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..b6641b00600 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,189 @@ +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: + DEPLOY: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || 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 + linux-arm64: + runs-on: ubuntu-2204-arm64-2c + 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 + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Build native artifact + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml package -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Upload native artifact + if: env.DEPLOY == 'true' + uses: actions/upload-artifact@v7 + with: + name: native-artifact-${{ github.job }}${{ matrix.ext }} + path: tensorflow-core/tensorflow-core-native/target/tensorflow-core-native-*-${{ github.job }}*.jar + if-no-files-found: error + retention-days: 1 + linux-x86_64: + runs-on: ubuntu-22.04 + 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 + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Build native artifact + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml package -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Upload native artifact + if: env.DEPLOY == 'true' + uses: actions/upload-artifact@v7 + with: + name: native-artifact-${{ github.job }}${{ matrix.ext }} + path: tensorflow-core/tensorflow-core-native/target/tensorflow-core-native-*-${{ github.job }}*.jar + if-no-files-found: error + retention-days: 1 + macosx-arm64: + runs-on: macos-14 + 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 + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Build native artifact + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml package -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Upload native artifact + if: env.DEPLOY == 'true' + uses: actions/upload-artifact@v7 + with: + name: native-artifact-${{ github.job }}${{ matrix.ext }} + path: tensorflow-core/tensorflow-core-native/target/tensorflow-core-native-*-${{ github.job }}*.jar + if-no-files-found: error + retention-days: 1 + deploy: + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + 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' + server-id: central + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy + - name: Checkout repository + uses: actions/checkout@v6 + - name: Download native artifacts + uses: actions/download-artifact@v8 + with: + pattern: native-artifact-* + path: tensorflow-core/tensorflow-core-native/target + merge-multiple: true + - name: Build and Deploy snapshot artifacts + env: + MAVEN_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.CI_DEPLOY_PASSWORD }} + run: | + java -version + mvn -version + mvn deploy -Pdeploying -B -e + release: + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/r') }} + 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' + server-id: central + server-username: MAVEN_USERNAME # env variable for username in deploy + server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE # Handled as an env variable name reference + - name: Checkout repository + uses: actions/checkout@v6 + - name: Download native artifacts + uses: actions/download-artifact@v8 + with: + pattern: native-artifact-* + path: tensorflow-core/tensorflow-core-native/target + merge-multiple: true + - name: Build and Deploy release artifacts + env: + MAVEN_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.CI_DEPLOY_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + run: | + java -version + mvn -version + mvn deploy -Pdeploying -Preleasing -B -e + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index c9abe95e860..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,193 +0,0 @@ -name: CI jobs -on: - push: - branches: - - master - - 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 -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: | - yum -y update - yum -y install centos-release-scl-rh epel-release - yum -y install java-1.8.0-openjdk-devel devtoolset-7 rh-git218 patch python36-devel python36-numpy python36-pip python36-six - echo Downloading Maven - curl -L https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -o $HOME/apache-maven-3.6.3-bin.tar.gz - tar xzf $HOME/apache-maven-3.6.3-bin.tar.gz -C /opt/ - ln -sf /opt/apache-maven-3.6.3/bin/mvn /usr/bin/mvn - echo Downloading Bazel - curl -L https://github.com/bazelbuild/bazel/releases/download/2.0.0/bazel-2.0.0-installer-linux-x86_64.sh -o bazel.sh --retry 10 - bash bazel.sh - echo Installing CUDA - curl -L https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda-repo-rhel7-10-1-local-10.1.243-418.87.00-1.0-1.x86_64.rpm -o $HOME/cuda.rpm - curl -L https://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.1-linux-x64-v7.6.5.32.tgz -o $HOME/cudnn.tgz - curl -L https://developer.download.nvidia.com/compute/redist/nccl/v2.4/nccl_2.4.8-1+cuda10.1_x86_64.txz -o $HOME/nccl.txz - rpm -i $HOME/cuda.rpm - cd /var/cuda-repo-10-1-local-10.1.243-418.87.00/; rpm -i --nodeps cuda*.rpm libc*.rpm - 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/ - - 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 - 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 }} - 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/2.0.0/bazel-2.0.0-installer-darwin-x86_64.sh -o bazel.sh --retry 10 - bash bazel.sh - brew install libomp - - 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 - 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 }} - 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: ["", -mkl] # -gpu, -mkl-gpu] - steps: - - name: Configure page file - uses: al-cheb/configure-pagefile-action@v1.2 - - name: Install environment - shell: cmd - run: | - python -m pip install numpy six - echo Removing broken version of Bash from WSL - rm.exe "C:/WINDOWS/system32/bash.EXE" - echo Removing some unused stuff to avoid running out of disk space - rm.exe -Rf "C:/Program Files (x86)/Android" "C:/Program Files/dotnet" "%CONDA%" "%GOROOT_1_10_X64%" "%GOROOT_1_11_X64%" "%GOROOT_1_12_X64%" "%GOROOT_1_13_X64%" "C:\hostedtoolcache\windows\Ruby" "C:\Rust" - echo Removing old versions of MSVC that interfere with Bazel - bash.exe -lc "find 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/' -iname '14.1*' -exec rm -Rf {} \;" - echo Downloading Bazel - mkdir C:\bazel - curl.exe -L https://github.com/bazelbuild/bazel/releases/download/2.0.0/bazel-2.0.0-windows-x86_64.exe -o C:/bazel/bazel.exe --retry 10 - echo Installing CUDA - curl.exe -L http://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_426.00_windows.exe -o cuda.exe - curl.exe -L https://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.1-windows7-x64-v7.6.5.32.zip -o cudnn.zip - cuda.exe -s - mkdir cuda - unzip.exe cudnn.zip - cp.exe -a cuda/include cuda/lib cuda/bin "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.1/" - 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\v10.1" - set "CUDA_PATH_V10_1=%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.1" - set "PATH=C:\bazel;C:\Program Files\Git\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;%PATH%" - 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 - 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 }} - 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 098ce71c656..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 @@ -53,3 +58,12 @@ gradleBuild .classpath **/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 new file mode 100644 index 00000000000..9da8b9603aa --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,166 @@ +# Building and Contributing to TensorFlow Java + +## Contributing + +### Formatting + +Java sources should be formatted according to the [Google style guide](https://google.github.io/styleguide/javaguide.html). It can be included +in [IntelliJ](https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml) and +[Eclipse](https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml). +[Google's C++ style guide](https://google.github.io/styleguide/cppguide.html) should also be used for C++ code. + +### Dependencies + +For dependencies, we can use anything compliant with [this list](https://opensource.google/docs/thirdparty/licenses/#notice), but we want to keep the core libraries as dependency free as possible. + +## Building + +To build all the artifacts locally, simply invoke the command `mvn install` at the root of this repository (or the Maven command of your choice). + +### JDK 16+ + +If you're using JDK 16+, you need to add some exports for the formatter plugin: + +``` +--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 +``` + +This can be done in `.mvn/jvm.config` or `MAVEN_OPTS`. + +### Native Builds + +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 + +Occasionally tests will fail with a message like: + +``` +Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test(default-test)on project tensorflow-core-api:There are test failures. + + Please refer to C:\mpicbg\workspace\tensorflow\java\tensorflow-core\tensorflow-core-api\target\surefire-reports for the individual test results. + Please refer to dump files(if any exist)[date]-jvmRun[N].dump,[date].dumpstream and[date]-jvmRun[N].dumpstream. + The forked VM terminated without properly saying goodbye.VM crash or System.exit called? + Command was cmd.exe/X/C"C:\Users\me\.jdks\adopt-openj9-1.8.0_275\jre\bin\java -jar C:\Users\me\AppData\Local\Temp\surefire236563113746082396\surefirebooter5751859365434514212.jar C:\Users\me\AppData\Local\Temp\surefire236563113746082396 2020-12-18T13-57-26_766-jvmRun1 surefire2445852067572510918tmp surefire_05950149004635894208tmp" + Error occurred in starting fork,check output in log + Process Exit Code:-1 + Crashed tests: + org.tensorflow.TensorFlowTest + org.apache.maven.surefire.booter.SurefireBooterForkException:The forked VM terminated without properly saying goodbye.VM crash or System.exit called? + Command was cmd.exe/X/C"C:\Users\me\.jdks\adopt-openj9-1.8.0_275\jre\bin\java -jar C:\Users\me\AppData\Local\Temp\surefire236563113746082396\surefirebooter5751859365434514212.jar C:\Users\me\AppData\Local\Temp\surefire236563113746082396 2020-12-18T13-57-26_766-jvmRun1 surefire2445852067572510918tmp surefire_05950149004635894208tmp" + Error occurred in starting fork,check output in log + Process Exit Code:-1 + Crashed tests: + org.tensorflow.TensorFlowTest + at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:671) + at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533) + at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278) + at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244) +``` + +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. + +## Upgrading TensorFlow Version + +To upgrade the version of TensorFlow that is embedded within TensorFlow Java, please follow carefully these steps. + +### Upgrading TensorFlow Native Library + +1. Download locally the archive of the tensorflow release at https://github.com/tensorflow/tensorflow/archive/refs/tags/vX.X.X.tar.gz +2. Compute the SHA sum using the shell command `shasum -a 256 ` +3. Update `urls`, `sha256` and `strip_prefix` fields of the `org_tensorflow` archive rule in Bazel [workspace](https://github.com/tensorflow/java/blob/master/tensorflow-core/tensorflow-core-native/WORKSPACE#L19) +4. Extract the archive in a temporary folder +5. Copy the content of `tensorflow-x.x.x/.bazelrc` file to `tensorflow-core/tensorflow-core-native/tensorflow.bazelrc` under TensorFlow Java source tree +6. Copy the content of `tensorflow-x.x.x/WORKSPACE` after the "###### Copy content of..." notice to `tensorflow-core/tensorflow-core-native/WORKSPACE`, read notice for more details +7. Copy the content of `tensorflow-x.x.x/.bazelversion` file to `tensorflow-core/tensorflow-core-native/.bazelversion` +8. Validate that options in `tensorflow-core/tensorflow-core-native/.bazelrc` are still accurate or update them accordingly +9. Update URLs of existing TensorFlow binaries in the `tensorflow-core/tensorflow-core-native/scripts/dist_download` script +10. Update URLs of TensorFlow-Text binaries used for testing in the `tensorflow-core/tensorflow-core-api/scripts/test_download` script + +#### Patching TensorFlow Sources + +In order to build the TensorFlow native library to work with TensorFlow Java, we sometimes need to apply some patches to the TensorFlow sources. These +patches are found in `tensorflow-core/tensorflow-core-native/external`. + +- If you have an error like "Error in fail: Error applying patch //external:xxx.patch:", verify why the patch is failing by looking at the TensorFlow source code. + Chances are that this code has changed and the patch needs to be updated. +- To create a new patch or update one, you can make a copy of the TensorFlow source file to change, make your change and generate a patch using `git diff ` +- If more than one file needs to be added to the patch, it's easier to clone the [TensorFlow repository](https://github.com/tensorflow/tensorflow), apply the changes and use `git diff` at the root of the tree + +### Generating Java Bindings + +After upgrading the TensorFlow library, you need to regenerate all Java bindings that depends on the native code. That includes Java protos, C API bindings (JavaCPP) and +operator classes. You can trigger the regeneration of these bindings with the Maven command `mvn clean install -Pgenerating`. + +This will also trigger a small Bazel build of the TensorFlow sources to regenerate the Java protos, so make sure your [environment](CONTRIBUTING.md#native-builds) is setup properly. + +#### Operations Classification + +When generating the operator classes, the build process might prompt you to provide information about the new operations found in the targeted TensorFlow version. This will generate a new API definition +under the [tensorflow-core/tensorflow-core-api/api](https://github.com/tensorflow/java/tree/master/tensorflow-core/tensorflow-core-api/api) folder. The required +information is: +* The visibility for this op + * VISIBLE to force the creation of a Java class that will be also exposed by the `*Ops` API classes. + * HIDDEN for creating a Java class that won't be exposed by the `*Ops` API classes. + * SKIP for not creating a Java class for this operation + * DEFAULT to rely on the visibility settings set in TensorFlow sources +* The name group for this operator + * This name is used to place this operator under the right subpackage and `*Ops` API. + * For example, the group `nn` will place the operator `Conv` under the `org.tensorflow.op.nn` package and in the `NnOps` API class. + * When no group is specified, the operator will go under the `org.tensorflow.op.core` package and in the `Ops` API class. +* The name for this op + * By default is the name found in TensorFlow registry but can be useful in some cases to rename it in case it clashes with Java keywords (e.g. `Switch`-> `SwitchCond`) + * Can also be used to remove the suffix of an operation that has multiple versions (e.g. `RestoreV2` -> `Restore`) + +The actual classification process is a bit arbitrary and based on the good judgement of the developer. The reason is that most ops in Python +are being wrapped by a higher-level API and therefore are left unclassified, while in Java they are exposed and can be used directly by +the users. + +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`. + +#### 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 clean install -Pgenerating` in `tensorflow-core-api`. + +## Known Issues + +### Missing Gradients + +In some cases, a op supported by Tensorflow Java will not have a gradient defined, resulting in errors like this: +``` +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). + +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/LICENSE b/LICENSE index 786bd07395c..261eeb9e9f8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,3 @@ -Copyright 2020 The TensorFlow Authors. All rights reserved. - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/MIGRATING.md b/MIGRATING.md new file mode 100644 index 00000000000..61148063487 --- /dev/null +++ b/MIGRATING.md @@ -0,0 +1,149 @@ +# Migrating Between TensorFlow Java Releases + +This guide explains in detail how to migrate your code from a pre-1.0 release to a 1.0 or newer release. Post 1.0 +releases have API stability as much as possible, though upstream TensorFlow does remove ops from time to time and +consequently those ops will be removed from TensorFlow-Java + +## Migrating to 1.0.0 or newer + +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 bca18d1fe49..8cbb89877bc 100644 --- a/README.md +++ b/README.md @@ -21,64 +21,73 @@ 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 - -## Building Sources -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`. +* `tensorflow-ndarray` + * API for creating and manipulating n-dimensional arrays, can be used independently from TensorFlow. + +## Communication -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). +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. -This step can take multiple hours on a regular laptop. It is possible though to skip completely the native build if you are -working on a version that already has pre-compiled native artifacts for your platform [available on Sonatype OSS Nexus repository](#Snapshots). -You just need to activate the `dev` profile in your Maven command to use those artifacts instead of building them from scratch -(e.g. `mvn install -Pdev`). +## Building Sources -Note that modifying any source files under `tensorflow-core` may impact the low-level TensorFlow bindings, in which case a -complete build could be required to reflect the changes. +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 + +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. Binaries for `windows-x86_64` are available +for TF-Java 1.1 and earlier, they were dropped for the 1.2 release and newer as the native binaries 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.2.0 org.tensorflow - tensorflow-core-api - 0.2.0 - linux-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.2.0 + linux-x86_64 ``` +Or Gradle: +```groovy +def tfVersion = '1.2.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: @@ -86,50 +95,73 @@ native dependencies as follows: org.tensorflow tensorflow-core-api - 0.2.0 + 1.2.0 org.tensorflow - tensorflow-core-api - 0.2.0 - linux-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.2.0 + linux-arm64 org.tensorflow - tensorflow-core-api - 0.2.0 - macosx-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.2.0 + linux-x86_64-gpu org.tensorflow - tensorflow-core-api - 0.2.0 - windows-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.2.0 + macosx-arm64 ``` +Or Gradle: +```groovy +def tfVersion = '1.2.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" +``` + +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, 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: +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-arm64`, and `macosx-arm64` + +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.2.0 ``` +Or Gradle: +```groovy +implementation "org.tensorflow:tensorflow-core-platform:1.2.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 @@ -146,22 +178,65 @@ to add Sonatype OSS repository in your pom.xml, like the following org.tensorflow tensorflow-core-platform - 0.3.0-SNAPSHOT + 1.3.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.3.0-SNAPSHOT" +} +``` -## TensorFlow Version Support - -This table shows the mapping between different version of TensorFlow for Java and the core runtime libraries. +## TensorFlow native libraries -| TensorFlow Java Version | TensorFlow Version | -| ------------- | ------------- | -| 0.2.0 | 2.3.1 | -| 0.3.0-SNAPSHOT | 2.3.1 | +TensorFlow-Java is built on top of the native TensorFlow library, and uses [JavaCPP](https://github.com/bytedeco/javacpp) +to call that library which in turn uses the Java Native Interface (JNI). In [Java 24 and newer](https://openjdk.org/jeps/472) +uses of JNI trigger a warning of the form: +``` +WARNING: A restricted method in java.lang.System has been called +WARNING: java.lang.System::loadLibrary has been called by org.bytedeco.javacpp.Loader in an unnamed module (file:/.../.m2/repository/org/bytedeco/javacpp/1.5.12/javacpp-1.5.12.jar) +WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module +WARNING: Restricted methods will be blocked in a future release unless native access is enabled +``` +This is expected, and adding the `--enable-native-access=ALL-UNNAMED` flag to enable JNI will suppress it. In a future +Java version this warning may be turned into an error and the flag will be required to use TensorFlow-Java. + +## 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 | 2.21.0 | 11 | +| 1.3.0-SNAPSHOT | 2.21.0 | 11 | ## How to Contribute? -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. +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..4b943f2713d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,9 +1,9 @@ # Releasing TensorFlow Java The -[TensorFlow Java API](https://github.com/tensorflow/java) is available on Maven Central and JCenter +[TensorFlow Java API](https://github.com/tensorflow/java) is available on Maven Central through artifacts uploaded to -[OSS Sonatype](https://oss.sonatype.org/content/repositories/releases/org/tensorflow/). This +[Maven Central](https://central.sonatype.com/). This document describes the process of updating the release artifacts. It does _not_ describe how to use the artifacts, for which the reader is referred to the [TensorFlow for Java installation instructions](https://github.com/tensorflow/java/blob/master/README.md). @@ -14,8 +14,7 @@ TensorFlow source (which is primarily in C++) is built using [bazel](https://bazel.build) and not [maven](https://maven.apache.org/). TensorFlow Java wraps over this native code and thus depends on platform (OS, architecture) specific native code. -Hence, the process for building and uploading release artifacts is not a single -`mvn deploy` command. +Hence, the process for building and uploading release artifacts is not a single `mvn deploy` command. ## Release process overview @@ -24,8 +23,8 @@ The process of releasing TensorFlow Java is split in two major steps: * Building and deploying all artifacts consolidated The first step is executed on different build servers, each responsible to build the native -artifact for a specific architecture and platform. The second step is conducted locally in -a [Docker](https://www.docker.com) container for a hermetic release process. +artifact for a specific architecture and platform. The second step retrieves all native artifacts +built in the first step to consolidate them on a single server, and run a Maven `deploy` from there. It is important to note that any change pushed to a release branch (i.e. a branch prefixed by `r`) will start a new release workflow. Therefore, these changes should always increment the @@ -33,14 +32,21 @@ version number. ### Pre-requisites -- `docker` -- An account at [oss.sonatype.org](https://oss.sonatype.org/), that has +- An account at [Maven Central](https://central.sonatype.com/), that has permissions to update artifacts in the `org.tensorflow` group. If your account does not have permissions, then you'll need to ask someone who does - to [file a ticket](https://issues.sonatype.org/) to add to the permissions - ([sample ticket](https://issues.sonatype.org/browse/MVNCENTRAL-1637)). -- A GPG signing key, required - [to sign the release artifacts](http://central.sonatype.org/pages/apache-maven.html#gpg-signed-components). + to [file a ticket](mailto:central-support@sonatype.com) to add to the permissions. +- + Add your account username and token to the GitHub repository secrets as `CI_DEPLOY_USERNAME` and `CI_DEPLOY_PASSWORD` + respectively. + +- A [GPG signing key](http://central.sonatype.org/pages/apache-maven.html#gpg-signed-components) for signing the artifacts. + + The public key must be registered with a key server supported by Maven Central (e.g. https://keyserver.ubuntu.com/) and + the private key + passphrase should be stored in the GitHub repository secrets as `MAVEN_GPG_PRIVATE_KEY` and + `MAVEN_GPG_PASSPHRASE` respectively. See [GitHub documentation](https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-Apache-Maven) + for more details. + ### Preparing a release @@ -59,10 +65,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/docs/install.md?plain=1#L69 + - https://github.com/tensorflow/java/blob/master/docs/docs/install.md?plain=1#L175 + - https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts + - https://github.com/tensorflow/java/blob/master/README.md#tensorflow-java-version-support 5. Commit the changes and push the new branch to the GitHub repository ``` @@ -89,10 +96,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/docs/install.md?plain=1#L69 + - https://github.com/tensorflow/java/blob/master/docs/docs/install.md?plain=1#L175 + - https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts + - https://github.com/tensorflow/java/blob/master/README.md#tensorflow-java-version-support 6. Commit the changes and push the branch to the GitHub repository ``` @@ -101,88 +109,33 @@ version number. git push ``` -### Building native artifacts - -Any change pushed to a release branch will trigger a new release workflow. GitHub Actions builds the native artifacts -for all supported architures/platforms and deploy them temporarily on OSSRH for staging. - -There is no user action required for this step other than watching the progress of the GitHub -Actions workflow and making sure that all steps have been completed successfully. - -#### Build native artifacts manually - -Some platforms cannot be build successfully on GitHub Actions, due to some limits to their resources -(e.g. max 6 hours for a job). For this reasons, we need to build manually some of our artifacts on -private servers. - -To do so, follow the same steps as the [CI build](https://github.com/tensorflow/java/blob/master/.github/workflows/ci.yml) -for the same platform and make sure to checkout the release branch and to provide your Sonatype credentials -for temporary staging. - -### Performing the release - -1. At the root of your TensorFlow Java copy, create a Maven settings.xml file with your OSSRH credentials and - your GPG key passphrase: - ```sh - SONATYPE_USERNAME="your_sonatype.org_username_here" - SONATYPE_PASSWORD="your_sonatype.org_password_here" - GPG_PASSPHRASE="your_gpg_passphrase_here" - cat > settings.xml < - - - ossrh - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - ossrh-staging - ${SONATYPE_USERNAME} - ${SONATYPE_PASSWORD} - - - - - - true - - - gpg2 - ${GPG_PASSPHRASE} - - - - - EOF - ``` -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 - 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. - ``` - # Staging repository created: orgtensorflow-1100 - sh release.sh 1100 - ``` -3. If the script above succeeds then the artifacts would have been uploaded to - the private staging repository in Sonatype. After verifying the release, you should finalize or - abort the release. Visit https://oss.sonatype.org/#stagingRepositories, find the `orgtensorflow-*` - of your release and click `Close` and `Release` to finalize the release. You always have the option - to `Drop` it to abort and restart if something went wrong. - -4. Go to GitHub and create a release tag on the release branch with a summary of what the version includes. - -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)). - -### Finishing a release +### Performing the Release -#### Major or minor release +#### Release Workflow + +Pushing on a release branch will trigger a GitHub Actions workflow that builds the native artifacts for all supported architectures/platforms +and deploys them temporarily as GitHub Workflow artifacts. + +After this step, all native artifacts are retrieved and consolidated into the same target folder on single server in GitHub Action. +A final Maven `deploy` command on that server will take care of publishing all TensorFlow Java artifacts (include the native ones) to Maven +Central for staging. + +#### Publishing Approval + +After all artifacts have been published, you should log to [Maven Central](https://central.sonatype.com/), go to `Publish -> Deployments`, +and either drop the staging repository (if something is wrong) or publish it (if everything looks good). If you drop it, you will need to +retrigger the [release CI](#release-workflow). + +### Finishing a Release + +#### Release Notes + +Go to GitHub and automatically generate release notes for the new version by going to `Releases -> Draft a new release` +and selecting the tag for the release. You can edit the release notes as needed. + +#### Bumping Next Snapshot Version + +##### After a Major or Minor Release 1. Checkout the master branch and merge back changes from the released branch ``` @@ -191,12 +144,12 @@ Some things of note: ``` 2. In your local copy, checkout the master branch and increase the next snapshot version. ``` - mvn versions:set -DnewVersion=1.1.0-SNAPSHOT + mvn versions:set -DnewVersion=1.3.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/docs/install.md?plain=1#L112 + - https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts + - https://github.com/tensorflow/java/blob/master/README.md#tensorflow-java-version-support 4. Commit your changes and push the master branch to the GitHub repository ``` @@ -205,7 +158,7 @@ Some things of note: git push ``` -#### Patch release +##### After a Patch Release 1. Checkout the master branch and merge back changes from the released branch ``` @@ -221,6 +174,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..8db1ff0e089 --- /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. + +### [tensorflow-ndarray](https://github.com/tensorflow/java/tree/master/tensorflow-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..564414316dd --- /dev/null +++ b/docs/docs/install.md @@ -0,0 +1,221 @@ +# 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 + +Tensorflow Java 1.1 and earlier has binaries for: + +* Windows 10 or higher; 64-bit, x86 + +TensorFlow Java 1.0 series and earlier has 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.2.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.3.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.2.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.2.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..60d03a5f643
--- /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 2026"
+
+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
+  - API Reference:
+      - references.md
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 bedf291731c..00000000000
--- a/ndarray/pom.xml
+++ /dev/null
@@ -1,77 +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.junit.jupiter
-        junit-jupiter-api
-        test
-      
-      
-        org.junit.jupiter
-        junit-jupiter-engine
-        test
-    
-    
-      org.openjdk.jmh
-      jmh-core
-      test
-    
-    
-      org.openjdk.jmh
-      jmh-generator-annprocess
-      test
-    
-  
-
-  
-    
-      
-        org.apache.maven.plugins
-        maven-surefire-plugin
-        2.22.2
-        
-          1
-          false
-          -Xmx2G -XX:MaxPermSize=256m
-          false
-          
-            **/*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/DimensionalSpace.java b/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/DimensionalSpace.java deleted file mode 100644 index e4bdc53c713..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/impl/dimension/DimensionalSpace.java +++ /dev/null @@ -1,173 +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 java.util.Arrays; -import org.tensorflow.ndarray.index.Index; -import org.tensorflow.ndarray.Shape; - -public class DimensionalSpace { - - public static DimensionalSpace create(Shape shape) { - Dimension[] dimensions = new Dimension[shape.numDimensions()]; - - // Start from the last dimension, where all elements are continuous - for (int i = dimensions.length - 1, elementSize = 1; i >= 0; --i) { - dimensions[i] = new Axis(shape.size(i), elementSize); - elementSize *= dimensions[i].numElements(); - } - return new DimensionalSpace(dimensions, shape); - } - - public RelativeDimensionalSpace mapTo(Index[] indices) { - if (dimensions == null || indices.length > dimensions.length) { - throw new ArrayIndexOutOfBoundsException(); - } - int dimIdx = 0; - int newDimIdx = 0; - int segmentationIdx = -1; - long initialOffset = 0; - - Dimension[] newDimensions = new Dimension[dimensions.length]; - while (dimIdx < indices.length) { - - if (indices[dimIdx].isPoint()) { - // When an index targets a single point in a given dimension, calculate the offset of this - // point and cumulate the offset of any subsequent point as well - long offset = 0; - do { - offset += indices[dimIdx].mapCoordinate(0, dimensions[dimIdx]); - } while (++dimIdx < indices.length && indices[dimIdx].isPoint()); - - // If this is the first index, then the offset is the position of the whole dimension - // space within the original one. If not, then we apply the offset to the last vectorial - // dimension - if (newDimIdx == 0) { - initialOffset = offset; - } else { - long reducedSize = dimensions[dimIdx - 1].elementSize(); - newDimensions[newDimIdx - 1] = new ReducedDimension(newDimensions[newDimIdx - 1], offset, reducedSize); - segmentationIdx = newDimIdx - 1; - } - - } else { - // Map any other index to the appropriate dimension of this space - Dimension newDimension = indices[dimIdx].apply(dimensions[dimIdx++]); - newDimensions[newDimIdx] = newDimension; - if (newDimension.isSegmented()) { - segmentationIdx = newDimIdx; - } - ++newDimIdx; - } - } - - // When the number of indices provided is smaller than the number of dimensions in this space, - // we copy the remaining dimensions directly to the new space as well. - for (; dimIdx < dimensions.length; ++dimIdx, ++newDimIdx) { - Dimension dim = dimensions[dimIdx]; - newDimensions[newDimIdx] = dim; - if (dim.isSegmented()) { - segmentationIdx = newDimIdx; - } - } - return new RelativeDimensionalSpace(Arrays.copyOf(newDimensions, newDimIdx), segmentationIdx, initialOffset); - } - - public DimensionalSpace from(int dimensionStart) { - if (dimensionStart > dimensions.length) { - throw new IndexOutOfBoundsException(); - } - Dimension[] newDimensions = Arrays.copyOfRange(dimensions, dimensionStart, dimensions.length); - if (segmentationIdx > dimensionStart) { - return new DimensionalSpace(newDimensions, segmentationIdx - dimensionStart); - } - return new DimensionalSpace(newDimensions); - } - - public Shape shape() { - if (shape == null) { - shape = toShape(dimensions); - } - return shape; - } - - public int numDimensions() { - return dimensions.length; - } - - public long numElements(int i) { - return dimensions[i].numElements(); - } - - public long physicalSize() { - return dimensions.length > 0 ? dimensions[0].physicalSize() : 1; // dimensions.length == 0 for scalars - } - - public Dimension get(int i) { - return dimensions[i]; - } - - public boolean isSegmented() { - return segmentationIdx >= 0; - } - - public int segmentationIdx() { - return segmentationIdx; - } - - public long positionOf(long[] coords) { - long position = 0L; - for (int i = 0; i < coords.length; ++i) { - position += dimensions[i].positionOf(coords[i]); - } - return position; - } - - /** Succinct description of the shape meant for debugging. */ - @Override - public String toString() { - return Arrays.toString(dimensions); - } - - DimensionalSpace(Dimension[] dimensions, int segmentationIdx) { - this.dimensions = dimensions; - this.segmentationIdx = segmentationIdx; - } - - private DimensionalSpace(Dimension[] dimensions) { - this(dimensions, -1); - } - - private DimensionalSpace(Dimension[] dimensions, Shape shape) { - this(dimensions); - this.shape = shape; - } - - private final Dimension[] dimensions; - private final int segmentationIdx; - private Shape shape; - - private static Shape toShape(Dimension[] dimensions) { - long[] shapeDimSizes = new long[dimensions.length]; - int i = 0; - for (Dimension dimension : dimensions) { - shapeDimSizes[i++] = dimension.numElements(); - } - return Shape.of(shapeDimSizes); - } -} diff --git a/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 b38e33d5e22..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/All.java +++ /dev/null @@ -1,42 +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() { - } -} 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 5d92ee3286b..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/At.java +++ /dev/null @@ -1,48 +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 At implements Index { - - @Override - public long numElements(Dimension dim) { - return 1; - } - - @Override - public long mapCoordinate(long coordinate, Dimension dim) { - return dim.positionOf(coord); // TODO validate coordinate is 0? - } - - @Override - public Dimension apply(Dimension dim) { - throw new IllegalStateException(); // FIXME? - } - - @Override - public boolean isPoint() { - return true; - } - - At(long coord) { - this.coord = coord; - } - - private final long coord; -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/index/Even.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Even.java deleted file mode 100644 index 54f53853c32..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Even.java +++ /dev/null @@ -1,37 +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 Even implements Index { - - static final Even INSTANCE = new Even(); - - @Override - public long numElements(Dimension dim) { - return (dim.numElements() >> 1) + (dim.numElements() % 2); - } - - @Override - public long mapCoordinate(long coordinate, Dimension dim) { - return coordinate << 1; - } - - private Even() { - } -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/index/Flip.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Flip.java deleted file mode 100644 index 7914d8faad5..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Flip.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.index; - -import org.tensorflow.ndarray.impl.dimension.Dimension; - -final class Flip implements Index { - - static final Flip INSTANCE = new Flip(); - - @Override - public long numElements(Dimension dim) { - return dim.numElements(); - } - - @Override - public long mapCoordinate(long coordinate, Dimension dim) { - return dim.numElements() - coordinate - 1; - } -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/index/From.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/From.java deleted file mode 100644 index c541e8370b2..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/From.java +++ /dev/null @@ -1,38 +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 From implements Index { - - @Override - public long numElements(Dimension dim) { - return dim.numElements() - start; - } - - @Override - public long mapCoordinate(long coordinate, Dimension dim) { - return start + coordinate; - } - - From(long start) { - this.start = start; - } - - private final long start; -} 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 00b411d0167..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Hyperslab.java +++ /dev/null @@ -1,74 +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 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; -} 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 da6aa9049f6..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Index.java +++ /dev/null @@ -1,77 +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; - } -} 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 abc72195c82..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Indices.java +++ /dev/null @@ -1,219 +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); - } - - /** - * 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()); - } - - /** - * 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 Even.INSTANCE; - } - - /** - * 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 Odd.INSTANCE; - } - - /** - * 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 stepLength the number of elements between each steps - * @return index - */ - public static Index step(long stepLength) { - return new Step(stepLength); - } - - /** - * 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 from(long start) { - return new From(start); - } - - /** - * 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 to(long end) { - return new To(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 - * - * @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 new Range(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 Flip.INSTANCE; - } - - /** - * 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); - } -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/index/Odd.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Odd.java deleted file mode 100644 index 070331f1ffb..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Odd.java +++ /dev/null @@ -1,37 +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 Odd implements Index { - - static final Odd INSTANCE = new Odd(); - - @Override - public long numElements(Dimension dim) { - return dim.numElements() >> 1; - } - - @Override - public long mapCoordinate(long coordinate, Dimension dim) { - return (coordinate << 1) + 1; - } - - private Odd() { - } -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/index/Range.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/Range.java deleted file mode 100644 index e5d6003d87b..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Range.java +++ /dev/null @@ -1,40 +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 Range implements Index { - - @Override - public long numElements(Dimension dim) { - return end - start; - } - - @Override - public long mapCoordinate(long coordinate, Dimension dim) { - return start + coordinate; - } - - Range(long start, long end) { - this.start = start; - this.end = end; - } - - private final long start; - private final long end; -} 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 41d37d05806..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Sequence.java +++ /dev/null @@ -1,39 +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; - -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; -} 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 725abd8f2e7..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/Step.java +++ /dev/null @@ -1,38 +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 Step implements Index { - - @Override - public long numElements(Dimension dim) { - return (dim.numElements() / stepLength) + 1; // FIXME always include element 0? - } - - @Override - public long mapCoordinate(long coordinate, Dimension dim) { - return coordinate * stepLength; - } - - Step(long stepLength) { - this.stepLength = stepLength; - } - - private final long stepLength; -} diff --git a/ndarray/src/main/java/org/tensorflow/ndarray/index/To.java b/ndarray/src/main/java/org/tensorflow/ndarray/index/To.java deleted file mode 100644 index 167d1c6865e..00000000000 --- a/ndarray/src/main/java/org/tensorflow/ndarray/index/To.java +++ /dev/null @@ -1,38 +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 To implements Index { - - @Override - public long numElements(Dimension dim) { - return end; - } - - @Override - public long mapCoordinate(long coordinate, Dimension dim) { - return coordinate; - } - - To(long end) { - this.end = end; - } - - private final long end; -} 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/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 1c1d89680e7..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.from; -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.to; - -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(from(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(to(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 8acfdff7721..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 = 0, 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/DenseNdArrayTest.java b/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DenseNdArrayTest.java deleted file mode 100644 index d5b5ca809a4..00000000000 --- a/ndarray/src/test/java/org/tensorflow/ndarray/impl/dense/DenseNdArrayTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.tensorflow.ndarray.impl.dense; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import org.junit.jupiter.api.Test; -import org.tensorflow.ndarray.Shape; -import org.tensorflow.ndarray.IntNdArray; -import org.tensorflow.ndarray.NdArrays; -import org.tensorflow.ndarray.StdArrays; -import org.tensorflow.ndarray.index.Indices; - -public class DenseNdArrayTest { - - @Test - public void arrayEquals() { - IntNdArray array = NdArrays.ofInts(Shape.of(2, 2)) - .set(NdArrays.vectorOf(1, 2), 0) - .set(NdArrays.vectorOf(3, 4), 1); - - assertTrue(array.equals(StdArrays.ndCopyOf(new int[][] {{1, 2}, {3, 4}}))); - assertTrue(array.equals(StdArrays.ndCopyOf(new Integer[][] {{1, 2}, {3, 4}}))); - assertFalse(array.equals(NdArrays.vectorOf(1, 2, 3, 4))); - assertFalse(array.equals(StdArrays.ndCopyOf(new int[][] {{3, 4}, {1, 2}}))); - assertFalse(array.equals(StdArrays.ndCopyOf(new long[][] {{1L, 2L}, {3L, 4L}}))); - } - - @Test - public void equalsAndHashCodeOnSlices() { - IntNdArray vector1 = NdArrays.vectorOf(3, 4); - IntNdArray vector2 = NdArrays.vectorOf(1, 2, 3, 4); - IntNdArray matrix1 = StdArrays.ndCopyOf(new int[][] {{1, 2}, {3, 4}}); - IntNdArray matrix2 = StdArrays.ndCopyOf(new int[][] {{1, 0, 2, 0}, {3, 0, 4, 0}}); - IntNdArray matrix3d1 = StdArrays.ndCopyOf(new int[][][] { - {{1, 2}, {3, 4}}, - {{5, 6}, {7, 8}} - }); - IntNdArray matrix3d2 = StdArrays.ndCopyOf(new int[][][] { - {{1, 2}, {4, 5}}, - {{3, 4}, {6, 7}} - }); - - assertTrue(vector1.equals(vector2.slice(Indices.from(2)))); - assertTrue(vector1.equals(matrix1.get(1))); - assertTrue(vector1.equals(matrix2.get(1).slice(Indices.even()))); - assertTrue(matrix1.equals(matrix2.slice(Indices.all(), Indices.even()))); - assertTrue(matrix3d1.get(0).equals(matrix1)); - assertFalse(matrix3d1.get(0).equals(vector2)); - assertTrue(matrix1.equals(matrix3d2.slice(Indices.all(), Indices.at(0)))); - } -} diff --git a/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 eb6f943919d..53e088b8c2e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,13 @@ - + 4.0.0 org.tensorflow tensorflow-java - 0.3.0-SNAPSHOT + 1.3.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 + + Copyright 2015, 2026 The TensorFlow Authors. All Rights Reserved. + + -Xmaxerrs + 65536 + -Xmaxwarns + 65536 + + none + false + 256m + 2048m + + https://protobuf.dev/reference/java/api-docs + https://bytedeco.org/javacpp/apidocs + + true + + + + javadoc-site + + javadoc + + + + attach-javadocs + + jar + + + + + + + + + + jdk17 + + 17 + 17 + 17 + + + + + + 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 + + + + windows + - 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.2.8 sign-artifacts @@ -193,15 +546,12 @@ - - --pinentry-mode - loopback - + bc maven-source-plugin - 3.2.1 + 3.3.0 attach-sources @@ -213,16 +563,37 @@ maven-javadoc-plugin - 3.2.0 + 3.12.0 + + ./docs/overview.md + + Copyright 2015, 2026 The TensorFlow Authors. All Rights Reserved. + + -Xmaxerrs + 65536 + -Xmaxwarns + 65536 + + false + 256m + 2048m + + https://protobuf.dev/reference/java/api-docs + https://bytedeco.org/javacpp/apidocs + + + + javadoc-site + + javadoc + + attach-javadocs jar - - true - @@ -236,13 +607,53 @@ true + + com.diffplug.spotless + spotless-maven-plugin + ${spotless.version} + + origin/master + + + + 1.20.0 + + + + + + + org.sonatype.central + central-publishing-maven-plugin + + 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 + + + + org.sonatype.central + central-publishing-maven-plugin + 0.11.0 + true + + central + diff --git a/release.sh b/release.sh deleted file mode 100755 index 6b48e303d9a..00000000000 --- a/release.sh +++ /dev/null @@ -1,52 +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. -# ============================================================================== -# -# Script to upload release artifacts for the TensorFlow Java library to -# Maven Central. See RELEASE.md for an explanation. - -cd $(dirname "$0") -STAGING_SEQ="$1" -shift -shift -CMD="$*" - -if [[ -z "${STAGING_SEQ}" ]] -then - echo "Usage: ./release.sh []" - exit 1 -fi - -# If release fails, debug with -# ./release.sh ${STAGING_SEQ} bash -# To get a shell to poke around the maven artifacts with. -if [[ -z "${CMD}" ]] -then - CMD="bash deploy.sh" -fi - -export GPG_TTY=$(tty) -set -ex - -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 \ - ${CMD} diff --git a/tensorflow-core/pom.xml b/tensorflow-core/pom.xml index 5140b1869d2..16fbb636058 100644 --- a/tensorflow-core/pom.xml +++ b/tensorflow-core/pom.xml @@ -22,7 +22,7 @@ org.tensorflow tensorflow-java - 0.3.0-SNAPSHOT + 1.3.0-SNAPSHOT tensorflow-core pom @@ -31,893 +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 - 0.21.5-${javacpp.version} + 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 2d1e0662524..00000000000 --- a/tensorflow-core/tensorflow-core-api/.bazelrc +++ /dev/null @@ -1,431 +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_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 -# C++1z: Build with C++17 options -# avx_linux: Build with avx instruction set on linux. -# avx2_linux: Build with avx2 instruction set on linux. -# arch_native_linux: Build with instruction sets available to the host machine on linux -# 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. -# monolithic: Build all TF C++ code into a single shared object. -# dynamic_kernels: Try to link all kernels dynamically (experimental). -# -# -# 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 -# using_cuda: CUDA is available to build system. -# cuda: Build with full cuda support. -# rocm: Build with AMD GPU support (rocm). -# sycl: Build with SYCL support. -# sycl_nodouble: -# sycl_asan: -# sycl_trisycl: -# mkl: Enable full mkl support. -# tensorrt: Enable Tensorrt support. -# ngraph: Enable ngraph support. -# 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: RBE options to build with GPU support using nvcc. -# rbe_gpu_linux: An alias for rbe_linux_cuda_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 -# - - - -# 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_mkl_dnn_v1_only=true -build:mkl -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 - -# 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 - -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 - -build:sycl --crosstool_top=@local_config_sycl//crosstool:toolchain -build:sycl --define=using_sycl=true -build:sycl --action_env TF_NEED_OPENCL_SYCL=1 - -build:sycl_nodouble --config=sycl -build:sycl_nodouble --cxxopt -DTENSORFLOW_SYCL_NO_DOUBLE - -build:sycl_nodouble --config=sycl -build:sycl_asan --copt -fno-omit-frame-pointer --copt -fsanitize-coverage=3 --copt -DGPR_NO_DIRECT_SYSCALLS --linkopt -fPIC --linkopt -fsanitize=address - -build:sycl_nodouble --config=sycl -build:sycl_trisycl --define=using_trisycl=true - -# Options extracted from configure script -build:ngraph --define=with_ngraph_support=true -build:numa --define=with_numa_support=true - -# 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 --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 - -# Enable using platform specific build settings -build --enable_platform_specific_config - -# Suppress C++ compiler warnings, otherwise build logs become 10s of MBs. -build:linux --copt=-w -build:macos --copt=-w -build:windows --copt=/w - -# 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 - -# Default paths for TF_SYSTEM_LIBS -build:linux --define=PREFIX=/usr -build:linux --define=LIBDIR=$(PREFIX)/lib -build:linux --define=INCLUDEDIR=$(PREFIX)/include -build:macos --define=PREFIX=/usr -build:macos --define=LIBDIR=$(PREFIX)/lib -build:macos --define=INCLUDEDIR=$(PREFIX)/include -# TF_SYSTEM_LIBS do not work on windows. - -# By default, build TF in C++ 14 mode. -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 - -# 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 - -# 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: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 --action_env=TF_ENABLE_XLA=1 -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 --linkopt=-lm - -build:rbe_cpu_linux --config=rbe_linux -build:rbe_cpu_linux --crosstool_top="//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:toolchain" -build:rbe_cpu_linux --extra_toolchains="//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:cc-toolchain-k8" -build:rbe_cpu_linux --extra_execution_platforms"=@org_tensorflow//third_party/toolchains:rbe_ubuntu16.04-manylinux2010" -build:rbe_cpu_linux --host_platform="@org_tensorflow//third_party/toolchains:rbe_ubuntu16.04-manylinux2010" -build:rbe_cpu_linux --platforms="@org_tensorflow//third_party/toolchains:rbe_ubuntu16.04-manylinux2010" - -build:rbe_linux_cuda_nvcc --config=rbe_linux -build:rbe_linux_cuda_nvcc --crosstool_top="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain" -build:rbe_linux_cuda_nvcc --extra_toolchains="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain-linux-x86_64" -build:rbe_linux_cuda_nvcc --extra_execution_platforms="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" -build:rbe_linux_cuda_nvcc --host_platform="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" -build:rbe_linux_cuda_nvcc --platforms="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform" -build:rbe_linux_cuda_nvcc --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda" -build:rbe_linux_cuda_nvcc --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_tensorrt" -build:rbe_linux_cuda_nvcc --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu16.04-py3-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_nccl" -build:rbe_linux_cuda_nvcc --repo_env=TF_NEED_TENSORRT=1 -build:rbe_linux_cuda_nvcc --repo_env=TF_CUDA_VERSION=10 -build:rbe_linux_cuda_nvcc --repo_env=TF_CUDNN_VERSION=7 -build:rbe_linux_cuda_nvcc --repo_env=REMOTE_GPU_TESTING=1 -build:rbe_linux_cuda_nvcc --repo_env=TF_NEED_CUDA=1 -build:rbe_linux_cuda_nvcc --define=using_cuda_nvcc=true -test:rbe_linux_cuda_nvcc --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" - -common:rbe_gpu_linux --config=rbe_linux_cuda_nvcc - -build:rbe_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/bazel_211:toolchain" -build:rbe_win --extra_toolchains="@org_tensorflow//third_party/toolchains/preconfig/win/bazel_211: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=500 - -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 -# 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 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 37dda9b59b0..00000000000 --- a/tensorflow-core/tensorflow-core-api/WORKSPACE +++ /dev/null @@ -1,46 +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-windows.patch", # https://github.com/tensorflow/tensorflow/issues/25213 - ":tensorflow-proto.patch", - ], - patch_tool = "patch", - patch_args = ["-p1"], - patch_cmds = ["grep -rl 'java_package' tensorflow/core | xargs sed -i.bak 's/^\(.* java_package = \"org\.tensorflow\.\)\(.*\"\)/\\1proto.\\2'/"], - urls = [ - "https://github.com/tensorflow/tensorflow/archive/v2.3.1.tar.gz", - ], - sha256 = "ee534dd31a811f7a759453567257d1e643f216d8d55a25c32d2fbfff8153a1ac", - strip_prefix = "tensorflow-2.3.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 356a00db91d..00000000000 --- a/tensorflow-core/tensorflow-core-api/build.sh +++ /dev/null @@ -1,86 +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 - # Work around compiler issues on Windows documented mainly in configure.py but also elsewhere - export BUILD_FLAGS="--copt=//arch:AVX `#--copt=//arch:AVX2` --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=-D_USE_MATH_DEFINES --host_copt=-D_USE_MATH_DEFINES --define=override_eigen_strong_inline=true" - # https://software.intel.com/en-us/articles/intel-optimization-for-tensorflow-installation-guide#wind_B_S - export PATH=$PATH:$(pwd)/bazel-tensorflow-core-api/external/mkl_windows/lib/ - export PYTHON_BIN_PATH=$(which python.exe) -else - export BUILD_FLAGS="--copt=-msse4.1 --copt=-msse4.2 --copt=-mavx `#--copt=-mavx2 --copt=-mfma` --cxxopt=-std=c++14 --host_cxxopt=-std=c++14 --linkopt=-lstdc++ --host_linkopt=-lstdc++" - export PYTHON_BIN_PATH=$(which python3) -fi - -if [[ "${EXTENSION:-}" == *mkl* ]]; then - # Don't use MKL-DNN v1 as it is only currently supported by Linux platform - export BUILD_FLAGS="$BUILD_FLAGS --config=mkl --define build_with_mkl_dnn_v1_only=false" -fi - -if [[ "${EXTENSION:-}" == *gpu* ]]; then - export BUILD_FLAGS="$BUILD_FLAGS --config=cuda" - export TF_CUDA_COMPUTE_CAPABILITIES="3.5,7.0" - 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 \ - @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 - -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-proto.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch deleted file mode 100644 index f3e1b030826..00000000000 --- a/tensorflow-core/tensorflow-core-api/external/tensorflow-proto.patch +++ /dev/null @@ -1,138 +0,0 @@ -diff -ruN a/tensorflow/core/protobuf/bfc_memory_map.proto b/tensorflow/core/protobuf/bfc_memory_map.proto ---- a/tensorflow/core/protobuf/bfc_memory_map.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/bfc_memory_map.proto 2020-03-30 23:43:29.000000000 -0400 -@@ -3,6 +3,9 @@ - package tensorflow; - - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; -+option java_outer_classname = "BfcMemoryMapProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.util"; - - // Some of the data from AllocatorStats - message MemAllocatorStats { -diff -ruN a/tensorflow/core/protobuf/data/experimental/snapshot.proto b/tensorflow/core/protobuf/data/experimental/snapshot.proto ---- a/tensorflow/core/protobuf/data/experimental/snapshot.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/data/experimental/snapshot.proto 2020-03-30 23:56:11.000000000 -0400 -@@ -6,6 +6,10 @@ - import "tensorflow/core/framework/tensor_shape.proto"; - import "tensorflow/core/framework/types.proto"; - -+option java_outer_classname = "SnapshotProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.util"; -+ - // Each SnapshotRecord represents one batch of pre-processed input data. A batch - // consists of a list of tensors that we encode as TensorProtos. This message - // doesn't store the structure of the batch. -diff -ruN a/tensorflow/core/protobuf/device_properties.proto b/tensorflow/core/protobuf/device_properties.proto ---- a/tensorflow/core/protobuf/device_properties.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/device_properties.proto 2020-03-30 23:44:22.000000000 -0400 -@@ -19,6 +19,8 @@ - - option cc_enable_arenas = true; - option java_outer_classname = "DevicePropertiesProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.framework"; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; - - message DeviceProperties { -diff -ruN a/tensorflow/core/protobuf/saved_object_graph.proto b/tensorflow/core/protobuf/saved_object_graph.proto ---- a/tensorflow/core/protobuf/saved_object_graph.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/saved_object_graph.proto 2020-03-30 23:36:13.000000000 -0400 -@@ -11,6 +11,9 @@ - - option cc_enable_arenas = true; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; -+option java_outer_classname = "SavedObjectGraphProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.framework"; - - // A SavedObjectGraph is part of object-based SavedModels in TF 2.0. It - // describes the directed graph of Python objects (or equivalent in other -diff -ruN a/tensorflow/core/protobuf/struct.proto b/tensorflow/core/protobuf/struct.proto ---- a/tensorflow/core/protobuf/struct.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/struct.proto 2020-03-30 23:45:26.000000000 -0400 -@@ -6,6 +6,9 @@ - import "tensorflow/core/framework/types.proto"; - - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; -+option java_outer_classname = "StructProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.framework"; - - // `StructuredValue` represents a dynamically typed value representing various - // data structures that are inspired by Python data structures typically used in -diff -ruN a/tensorflow/core/protobuf/trackable_object_graph.proto b/tensorflow/core/protobuf/trackable_object_graph.proto ---- a/tensorflow/core/protobuf/trackable_object_graph.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/trackable_object_graph.proto 2020-03-30 23:51:22.000000000 -0400 -@@ -4,6 +4,9 @@ - - option cc_enable_arenas = true; - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; -+option java_outer_classname = "TrackableObjectGraphProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.framework"; - - // A TensorBundle addition which saves extra information about the objects which - // own variables, allowing for more robust checkpoint loading into modified -diff -ruN a/tensorflow/core/protobuf/transport_options.proto b/tensorflow/core/protobuf/transport_options.proto ---- a/tensorflow/core/protobuf/transport_options.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/protobuf/transport_options.proto 2020-03-30 23:53:15.000000000 -0400 -@@ -3,6 +3,7 @@ - package tensorflow; - - option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto"; -+option java_package = "org.tensorflow.distruntime"; - - // Extra data needed on a non-RDMA RecvBufResponse. - message RecvBufRespExtra { -diff -ruN a/tensorflow/core/lib/core/error_codes.proto b/tensorflow/core/lib/core/error_codes.proto ---- a/tensorflow/core/lib/core/error_codes.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/lib/core/error_codes.proto 2020-03-30 23:44:22.000000000 -0400 -@@ -1,3 +1,5 @@ - syntax = "proto3"; - -+option java_package = "org.tensorflow.framework"; -+ - import public "tensorflow/core/protobuf/error_codes.proto"; -diff -ruN a/tensorflow/core/profiler/protobuf/xplane.proto b/tensorflow/core/profiler/protobuf/xplane.proto ---- a/tensorflow/core/profiler/protobuf/xplane.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/profiler/protobuf/xplane.proto 2020-03-30 23:44:22.000000000 -0400 -@@ -3,6 +3,9 @@ - package tensorflow.profiler; - - option cc_enable_arenas = true; -+option java_outer_classname = "XPlaneProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.profiler"; - - // A container of parallel XPlanes, generated by one or more profiling sources. - // Next ID: 2 -diff -ruN a/tensorflow/core/util/memmapped_file_system.proto b/tensorflow/core/util/memmapped_file_system.proto ---- a/tensorflow/core/util/memmapped_file_system.proto 2020-03-31 00:00:24.000000000 -0400 -+++ b/tensorflow/core/util/memmapped_file_system.proto 2020-03-30 23:44:22.000000000 -0400 -@@ -17,6 +17,9 @@ - package tensorflow; - - option cc_enable_arenas = true; -+option java_outer_classname = "MemmappedFileSystemProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.util"; - - // A message that describes one region of memmapped file. - message MemmappedFileSystemDirectoryElement { -diff --git a/tensorflow/core/profiler/profiler_options.proto b/tensorflow/core/profiler/profiler_options.proto -index 8b4fc3de6f..9a34ea5aaf 100644 ---- a/tensorflow/core/profiler/profiler_options.proto -+++ b/tensorflow/core/profiler/profiler_options.proto -@@ -1,6 +1,9 @@ - syntax = "proto3"; - - package tensorflow; -+option java_outer_classname = "ProfilerOptionsProtos"; -+option java_multiple_files = true; -+option java_package = "org.tensorflow.profiler"; - - message ProfileOptions { - // Some default value of option are not proto3 default value. Use this version \ No newline at end of file diff --git a/tensorflow-core/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 df96098954f..00000000000 --- a/tensorflow-core/tensorflow-core-api/external/tensorflow-windows.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -ruN tensorflow-1.14.0-rc1/third_party/mkl/mkl.BUILD tensorflow-1.14.0-rc1-windows/third_party/mkl/mkl.BUILD ---- tensorflow-1.14.0-rc1/third_party/mkl/mkl.BUILD 2019-06-08 11:23:20.000000000 +0900 -+++ tensorflow-1.14.0-rc1-windows/third_party/mkl/mkl.BUILD 2019-06-12 08:30:41.232683854 +0900 -@@ -35,11 +35,23 @@ - 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 = [ -- "lib/libiomp5md.lib", -- "lib/mklml.lib", -+ deps = [ -+ "iomp5", -+ "mklml", - ], - linkopts = ["/FORCE:MULTIPLE"], - visibility = ["//visibility:public"], diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml index f0953383920..09af0ac7cf4 100644 --- a/tensorflow-core/tensorflow-core-api/pom.xml +++ b/tensorflow-core/tensorflow-core-api/pom.xml @@ -6,55 +6,47 @@ org.tensorflow tensorflow-core - 0.3.0-SNAPSHOT + 1.3.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} + 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 @@ -64,7 +56,7 @@ com.google.truth truth - 1.0.1 + ${truth.version} test @@ -75,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 + + + + + + + + @@ -121,14 +183,14 @@ org.codehaus.mojo build-helper-maven-plugin - 3.0.0 + 3.4.0 - + add-gen-sources generate-sources @@ -137,302 +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/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.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 - - - - 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}/*iomp5* - org/tensorflow/internal/c_api/${native.classifier}/*msvcr120* - - - - - - - maven-surefire-plugin - 2.22.0 - - - - 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::DataTypeOf(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)); - } - return op; -} - -} // 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 40d72656561..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_specs.h +++ /dev/null @@ -1,180 +0,0 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -#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_; } - const string& description() const { return description_; } - bool iterable() const { return iterable_; } - - private: - const string op_def_name_; - const Variable var_; - const 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) {} - - 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 8598b1d945d..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.cc +++ /dev/null @@ -1,379 +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("?"); - } 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()); - if (!pt->supertypes().empty()) { - Append(" extends ").AppendType(pt->supertypes().front()); - } - first = false; - } - return Append(">"); -} - -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 097887083e7..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.h +++ /dev/null @@ -1,262 +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); - 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 f78720827b0..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,17 +18,55 @@ package org.tensorflow.op; import java.util.List; -import org.tensorflow.DataType; +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; /** * 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, - List> outputTypes, List outputShapes, - DataServiceDataset.Options... options) { - return DataServiceDataset.create(scope, datasetId, processingMode, address, protocol, jobName, maxOutstandingRequests, iterationCounter, outputTypes, outputShapes, options); + public AssertNextDataset assertNextDataset(Operand inputDataset, + Operand transformations, List> outputTypes, + List outputShapes) { + return AssertNextDataset.create(scope, inputDataset, transformations, outputTypes, outputShapes); + } + + /** + * Creates a dataset that shards the input dataset. + * Creates a dataset that shards the input dataset by num_workers, returning a + * sharded dataset for the index-th worker. This attempts to automatically shard + * a dataset by examining the Dataset graph and inserting a shard op before the + * inputs to a reader Dataset (e.g. CSVDataset, TFRecordDataset). + *

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

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

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

    + *
  • One tensor for each component of an element of {@code input_dataset}.
  • + *
  • One tensor for each value in {@code other_arguments}.
  • + *
+ * + * @param inputDataset The inputDataset value + * @param otherArguments A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + * @param predicate A function returning a scalar boolean. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of TakeWhileDataset + */ + public TakeWhileDataset takeWhileDataset(Operand inputDataset, + Iterable> otherArguments, ConcreteFunction predicate, + List> outputTypes, List outputShapes) { + return TakeWhileDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes); + } + + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param threadPool A resource produced by the ThreadPoolHandle op. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ThreadPoolDataset + */ + public ThreadPoolDataset threadPoolDataset(Operand inputDataset, + Operand threadPool, List> outputTypes, + List outputShapes) { + return ThreadPoolDataset.create(scope, inputDataset, threadPool, outputTypes, outputShapes); + } + + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param numThreads The number of threads in the thread pool. + * @param displayName A human-readable name for the threads that may be visible in some + * visualizations. + * @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 b3207a5d4e7..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,42 +18,145 @@ package org.tensorflow.op; import java.util.List; -import org.tensorflow.DataType; +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; @@ -71,176 +174,1177 @@ 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, + public AnonymousIterator anonymousIterator(List> outputTypes, List outputShapes) { return AnonymousIterator.create(scope, outputTypes, outputShapes); } /** - * 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, - Operand dropRemainder, List> outputTypes, List outputShapes, - BatchDataset.Options... options) { + 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); } /** + * 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 CSVDatasetV2 operation * - * @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 */ 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); + 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); } /** - * Creates a dataset that concatenates `input_dataset` with `another_dataset`. + * The ChooseFastestBranchDataset operation * - * @param inputDataset - * @param anotherDataset - * @param outputTypes - * @param outputShapes + * @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 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) { - return ConcatenateDataset.create(scope, inputDataset, anotherDataset, outputTypes, outputShapes); + 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); + } + + /** + * A container for an iterator resource. + * + * @param handle A handle to the iterator to delete. + * @param deleter A variant deleter. + * @return a new instance of DeleteIterator + */ + 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. + * + * @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 + */ + 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); } /** - * A container for an iterator resource. + * Creates a MultiDeviceIterator resource. * - * @param handle A handle to the iterator to delete. - * @param deleter A variant deleter. - * @return a new instance of DeleteIterator + * @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 DeleteIterator deleteIterator(Operand handle, Operand deleter) { - return DeleteIterator.create(scope, handle, deleter); + public MultiDeviceIterator multiDeviceIterator(List devices, String sharedName, + String container, List> outputTypes, List outputShapes) { + return MultiDeviceIterator.create(scope, devices, sharedName, container, outputTypes, outputShapes); } /** - * Converts the given variant tensor to an iterator and stores it in the given resource. + * Generates a MultiDeviceIterator resource from its provided string handle. * - * @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 + * @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 DeserializeIterator deserializeIterator(Operand resourceHandle, Operand serialized) { - return DeserializeIterator.create(scope, resourceHandle, serialized); + 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, + public MultiDeviceIteratorGetNextFromShard multiDeviceIteratorGetNextFromShard( + Operand multiDeviceIterator, Operand shardNum, + Operand incarnationId, List> outputTypes, List outputShapes) { - return Iterator.create(scope, sharedName, container, outputTypes, 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, List> outputTypes, - List outputShapes) { - return IteratorGetNextSync.create(scope, iterator, outputTypes, outputShapes); + public NonSerializableDataset nonSerializableDataset(Operand inputDataset, + List> outputTypes, List 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) { @@ -250,23 +1354,23 @@ 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, List> outputTypes, - List outputShapes) { + public OptionalGetValue optionalGetValue(Operand optional, + List> outputTypes, List outputShapes) { return OptionalGetValue.create(scope, optional, outputTypes, outputShapes); } /** * 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); } @@ -279,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, - List> outputTypes, List outputShapes) { - return RepeatDataset.create(scope, inputDataset, count, outputTypes, outputShapes); + 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 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 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 - * @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 */ - 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); } /** - * Creates a dataset that contains `count` elements from the `input_dataset`. + * Set a summary_writer_interface to record statistics using given stats_aggregator. * - * @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 statsAggregator The statsAggregator value + * @param summary The summary value + * @return a new instance of StatsAggregatorSetSummaryWriter + */ + public StatsAggregatorSetSummaryWriter statsAggregatorSetSummaryWriter( + Operand statsAggregator, Operand summary) { + return StatsAggregatorSetSummaryWriter.create(scope, statsAggregator, summary); + } + + /** + * Creates a dataset that contains {@code count} elements from the {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param 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 {@code components} as a tuple of tensors 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 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 `components` once. + * Creates a dataset that emits each dim-0 slice of {@code components} 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 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); } /** @@ -370,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); } /** @@ -385,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); } /** - * Creates a dataset that zips together `input_datasets`. - *

+ * 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 {@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 index f12d18f925b..4ea1efd10db 100644 --- 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 @@ -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,27 +24,38 @@ /** * An API for building {@code debugging} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class DebuggingOps { private final Scope scope; - DebuggingOps(Scope scope) { - this.scope = scope; + private final Ops ops; + + DebuggingOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; } /** - * Checks a tensor for NaN 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. + * 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 data type for {@code output()} output - * @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 */ 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 1fb69c6637d..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. @@ -17,18 +17,18 @@ // package org.tensorflow.op; -import org.tensorflow.DataType; import org.tensorflow.Operand; 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; @@ -42,70 +42,95 @@ 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) { + public AsString asString(Operand input, AsString.Options... options) { return AsString.create(scope, input, options); } /** * 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, DataType DstT, + public Cast cast(Operand x, Class DstT, Cast.Options... options) { return Cast.create(scope, x, DstT, options); } /** * 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, - DataType Tout) { + Class Tout) { 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 35791f74ec8..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. @@ -18,7 +18,6 @@ package org.tensorflow.op; import java.util.List; -import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.op.image.AdjustContrast; import org.tensorflow.op.image.AdjustHue; @@ -30,26 +29,38 @@ import org.tensorflow.op.image.DecodeAndCropJpeg; import org.tensorflow.op.image.DecodeBmp; import org.tensorflow.op.image.DecodeGif; +import org.tensorflow.op.image.DecodeImage; import org.tensorflow.op.image.DecodeJpeg; import org.tensorflow.op.image.DecodePng; +import org.tensorflow.op.image.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; import org.tensorflow.types.TInt64; @@ -61,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; @@ -75,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, @@ -98,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) { @@ -117,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, @@ -137,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 @@ -152,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, @@ -176,45 +181,43 @@ 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`. - * - * @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 + * {@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 {@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, + public CropAndResize cropAndResize(Operand image, Operand boxes, Operand boxInd, Operand cropSize, CropAndResize.Options... options) { return CropAndResize.create(scope, image, boxes, boxInd, cropSize, options); } @@ -222,26 +225,22 @@ public CropAndResize cropAndResize(Operand image, Operand /** * Computes the gradient of the crop_and_resize op wrt the input boxes tensor. * - * @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 */ - public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand grads, - Operand image, Operand boxes, Operand boxInd, + public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand grads, + Operand image, Operand boxes, Operand boxInd, CropAndResizeGradBoxes.Options... options) { return CropAndResizeGradBoxes.create(scope, grads, image, boxes, boxInd, options); } @@ -249,64 +248,50 @@ public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand /** * 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( Operand grads, Operand boxes, Operand boxInd, - Operand imageSize, DataType T, CropAndResizeGradImage.Options... options) { + Operand imageSize, Class T, CropAndResizeGradImage.Options... options) { return CropAndResizeGradImage.create(scope, grads, boxes, boxInd, imageSize, T, options); } /** * 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, @@ -316,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) { @@ -341,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 @@ -358,36 +336,84 @@ public DecodeGif decodeGif(Operand contents) { return DecodeGif.create(scope, contents); } + /** + * 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 contents 0-D. The encoded image bytes. + * @param options carries optional attribute values + * @return a new instance of DecodeImage, with default output types + */ + public DecodeImage decodeImage(Operand contents, + DecodeImage.Options... options) { + return DecodeImage.create(scope, contents, options); + } + + /** + * 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 contents 0-D. The encoded image bytes. + * @param dtype The desired DType of the returned Tensor. + * @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, + DecodeImage.Options... options) { + return DecodeImage.create(scope, contents, dtype, options); + } + /** * 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) { @@ -396,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); @@ -432,62 +446,93 @@ 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, DataType dtype, + public DecodePng decodePng(Operand contents, Class dtype, DecodePng.Options... options) { 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. - * - * @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 + *

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 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, @@ -497,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. - * - * @param image 3-D with shape `[height, width, channels]`. - * @param options carries optional attributes values + *
  • 1: Output a grayscale image.
  • + *
  • 3: Output an RGB image.
  • + *
+ * + * @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) { @@ -534,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. @@ -549,50 +583,77 @@ 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) { + public EncodePng encodePng(Operand image, EncodePng.Options... options) { return EncodePng.create(scope, image, 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 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 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 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, @@ -602,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); @@ -615,43 +674,140 @@ 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, - DataType outputType) { + Class outputType) { 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. - * - * @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. + * * @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 @@ -662,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. @@ -683,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, @@ -696,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. @@ -731,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); + } + + /** + * Computes the gradient of bilinear interpolation. + * + * @param grads 4-D with shape {@code [batch, height, width, channels]}. + * @param originalImage 4-D with shape {@code [batch, orig_height, orig_width, channels]}, + * The image tensor that was resized. + * @param options carries optional attribute values + * @param data type for {@code ResizeBilinearGrad} output and operands + * @return a new instance of ResizeBilinearGrad + */ + public ResizeBilinearGrad resizeBilinearGrad(Operand grads, + Operand originalImage, ResizeBilinearGrad.Options... options) { + return ResizeBilinearGrad.create(scope, grads, originalImage, options); } /** - * Resize `images` to `size` using nearest neighbor interpolation. + * Resize {@code images} to {@code size} using nearest neighbor 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 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) { @@ -876,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),
@@ -908,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( @@ -932,18 +1120,116 @@ 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, + public ScaleAndTranslate scaleAndTranslate(Operand images, + 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 {@code seed}, + * deterministically 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 {@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 {@code seed} and is + * independent of how many times the function is called, and independent of global + * 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 = ( + * ... 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) + * <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( + * ... tf.expand_dims(tf.cast(image, tf.float32),0), bbox_draw, colors) + * <tf.Tensor: shape=(1, 3, 3, 1), dtype=float32, numpy= + * array([[[[1.], + * [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 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 {@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( + Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, + Operand seed, StatelessSampleDistortedBoundingBox.Options... options) { + return StatelessSampleDistortedBoundingBox.create(scope, imageSize, boundingBoxes, minObjectCovered, seed, options); } /** 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 3cb7569ab38..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. @@ -18,7 +18,6 @@ package org.tensorflow.op; import java.util.List; -import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.io.DecodeBase64; @@ -28,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; @@ -77,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; @@ -91,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 @@ -104,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, @@ -123,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. @@ -133,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, @@ -143,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. @@ -162,115 +160,132 @@ 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, - Operand fixedLength, DataType outType, DecodePaddedRaw.Options... options) { + Operand fixedLength, Class outType, DecodePaddedRaw.Options... options) { return DecodePaddedRaw.create(scope, inputBytes, fixedLength, outType, options); } /** * 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, DataType outType, + public DecodeRaw decodeRaw(Operand bytes, Class outType, DecodeRaw.Options... options) { return DecodeRaw.create(scope, bytes, outType, options); } /** - * 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( - Operand serializedSparse, DataType dtype) { + Operand serializedSparse, Class dtype) { 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, FifoQueue.Options... options) { + public FifoQueue fifoQueue(List> componentTypes, + FifoQueue.Options... options) { return FifoQueue.create(scope, componentTypes, options); } @@ -278,7 +293,7 @@ public FifoQueue fifoQueue(List> componentTypes, FifoQueue.Options.. * 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,16 +338,15 @@ 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, + public PaddingFifoQueue paddingFifoQueue(List> componentTypes, PaddingFifoQueue.Options... options) { return PaddingFifoQueue.create(scope, componentTypes, options); } @@ -344,19 +356,19 @@ public PaddingFifoQueue paddingFifoQueue(List> componentTypes, * * @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> componentTypes, * 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 @@ -396,9 +408,9 @@ public PaddingFifoQueue paddingFifoQueue(List> componentTypes, */ public ParseExample parseExample(Operand serialized, Operand names, Operand sparseKeys, Operand denseKeys, Operand raggedKeys, - Iterable> denseDefaults, Long numSparse, List> sparseTypes, - List> raggedValueTypes, List> raggedSplitTypes, - List denseShapes) { + Iterable> denseDefaults, Long numSparse, List> sparseTypes, + List> raggedValueTypes, + List> raggedSplitTypes, List denseShapes) { return ParseExample.create(scope, serialized, names, sparseKeys, denseKeys, raggedKeys, denseDefaults, numSparse, sparseTypes, raggedValueTypes, raggedSplitTypes, denseShapes); } @@ -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, @@ -454,10 +466,13 @@ public ParseSequenceExample parseSequenceExample(Operand serialized, 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, + Iterable> contextDenseDefaults, List> contextSparseTypes, + List> contextRaggedValueTypes, + List> contextRaggedSplitTypes, + List> featureListDenseTypes, + List> featureListSparseTypes, + List> featureListRaggedValueTypes, + List> featureListRaggedSplitTypes, ParseSequenceExample.Options... options) { return ParseSequenceExample.create(scope, serialized, debugName, contextSparseKeys, contextDenseKeys, contextRaggedKeys, featureListSparseKeys, featureListDenseKeys, featureListRaggedKeys, featureListDenseMissingAssumedEmpty, contextDenseDefaults, contextSparseTypes, contextRaggedValueTypes, contextRaggedSplitTypes, featureListDenseTypes, featureListSparseTypes, featureListRaggedValueTypes, featureListRaggedSplitTypes, options); } @@ -467,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. @@ -477,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] @@ -499,7 +514,7 @@ public ParseSequenceExample parseSequenceExample(Operand serialized, */ public ParseSingleExample parseSingleExample(Operand serialized, Iterable> denseDefaults, Long numSparse, List sparseKeys, - List denseKeys, List> sparseTypes, List denseShapes) { + List denseKeys, List> sparseTypes, List denseShapes) { return ParseSingleExample.create(scope, serialized, denseDefaults, numSparse, sparseKeys, denseKeys, sparseTypes, denseShapes); } @@ -540,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, @@ -553,8 +568,9 @@ public ParseSingleSequenceExample parseSingleSequenceExample(Operand se Iterable> contextSparseKeys, Iterable> contextDenseKeys, Iterable> featureListSparseKeys, Iterable> featureListDenseKeys, Iterable> contextDenseDefaults, - Operand debugName, List> contextSparseTypes, - List> featureListDenseTypes, List> featureListSparseTypes, + Operand debugName, List> contextSparseTypes, + List> featureListDenseTypes, + List> featureListSparseTypes, ParseSingleSequenceExample.Options... options) { return ParseSingleSequenceExample.create(scope, serialized, featureListDenseMissingAssumedEmpty, contextSparseKeys, contextDenseKeys, featureListSparseKeys, featureListDenseKeys, contextDenseDefaults, debugName, contextSparseTypes, featureListDenseTypes, featureListSparseTypes, options); } @@ -562,20 +578,19 @@ 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, - DataType outType) { + Class outType) { return ParseTensor.create(scope, serialized, outType); } /** * 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 @@ -587,17 +602,16 @@ 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, List shapes, - PriorityQueue.Options... options) { + public PriorityQueue priorityQueue(List> componentTypes, + List shapes, PriorityQueue.Options... options) { return PriorityQueue.create(scope, componentTypes, shapes, options); } /** * 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 @@ -605,146 +619,130 @@ public PriorityQueue priorityQueue(List> componentTypes, List * 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, - List> componentTypes, QueueDequeueMany.Options... options) { + 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, - List> componentTypes, QueueDequeueUpTo.Options... options) { + 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); } @@ -754,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); } @@ -762,10 +760,10 @@ 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, + public RandomShuffleQueue randomShuffleQueue(List> componentTypes, RandomShuffleQueue.Options... options) { return RandomShuffleQueue.create(scope, componentTypes, options); } @@ -773,7 +771,7 @@ public RandomShuffleQueue randomShuffleQueue(List> componentTypes, /** * 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) { @@ -782,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); } @@ -799,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). @@ -814,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); } @@ -842,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. * @@ -857,119 +853,110 @@ 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) { + public SerializeManySparse serializeManySparse(Operand sparseIndices, + Operand sparseValues, Operand sparseShape) { return SerializeManySparse.create(scope, sparseIndices, sparseValues, sparseShape); } /** - * 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, Operand sparseValues, Operand sparseShape, - DataType outType) { + public SerializeManySparse serializeManySparse(Operand sparseIndices, + Operand sparseValues, Operand sparseShape, Class outType) { return SerializeManySparse.create(scope, sparseIndices, sparseValues, sparseShape, outType); } /** - * 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`. - * @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) { + public SerializeSparse serializeSparse(Operand sparseIndices, + Operand sparseValues, Operand sparseShape) { return SerializeSparse.create(scope, sparseIndices, sparseValues, sparseShape); } /** - * 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, Operand sparseValues, Operand sparseShape, - DataType outType) { + public SerializeSparse serializeSparse(Operand sparseIndices, + Operand sparseValues, Operand sparseShape, Class outType) { return SerializeSparse.create(scope, sparseIndices, sparseValues, sparseShape, outType); } /** * 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) { + public SerializeTensor serializeTensor(Operand tensor) { return SerializeTensor.create(scope, 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, @@ -980,8 +967,8 @@ public ShardedFilename shardedFilename(Operand basename, Operand basename, Operand numShards) { @@ -991,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) { @@ -1022,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 6d63d9ddd89..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. @@ -17,9 +17,9 @@ // package org.tensorflow.op; -import org.tensorflow.DataType; 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; @@ -50,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; @@ -62,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; @@ -73,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; @@ -83,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, @@ -137,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) { @@ -147,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) { @@ -158,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, @@ -171,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) { @@ -181,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) { @@ -191,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) { @@ -201,10 +226,15 @@ public BatchMatrixDiagPart batchMatrixDiagPart(Operand i } /** + * The BatchMatrixInverse operation + * DEPRECATED: This operation is deprecated and will be removed in a future version. + * Use tf.linalg.inv instead. + *

Computes the inverse of one or more square invertible matrices or their + * adjoints (conjugate transposes). * - * @param data type for {@code output()} output - * @param input - * @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 */ public BatchMatrixInverse batchMatrixInverse(Operand input, @@ -213,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, @@ -225,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, @@ -238,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, @@ -252,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( @@ -265,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, @@ -277,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) { @@ -289,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) { @@ -314,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) { @@ -333,31 +364,29 @@ 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, - Operand perm) { + public ConjugateTranspose conjugateTranspose(Operand x, + Operand perm) { return ConjugateTranspose.create(scope, x, perm); } /** * 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) { @@ -366,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) { @@ -381,110 +409,97 @@ 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, DataType Tout, + public Eig eig(Operand input, Class Tout, Eig.Options... options) { return Eig.create(scope, input, Tout, options); } /** * 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) { @@ -493,42 +508,36 @@ 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, - Operand axis, EuclideanNorm.Options... options) { + public EuclideanNorm euclideanNorm(Operand input, + Operand axis, EuclideanNorm.Options... options) { return EuclideanNorm.create(scope, input, axis, options); } /** - * 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 + * Computes the inverse of one or more square invertible matrices or their adjoints (conjugate transposes). + * 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) { @@ -536,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, @@ -606,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 the determinant = sign*exp(log_abs_determinant). - * The log_abs_determinant is computed as det(P)*sum(log(diag(LU))) where LU - * is the LU decomposition of the input and P is the corresponding + * {@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) { @@ -627,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); @@ -658,52 +647,45 @@ 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, - DataType outputIdxType) { + Class outputIdxType) { return Lu.create(scope, input, outputIdxType); } /** - * 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) { @@ -712,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]],
@@ -761,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]],
@@ -776,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],
@@ -786,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, @@ -820,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]],
@@ -860,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],
@@ -879,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, @@ -904,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]],
@@ -954,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]],
@@ -974,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]],
@@ -986,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, @@ -1020,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]],
@@ -1080,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]],
@@ -1097,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],
@@ -1111,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],
@@ -1122,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, @@ -1157,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],
@@ -1209,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],
@@ -1218,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],
@@ -1235,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],
@@ -1251,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, @@ -1279,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, @@ -1332,21 +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[..., :,:])` - *

{@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) { @@ -1354,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, Operand maxA, - Operand minB, Operand maxB, DataType Toutput, DataType Tactivation, - QuantizedMatMul.Options... options) { + 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, @@ -1407,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, @@ -1428,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) { @@ -1455,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) { @@ -1479,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) { @@ -1507,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) { @@ -1536,42 +1600,36 @@ 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) { + public Transpose transpose(Operand x, Operand perm) { return Transpose.create(scope, x, perm); } /** * 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],
@@ -1584,25 +1642,25 @@ public  Transpose transpose(Operand x,
    *
    *  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)
-   *  # 
-   *  }
+ * # [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, @@ -1610,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 b193c2e404d..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. @@ -17,7 +17,6 @@ // package org.tensorflow.op; -import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.ndarray.Shape; import org.tensorflow.op.math.Abs; @@ -35,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; @@ -61,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; @@ -93,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; @@ -133,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; @@ -143,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) { @@ -162,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) { @@ -183,9 +196,11 @@ public AccumulateN accumulateN(Iterable> inputs, /** * Computes acos of x element-wise. + * Provided an input tensor, the {@code tf.math.acos} operation returns the inverse cosine of each element of the tensor. If {@code y = tf.math.cos(x)} then, {@code x = tf.math.acos(y)}. + *

Input range is {@code [-1, 1]} and the output has a range of {@code [0, pi]}. * - * @param data type for {@code y()} output - * @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) { @@ -194,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) { @@ -212,13 +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) - * - * @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) { @@ -227,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) { @@ -245,63 +258,59 @@ 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) { + public Angle angle(Operand input) { return Angle.create(scope, 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, DataType Tout) { + public Angle angle(Operand input, Class Tout) { return Angle.create(scope, input, Tout); } /** - * 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, @@ -311,134 +320,121 @@ 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) { + public ArgMax argMax(Operand input, + Operand dimension) { return ArgMax.create(scope, input, dimension); } /** * 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, - Operand dimension, DataType outputType) { + public ArgMax argMax(Operand input, + Operand dimension, Class outputType) { return ArgMax.create(scope, input, dimension, outputType); } /** * 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) { + public ArgMin argMin(Operand input, + Operand dimension) { return ArgMin.create(scope, input, dimension); } /** * 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, - Operand dimension, DataType outputType) { + public ArgMin argMin(Operand input, + Operand dimension, Class outputType) { return ArgMin.create(scope, input, dimension, outputType); } /** * 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) { @@ -447,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) { @@ -467,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) { @@ -492,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) { @@ -511,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) { @@ -532,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) { @@ -557,125 +595,103 @@ 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 - */ - public ComplexAbs complexAbs(Operand x) { + * 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); } /** * 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, - DataType Tout) { + public ComplexAbs complexAbs(Operand x, Class Tout) { return ComplexAbs.create(scope, x, Tout); } /** * 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) { @@ -684,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) { @@ -705,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) { @@ -724,115 +736,140 @@ 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, + public Cumprod cumprod(Operand x, Operand axis, Cumprod.Options... options) { return Cumprod.create(scope, x, axis, options); } /** - * 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 - * @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, + public Cumsum cumsum(Operand x, Operand axis, Cumsum.Options... options) { return Cumsum.create(scope, x, axis, options); } + /** + * 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: + *
+   *  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) { @@ -841,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) { @@ -856,14 +892,12 @@ public Div div(Operand x, Operand y) { /** * Returns 0 if the denominator is zero. - *

+ * NOTE: {@code math.DivNoNan} supports broadcasting. More about broadcasting + * here * - * 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 - * @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) { @@ -872,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) { @@ -895,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) { @@ -906,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) { @@ -917,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) { @@ -927,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) { @@ -963,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) { @@ -999,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) { @@ -1009,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) { @@ -1023,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) { @@ -1041,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) { @@ -1066,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) { @@ -1091,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) { @@ -1116,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) { @@ -1142,69 +1167,61 @@ 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) { + public Imag imag(Operand input) { return Imag.create(scope, 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, DataType Tout) { + public Imag imag(Operand input, Class Tout) { return Imag.create(scope, input, Tout); } /** * 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) { @@ -1213,77 +1230,76 @@ 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) { + public IsFinite isFinite(Operand x) { return IsFinite.create(scope, 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) { + public IsInf isInf(Operand x) { return IsInf.create(scope, 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) { + public IsNan isNan(Operand x) { return IsNan.create(scope, 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) { @@ -1291,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) { @@ -1316,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) { @@ -1337,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) { @@ -1356,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) { @@ -1375,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) { @@ -1388,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) { @@ -1399,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) { @@ -1412,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) { @@ -1428,33 +1434,31 @@ 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, + public Mean mean(Operand input, Operand axis, Mean.Options... options) { return Mean.create(scope, input, axis, options); } /** - * 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) + * 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) { @@ -1463,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) { @@ -1481,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) { @@ -1496,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) { @@ -1510,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) { @@ -1521,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) { @@ -1533,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) { @@ -1553,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, @@ -1568,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) { @@ -1588,35 +1583,32 @@ 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) { + public PopulationCount populationCount(Operand x) { return PopulationCount.create(scope, 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) { @@ -1626,97 +1618,90 @@ 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, - Operand minY, Operand maxY, DataType Toutput) { + 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); } /** * 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, - Operand minY, Operand maxY, DataType Toutput) { + 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) { + public Real real(Operand input) { return Real.create(scope, 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, DataType Tout) { + public Real real(Operand input, Class Tout) { return Real.create(scope, input, Tout); } /** * 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) { @@ -1725,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) { @@ -1758,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) { @@ -1772,224 +1803,302 @@ 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); + public SegmentMax segmentMax(Operand data, + 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, - Operand segmentIds) { + public SegmentMean segmentMean(Operand data, + Operand segmentIds) { return SegmentMean.create(scope, data, segmentIds); } /** * 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); + public SegmentMin segmentMin(Operand data, + 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); + public SegmentProd segmentProd(Operand data, + 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); + public SegmentSum segmentSum(Operand data, + 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) { @@ -1998,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) { @@ -2018,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) { @@ -2037,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 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. + * @return a new instance of SobolSample, with default output types + */ + public SobolSample sobolSample(Operand dim, Operand numResults, + Operand skip) { + return SobolSample.create(scope, dim, numResults, skip); + } + + /** + * Generates points from the Sobol sequence. + * Creates a Sobol sequence with {@code num_results} samples. Each sample has dimension + * {@code dim}. Skips the first {@code skip} samples. + * + * @param dim Positive scalar {@code Tensor} representing each sample's dimension. + * @param numResults Positive scalar {@code Tensor} of dtype int32. The number of Sobol points to return + * in the output. + * @param skip Positive scalar {@code Tensor} of dtype int32. The number of initial points of the + * Sobol sequence to skip. + * @param dtype The type of the sample. One of: {@code float32} or {@code float64}. + * @param data type for {@code SobolSample} output and operands + * @return a new instance of SobolSample + */ + public SobolSample sobolSample(Operand dim, + Operand numResults, Operand skip, Class dtype) { + return SobolSample.create(scope, dim, numResults, skip, dtype); + } + + /** + * The Softplus operation + * + * @param 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) { @@ -2074,14 +2240,13 @@ public Square square(Operand x) { } /** - * Returns (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) + * Returns conj(x - y)(x - y) element-wise. + * NOTE: {@code math.SquaredDifference} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @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) { @@ -2090,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) { @@ -2105,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) { @@ -2125,19 +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]`. - *

- *

{@code
-   *    x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")])
-   *    tf.math.tanh(x) ==> [-1. -0.99990916 -0.46211717 0.7615942 0.8336547 0.9640276 0.9950547 1.]
-   *    }
- * - * @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) { @@ -2145,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) { @@ -2166,189 +2345,267 @@ 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, Operand segmentIds, Operand numSegments) { + public UnsortedSegmentMax unsortedSegmentMax(Operand data, + Operand segmentIds, Operand numSegments) { return UnsortedSegmentMax.create(scope, data, segmentIds, numSegments); } /** * 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, Operand segmentIds, Operand numSegments) { + public UnsortedSegmentMin unsortedSegmentMin(Operand data, + Operand segmentIds, Operand numSegments) { return UnsortedSegmentMin.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. - *

- * 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, Operand segmentIds, Operand numSegments) { + public UnsortedSegmentProd unsortedSegmentProd(Operand data, + Operand segmentIds, Operand numSegments) { return UnsortedSegmentProd.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 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, Operand segmentIds, Operand numSegments) { + public UnsortedSegmentSum unsortedSegmentSum(Operand data, + Operand segmentIds, Operand numSegments) { return UnsortedSegmentSum.create(scope, data, segmentIds, numSegments); } /** * 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) { @@ -2358,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) { @@ -2370,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) { @@ -2380,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 0992cc606ba..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. @@ -18,16 +18,20 @@ package org.tensorflow.op; import java.util.List; -import org.tensorflow.DataType; import org.tensorflow.Operand; 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; @@ -37,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; @@ -50,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; @@ -70,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; @@ -83,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; @@ -101,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; @@ -113,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, @@ -137,15 +170,17 @@ public AvgPool avgPool(Operand value, List ksize /** * Performs 3D average pooling on the input. + * Each entry in {@code output} is the mean of the corresponding size {@code ksize} window in + * {@code value}. * - * @param data type for {@code output()} output - * @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, @@ -156,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, @@ -173,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, @@ -189,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( @@ -204,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, @@ -216,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( @@ -231,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, @@ -248,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, @@ -264,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 @@ -275,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, @@ -284,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, @@ -328,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, @@ -351,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, @@ -372,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, @@ -398,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, @@ -421,41 +588,39 @@ 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( - Operand inputSizes, Operand filter, Operand outBackprop, List strides, - String padding, Conv3dBackpropInput.Options... options) { + public Conv3dBackpropInput conv3dBackpropInput( + Operand inputSizes, Operand filter, Operand outBackprop, + List strides, String padding, Conv3dBackpropInput.Options... options) { return Conv3dBackpropInput.create(scope, inputSizes, filter, outBackprop, strides, padding, options); } /** * 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, @@ -466,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, @@ -490,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, @@ -509,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( @@ -561,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( @@ -612,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, DataType T, - DataType 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, @@ -667,13 +949,40 @@ public DataFormatDimMap dataFormatDimMap(Operand x, } /** - * Returns the permuted vector/tensor in the destination data format given the - *

- * one in the source data format. + * 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]
+   *  
+ *

, the output will be: + *

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

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 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 + * @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, @@ -683,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, @@ -775,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, @@ -812,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( @@ -838,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( @@ -861,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, @@ -905,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, @@ -925,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, @@ -943,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. @@ -982,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, @@ -993,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, @@ -1015,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, @@ -1063,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. @@ -1078,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, @@ -1089,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. @@ -1110,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( @@ -1121,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 @@ -1134,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, @@ -1154,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 @@ -1166,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, @@ -1215,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) { @@ -1231,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, @@ -1245,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. @@ -1264,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, @@ -1275,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( @@ -1298,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) { @@ -1316,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); } @@ -1333,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, @@ -1351,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, @@ -1372,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, @@ -1393,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, @@ -1413,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, @@ -1433,46 +2075,64 @@ 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( - Operand input, Operand grad, Operand argmax, List ksize, List strides, - String padding, MaxPoolGradGradWithArgmax.Options... options) { + public MaxPoolGradGradWithArgmax maxPoolGradGradWithArgmax( + Operand input, Operand grad, Operand argmax, List ksize, + List strides, String padding, MaxPoolGradGradWithArgmax.Options... options) { 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) { @@ -1481,50 +2141,47 @@ 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( - Operand input, List ksize, List strides, DataType Targmax, String padding, + Operand input, List ksize, List strides, Class Targmax, String padding, MaxPoolWithArgmax.Options... options) { return MaxPoolWithArgmax.create(scope, input, ksize, strides, Targmax, padding, options); } /** - * 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, @@ -1535,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. @@ -1544,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); @@ -1554,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. @@ -1577,86 +2232,488 @@ 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, - Operand gamma, Operand gammaMin, Operand gammaMax, DataType outType, + Operand gamma, Operand gammaMin, Operand gammaMax, Class outType, Float varianceEpsilon, Boolean scaleAfterNormalization) { return QuantizedBatchNormWithGlobalNormalization.create(scope, t, tMin, tMax, m, mMin, mMax, v, vMin, vMax, beta, betaMin, betaMax, gamma, gammaMin, gammaMax, outType, varianceEpsilon, scaleAfterNormalization); } /** * 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, - Operand minBias, Operand maxBias, DataType outType) { + 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, - Operand minFilter, Operand maxFilter, DataType outType, + 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); } @@ -1664,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. @@ -1673,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, - Operand minFeatures, Operand maxFeatures, DataType outType) { + 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, - Operand minFeatures, Operand maxFeatures, DataType outType) { + 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, - DataType outType) { + 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) { @@ -1756,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) { @@ -1775,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) { @@ -1840,237 +2887,207 @@ 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, - Operand paddings, Long blockSize) { + public SpaceToBatch spaceToBatch(Operand input, + Operand paddings, Long blockSize) { return SpaceToBatch.create(scope, input, paddings, blockSize); } /** * 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, @@ -2079,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 64cecadbe6d..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 9a529e86eb4..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,15 @@ package org.tensorflow.op; import java.nio.charset.Charset; +import java.util.Arrays; import java.util.List; -import org.tensorflow.DataType; +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; @@ -39,9 +43,15 @@ import org.tensorflow.ndarray.buffer.FloatDataBuffer; import org.tensorflow.ndarray.buffer.IntDataBuffer; import org.tensorflow.ndarray.buffer.LongDataBuffer; +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,34 +66,58 @@ 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; import org.tensorflow.op.core.Empty; import org.tensorflow.op.core.EmptyTensorList; +import org.tensorflow.op.core.EmptyTensorMap; +import org.tensorflow.op.core.EncodeProto; import org.tensorflow.op.core.EnsureShape; +import org.tensorflow.op.core.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; @@ -91,23 +125,30 @@ 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; import org.tensorflow.op.core.InplaceSub; import org.tensorflow.op.core.InplaceUpdate; import org.tensorflow.op.core.IsVariableInitialized; +import org.tensorflow.op.core.KthOrderStatistic; +import org.tensorflow.op.core.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; @@ -118,15 +159,20 @@ 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; +import org.tensorflow.op.core.Ones; import org.tensorflow.op.core.OnesLike; import org.tensorflow.op.core.OrderedMapClear; import org.tensorflow.op.core.OrderedMapIncompleteSize; @@ -138,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; @@ -176,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; @@ -184,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; @@ -202,16 +259,30 @@ 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; import org.tensorflow.op.core.StridedSliceGrad; +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; @@ -243,8 +314,12 @@ import org.tensorflow.op.core.TensorListSetItem; import org.tensorflow.op.core.TensorListSplit; import org.tensorflow.op.core.TensorListStack; -import org.tensorflow.op.core.TensorScatterMax; -import org.tensorflow.op.core.TensorScatterMin; +import org.tensorflow.op.core.TensorMapErase; +import org.tensorflow.op.core.TensorMapHasKey; +import org.tensorflow.op.core.TensorMapInsert; +import org.tensorflow.op.core.TensorMapLookup; +import org.tensorflow.op.core.TensorMapSize; +import org.tensorflow.op.core.TensorMapStackKeys; import org.tensorflow.op.core.TensorScatterNdAdd; import org.tensorflow.op.core.TensorScatterNdMax; import org.tensorflow.op.core.TensorScatterNdMin; @@ -253,21 +328,23 @@ import org.tensorflow.op.core.TensorStridedSliceUpdate; import org.tensorflow.op.core.Tile; import org.tensorflow.op.core.Timestamp; -import org.tensorflow.op.core.TryRpc; +import org.tensorflow.op.core.TopKUnique; +import org.tensorflow.op.core.TopKWithUnique; import org.tensorflow.op.core.Unbatch; import org.tensorflow.op.core.UnbatchGrad; +import org.tensorflow.op.core.UniformQuantizedClipByValue; import org.tensorflow.op.core.Unique; import org.tensorflow.op.core.UniqueWithCounts; import org.tensorflow.op.core.UnravelIndex; import org.tensorflow.op.core.Unstack; import org.tensorflow.op.core.Unstage; +import org.tensorflow.op.core.UpperBound; import org.tensorflow.op.core.VarHandleOp; import org.tensorflow.op.core.VarIsInitializedOp; import org.tensorflow.op.core.Variable; 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; @@ -315,33 +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 MathOps math; + public final DebuggingOps debugging; + + public final CollectiveOps collective; + + public final DistributeOps distribute; public final AudioOps audio; @@ -351,40 +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); 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) { @@ -392,102 +482,197 @@ 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) { + public All all(Operand input, Operand axis, All.Options... options) { return All.create(scope, input, axis, options); } /** - * 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) { + public Any any(Operand input, Operand axis, Any.Options... options) { return Any.create(scope, input, axis, options); } /** - * 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 */ @@ -498,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 */ @@ -506,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. @@ -521,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, @@ -537,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, @@ -554,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, @@ -571,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. * @@ -579,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, - Operand value) { + 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, @@ -603,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. * @@ -611,49 +798,46 @@ 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, - Operand value) { + 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) { + public Barrier barrier(List> componentTypes, Barrier.Options... options) { return Barrier.create(scope, componentTypes, options); } /** * 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 @@ -662,7 +846,7 @@ public Barrier barrier(List> componentTypes, Barrier.Options... 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) { @@ -681,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 @@ -694,8 +877,8 @@ public BarrierIncompleteSize barrierIncompleteSize(Operand handle) { * @param componentIndex The component of the barrier elements that is being assigned. * @return a new instance of BarrierInsertMany */ - public BarrierInsertMany barrierInsertMany(Operand handle, - Operand keys, Operand values, Long componentIndex) { + public BarrierInsertMany barrierInsertMany(Operand handle, Operand keys, + Operand values, Long componentIndex) { return BarrierInsertMany.create(scope, handle, keys, values, componentIndex); } @@ -711,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. @@ -724,60 +905,54 @@ 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, - List> componentTypes, BarrierTakeMany.Options... options) { + List> componentTypes, BarrierTakeMany.Options... options) { return BarrierTakeMany.create(scope, handle, numElements, componentTypes, options); } /** * 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, @@ -785,222 +960,335 @@ 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, - Operand crops, Long blockSize) { + public BatchToSpace batchToSpace(Operand input, + Operand crops, Long blockSize) { return BatchToSpace.create(scope, input, crops, blockSize); } /** * 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, Operand blockShape, Operand crops) { + public BatchToSpaceNd batchToSpaceNd(Operand input, + Operand blockShape, Operand crops) { return BatchToSpaceNd.create(scope, input, blockShape, crops); } /** * 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, DataType type) { + public Bitcast bitcast(Operand input, Class type) { return Bitcast.create(scope, input, type); } + /** + * Apply boolean mask to tensor. Returns the flat array of each element corresponding to a {@code + * true} in the mask. + * + *

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

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

The {@code axis} could be used with {@code mask} to indicate the axis to mask from (it's 0 + * by default). In that case, {@code axis + dim(mask) <= dim(tensor)} and {@code mask}'s shape + * must match the first {@code axis + dim(mask)} dimensions of {@code tensor}'s shape. + * + * @param tensor The tensor to mask. + * @param mask The mask to apply. + * @param options carries optional attributes values + * @return The masked tensor. + */ + public Operand booleanMask(Operand tensor, Operand mask, + BooleanMask.Options... options) { + return BooleanMask.create(scope, tensor, mask, 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. + * @param updates the new values + * @param options carries optional attributes values + * @return The masked tensor. + */ + public Operand booleanMaskUpdate(Operand tensor, Operand mask, + Operand updates, BooleanMaskUpdate.Options... options) { + return BooleanMaskUpdate.create(scope, tensor, mask, updates, options); + } + /** * 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, @@ -1008,225 +1296,309 @@ 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, - Operand shape) { + public BroadcastTo broadcastTo(Operand input, + Operand shape) { return BroadcastTo.create(scope, input, shape); } /** * 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. * @return a new instance of Bucketize */ - public Bucketize bucketize(Operand input, List boundaries) { + public Bucketize bucketize(Operand input, List boundaries) { return Bucketize.create(scope, input, boundaries); } /** - * 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. - * @return a new instance of ClipByValue + * @param argument the argument to the call + * @return the output of the function + * @see ConcreteFunction#call(Ops, Operand) */ - public ClipByValue clipByValue(Operand t, Operand clipValueMin, - Operand clipValueMax) { - return ClipByValue.create(scope, t, clipValueMin, clipValueMax); + public Operand call(ConcreteFunction function, Operand argument) { + return Function.call(scope, function, argument); } /** - * Concatenates tensors along one dimension. + * 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 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 axis 0-D. The dimension along which to concatenate. Must be in the - * range [-rank(values), rank(values)). - * @return a new instance of Concat + * @param arguments the arguments to the call + * @return the outputs of the function + * @see ConcreteFunction#call(Ops, Map) */ - public Concat concat(Iterable> values, - Operand axis) { - return Concat.create(scope, values, axis); + public Map> call(ConcreteFunction function, + Map> arguments) { + return Function.call(scope, function, arguments); } /** - * Creates a constant of {@code long} elements that is a copy of a given n-dimensional array. + * 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 scope is a scope used to add the underlying operation. - * @param data an n-dimensional array of {@code long} elements. - * @return a long constant + *

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 Constant constant(LongNdArray data) { - return Constant.tensorOf(scope, data); + public Case caseOp(Operand branchIndex, Iterable> input, + List> Tout, List branches, Case.Options... options) { + return Case.create(scope, branchIndex, input, Tout, branches, options); } /** - * Creates a rank-1 constant of {@code int} elements. + * 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 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 tensor The tensor value + * @param data type for {@code CheckPinned} output and operands + * @return a new instance of CheckPinned */ - public Constant constant(int[] data) { - return Constant.vectorOf(scope, data); + public CheckPinned checkPinned(Operand tensor) { + return CheckPinned.create(scope, tensor); } /** - * 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 an integer constant + * 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 Constant constant(int[][][] data) { - return Constant.tensorOf(scope, data); + public ClipByValue clipByValue(Operand t, Operand clipValueMin, + Operand clipValueMax) { + return ClipByValue.create(scope, t, clipValueMin, clipValueMax); } /** - * Creates a constant containing a single {@code double} element. + * 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 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 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 Constant constant(double data) { - return Constant.scalarOf(scope, data); + public CompositeTensorVariantFromComponents compositeTensorVariantFromComponents( + Iterable> components, String metadata) { + return CompositeTensorVariantFromComponents.create(scope, components, metadata); } /** - * Creates a rank-5 constant of {@code long} elements. + * 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 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 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 Constant constant(long[][][][][] data) { - return Constant.tensorOf(scope, data); + public CompositeTensorVariantToComponents compositeTensorVariantToComponents( + Operand encoded, String metadata, List> Tcomponents) { + return CompositeTensorVariantToComponents.create(scope, encoded, metadata, Tcomponents); } /** - * Creates a rank-5 constant of {@code boolean} elements. + * Concatenates tensors along one dimension. * - * @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) { - return Constant.tensorOf(scope, data); + * @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, + Operand axis) { + return Concat.create(scope, values, axis); } /** - * Creates a constant of {@code int} elements that is a copy of a given n-dimensional array. + * Computes offsets of concat inputs within its output. + * For example: + *

+ *
+ *
+ *

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

+ *
+ *
+ *

This is typically used by gradient computations for a concat operation. + * + * @param concatDim The dimension along which to concatenate. + * @param shape The {@code N} int32 or int64 vectors representing shape of tensors being concatenated. + * @param data type for {@code ConcatOffset} output and operands + * @return a new instance of ConcatOffset + */ + public ConcatOffset concatOffset(Operand concatDim, + Iterable> shape) { + return ConcatOffset.create(scope, concatDim, shape); + } + + /** + * Creates a constant containing a single {@code int} element. * - * @param scope is a scope used to add the underlying operation. - * @param data an n-dimensional array of {@code int} elements. + * @param data The value to put into the new constant. * @return an integer constant */ - public Constant constant(IntNdArray data) { - return Constant.tensorOf(scope, data); + public Constant constant(int data) { + return Constant.scalarOf(scope, data); } /** - * Creates a constant of {@code double} elements that is a copy of a given n-dimensional array. + * Creates a rank-3 constant of {@code double} elements. * - * @param scope is a scope used to add the underlying operation. - * @param data an n-dimensional array 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(DoubleNdArray data) { + public Constant constant(double[][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-4 constant of {@code int} elements. + * Creates a rank-5 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 an integer constant + * @return a byte constant */ - public Constant constant(int[][][][] data) { + public Constant constant(byte[][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-6 constant of {@code float} 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 float constant + * @return an integer constant */ - public Constant constant(float[][][][][][] data) { + public Constant constant(int[][][][] data) { return Constant.tensorOf(scope, data); } /** * Creates a constant containing a single {@code byte} element. * - * @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 */ @@ -1235,57 +1607,74 @@ public Constant constant(byte data) { } /** - * Creates a rank-3 constant of {@code boolean} elements. + * Creates a rank-6 constant of {@code float} elements. + * + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. + * @return a float constant + */ + public Constant constant(float[][][][][][] data) { + return Constant.tensorOf(scope, data); + } + + /** + * Creates a rank-6 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 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 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-2 constant of {@code long} 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 long constant */ - public Constant constant(long[][] data) { + public Constant constant(long[][][][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-5 constant of {@code byte} elements. + * Creates a rank-1 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.vectorOf(scope, data); + } + + /** + * Creates a rank-2 constant of {@code boolean} elements. + * + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. + * @return a boolean constant + */ + public Constant constant(boolean[][] data) { return Constant.tensorOf(scope, data); } /** * Creates a 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 n-dimensional array of {@code boolean} elements. * @return a boolean constant */ @@ -1294,44 +1683,72 @@ public Constant constant(BooleanNdArray data) { } /** - * Creates a rank-2 constant of {@code float} 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 float constant + * @return a double constant */ - public Constant constant(float[][] data) { + public Constant constant(double[] data) { + return Constant.vectorOf(scope, data); + } + + /** + * Creates a constant of {@code long} elements that is a copy of a given n-dimensional array. + * + * @param data an n-dimensional array of {@code long} elements. + * @return a long constant + */ + public Constant constant(LongNdArray data) { return Constant.tensorOf(scope, data); } /** - * Creates a constant of {@code byte} 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 byte} elements. - * @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 a long constant */ - public Constant constant(ByteNdArray data) { + public Constant constant(long[][][] data) { return Constant.tensorOf(scope, data); } /** - * Creates a rank-2 constant of {@code byte} 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 byte constant */ - public Constant constant(byte[][] data) { + public Constant constant(byte[] data) { + return Constant.vectorOf(scope, data); + } + + /** + * Creates a constant of {@code float} elements that is a copy of a given n-dimensional array. + * + * @param data an n-dimensional array of {@code float} elements. + * @return a float constant + */ + public Constant constant(FloatNdArray data) { + return Constant.tensorOf(scope, data); + } + + /** + * Creates a rank-5 constant of {@code int} elements. + * + * @param data An array containing the values to put into the new constant. The dimensions of the + * new constant will match those of the array. + * @return an integer constant + */ + 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 @@ -1341,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); } @@ -1392,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 */ @@ -1401,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 */ @@ -1482,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 @@ -1553,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); } @@ -1698,7 +2094,6 @@ 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 */ @@ -1707,20 +2102,20 @@ public Constant constant(Shape shape) { } /** - * Create a constant from a Tensor. + * 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 tensor a Tensor holding the constant value - * @return a constant of the same data type as `tensor` + * @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(Tensor tensor) { - return Constant.create(scope, tensor); + 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. @@ -1733,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 @@ -1743,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 @@ -1795,62 +2174,71 @@ 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. + * + * @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. + */ + public Constant constant(Class type, Number number) { + return Constant.tensorOf(scope, type, 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. @@ -1862,42 +2250,63 @@ public Constant constant(Charset charset, Shape shape, DataBuffer the tensor type + * @param type the tensor type class + * @param shape the tensor shape. + * @param data a buffer containing the tensor data. + * @return a constant of type `type` + * @throws IllegalArgumentException If the tensor datatype or shape is not compatible with the + * buffer + */ + public Constant constant(Class type, Shape shape, ByteDataBuffer data) { + return Constant.tensorOf(scope, type, shape, data); + } + + /** + * Create a constant by making an immutable copy of {@code tensor}. {@code tensor} may be closed + * afterward without issue. + * + * @param tensor a Tensor holding the constant value + * @return a constant of the same data type as `tensor` + */ + public Constant constantOf(T tensor) { + return Constant.create(scope, 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. * - * @param scope is a scope used to add the underlying operation. - * @param type the tensor datatype. - * @param shape the tensor shape. - * @param data a buffer containing the tensor data. - * @return a constant of type `type` - * @throws IllegalArgumentException If the tensor datatype or shape is not compatible with the - * buffer + * @param toMatch the operand providing the target type + * @param number the value of the tensor + * @return a constant with the same type as {@code toMatch} + * @throws IllegalArgumentException if the type is unknown (which should be impossible). + * @see Ops#constant(Class, Number) */ - public Constant constant(DataType type, Shape shape, - ByteDataBuffer data) { - return Constant.tensorOf(scope, type, shape, data); + public Constant constantOfSameType(Operand toMatch, Number number) { + return Constant.tensorOfSameType(scope, toMatch, number); } /** - * 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 @@ -1906,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) { @@ -1920,10 +2354,91 @@ public CountUpTo countUpTo(Operand ref, Long limit) { } /** - * Makes a copy of `x`. + * The op extracts fields from a serialized protocol buffers message into tensors. + * 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 + * {@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 {@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 + * is straightforward. However, there are a few special cases: + *

    + *
  • + *

    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 {@code DT_INT64} with the same twos-complement bit pattern (the obvious + * way). Unsigned int32 values can be represented exactly by specifying type + * {@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 {@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 attribute values + * @return a new instance of DecodeProto + */ + public DecodeProto decodeProto(Operand bytes, String messageType, + List fieldNames, List> outputTypes, + DecodeProto.Options... options) { + return DecodeProto.create(scope, bytes, messageType, fieldNames, outputTypes, options); + } + + /** + * Makes a copy of {@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) { @@ -1942,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, @@ -1978,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
@@ -2007,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, @@ -2026,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]]
@@ -2062,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])
@@ -2078,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, @@ -2095,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. @@ -2114,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, @@ -2125,114 +2663,205 @@ 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, DataType dtype, + public Empty empty(Operand shape, Class dtype, Empty.Options... options) { return Empty.create(scope, shape, dtype, options); } /** * 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, Operand maxNumElements, DataType elementDtype) { + public EmptyTensorList emptyTensorList(Operand elementShape, + Operand maxNumElements, Class elementDtype) { return EmptyTensorList.create(scope, elementShape, maxNumElements, elementDtype); } + /** + * Creates and returns an empty tensor map. + * handle: an empty tensor map + * + * @return a new instance of EmptyTensorMap + */ + public EmptyTensorMap emptyTensorMap() { + return EmptyTensorMap.create(scope); + } + + /** + * The op serializes protobuf messages provided in the input tensors. + * The types of the tensors in {@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 + * {@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 {@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 {@code DT_INT64} with the same twos-complement bit pattern (the obvious + * way). Unsigned int32 values can be represented exactly by specifying type + * {@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 {@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 attribute values + * @return a new instance of EncodeProto + */ + public EncodeProto encodeProto(Operand sizes, Iterable> values, + List fieldNames, String messageType, EncodeProto.Options... options) { + return EncodeProto.create(scope, sizes, values, fieldNames, messageType, options); + } + /** * Ensures that the tensor's shape matches the expected shape. - *

* 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, - Operand axis) { + public ExpandDims expandDims(Operand input, + Operand axis) { return ExpandDims.create(scope, input, axis); } /** - * 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. - *

- * We specify the size-related attributes as: - *

{@code
-   *        ksizes = [1, ksize_planes, ksize_rows, ksize_cols, 1]
-   *        strides = [1, stride_planes, strides_rows, strides_cols, 1]
-   *  }
+ *

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, @@ -2240,92 +2869,132 @@ 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) { + public Fill fill(Operand dims, Operand value) { return Fill.create(scope, dims, value); } /** * 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. * * @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) { + public Fingerprint fingerprint(Operand data, Operand method) { return Fingerprint.create(scope, data, method); } /** - * 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]
@@ -2337,76 +3006,81 @@ public  Fingerprint fingerprint(Operand data, Operand
+   *  
*
* *
- *

- * 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, Operand axis, Gather.Options... options) { + public Gather gather(Operand params, Operand indices, + Operand axis, Gather.Options... options) { return Gather.create(scope, params, indices, axis, options); } /** - * 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']]]
@@ -2423,21 +3097,21 @@ public  Gather gather(
    *      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']]]
@@ -2455,17 +3129,42 @@ public  Gather gather(
    *      params = [[['a0', 'b0'], ['c0', 'd0']],
    *                [['a1', 'b1'], ['c1', 'd1']]]
    *      output = [['b0', 'b1'], ['d0', 'c1']]
-   *  }
- * 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); + public GatherNd gatherNd(Operand params, + 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); } /** @@ -2474,81 +3173,79 @@ public GatherNd gatherNd(Operand para * @param value The tensor to be stored. * @return a new instance of GetSessionHandle */ - public GetSessionHandle getSessionHandle(Operand value) { + public GetSessionHandle getSessionHandle(Operand value) { return GetSessionHandle.create(scope, 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, - DataType dtype) { + Class dtype) { return GetSessionTensor.create(scope, handle, dtype); } /** - * 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) { @@ -2557,28 +3254,28 @@ 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(DataType keyDtype, - DataType valueDtype, HashTable.Options... options) { + public HashTable hashTable(Class keyDtype, + Class valueDtype, HashTable.Options... options) { return HashTable.create(scope, keyDtype, valueDtype, options); } /** * 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]
@@ -2587,16 +3284,16 @@ public  HashTable hashTable(DataType keyDty
    *  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) { @@ -2605,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]
@@ -2618,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]
-   *  }
- * - * @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 + * 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, DataType dtype) { + 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 value Attr {@code value} is the tensor to return. + * @param dtype The value of the dtype attribute + * @param data type for {@code HostConst} output and operands + * @return a new instance of HostConst + */ + public HostConst hostConst(Tensor value, Class dtype) { + return HostConst.create(scope, value, dtype); + } + /** * Return a tensor with the same shape and contents as the input tensor or value. * - * @param data type for {@code output()} output - * @param input + * @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) { @@ -2648,121 +3357,75 @@ 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(DataType dtype, Shape shape, + public ImmutableConst immutableConst(Class dtype, Shape shape, String memoryRegionName) { 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 (Tensor t = s.runner().fetch(z).run().get(0).expect(TInt32.DTYPE)) {
-   *        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 (Tensor t = s.runner().fetch("z").run().get(0).expect(TInt32.DTYPE)) {
-   *      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. - * - * @param scope - * @param initializer - * @throws IllegalArgumentException if the execution environment in scope is not a graph - * @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. * @@ -2771,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) { @@ -2820,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`.
+   *
+   *  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 InplaceSub} output and operands * @return a new instance of InplaceSub */ public InplaceSub inplaceSub(Operand x, Operand i, Operand v) { @@ -2836,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, @@ -2854,99 +3518,153 @@ public InplaceUpdate inplaceUpdate(Operand x, Operand - * Outputs boolean scalar indicating whether the tensor has been initialized. + * Checks whether a tensor has been initialized. + * Outputs boolean scalar indicating whether the tensor has been initialized. + * + * @param ref Should be from a {@code Variable} node. May be uninitialized. + * @return a new instance of IsVariableInitialized + */ + public IsVariableInitialized isVariableInitialized(Operand ref) { + return IsVariableInitialized.create(scope, ref); + } + + /** + * Computes the Kth order statistic of a data set. The current + * implementation uses a binary search requiring exactly 32 passes over + * the input data. The running time is linear with respect to input + * size. The median-of-medians algorithm is probably faster, but is + * difficult to implement efficiently in XLA. The implementation imposes + * a total ordering on floats. The ordering is consistent with the usual + * partial order. Positive NaNs are greater than positive + * infinity. Negative NaNs are less than negative infinity. NaNs with + * distinct payloads are treated as distinct. Subnormal numbers are + * preserved (not flushed to zero). Positive infinity is greater than all + * numbers. Negative infinity is less than all numbers. Positive is + * greater than negative zero. There are less than k values greater than + * the kth order statistic. There are at least k values greater than or + * equal to the Kth order statistic. The semantics are not the same as + * top_k_unique. + * + * @param input 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 ref Should be from a `Variable` node. May be uninitialized. - * @return a new instance of IsVariableInitialized + * @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 IsVariableInitialized isVariableInitialized(Operand ref) { - return IsVariableInitialized.create(scope, ref); + 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, DataType Tkeys, DataType 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, Operand keys, Operand defaultValue) { + 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 @@ -2955,54 +3673,155 @@ public LoopCond loopCond(Operand input) { return LoopCond.create(scope, input); } + /** + * Applies lower_bound(sorted_search_values, values) along each row. + * Each set of rows with the same index in (sorted_inputs, values) is treated + * independently. The resulting row is the equivalent of calling + * {@code np.searchsorted(sorted_inputs, values, side='left')}. + *

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

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

result = LowerBound(sorted_sequence, values) + *

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

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

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

result = LowerBound(sorted_sequence, values) + *

result == [[1, 2, 2], + * [0, 1, 5]] + * + * @param sortedInputs 2-D Tensor where each row is ordered. + * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + * @param outType The value of the outType attribute + * @param data type for {@code LowerBound} output and operands + * @param data type for {@code LowerBound} output and operands + * @return a new instance of LowerBound + */ + public LowerBound lowerBound(Operand sortedInputs, + Operand values, Class outType) { + return LowerBound.create(scope, sortedInputs, values, outType); + } + + /** + * Make all elements in the non-Batch dimension unique, but "close" to + * their initial value. Never returns a sub-normal number. Never returns + * 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 The input value + * @return a new instance of MakeUnique + */ + public MakeUnique makeUnique(Operand input) { + return MakeUnique.create(scope, 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) { + 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, + public MapIncompleteSize mapIncompleteSize(List> dtypes, MapIncompleteSize.Options... options) { return MapIncompleteSize.create(scope, dtypes, options); } /** * 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, List> dtypes, - MapPeek.Options... options) { + public MapPeek mapPeek(Operand key, Operand indices, + List> dtypes, MapPeek.Options... options) { return MapPeek.create(scope, key, indices, dtypes, options); } /** * 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) { + public MapSize mapSize(List> dtypes, MapSize.Options... options) { return MapSize.create(scope, dtypes, options); } @@ -3010,82 +3829,78 @@ public MapSize mapSize(List> dtypes, MapSize.Options... options) { * 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, - Iterable> values, List> dtypes, MapStage.Options... options) { + Iterable> values, List> dtypes, + MapStage.Options... options) { return MapStage.create(scope, key, indices, values, dtypes, options); } /** * 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, - List> dtypes, MapUnstage.Options... options) { + List> dtypes, MapUnstage.Options... options) { return MapUnstage.create(scope, key, indices, dtypes, options); } /** * 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, List> dtypes, - MapUnstageNoKey.Options... options) { + public MapUnstageNoKey mapUnstageNoKey(Operand indices, + List> dtypes, MapUnstageNoKey.Options... options) { return MapUnstageNoKey.create(scope, indices, dtypes, options); } /** * 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) { @@ -3094,71 +3909,94 @@ 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, - Operand paddings, String mode) { + public MirrorPad mirrorPad(Operand input, + Operand paddings, String mode) { 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 @@ -3170,93 +4008,97 @@ public MirrorPad mirrorPad(Operand in * 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, - List> Toutputs) { + List> Toutputs) { return MlirPassthroughOp.create(scope, inputs, mlirModule, Toutputs); } /** * 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( - Operand emptyKey, Operand deletedKey, DataType valueDtype, + Operand emptyKey, Operand deletedKey, Class valueDtype, MutableDenseHashTable.Options... options) { return MutableDenseHashTable.create(scope, emptyKey, deletedKey, valueDtype, options); } /** * 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(DataType keyDtype, - DataType valueDtype, MutableHashTable.Options... options) { + public MutableHashTable mutableHashTable(Class keyDtype, + Class valueDtype, MutableHashTable.Options... options) { return MutableHashTable.create(scope, keyDtype, valueDtype, options); } /** * 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( - DataType keyDtype, DataType valueDtype, MutableHashTableOfTensors.Options... options) { + Class keyDtype, Class valueDtype, MutableHashTableOfTensors.Options... options) { return MutableHashTableOfTensors.create(scope, keyDtype, valueDtype, options); } /** - * 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) { @@ -3265,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)
    *
@@ -3290,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) { @@ -3331,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]
@@ -3391,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)
@@ -3410,26 +4311,38 @@ 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, + public OneHot oneHot(Operand indices, Operand depth, Operand onValue, Operand offValue, OneHot.Options... options) { return OneHot.create(scope, indices, depth, onValue, offValue, options); } + /** + * Creates a one valued tensor given its type and shape. + * + * @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 + * @throws IllegalArgumentException if the tensor type or shape cannot be initialized with ones. + */ + public Ones ones(Operand dims, Class type) { + return Ones.create(scope, dims, type); + } + /** * 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) { @@ -3439,11 +4352,11 @@ 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, + public OrderedMapClear orderedMapClear(List> dtypes, OrderedMapClear.Options... options) { return OrderedMapClear.create(scope, dtypes, options); } @@ -3451,157 +4364,148 @@ 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, + public OrderedMapIncompleteSize orderedMapIncompleteSize(List> dtypes, OrderedMapIncompleteSize.Options... options) { return OrderedMapIncompleteSize.create(scope, dtypes, options); } /** * 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. * - * @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, - List> dtypes, OrderedMapPeek.Options... options) { + List> dtypes, OrderedMapPeek.Options... options) { return OrderedMapPeek.create(scope, key, indices, dtypes, options); } /** * 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, + public OrderedMapSize orderedMapSize(List> dtypes, OrderedMapSize.Options... options) { return OrderedMapSize.create(scope, dtypes, options); } /** * 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, - Iterable> values, List> dtypes, OrderedMapStage.Options... options) { + Iterable> values, List> dtypes, + OrderedMapStage.Options... options) { return OrderedMapStage.create(scope, key, indices, values, dtypes, options); } /** * 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, - List> dtypes, OrderedMapUnstage.Options... options) { + List> dtypes, OrderedMapUnstage.Options... options) { return OrderedMapUnstage.create(scope, key, indices, dtypes, options); } /** * 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, - List> dtypes, OrderedMapUnstageNoKey.Options... options) { + List> dtypes, OrderedMapUnstageNoKey.Options... options) { return OrderedMapUnstageNoKey.create(scope, indices, dtypes, options); } /** * 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, + public Pad pad(Operand input, Operand paddings, Operand constantValues) { return Pad.create(scope, input, paddings, constantValues); } /** - * 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, @@ -3610,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]]
@@ -3645,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])
@@ -3661,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( @@ -3676,29 +4578,50 @@ 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(DataType dtype, + public Placeholder placeholder(Class dtype, Placeholder.Options... options) { return Placeholder.create(scope, dtype, options); } /** - * 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, @@ -3708,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) { @@ -3721,59 +4643,73 @@ 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, + public Prod prod(Operand input, Operand axis, Prod.Options... options) { return Prod.create(scope, input, axis, options); } /** * Reshapes a quantized tensor as per the Reshape op. - *

- * ``` * - * @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, Operand shape, Operand inputMin, Operand inputMax) { + public QuantizedReshape quantizedReshape(Operand tensor, + Operand shape, Operand inputMin, Operand inputMax) { 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) { @@ -3782,169 +4718,232 @@ 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) { + public Rank rank(Operand input) { return Rank.create(scope, 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, - DataType 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, + public ReduceAll reduceAll(Operand input, Operand axis, ReduceAll.Options... options) { return ReduceAll.create(scope, input, axis, options); } /** - * 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, + public ReduceAny reduceAny(Operand input, Operand axis, ReduceAny.Options... options) { return ReduceAny.create(scope, input, axis, options); } /** * 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, - Operand axis, ReduceProd.Options... options) { + public ReduceProd reduceProd(Operand input, + Operand axis, ReduceProd.Options... options) { return ReduceProd.create(scope, input, axis, options); } /** * 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, ReduceSum.Options... options) { + public ReduceSum reduceSum(Operand input, Operand axis, + ReduceSum.Options... options) { return ReduceSum.create(scope, input, axis, options); } + /** + * 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 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 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) { @@ -3952,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, @@ -3965,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) { @@ -3982,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],
@@ -4042,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],
@@ -4062,40 +5071,38 @@ 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) { + public Reshape reshape(Operand tensor, Operand shape) { return Reshape.create(scope, tensor, shape); } /** * Increments variable pointed to by 'resource' until it reaches 'limit'. * - * @param 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, - DataType 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, :, ... :]
    *
@@ -4104,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, - Operand indices, DataType dtype, ResourceGather.Options... options) { + 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, Operand indices, DataType dtype) { + 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, Operand indices, Operand updates) { + 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, Operand indices, Operand updates) { + 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, Operand indices, Operand updates) { + 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, Operand indices, Operand updates) { + 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, Operand indices, Operand updates) { + 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. @@ -4334,78 +5323,76 @@ public ResourceScatterMul resourceScatterMu * 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, Operand indices, Operand updates, + 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, Operand indices, Operand updates, + 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, Operand indices, Operand updates, + public ResourceScatterNdMin resourceScatterNdMin(Operand ref, + Operand indices, Operand updates, ResourceScatterNdMin.Options... options) { return ResourceScatterNdMin.create(scope, ref, indices, updates, options); } /** * 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. @@ -4413,48 +5400,43 @@ public ResourceScatterNdMin resourceScatter * 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, Operand indices, Operand updates, + 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. @@ -4462,112 +5444,102 @@ public ResourceScatterNdSub resourceScatter * 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, Operand indices, Operand updates, + 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, Operand indices, Operand updates) { + 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[...]
+   *
+   *  # Vector indices (for each i)
+   *  ref[indices[i], ...] = updates[i, ...]
    *
-   * @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`.
+   *  # 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, Operand indices, Operand updates) { + 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]],
@@ -4577,7 +5549,7 @@ public  ResourceStridedSliceAssign resourceS
    *  # 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],
@@ -4585,7 +5557,7 @@ public  ResourceStridedSliceAssign resourceS
    *                          [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],
@@ -4593,41 +5565,36 @@ public  ResourceStridedSliceAssign resourceS
    *                          [ 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) { + public Reverse reverse(Operand tensor, Operand axis) { return Reverse.create(scope, tensor, axis); } /** * 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
@@ -4645,9 +5612,9 @@ public  Reverse reverse(Operand tensor
    *  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
@@ -4665,168 +5632,97 @@ public  Reverse reverse(Operand tensor
    *  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 * @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, - Operand seqLengths, Long seqDim, ReverseSequence.Options... options) { + public ReverseSequence reverseSequence(Operand input, + Operand seqLengths, Long seqDim, ReverseSequence.Options... options) { return ReverseSequence.create(scope, input, seqLengths, seqDim, options); } /** * 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, Operand axis) { + public Roll roll(Operand input, Operand shift, + Operand axis) { return Roll.create(scope, input, shift, axis); } - /** - * 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. - * - * @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, - Operand indices, Operand updates, ScatterAdd.Options... options) { + public ScatterAdd scatterAdd(Operand ref, + Operand indices, Operand updates, ScatterAdd.Options... options) { return ScatterAdd.create(scope, ref, indices, updates, options); } /** * Divides a variable reference by sparse updates. - *

* This operation computes - *

{@code
+   *  
    *      # Scalar indices
    *      ref[indices, ...] /= updates[...]
    *
@@ -4835,108 +5731,97 @@ public  ScatterAdd scatterAdd(Operand
    *
    *      # 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, - Operand indices, Operand updates, ScatterDiv.Options... options) { + public ScatterDiv scatterDiv(Operand ref, + Operand indices, Operand updates, ScatterDiv.Options... options) { return ScatterDiv.create(scope, ref, indices, updates, options); } /** - * 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, - Operand indices, Operand updates, ScatterMax.Options... options) { + public ScatterMax scatterMax(Operand ref, + Operand indices, Operand updates, ScatterMax.Options... options) { return ScatterMax.create(scope, ref, indices, updates, options); } /** - * 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, - Operand indices, Operand updates, ScatterMin.Options... options) { + public ScatterMin scatterMin(Operand ref, + Operand indices, Operand updates, ScatterMin.Options... options) { return ScatterMin.create(scope, ref, indices, updates, options); } /** * Multiplies sparse updates into a variable reference. - *

* This operation computes - *

{@code
+   *  
    *      # Scalar indices
    *      ref[indices, ...] *= updates[...]
    *
@@ -4945,89 +5830,83 @@ public  ScatterMin scatterMin(Operand
-   *  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, - Operand indices, Operand updates, ScatterMul.Options... options) { + public ScatterMul scatterMul(Operand ref, + Operand indices, Operand updates, ScatterMul.Options... options) { return ScatterMul.create(scope, ref, indices, updates, options); } /** - * 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],
@@ -5035,229 +5914,250 @@ public  ScatterMul scatterMul(Operand
    *      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, - Operand indices, Operand updates, ScatterNdAdd.Options... options) { + public ScatterNdAdd scatterNdAdd(Operand ref, + Operand indices, Operand updates, ScatterNdAdd.Options... options) { return ScatterNdAdd.create(scope, ref, indices, updates, options); } /** - * 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); + public ScatterNdNonAliasingAdd scatterNdNonAliasingAdd(Operand input, + 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, - Operand indices, Operand updates, ScatterNdSub.Options... options) { + public ScatterNdSub scatterNdSub(Operand ref, + Operand indices, Operand updates, ScatterNdSub.Options... options) { return ScatterNdSub.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: - *

- * $$[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, - Operand indices, Operand updates, ScatterNdUpdate.Options... options) { + public ScatterNdUpdate scatterNdUpdate(Operand ref, + Operand indices, Operand updates, ScatterNdUpdate.Options... options) { return ScatterNdUpdate.create(scope, ref, indices, updates, options); } /** * Subtracts sparse updates to a variable reference. - *

- *

{@code
+   *  
    *      # Scalar indices
    *      ref[indices, ...] -= updates[...]
    *
@@ -5266,36 +6166,32 @@ public  ScatterNdUpdate scatterNdUpdate(O
    *
    *      # 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, - Operand indices, Operand updates, ScatterSub.Options... options) { + public ScatterSub scatterSub(Operand ref, + Operand indices, Operand updates, ScatterSub.Options... options) { return ScatterSub.create(scope, ref, indices, updates, options); } /** * Applies sparse updates to a variable reference. - *

* This operation computes - *

{@code
+   *  
    *      # Scalar indices
    *      ref[indices, ...] = updates[...]
    *
@@ -5304,73 +6200,82 @@ public  ScatterSub scatterSub(Operand
    *
    *      # 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, - Operand indices, Operand updates, ScatterUpdate.Options... options) { + public ScatterUpdate scatterUpdate(Operand ref, + Operand indices, Operand updates, ScatterUpdate.Options... options) { return ScatterUpdate.create(scope, ref, indices, updates, options); } /** + * 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); @@ -5378,165 +6283,148 @@ 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, - DataType outIdx) { + Class outIdx) { return SetDiff1d.create(scope, x, y, outIdx); } /** - * 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, + public SetSize setSize(Operand setIndices, Operand setValues, Operand setShape, SetSize.Options... options) { return SetSize.create(scope, setIndices, setValues, setShape, options); } /** * 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) { + public org.tensorflow.op.core.Shape shape(Operand input) { return org.tensorflow.op.core.Shape.create(scope, 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, DataType outType) { + public org.tensorflow.op.core.Shape shape(Operand input, + Class outType) { return org.tensorflow.op.core.Shape.create(scope, input, outType); } /** * 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 - * @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, - DataType outType) { + 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) { + public Size size(Operand input) { return Size.create(scope, 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, DataType outType) { + public Size size(Operand input, Class outType) { return Size.create(scope, input, outType); } @@ -5545,7 +6433,7 @@ public Size size(Operand input, DataT * * @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) { @@ -5554,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) { @@ -5590,128 +6477,127 @@ 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, Operand blockShape, Operand paddings) { + public SpaceToBatchNd spaceToBatchNd(Operand input, + Operand blockShape, Operand paddings) { return SpaceToBatchNd.create(scope, input, blockShape, paddings); } /** - * 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) { @@ -5719,45 +6605,43 @@ 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, Operand axis, Long numSplit) { + public SplitV splitV(Operand value, Operand sizeSplits, + Operand axis, Long numSplit) { return SplitV.create(scope, value, sizeSplits, axis, numSplit); } /** * 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]
-   *  }
+ * 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) { @@ -5765,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)`. + * 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`. + * 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 data type for {@code output()} output * @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 */ 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 handle The handle to a stack. + * @param elem The tensor to be pushed onto the stack. + * @param options carries optional attribute values + * @param data type for {@code StackPushV2} output and operands + * @return a new instance of StackPush + */ + public StackPush stackPush(Operand handle, Operand elem, + StackPush.Options... options) { + return StackPush.create(scope, handle, elem, options); + } + /** * Stage values similar to a lightweight Enqueue. - *

* The basic functionality of this Op is similar to a queue with many * 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) { @@ -5812,27 +6744,26 @@ 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) { + public StageClear stageClear(List> dtypes, StageClear.Options... options) { return StageClear.create(scope, dtypes, options); } /** * 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, + public StagePeek stagePeek(Operand index, List> dtypes, StagePeek.Options... options) { return StagePeek.create(scope, index, dtypes, options); } @@ -5840,44 +6771,301 @@ public StagePeek stagePeek(Operand index, List> dtypes, /** * 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) { + 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: - *

logits and labels must have the same type and shape. - * - *