diff --git a/.github/ISSUE_TEMPLATE/00-bug-performance-issue.md b/.github/ISSUE_TEMPLATE/00-bug-performance-issue.md index 34ba4cf9601..d64a1afd895 100644 --- a/.github/ISSUE_TEMPLATE/00-bug-performance-issue.md +++ b/.github/ISSUE_TEMPLATE/00-bug-performance-issue.md @@ -8,21 +8,17 @@ about: Use this template for reporting a bug or a performance issue. **System information** - Have I written custom code (as opposed to using a stock example script provided in TensorFlow): -- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): -- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: +- OS Platform and Distribution (e.g., Linux Ubuntu 16.04 x86\_64): - TensorFlow installed from (source or binary): - TensorFlow version (use command below): -- Python version: +- Java version (i.e., the output of `java -version`): +- Java command line flags (e.g., GC parameters): +- Python version (if transferring a model trained in Python): - Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: - GPU model and memory: - -You can collect some of this information using our environment capture [script](https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh) -You can also obtain the TensorFlow version with -python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" - **Describe the current behavior** **Describe the expected behavior** diff --git a/.github/ISSUE_TEMPLATE/10-build-installation-issue.md b/.github/ISSUE_TEMPLATE/10-build-installation-issue.md index 99c2fe61271..75d00465ed2 100644 --- a/.github/ISSUE_TEMPLATE/10-build-installation-issue.md +++ b/.github/ISSUE_TEMPLATE/10-build-installation-issue.md @@ -7,23 +7,21 @@ about: Use this template for build/installation issues Please make sure that this is a build/installation issue. As per our [GitHub Policy](https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md), we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template **System information** -- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): -- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: +- OS Platform and Distribution (e.g., Linux Ubuntu 16.04 x86\_64): - TensorFlow installed from (source or binary): - TensorFlow version: -- Python version: -- Installed using virtualenv? pip? conda?: +- Java version (i.e., the output of `java -version`): +- Java command line flags (e.g., GC parameters): +- Installed from Maven Central?: - Bazel version (if compiling from source): - GCC/Compiler version (if compiling from source): - CUDA/cuDNN version: - GPU model and memory: - **Describe the problem** **Provide the exact sequence of commands / steps that you executed before running into the problem** - **Any other info / logs** Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. diff --git a/.github/ISSUE_TEMPLATE/50-other-issues.md b/.github/ISSUE_TEMPLATE/40-other-issues.md similarity index 100% rename from .github/ISSUE_TEMPLATE/50-other-issues.md rename to .github/ISSUE_TEMPLATE/40-other-issues.md diff --git a/.github/ISSUE_TEMPLATE/40-tflite-op-request.md b/.github/ISSUE_TEMPLATE/40-tflite-op-request.md deleted file mode 100644 index 7b391279e47..00000000000 --- a/.github/ISSUE_TEMPLATE/40-tflite-op-request.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: TensorFlow Lite Op Request -about: Use this template for reporting ops you are using or missing. - ---- - - -**System information** -- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): -- TensorFlow installed from (source or binary): -- TensorFlow version (or github SHA if from source): - - -**Provide the text output from tflite_convert** - -``` -# Copy and paste here -``` - -Also, please include a link to a GraphDef or the model if possible. - -**Any other info / logs** - -Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..eb13a791345 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,162 @@ +name: CI build +on: + push: + branches: + - master + - staging + - r[0-9]+.* + pull_request: + branches: + - master + - r[0-9]+.* + types: [opened, reopened, synchronize, labeled, unlabeled] +env: + STAGING_PROFILE_ID: 46f80d0729c92d + DEPLOY_SNAPSHOT: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }} + DEPLOY_RELEASE: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/r') }} +jobs: + check-format: + if: github.event_name == 'pull_request' + runs-on: ubuntu-22.04 + steps: + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'adopt' + java-version: '17' + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Build project + run: | + gcc --version + mvn -version + mvn clean install -Pjdk17 -B -U -e -Dlint.skip=true -Dmaven.test.skip=true + - name: Run format checks + run: | + mvn spotless:check -Pjdk17 -B -U -e + prepare: + runs-on: ubuntu-22.04 + outputs: + repositoryUrl: ${{ steps.repository.outputs.repositoryUrl }} + steps: + - name: Create staging repository + if: env.DEPLOY_RELEASE == 'true' + id: staging + run: | + echo "Creating staging repository with profile $STAGING_PROFILE_ID" + echo "Releasing TF Java - created by CI build" > request.xml + curl -X POST -d @request.xml -s -o response.xml -u ${{ secrets.CI_DEPLOY_USERNAME }}:${{ secrets.CI_DEPLOY_PASSWORD }} -H "Content-Type:application/xml" \ + https://ossrh-staging-api.central.sonatype.com/service/local/staging/profiles/$STAGING_PROFILE_ID/start + export STAGING_REPOSITORY_ID=`awk -F'[<>]' '/stagedRepositoryId/{print $3}' response.xml` + echo "Staging repository created: $STAGING_REPOSITORY_ID" + echo "::set-output name=stagingRepositoryId::$STAGING_REPOSITORY_ID" + - name: Checkout repository + uses: actions/checkout@v6 + - name: Extract distribution repository URL + id: repository + run: | + if [[ "${{ env.DEPLOY_RELEASE }}" = "true" ]]; then + export REPOSITORY_URL=`mvn exec:exec -q -N -Dexec.executable='echo' -Dexec.args="\\${project.distributionManagement.repository.url}" -DstagingRepositoryId=${{ steps.staging.outputs.stagingRepositoryId }}` + else + export REPOSITORY_URL=`mvn exec:exec -q -N -Dexec.executable='echo' -Dexec.args="\\${project.distributionManagement.snapshotRepository.url}"` + fi + echo "Repository URL: $REPOSITORY_URL" + echo "::set-output name=repositoryUrl::$REPOSITORY_URL" + linux-arm64: + runs-on: ubuntu-2204-arm64-2c + needs: prepare + strategy: + matrix: + ext: [""] + steps: + - name: Install environment + run: | + sudo apt update + sudo apt install -y curl wget unzip tar git gcc g++ + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: '17' + architecture: 'aarch64' + - name: Checkout repository + uses: actions/checkout@v6 + - name: Build project + run: | + gcc --version + mvn -version + echo "central${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Deploy native artifact + if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true' + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }} + linux-x86_64: + runs-on: ubuntu-22.04 + needs: prepare + strategy: + matrix: + ext: ["", -gpu] + steps: + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'adopt' + java-version: '11' + - name: Checkout repository + uses: actions/checkout@v6 + - name: Build project + run: | + gcc --version + mvn -version + echo "central${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Deploy native artifact + if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true' + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }} + macosx-arm64: + runs-on: macos-14 + needs: prepare + strategy: + matrix: + ext: [""] + steps: + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'zulu' + java-version: '17' + architecture: 'arm64' + - name: Checkout repository + uses: actions/checkout@v6 + - name: Build project + run: | + clang --version + mvn -version + echo "central${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml + mvn clean install -pl '!tensorflow-framework' -B -U -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} + - name: Deploy native artifact + if: env.DEPLOY_RELEASE == 'true' || env.DEPLOY_SNAPSHOT == 'true' + run: mvn -f tensorflow-core/tensorflow-core-native/pom.xml deploy:deploy-file@native-only -B -e -Djavacpp.platform=${{ github.job }} -Djavacpp.platform.extension=${{ matrix.ext }} -Durl=${{ needs.prepare.outputs.repositoryUrl }} + deploy: + if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/staging') }} # DEPLOY_SNAPSHOT (releases should be signed and deployed manually from local machine) + needs: [linux-x86_64, macosx-arm64, linux-arm64] + runs-on: ubuntu-22.04 + steps: + - name: Configure Java + uses: actions/setup-java@v5 + with: + distribution: 'adopt' + java-version: '11' + - name: Checkout repository + uses: actions/checkout@v6 + - name: Build project + run: | + java -version + mvn -version + mvn clean install -B -U -e -Pdeploying + - name: Deploy snapshot artifacts + run: | + echo "central${{ secrets.CI_DEPLOY_USERNAME }}${{ secrets.CI_DEPLOY_PASSWORD }}" > $HOME/.m2/settings.xml + mvn deploy -Pdeploying -B -e -Dmaven.test.skip=true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index cd6b8bf7365..00000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: CI jobs -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - linux-x86_64: - runs-on: ubuntu-latest - container: nvidia/cuda:10.1-cudnn7-devel-centos7 - 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-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/0.29.1/bazel-0.29.1-installer-linux-x86_64.sh -o bazel.sh --retry 10 - bash bazel.sh - - 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 -Possrh -B -U -e -Djavacpp.platform=linux-x86_64 -Djavacpp.platform.extension=${{ matrix.ext }} - df -h - macosx-x86_64: - runs-on: macos-latest - strategy: - matrix: - ext: ["", -mkl] - steps: - - name: Install environment - run: | - python3 -m pip install six - echo Downloading Bazel - curl -L https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-installer-darwin-x86_64.sh -o bazel.sh --retry 10 - bash bazel.sh - - 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 -Possrh -B -U -e -Djavacpp.platform=macosx-x86_64 -Djavacpp.platform.extension=${{ matrix.ext }} - df -h - windows-x86_64: - runs-on: windows-latest - strategy: - matrix: - ext: ["", -mkl, -gpu, -mkl-gpu] - steps: - - name: Install environment - shell: cmd - run: | - python -m pip install six - 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/0.29.1/bazel-0.29.1-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.4/cudnn-10.1-windows7-x64-v7.6.4.38.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/" - - 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;%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 - 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% -Possrh -B -U -e -Djavacpp.platform=windows-x86_64 -Djavacpp.platform.extension=${{ matrix.ext }} - df -h - wmic pagefile list /format:list diff --git a/.gitignore b/.gitignore index 2063545f295..d9e902d7d9e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ node_modules /.bazelrc.user /.tf_configure.bazelrc /**/bazel-* -/**/target/ /bazel_pip /tools/python_bin_path.sh /tensorflow/tools/git/gen @@ -17,6 +16,7 @@ __pycache__ cmake_build/ tensorflow/contrib/cmake/_build/ .idea/** +.run /build/ [Bb]uild/ /tensorflow/core/util/version_info.cc @@ -36,6 +36,10 @@ xcuserdata/** /api_init_files_list.txt /estimator_api_init_files_list.txt *.whl +tensorflow-core/tensorflow-core-api/downloads/ + +# Vim backups +*~ # Patch files *.orig @@ -47,3 +51,19 @@ xcuserdata/** *.iml local.properties gradleBuild + +# VSCode +.settings/ +.project +.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..ac7276eba99 --- /dev/null +++ b/MIGRATING.md @@ -0,0 +1,148 @@ +# Migrating Between TensorFlow Java Releases + +TensorFlow Java is still in an alpha stage, therefore is subject to contain breaking changes between the different releases. This guide explain in detail +how to migrate your code from a previous version to a new one that includes some changes that are not backward compatible. + +## Migrating to 1.0.0 + +TensorFlow-Java 1.0.0 requires Java 11 or later. + +### Native Artifact Renaming + +The native artifacts, that used to be distributed as `tensorflow-core-api`, are now distributed under `tensorflow-core-native`. If you still add +`tensorflow-core-platform` in your project, that won't affect you. But if you were adding dependencies to specific native runtimes, you need to update +them to reflect the new artifact name. + +For example, +```xml + + org.tensorflow + tensorflow-core-api + 0.5.0 + + + org.tensorflow + tensorflow-core-api + 0.5.0 + linux-x86_64 + +``` +will now be +```xml + + org.tensorflow + tensorflow-core-api + 1.0.0 + + + org.tensorflow + tensorflow-core-native + 1.0.0 + linux-x86_64 + +``` +### Java Module Renaming + +The Java Module (jigsaw) names has been updated to drop the leading `org.`, as follow: +- `tensorflow-core-api` : `tensorflow` (was `org.tensorflow` before) +- `tensorflow-core-generator` : `tensorflow.generator` (was `org.tensorflow-generator` before) +- `tensorflow-core-native` : `tensorflow.nativelib` +- `tensorflow-framework` : `tensorflow.framework` (was `org.tensorflow.framework` before) + +### GPU Support + +Previous versions of TF Java were building a `tensorflow-core-platform-gpu` artifact upon which application could depend +on to include any TensorFlow native library that GPU support enabled. Since TensorFlow has removed its support of GPU +on all platforms other than Linux, we removed our platform JAR in favour of simply adding a dependency on the +`linux-x86_64-gpu` native artifact. +```xml + + org.tensorflow + tensorflow-core-native + 1.0.0 + linux-x86_64-gpu + +``` +Please note that including this dependency won't work if your application also depends on `tensorflow-core-platform`. If +you need to support more platforms than Linux, you should include the other `tensorflow-core-native` dependencies +separately (see the [README](README.md) file). + +### Session Run Result + +In versions before 0.4.0 `Session.Runner.run` and `TensorFunction.call` returned a `List`. In newer versions +they return a `Result` class which is `AutoCloseable` to make management of the tensor lifetime simpler. To migrate +users should wrap the `run` invocation in a try-with-resources statement rather than closing the output tensors +individually. + +### Proto Definitions Moved + +Some proto definitions under `org.tensorflow.proto` have been moved to a different location under the same (`org.tensorflow.proto`) package. +Certain classes have moved packages, for example, `org.tensorflow.proto.example.Feature` to `org.tensorflow.proto.Feature`. +You will need to reimport these proto bindings to match the new location. Your IDE should easily be able to do this for you. + +## Migrating to 0.3.0 + +### Non-parameterized Typed Tensors + +In previous versions, the `Tensor` class was parameterized with its tensor type interface, which is part of the `TType` family. To access directly the memory +tensor from the JVM, an explicit conversion between `Tensor` and its tensor type was required by calling `tensor.data()`. + +In 0.3.0, tensors are always typed, making this generic parameter and explicit mapping obsolete. As soon as you get a handle to a tensor, you are able to +access directly its memory for reading (or writing for most tensor types) and no convertion is required. Any instances of a class in the `TType` family +can also now be manipulated directly as a `Tensor` (e.g. to be passed to a session for inference). + +Steps: +1. Replace a parameterized `Tensor` by its parameter (e.g. `Tensor` -> `TFloat32`) +2. Replace instance of `Tensor` with unknown parameter by `Tensor` +3. Remove any invocation to `Tensor.data()` (e.g. `tensor.data().getFloat()` -> `tensor.getFloat()`) +4. Replace any invocation to `Operand.data()` by `Operand.asTensor()` + +### Use of Java Type System instead of DataType + +In previous versions, the `DataType` class was used to carry information about the type of a `Tensor`, that can then be converted back to a tensor of that +type (see previous section). Since there were a exact parity between interfaces of the `TType` family and an instance of `DataType`, the latter has been dropped +in 0.3.0 to leverage instead the standard type system in Java, for a better idiomatic experience. + +Steps: +1. Replace all accesses to the `DTYPE` field of a `TType` interface by its class (e.g. `TFloat32.DTYPE` -> `TFloat32.class`) +2. Use Java type system for checking tensor types at runtime (e.g. using `instanceof` or `isAssignableFrom`) +3. Replace any invocation to `Tensor.expect()` by an explicit cast (e.g. `tensor.expect(TFloat32.DTYPE)` -> `(TFloat32)tensor`) + +### Example + +0.2.0: +``` +Session session = ...; + +try (Tensor tensor = TFloat32.tensorOf(Shape.of(1, 2))) { + TFloat32 tensorData = tensor.data(); + tensorData.setFloat(10.0f, 0); + tensorData.setFloat(20.0f, 1); + + try (Tensor result = session.runner().feed("x", tensor).fetch("y").run().get(0)) { + if (result.dataType() == TFloat32.DTYPE) { + Tensor typedResult = result.expect(TFloat32.DTYPE); + TFloat32 resultData = typedResult.data(); + System.out.println("Result is " + resultData.getFloat()); + } + } +} +``` + +0.3.0: +``` +Session session = ...; + +try (TFloat32 tensor = TFloat32.tensorOf(Shape.of(1, 2))) { + tensor.setFloat(10.0f, 0); + tensor.setFloat(20.0f, 1); + + try (Tensor result = session.runner().feed("x", tensor).fetch("y").run().get(0)) { + if (result instanceof TFloat32) { + TFloat32 typedResult = (TFloat32)result; + System.out.println("Result is " + typedResult.getFloat()); + } + } +} +``` + diff --git a/README.md b/README.md index 1200796c738..536ce3f27ba 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,5 @@ # TensorFlow for Java -***!!! IMPORTANT NOTICE !!! This repository is UNDER CONSTRUCTION and does not yet host the code of the -offical TensorFlow Java artifacts!*** - -***Please refer to the [TensorFlow Java module](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/java) -of the main repository for the actual code.*** - ## Welcome to the Java world of TensorFlow! TensorFlow can run on any JVM for building, training and running machine learning models. It comes with @@ -25,57 +19,73 @@ 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` - * All artifacts that build up the core language bindings of TensorFlow for Java. - * Those artifacts provide the minimal support required to use the TensorFlow runtime on a JVM. - -* `tensorflow-tools` - * Utility libraries that do not depend on the TensorFlow runtime but are useful for machine learning purposes - -* `tensorflow-frameworks` - * High-level APIs built on top of the core libraries for simplifying the usage of TensorFlow in Java. - -* `tensorflow-starters` - * Artifacts aggregating others for simplifying dependency management with TensorFlow - -*Note: Right now, only the `tensorflow-core` and `tensorflow-tools` components are present* - -## Building Sources + * 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 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) + +*Note: The NdArray Library module has now its own [repository](https://github.com/tensorflow/java-ndarray) and has been moved out of TensorFlow Java.* -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`. +## Communication -Note that in some cases, if a version of the TensorFlow runtime library is not found for your environment, -this process will fetch TensorFlow sources and trigger a build of all the native code (which can take -many hours on a standard laptop). In this case, you will also need to have 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. + +## Building Sources + +See [CONTRIBUTING.md](CONTRIBUTING.md#building). ## Using Maven Artifacts -To include TensorFlow in your Maven application, you first need to add a dependency on either the -`tensorflow-core` or `tensorflow-core-platform` artifacts. The former could be included multiple times -for different targeted systems by their classifiers, while the later includes them as dependencies for -`linux-x86_64`, `macosx-x86_64`, and `windows-x86_64`, with more to come in the future. There are also -`tensorflow-core-platform-mkl`, `tensorflow-core-platform-gpu`, and `tensorflow-core-platform-mkl-gpu` -artifacts that depend on artifacts with MKL and/or CUDA support enabled. +There are two options for adding TensorFlow Java as a dependency to your Maven project: with individual dependencies +for each targeted platform or with a single dependency that targets them all. + +### Individual dependencies + +With this option, you must first add a dependency to `tensorflow-core-api` and then one or multiple +dependencies to `tensorflow-core-native` with a classifier targeting a specific platform. This option is preferred as +it minimizes the size of your application by only including the TensorFlow builds you need, at the cost of being more +restrictive. + +While TensorFlow Java can be compiled for [multiple platforms](https://github.com/tensorflow/java/blob/master/tensorflow-core/pom.xml#L54), +only binaries for the following are being **supported and distributed** by this project: + +- `linux-x86_64`: Linux platforms on Intel/AMD chips +- `linux-x86_64-gpu`: Linux platforms on Intel/AMD chips with Cuda GPU support +- `linux-arm64`: Linux platforms on Arm chips +- `macosx-arm64`: MacOS X platforms on Apple Silicon chips +- `windows-x86_64`: Windows platforms on Intel/AMD chips (v1.1.0 and earlier) + +Binaries for `macosx-x86_64` are available for TF-Java 1.0 series releases and earlier, they were dropped from +TF-Java 1.1 and newer as they are no longer supported or released by Google. For example, for building a JAR that uses TensorFlow and is targeted to be deployed only on Linux -systems, you should add the following dependencies: +systems with no GPU support, you should add the following dependencies: ```xml org.tensorflow tensorflow-core-api - 0.1.0-SNAPSHOT + 1.1.0 org.tensorflow - tensorflow-core-api - 0.1.0-SNAPSHOT - linux-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + linux-x86_64 ``` +Or Gradle: +```groovy +def tfVersion = '1.1.0' +implementation "org.tensorflow:tensorflow-core-api:$tfVersion" +implementation "org.tensorflow:tensorflow-core-native:$tfVersion:linux-x86_64" +``` On the other hand, if you plan to deploy your JAR on more platforms, you need additional native dependencies as follows: @@ -83,50 +93,134 @@ native dependencies as follows: org.tensorflow tensorflow-core-api - 0.1.0-SNAPSHOT + 1.1.0 org.tensorflow - tensorflow-core-api - 0.1.0-SNAPSHOT - linux-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + linux-x86_64-gpu org.tensorflow - tensorflow-core-api - 0.1.0-SNAPSHOT - macosx-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + macosx-arm64 org.tensorflow - tensorflow-core-api - 0.1.0-SNAPSHOT - windows-x86_64${javacpp.platform.extension} + tensorflow-core-native + 1.1.0 + windows-x86_64 ``` +Or Gradle: +```groovy +def tfVersion = '1.1.0' +implementation "org.tensorflow:tensorflow-core-api:$tfVersion" +implementation "org.tensorflow:tensorflow-core-native:$tfVersion:linux-x86_64-gpu" +implementation "org.tensorflow:tensorflow-core-native:$tfVersion:macosx-arm64" +implementation "org.tensorflow:tensorflow-core-native:$tfVersion:windows-x86_64" +``` + +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``` -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: +### Single dependency + +In some cases, it might be preferable to add a single dependency that includes transitively all the artifacts +required to run TensorFlow Java on any [supported platforms](README.md#individual-dependencies) + +- `tensorflow-core-platform`: Includes `tensorflow-core-api`, plus native artifacts for `linux-x86_64`, `linux-x86_64-arm64`, `macosx-arm64` and `windows-x86_64` + +For example, to run TensorFlow Java on any CPU platform for which a binary is being distributed by this project, you can +simply add this dependency to your application: ```xml org.tensorflow - tensorflow-core-platform${javacpp.platform.extension} - 0.1.0-SNAPSHOT + tensorflow-core-platform + 1.1.0 ``` +Or Gradle: +```groovy +implementation "org.tensorflow:tensorflow-core-platform:1.1.0" +``` -Be aware though that the native library is quite large and including too many versions of it may -significantly increase the size of your JAR. So it is good practice to limit your dependencies to -the platforms you are targeting. For this purpose the `-platform` artifacts include profiles that follow +Be aware though that the builds of TensorFlow are quite voluminous and including too many native dependencies may +significantly increase the size of your application. So it is good practice to limit your dependencies to +the platforms you are targeting. For this purpose these artifacts include profiles that follow the conventions established on this page: * [Reducing the Number of Dependencies](https://github.com/bytedeco/javacpp-presets/wiki/Reducing-the-Number-of-Dependencies) -*Note: the `tensorflow-starters` artifact is not available at this moment* +### 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 + +```xml + + + tensorflow-snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + + true + + + + + + + org.tensorflow + tensorflow-core-platform + 1.2.0-SNAPSHOT + + +``` +Or Gradle: +```groovy +repositories { + mavenCentral() + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots") + } +} + +dependencies { + // Example of dependency, see section above for more options + implementation "org.tensorflow:tensorflow-core-platform:1.2.0-SNAPSHOT" +} +``` + +## TensorFlow/Java Version Support + +This table shows the mapping between TensorFlow, TensorFlow Java and minimum supported Java versions. + +| TensorFlow Java Version | TensorFlow Version | Minimum Java Version | +|-------------------------|--------------------|----------------------| +| 0.2.0 | 2.3.1 | 8 | +| 0.3.0 | 2.4.1 | 8 | +| 0.3.1 | 2.4.1 | 8 | +| 0.3.2 | 2.4.1 | 8 | +| 0.3.3 | 2.4.1 | 8 | +| 0.4.0 | 2.7.0 | 8 | +| 0.4.1 | 2.7.1 | 8 | +| 0.4.2 | 2.7.4 | 8 | +| 0.5.0 | 2.10.1 | 11 | +| 1.0.0-rc.1 | 2.16.1 | 11 | +| 1.0.0-rc.2 | 2.16.2 | 11 | +| 1.0.0 | 2.16.2 | 11 | +| 1.1.0 | 2.18.0 | 11 | +| 1.2.0-SNAPSHOT | 2.21.0 | 11 | ## How to Contribute? -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 new file mode 100644 index 00000000000..66bd9dfaa9e --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,224 @@ +# Releasing TensorFlow Java + +The +[TensorFlow Java API](https://github.com/tensorflow/java) is available on Maven Central and JCenter +through artifacts uploaded to +[OSS Sonatype](https://oss.sonatype.org/content/repositories/releases/org/tensorflow/). 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). + +## Background + +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. + +## Release process overview + +The process of releasing TensorFlow Java is split in two major steps: +* Building and deploying the native artifacts +* 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. + +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 +version number. + +### Pre-requisites + +- `docker` +- An account at [oss.sonatype.org](https://oss.sonatype.org/), 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). + +### Preparing a release + +#### Major or minor release + +1. Get a clean version of the source code by cloning the + [TensorFlow Java GitHub repository](https://github.com/tensorflow/java) + ``` + git clone https://github.com/tensorflow/java + ``` +2. Create a new branch for the release named `r.` + ``` + git checkout -b r1.0 + ``` +3. Update the version of the Maven artifacts to the full version of the release + ``` + mvn versions:set -DnewVersion=1.0.0 + ``` +4. Update the TensorFlow Java version to reflect the new release at the following locations: + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L61 + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L167 + - https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts + - https://github.com/tensorflow/java/blob/master/README.md#tensorflow-version-support + +5. Commit the changes and push the new branch to the GitHub repository + ``` + git add . + git commit -m "Releasing 1.0.0" + git push --set-upstream origin r1.0 + ``` + +#### Patch release + +1. Get a clean version of the source code by cloning the + [TensorFlow Java GitHub repository](https://github.com/tensorflow/java) + ``` + git clone https://github.com/tensorflow/java + ``` +2. Switch to the release branch of the version to patch + ``` + git checkout r1.0 + ``` +3. Patch the code with your changes. For example, changes could be merged from another branch you + were working on or be applied directly to this branch when the required changes are minimal. + +4. Update the version of the Maven artifacts to the full version of the release + ``` + mvn versions:set -DnewVersion=1.0.1 + ``` +5. Update the TensorFlow Java version to reflect the new release at the following locations: + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L61 + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L167 + - https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts + - https://github.com/tensorflow/java/blob/master/README.md#tensorflow-version-support + +6. Commit the changes and push the branch to the GitHub repository + ``` + git add . + git commit -m "Releasing 1.0.1" + 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 < + + + central + ${USERNAME} + ${PASSWORD} + + + central-staging + ${USERNAME} + ${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 a parameter the sequence number of the staging repository created in OSSRH + by the GitHub Actions workflow. You can retrieve this ID by looking in the staging repositories + in OSSRH console directly, or check at the output of the step `Create Staging Repository` of the + `prepare` job in the workflow execution, where the ID is printed. + ``` + # 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. + +### Finishing a release + +#### Major or minor release + +1. Checkout the master branch and merge back changes from the released branch + ``` + git checkout master + git merge r1.0 + ``` +2. In your local copy, checkout the master branch and increase the next snapshot version. + ``` + mvn versions:set -DnewVersion=1.1.0-SNAPSHOT + ``` +3. Update the TensorFlow Java version to reflect the new snapshot at the following locations: + - https://github.com/tensorflow/java/blob/master/docs/install.md?plain=1#L104 + - https://github.com/tensorflow/java/blob/master/README.md#using-maven-artifacts + - https://github.com/tensorflow/java/blob/master/README.md#tensorflow-version-support + +4. Commit your changes and push the master branch to the GitHub repository + ``` + git add . + git commit -m "Increase version for next iteration" + git push + ``` + +#### Patch release + +1. Checkout the master branch and merge back changes from the released branch + ``` + git checkout master + git merge r1.0 + ``` +2. Commit the changes and push the master branch to the GitHub repository + ``` + git add . + git commit -m "Merge release 1.0.1" + git push + ``` + +## References + +- [Maven Central guide](https://central.sonatype.org/register/central-portal/) for hosting releases. diff --git a/docs/_toc.yaml b/docs/_toc.yaml new file mode 100755 index 00000000000..93b4e5db2ae --- /dev/null +++ b/docs/_toc.yaml @@ -0,0 +1,18 @@ +# Copyright 2019 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ============================================================================== +toc: +- title: Install + path: /jvm/install diff --git a/docs/docs/assets/tensorflow.svg b/docs/docs/assets/tensorflow.svg new file mode 100644 index 00000000000..c0778626d66 --- /dev/null +++ b/docs/docs/assets/tensorflow.svg @@ -0,0 +1 @@ + diff --git a/docs/docs/index.md b/docs/docs/index.md new file mode 100755 index 00000000000..c9fcbf53e7e --- /dev/null +++ b/docs/docs/index.md @@ -0,0 +1,42 @@ +# TensorFlow for Java + +TensorFlow Java can run on any JVM for building, training and running machine learning models. It comes with +a series of utilities and frameworks that help achieve most of the tasks common to data scientists +and developers working in this domain. Java and other JVM languages, such as Scala or Kotlin, are +frequently used in small-to-large enterprises all over the world, which makes TensorFlow a strategic +choice for adopting machine learning at a large scale. + +## The Repository + +In the early days, the Java language bindings for TensorFlow were hosted in the +[main TensorFlow repository](https://github.com/tensorflow/tensorflow) +and released only when a new version of the core library was ready to be distributed, which happens only +a few times a year. Now, all Java-related code has been moved to this repository so that it can evolve and +be released independently from official TensorFlow releases. In addition, most of the build tasks have been +migrated from Bazel to Maven, which is more familiar for most Java developers. + +The following describes the layout of the repository and its different artifacts: + +### [tensorflow-core](https://github.com/tensorflow/java/tree/master/tensorflow-core) + * **Intended audience**: developers who wants to deploy a TensorFlow model on a JVM for inference. Also for projects + that provide their own APIs or frameworks on top of TensorFlow and just want a thin layer to access the TensorFlow runtime from the JVM. + * All artifacts that make up the core language bindings of TensorFlow for Java. + +### [tensorflow-framework](https://github.com/tensorflow/java/tree/master/tensorflow-framework) + * **Intended audience**: neural network developers. + * Primary API for building and training neural networks with TensorFlow. + +### [ndarray](https://github.com/tensorflow/java-ndarray) + * **Intended audience**: any developer who needs a Java n-dimensional array implementation, whether or not they use it with TensorFlow. + * Generic utility library for n-dimensional data I/O operations. + * Used by TensorFlow but does not depend on TensorFlow. + +## Communication + +This repository is maintained by TensorFlow JVM Special Interest Group (SIG). You can easily contact the group +by posting to the [TensorFlow Forum](https://discuss.tensorflow.org), adding the `sig_jvm` tag, or by writing to us on +the [sig-jvm Gitter channel](https://gitter.im/tensorflow/sig-jvm). You can also simply send pull requests +and raise issues to this repository. + + + diff --git a/docs/docs/install.md b/docs/docs/install.md new file mode 100755 index 00000000000..2fe676e956a --- /dev/null +++ b/docs/docs/install.md @@ -0,0 +1,218 @@ +# Install TensorFlow Java + +[TensorFlow Java](https://github.com/tensorflow/java) can run on any JVM for +building, training and deploying machine learning models. It supports both CPU +and GPU execution, in graph or eager mode, and presents a rich API for using +TensorFlow in a JVM environment. Java and other JVM languages, like Scala and +Kotlin, are frequently used in large and small enterprises all over the world, +which makes TensorFlow Java a strategic choice for adopting machine learning at +a large scale. + +Note: Starting from version 1.0.0, the TensorFlow Java project follows the +[TensorFlow API stability guarantees](https://www.tensorflow.org/guide/versions#api_stability). +However, as these bindings are downstream of the TensorFlow C API, users should +be aware that stability is subject to the evolution of the upstream TensorFlow core. + +## Requirements + +TensorFlow Java runs on Java 11 and above, and supports out-of-the-box the +following platforms: + +* Ubuntu 20.04 or higher; 64-bit, x86 +* Ubuntu 22.04 or higher; 64-bit, arm +* macOS 14 or higher; 64-bit, arm +* Windows 10 or higher; 64-bit, x86 + +TensorFlow Java 1.0 series and earlier releases also have binaries for: + +* macOS 12 or higher; 64-bit, x86 + +*Note: To use TensorFlow on Android, see [LiteRT](https://tensorflow.org/lite)* + +## Versions + +TensorFlow Java has its own release cycle, independent of the +[TensorFlow runtime](https://github.com/tensorflow/tensorflow). Consequently, +its version does not match the version of TensorFlow runtime it runs on. Consult +the TensorFlow Java +[versioning table](https://github.com/tensorflow/java/#tensorflow-version-support) +to list all versions available and their mapping with the TensorFlow runtime. + +## Artifacts + +There are +[several ways](https://github.com/tensorflow/java/#using-maven-artifacts) to add +TensorFlow Java to your project. The easiest one is to add a dependency on the +`tensorflow-core-platform` artifact, which includes both the TensorFlow Java +Core API and the native dependencies it requires to run on all supported +platforms. + +To include CUDA® support for Linux x86, select the `tensorflow-core-native:linux-x86_64-gpu` artifact. + +In addition, a separate dependency on the `tensorflow-framework` library can be +added to benefit from a rich set of utilities for TensorFlow-based machine +learning on the JVM. + +## Installing with Maven + +To include TensorFlow in your [Maven](http://maven.apache.org) application, add +a dependency on its [artifacts](#artifacts) to your project's `pom.xml` file. +For example, + +```xml + + org.tensorflow + tensorflow-core-platform + 1.1.0 + +``` + +### Reducing Number of Dependencies + +It is important to note that adding a dependency on a `tensorflow-core-platform` +artifact will import native libraries for all supported platforms, which can +significantly increase the size of your project. + +If you wish to target a subset of the available platforms then you can exclude +the unnecessary artifacts from the other platforms using the +[Maven Dependency Exclusion](https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html#dependency-exclusions) +feature. + +Another way to select which platforms you want to include in your application is +to set JavaCPP system properties, in your Maven command line or in your +`pom.xml`. Please see JavaCPP +[documentation](https://github.com/bytedeco/javacpp-presets/wiki/Reducing-the-Number-of-Dependencies) +for more details. + +### Using Snapshots + +The latest TensorFlow Java development snapshots from the TensorFlow Java source +repository are available on the [OSS Sonatype](https://oss.sonatype.org) Nexus +repository. To depend on these artifacts, make sure to configure the OSS +snapshots repository in your `pom.xml`. + +```xml + + + tensorflow-snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + + true + + + + + + + org.tensorflow + tensorflow-core-platform + 1.2.0-SNAPSHOT + + +``` + +## Installing with Gradle + +To include TensorFlow in your [Gradle](https://gradle.org) application, add a +dependency on its [artifacts](#artifacts) to your project's `build.gradle` file. +For example, + +```groovy +repositories { + mavenCentral() +} + +dependencies { + compile group: 'org.tensorflow', name: 'tensorflow-core-platform', version: '1.0.0' +} +``` + +### Reducing Number of Dependencies + +Excluding native artifacts from TensorFlow Java with Gradle is not as easy as +with Maven. We recommend that you use Gradle JavaCPP plugins to reduce this +number of dependencies. + +Please read at Gradle JavaCPP +[documentation](https://github.com/bytedeco/gradle-javacpp) for more details. + +## Installing from Sources + +To build TensorFlow Java from sources, and possibly customize it, please read +the following +[instructions](https://github.com/tensorflow/java/blob/master/CONTRIBUTING.md#building). + +*Note: Only official builds distributed by TensorFlow are supported by its +maintainers and custom builds should be used at the user's risk.* + +## Example Program + +This example shows how to build an Apache Maven project with TensorFlow. First, +add the TensorFlow dependency to the project's `pom.xml` file: + +```xml + + 4.0.0 + org.myorg + hellotensorflow + 1.0-SNAPSHOT + + + HelloTensorFlow + + 11 + 11 + + + + + + org.tensorflow + tensorflow-core-platform + 1.1.0 + + + +``` + +Create the source file `src/main/java/HelloTensorFlow.java`: + +```java +import org.tensorflow.ConcreteFunction; +import org.tensorflow.Signature; +import org.tensorflow.Tensor; +import org.tensorflow.TensorFlow; +import org.tensorflow.op.Ops; +import org.tensorflow.op.core.Placeholder; +import org.tensorflow.op.math.Add; +import org.tensorflow.types.TInt32; + +public class HelloTensorFlow { + + public static void main(String[] args) throws Exception { + System.out.println("Hello TensorFlow " + TensorFlow.version()); + + try (ConcreteFunction dbl = ConcreteFunction.create(HelloTensorFlow::dbl); + TInt32 x = TInt32.scalarOf(10); + TInt32 dblX = (TInt32)dbl.call(x)) { + System.out.println(x.getInt() + " doubled is " + dblX.getInt()); + } + } + + private static Signature dbl(Ops tf) { + Placeholder x = tf.placeholder(TInt32.class); + Add dblX = tf.math.add(x, x); + return Signature.builder().input("x", x).output("dbl", dblX).build(); + } +} +``` + +Compile and execute: + +
+mvn -q compile exec:java
+
+ +The command prints TensorFlow version and a simple calculation. + +Success! TensorFlow Java is configured. diff --git a/docs/docs/references.md b/docs/docs/references.md new file mode 100644 index 00000000000..524b23dc675 --- /dev/null +++ b/docs/docs/references.md @@ -0,0 +1,8 @@ +--- +hide: + - navigation + - toc + - title +--- +# + \ No newline at end of file diff --git a/docs/docs/stylesheets/extra.css b/docs/docs/stylesheets/extra.css new file mode 100644 index 00000000000..70aefe6843e --- /dev/null +++ b/docs/docs/stylesheets/extra.css @@ -0,0 +1,14 @@ +:root > * { + /*--md-primary-fg-color: #EE782F;*/ + /*--md-primary-fg-color--light: #455960;*/ + /*--md-primary-fg-color--dark: #90030C;*/ +} + +.md-typeset h1, .md-typeset h2 { + font-weight: 800; + letter-spacing: -.01em; +} + +.md-sidebar--primary { + display: none; +} \ No newline at end of file diff --git a/docs/legacy_tools/build_java_api_docs.py b/docs/legacy_tools/build_java_api_docs.py new file mode 100644 index 00000000000..77d3ba80f31 --- /dev/null +++ b/docs/legacy_tools/build_java_api_docs.py @@ -0,0 +1,132 @@ +# Lint as: python3 +# Copyright 2020 The TensorFlow Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== + +###################################################################################################################### +# IMPORTANT: Files in legacy_tools are no longer used to generate the TensorFlow-Java API docs as there are unfixed issues +# when using DocLava outside of the Google environment. We are keeping these for reference in case they are useful later. +###################################################################################################################### + + +"""Generate TensorFlow Java reference docs for TensorFlow.org.""" +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function + +import pathlib +import shutil +import tempfile +import io +import requests +import zipfile +from git import Repo + +from absl import app +from absl import flags + +from tensorflow_docs.api_generator import gen_java + +FLAGS = flags.FLAGS + +NDARRAY_VERSION = 'v1.0.0' +JAVACPP_VERSION = '1.5.11' +PROTOBUF_VERSION = 'v3.21.9' + +# __file__ is the path to this file +TOOLS_DIR = pathlib.Path(__file__).resolve().parent +DOCS_DIR = TOOLS_DIR.parent +REPO_ROOT = DOCS_DIR.parent +DOC_OUTPUT_DIR = DOCS_DIR.joinpath("output") + +SECTION_LABELS = { + 'org.tensorflow': 'Core', + 'org.tensorflow.ndarray': 'NdArray', + 'org.tensorflow.framework': 'Framework', +} + +# These flags are required by infrastructure, not all of them are used. +flags.DEFINE_string('output_dir', f"{DOC_OUTPUT_DIR}", + ("Use this branch as the root version and don't" + ' create in version directory')) + +flags.DEFINE_string('site_path', 'api_docs/', + 'Path prefix in the _toc.yaml') + +flags.DEFINE_string('code_url_prefix', None, + '[UNUSED] The url prefix for links to code.') + +flags.DEFINE_bool( + 'search_hints', True, + '[UNUSED] Include metadata search hints in the generated files') + + +def checkout_repo(repo_url: str, target_dir_name: str, version: str): + local_repo_path = f"{REPO_ROOT}/{target_dir_name}" + if not pathlib.Path(local_repo_path).exists(): + local_repo = Repo.clone_from(repo_url, local_repo_path) + else: + local_repo = Repo(local_repo_path) + local_repo.remotes['origin'].fetch() + local_repo.git.checkout(version) + + +def overlay(from_root, to_root): + for from_path in pathlib.Path(from_root).rglob('*'): + relpath = from_path.relative_to(from_root) + to_path = to_root/relpath + if from_path.is_file(): + assert not to_path.exists() + shutil.copyfile(from_path, to_path) + else: + to_path.mkdir(exist_ok=True) + + +def main(unused_argv): + checkout_repo('https://github.com/tensorflow/java-ndarray', 'ndarray', NDARRAY_VERSION) + checkout_repo('https://github.com/bytedeco/javacpp', 'javacpp', JAVACPP_VERSION) + response = requests.get('https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.21.9/protobuf-java-3.21.9-sources.jar') + with zipfile.ZipFile(io.BytesIO(response.content)) as z: + z.extractall(f"{REPO_ROOT}/protobuf") + response = requests.get('https://repo1.maven.org/maven2/org/osgi/osgi.annotation/8.1.0/osgi.annotation-8.1.0-sources.jar') + with zipfile.ZipFile(io.BytesIO(response.content)) as z: + z.extractall(f"{REPO_ROOT}/osgi") + + merged_source = pathlib.Path(tempfile.mkdtemp()) + (merged_source / 'java/org').mkdir(parents=True) + shutil.copytree(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/', merged_source/'java/org/tensorflow') + overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow', merged_source/'java/org/tensorflow') + overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow', merged_source/'java/org/tensorflow') + overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-native/src/gen/java/org/tensorflow/', merged_source/'java/org/tensorflow/') + overlay(REPO_ROOT/'tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/', merged_source/'java/org/tensorflow/') + shutil.copytree(REPO_ROOT/'tensorflow-framework/src/main/java/org/tensorflow/framework', merged_source/'java/org/tensorflow/framework') + shutil.copytree(REPO_ROOT/'ndarray/ndarray/src/main/java/org/tensorflow/ndarray', merged_source/'java/org/tensorflow/ndarray') + shutil.copytree(REPO_ROOT/'javacpp/src/main/java/org/bytedeco', merged_source/'java/org/bytedeco') + shutil.copytree(REPO_ROOT/'protobuf/com/', merged_source/'java/com') + shutil.copytree(REPO_ROOT/'osgi/org/osgi', merged_source/'java/org/osgi') + + gen_java.gen_java_docs( + package='org.tensorflow', + source_path=merged_source / 'java', + output_dir=pathlib.Path(FLAGS.output_dir), + site_path=pathlib.Path(FLAGS.site_path), + section_labels=SECTION_LABELS, + # Uncomment for local testing: + script_path=pathlib.Path(TOOLS_DIR, 'run-javadoc-for-tf-local.sh'), + ) + + +if __name__ == '__main__': + flags.mark_flags_as_required(['output_dir']) + app.run(main) diff --git a/docs/legacy_tools/requirements.txt b/docs/legacy_tools/requirements.txt new file mode 100644 index 00000000000..4435ca4d4a9 --- /dev/null +++ b/docs/legacy_tools/requirements.txt @@ -0,0 +1,8 @@ +###################################################################################################################### +# IMPORTANT: Files in legacy_tools are no longer used to generate the TensorFlow-Java API docs as there are unfixed issues +# when using DocLava outside of the Google environment. We are keeping these for reference in case they are useful later. +###################################################################################################################### + +GitPython +requests +tensorflow-docs \ No newline at end of file diff --git a/docs/legacy_tools/run-javadoc-for-tf-local.sh b/docs/legacy_tools/run-javadoc-for-tf-local.sh new file mode 100644 index 00000000000..97d59ddfd6e --- /dev/null +++ b/docs/legacy_tools/run-javadoc-for-tf-local.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +###################################################################################################################### +# IMPORTANT: Files in legacy_tools are no longer used to generate the TensorFlow-Java API docs as there are unfixed issues +# when using DocLava outside of the Google environment. We are keeping these for reference in case they are useful later. +###################################################################################################################### + +set -ex + +export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home # Or change to any JDK 11 home path + +# https://android.googlesource.com/platform/external/doclava/ +# There's a debian package: +# https://packages.debian.org/unstable/doclava-aosp +# Install with: +# +# $ sudo apt install doclava-aosp #v 6.0.1+r55-1+build1 +# +# https://unix.stackexchange.com/questions/594841/how-do-i-assign-a-value-to-a-bash-variable-iff-that-variable-is-null-unassigned +DOCLAVA_JAR=${DOCLAVA_JAR:-'tools/lib/doclava.jar'} # Build lib locally + + +# Install java clear silver templates with: +# +# $ sudo apt install libjsilver-aosp-java #v 6.0.1+r55-1+build1 +JSILVER_JAR=${JSILVER_JAR:-'tools/lib/jsilver.jar'} # Build lib locally + + +######### DELETE OUTPUT_DIR ################# + +# Empty the output directory in case a class has been deleted +rm -rf "${OUTPUT_DIR:?}"/* +############ RUN DOCLAVA ################### + +# $FEDERATED_DOCS is a space-separated string of url,file pairs. +read -a api_pairs <<< "${FEDERATED_DOCS}" +FEDERATED_PARAMS="" +for i in "${!api_pairs[@]}"; do + api_pair_str="${api_pairs[$i]}" # "url,api.txt" + read -a api_pair <<< "${api_pair_str//,/ }" + # Using the index as the API "name", build the federation params. Note that + # using 0 as an API name will evaluate to false and cause rendering bugs, + # so we preface with "api_". + FEDERATED_PARAMS+=" -federate api_${i} ${api_pair[0]}" + FEDERATED_PARAMS+=" -federationapi api_${i} ${api_pair[1]}" +done + +# To install javadoc, for example, use +# +# sudo apt install openjdk-11-jdk +# +# doclava doesn't work with openjdk-13 +# ``` +# javadoc: error - Class com.google.doclava.Doclava is not a valid doclet. +# Note: As of JDK 13, the com.sun.javadoc API is no longer supported. +# ``` +# It's used here: https://android.googlesource.com/platform/external/doclava/+/refs/heads/master/src/com/google/doclava/Doclava.java + +# Each package in $PACKAGE needs to prefaced with -subpackages, so do that. +SUBPACKAGES="" +read -r -a packages <<< "${PACKAGE}" +for pkg in "${packages[@]}"; do + SUBPACKAGES+=" -subpackages ${pkg}" +done +( # Capture the return code. it may be non-zero for minor errors. + /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/bin/javadoc \ + -sourcepath "${SOURCE_PATH}" \ + -docletpath "${DOCLAVA_JAR}:${JSILVER_JAR}" \ + -doclet com.google.doclava.Doclava \ + -toroot "${SITE_PATH}"/ \ + -yaml _toc.yaml \ + -templatedir "${TEMPLATES}" \ + -public \ + -d "${OUTPUT_DIR}" \ + ${FEDERATED_PARAMS} \ + ${SUBPACKAGES} +) + + +mv "${OUTPUT_DIR}"/reference/* "${OUTPUT_DIR}" + +################################################################### +################### START OF POST-PROCESSING ###################### +################################################################### +rm "${OUTPUT_DIR}/navtree_data.js" || true +rm "${OUTPUT_DIR}/hierarchy.html" || true + +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' "s|${SITE_PATH}/reference|${SITE_PATH}|g" +find ${OUTPUT_DIR} -name "*.yaml" | xargs sed -i '' "s|${SITE_PATH}/reference|${SITE_PATH}|g" +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' "s|a href=\"reference/org/tensorflow|a href=\"${SITE_PATH}/org/tensorflow|g" +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' "s|a href=\"reference/com/google|a href=\"${SITE_PATH}/com/google|g" + +JAVA_LANG=https://docs.oracle.com/javase/8/docs/api +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' "s|a href=\"reference/java/lang|a href=\"${JAVA_LANG}/java/lang|g" + +find ${OUTPUT_DIR} -name "*.html" | xargs sed -i '' 's|
|
|g'
+
+rm ${OUTPUT_DIR}/timestamp.js || true
+rm ${OUTPUT_DIR}/lists.js || true
+rm ${OUTPUT_DIR}/index.html || true
+
+cp ${TEMPLATES}/screen.css ${OUTPUT_DIR}/
+
+
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
new file mode 100644
index 00000000000..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/pom.xml b/pom.xml
index 5112f662760..6fcc6e1a872 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,11 +1,13 @@
-
+
 
   4.0.0
 
   org.tensorflow
   tensorflow-java
-  0.1.0-SNAPSHOT
+  1.2.0-SNAPSHOT
   pom
 
   TensorFlow Java Parent
@@ -17,100 +19,496 @@
   
     
       The Apache Software License, Version 2.0
-      http://www.apache.org/licenses/LICENSE-2.0.txt
+      https://www.apache.org/licenses/LICENSE-2.0.txt
       repo
     
   
 
   
-    https://github.com/tensorflow/tensorflow.git
-    git@github.com:tensorflow/tensorflow.git
-    scm:git:https://github.com/tensorflow/tensorflow.git
+    https://github.com/tensorflow/java.git
+    scm:git@github.com:tensorflow/java.git
+    scm:git:https://github.com/tensorflow/java.git
   
 
   
-    tensorflow-tools
+    tensorflow-ndarray
     tensorflow-core
-    tensorflow-training
+    tensorflow-framework
   
 
   
-    ASCII
-    1.8
-    1.8
-    4.12
-    1.21
-    true
+    ${os.name}-${os.arch}
+
+    UTF8
+    11
+    11
+    11
+    5.10.0
+    1.37
+    2.7
+    2.25.0
+    true
+    true
+    true
+    2.46.1
   
 
+  
+    
+      central-snapshots
+      Maven Central Snapshots
+      https://central.sonatype.com/repository/maven-snapshots/
+      
+        false
+      
+      
+        true
+      
+    
+  
+
+  
+    
+      central-snapshots
+      Maven Central Plugin Snapshots
+      https://central.sonatype.com/repository/maven-snapshots/
+      
+        false
+      
+      
+        true
+      
+    
+  
+
+  
+    
+      central
+      https://central.sonatype.com/repository/maven-snapshots
+    
+    
+      central
+      https://ossrh-staging-api.central.sonatype.com/service/local/staging/deployByRepositoryId/${stagingRepositoryId}/
+    
+  
+
   
     
       
-        junit
-        junit
+        org.junit.jupiter
+        junit-jupiter-api
+        ${junit.version}
+        test
+      
+      
+        org.junit.jupiter
+        junit-jupiter-engine
         ${junit.version}
+        test
+      
+      
+        org.openjdk.jmh
+        jmh-core
+        ${jmh.version}
+        test
       
-	  
-	    org.openjdk.jmh
-	    jmh-core
-	    ${jmh.version}
-  	    test
-	  
-	  
-	    org.openjdk.jmh
-	    jmh-generator-annprocess
-	    ${jmh.version}
+      
+        org.openjdk.jmh
+        jmh-generator-annprocess
+        ${jmh.version}
         test
-	  
+      
     
   
 
-  
   
+    
     
-      ossrh
-      
-        
-        
-          ossrh
-          https://oss.sonatype.org/content/repositories/snapshots
-        
-        
-          ossrh
-          https://oss.sonatype.org/service/local/staging/deploy/maven2/
-        
-      
+      dev
+      
+        false
+      
+    
+
+    
+    
+      deploying
+      
+        false
+        false
+      
     
+
+    
     
-      bintray
-      
-        
+      releasing
+      
+        false
+      
+      
         
-          bintray
-          https://api.bintray.com/maven/google/tensorflow/tensorflow/;publish=0
+          ossrh-staging
+          OSSRH Sonatype Staging
+          
+            https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${stagingRepositoryId}/
+          
+          
+            true
+          
+          
+            false
+          
         
-      
+      
+    
+
+    
+      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-enforcer-plugin
+        3.4.1
+        
+          
+            enforce
+            
+              
+                
+                
+                  3.6
+                
+              
+            
+            
+              enforce
+            
+          
+        
+      
+      
         org.apache.maven.plugins
         maven-gpg-plugin
-        1.5
+        3.1.0
         
           
             sign-artifacts
@@ -120,14 +518,117 @@
             
           
         
+        
+          
+            --pinentry-mode
+            loopback
+          
+        
+      
+      
+        maven-source-plugin
+        3.3.0
+        
+          
+            attach-sources
+            
+              jar-no-fork
+            
+          
+        
+      
+      
+        maven-javadoc-plugin
+        3.12.0
+      
+          ./docs/overview.md
+          
+          Copyright 2015, 2025 The TensorFlow Authors. All Rights Reserved. TensorFlow-Java Main Documentation]]>
+          
+              -Xmaxerrs
+              65536
+              -Xmaxwarns
+              65536
+          
+          false
+          256m
+          2048m
+          
+              https://tensorflow.github.io/java/javadoc-ndarray/v1.0.0/
+              https://protobuf.dev/reference/java/api-docs
+              https://bytedeco.org/javacpp/apidocs
+          
+      
+        
+            
+                javadoc-site
+                
+                    javadoc
+                
+            
+          
+            attach-javadocs
+            
+              jar
+            
+          
+        
+      
+      
+        org.codehaus.mojo
+        versions-maven-plugin
+        ${versions-plugin.version}
+        
+          false
+          true
+          true
+        
+      
+      
+        com.diffplug.spotless
+        spotless-maven-plugin
+        ${spotless.version}
+        
+          origin/master
+          
+          
+            
+              1.20.0
+            
+            
+          
+        
+      
+      
     
+
     
       
         
           org.apache.maven.plugins
           maven-jar-plugin
-          3.2.0
+          3.3.0
+        
+        
+          org.apache.maven.plugins
+          maven-surefire-plugin
+          3.1.2
+          
+            
+              **/*Test.java
+            
+            false
+          
         
       
     
diff --git a/release.sh b/release.sh
new file mode 100755
index 00000000000..acd1041d766
--- /dev/null
+++ b/release.sh
@@ -0,0 +1,62 @@
+#!/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 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="mvn clean deploy -B -e --settings ./settings.xml -Pdeploying -Preleasing -DstagingRepositoryId=orgtensorflow-${STAGING_SEQ}"
+fi
+
+export GPG_TTY=$(tty)
+set -ex
+
+if [[ ! -f settings.xml ]]
+then
+  cp -f ~/.m2/settings.xml .
+fi
+
+docker run \
+  -e GPG_TTY="${GPG_TTY}" \
+  -v ${PWD}:/tensorflow-java \
+  -v ${HOME}/.gnupg:/root/.gnupg \
+  -w /tensorflow-java \
+  -it \
+  --platform linux/amd64 \
+  maven:3.8.6-jdk-11  \
+  ${CMD}
+
+echo
+echo "Uploaded to the staging repository"
+echo "After validating the release: "
+echo "* Login to https://oss.sonatype.org/#stagingRepositories"
+echo "* Find the 'org.tensorflow' staging release and click either 'Release' to release or 'Drop' to abort"
diff --git a/tensorflow-core/pom.xml b/tensorflow-core/pom.xml
index 563efcd1efe..cc87f6a76bc 100644
--- a/tensorflow-core/pom.xml
+++ b/tensorflow-core/pom.xml
@@ -22,7 +22,7 @@
   
     org.tensorflow
     tensorflow-java
-    0.1.0-SNAPSHOT
+    1.2.0-SNAPSHOT
   
   tensorflow-core
   pom
@@ -31,744 +31,47 @@
   Parent POM of TensorFlow core artifacts
 
   
+    tensorflow-core-native
     tensorflow-core-generator
     tensorflow-core-api
-    tensorflow-core-platform${javacpp.platform.extension}
   
 
   
+    
+    4.31.1
+
     ${javacpp.platform}${javacpp.platform.extension}
-    false       
-    false     
-    false 
     
     ${javacpp.platform}
-    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-x86_64${javacpp.platform.extension}
-    windows-x86${javacpp.platform.extension}
-    windows-x86_64${javacpp.platform.extension}
-    1.5.2
-    0.21.2-${javacpp.version}
+    linux-armhf
+    linux-arm64
+    linux-x86_64
+    macosx-arm64
+    macosx-x86_64
+    windows-x86_64
+    linux-armhf${javacpp.platform.extension}
+    linux-arm64${javacpp.platform.extension}
+    linux-x86_64${javacpp.platform.extension}
+    macosx-arm64${javacpp.platform.extension}
+    macosx-x86_64${javacpp.platform.extension}
+    windows-x86_64${javacpp.platform.extension}
+    1.5.12
   
 
   
     
-      javacpp-platform-default
-      
-        
-          !javacpp.platform
-        
-      
-      
-        ${os.name}-${os.arch}
-      
-    
-
-    
-      javacpp-platform-custom
-      
-        
-          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}${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}
-        ${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.extension}
-        
-        
-        
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-linux-arm64
-      
-        
-          javacpp.platform
-          linux-arm64
-        
-      
-      
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-linux-ppc64le
-      
-        
-          javacpp.platform
-          linux-ppc64le
-        
-      
-      
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-linux-x86
-      
-        
-          javacpp.platform
-          linux-x86
-        
-      
-      
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-linux-x86_64
-      
-        
-          javacpp.platform
-          linux-x86_64
-        
-      
-      
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-        
-      
-    
-
-    
-      javacpp-platform-macosx-x86_64
-      
-        
-          javacpp.platform
-          macosx-x86_64
-        
-      
-      
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-        
-      
-    
-
-    
-      javacpp-platform-windows-x86
-      
-        
-          javacpp.platform
-          windows-x86
-        
-      
-      
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-        
-      
-    
-
-    
-      javacpp-platform-windows-x86_64
-      
-        
-          javacpp.platform
-          windows-x86_64
-        
-      
-      
-        
-        
-        
-        
-        
-        
-        
-        ${javacpp.platform}${javacpp.platform.extension}
-      
-    
-
-    
-    
-      no-platform-dependency
-      
-        
-          ${basedir}
-        
-      
-      
-        
-        
-        
-        
-        
-        
-        
-        
-      
-    
-
-    
-    
-      javacpp.platform.linux-armhf-true
-      
-        
-          javacpp.platform.linux-armhf
-        
-      
-      
-        linux-armhf${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.linux-arm64-true
-      
-        
-          javacpp.platform.linux-arm64
-        
-      
-      
-        linux-arm64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.linux-ppc64le-true
-      
-        
-          javacpp.platform.linux-ppc64le
-        
-      
-      
-        linux-ppc64le${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.linux-x86-true
-      
-        
-          javacpp.platform.linux-x86
-        
-      
-      
-        linux-x86${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.linux-x86_64-true
-      
-        
-          javacpp.platform.linux-x86_64
-        
-      
-      
-        linux-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.macosx-x86_64-true
-      
-        
-          javacpp.platform.macosx-x86_64
-        
-      
-      
-        macosx-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.windows-x86-true
-      
-        
-          javacpp.platform.windows-x86
-        
-      
-      
-        windows-x86${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.windows-x86_64-true
-      
-        
-          javacpp.platform.windows-x86_64
-        
-      
-      
-        windows-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-arm
-      
-        
-          javacpp.platform.host
-        
-        linuxarm
-      
-      
-        linux-armhf${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-armhf
-      
-        
-          javacpp.platform.host
-        
-        linuxarmhf
-      
-      
-        linux-armhf${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-aarch64
-      
-        
-          javacpp.platform.host
-        
-        linuxaarch64
-      
-      
-        linux-arm64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-armv8
-      
-        
-          javacpp.platform.host
-        
-        linuxarmv8
-      
-      
-        linux-arm64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-arm64
-      
-        
-          javacpp.platform.host
-        
-        linuxarm64
-      
-      
-        linux-arm64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-ppc64le
-      
-        
-          javacpp.platform.host
-        
-        linuxppc64le
-      
-      
-        linux-ppc64le${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-amd64
-      
-        
-          javacpp.platform.host
-        
-        linuxamd64
-      
-      
-        linux-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-x86-64
-      
-        
-          javacpp.platform.host
-        
-        linuxx86-64
-      
-      
-        linux-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-linux-x86_64
-      
-        
-          javacpp.platform.host
-        
-        linuxx86_64
-      
-      
-        linux-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-macosx-amd64
-      
-        
-          javacpp.platform.host
-        
-        mac os xamd64
-      
-      
-        macosx-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-macosx-x86-64
-      
-        
-          javacpp.platform.host
-        
-        mac os xx86-64
-      
-      
-        macosx-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-macosx-x86_64
-      
-        
-          javacpp.platform.host
-        
-        mac os xx86_64
-      
-      
-        macosx-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-windows-amd64
-      
-        
-          javacpp.platform.host
-        
-        windowsamd64
-      
-      
-        windows-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-windows-x86-64
-      
-        
-          javacpp.platform.host
-        
-        windowsx86-64
-      
-      
-        windows-x86_64${javacpp.platform.extension}
-      
-    
-
-    
-      javacpp.platform.custom-windows-x86_64
-      
-        
-          javacpp.platform.host
-        
-        windowsx86_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
-      
+      
+      deploying
+      
+        tensorflow-core-platform
+      
     
   
-
 
-
diff --git a/tensorflow-core/tensorflow-core-api/.bazelrc b/tensorflow-core/tensorflow-core-api/.bazelrc
deleted file mode 100644
index 4b673d3fcfb..00000000000
--- a/tensorflow-core/tensorflow-core-api/.bazelrc
+++ /dev/null
@@ -1,172 +0,0 @@
-# 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
-
-# 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
-
-# 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 -c opt
-
-# This config option is used to enable MKL-DNN open source library only,
-# without depending on MKL binary version.
-build:mkl_open_source_only --define=build_with_mkl_dnn_only=true
-build:mkl_open_source_only --define=build_with_mkl_dnn_v1_only=true
-build:mkl_open_source_only --define=build_with_mkl=true --define=enable_mkl=true
-build:mkl_open_source_only --define=tensorflow_mkldnn_contraction_kernel=0
-
-build:download_clang --crosstool_top=@local_config_download_clang//:toolchain
-build:download_clang --define=using_clang=true
-build:download_clang --action_env TF_DOWNLOAD_CLANG=1
-# Instruct clang to use LLD for linking.
-# This only works with GPU builds currently, since Bazel sets -B/usr/bin in
-# auto-generated CPU crosstool, forcing /usr/bin/ld.lld to be preferred over
-# the downloaded one.
-build:download_clang_use_lld --linkopt='-fuse-ld=lld'
-
-# 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: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:gdr --define=with_gdr_support=true
-build:ngraph --define=with_ngraph_support=true
-build:verbs --define=with_verbs_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:nokafka --define=no_kafka_support=true
-build:noignite --define=no_ignite_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 --strategy=Genrule=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
-
-# 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
-
-# Default paths for TF_SYSTEM_LIBS
-build --define=PREFIX=/usr
-build --define=LIBDIR=$(PREFIX)/lib
-build --define=INCLUDEDIR=$(PREFIX)/include
-
-# Suppress all warning messages.
-build:short_logs --output_filter=DONT_MATCH_ANYTHING
-
-# Options when using remote execution
-build:rbe --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
-build:rbe --auth_enabled=true
-build:rbe --auth_scope=https://www.googleapis.com/auth/cloud-source-tools
-build:rbe --define=EXECUTOR=remote
-build:rbe --flaky_test_attempts=3
-build:rbe --jobs=200
-build:rbe --remote_accept_cached=true
-build:rbe --remote_cache=remotebuildexecution.googleapis.com
-build:rbe --remote_executor=remotebuildexecution.googleapis.com
-build:rbe --remote_local_fallback=false
-build:rbe --remote_timeout=600
-build:rbe --spawn_strategy=remote
-build:rbe --strategy=Genrule=remote
-build:rbe --strategy=Closure=remote
-build:rbe --strategy=Javac=remote
-build:rbe --strategy=TestRunner=remote
-build:rbe --tls_enabled
-test:rbe --test_env=USER=anon
-
-# Options to build TensorFlow 1.x or 2.x.
-build:v1 --define=tf_api_version=1
-build:v2 --define=tf_api_version=2
-test:v1 --test_env=TF2_BEHAVIOR=0
-test:v2 --test_env=TF2_BEHAVIOR=1
-build --config=v2
-test --config=v2
-
-# 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 5fb3d1b53d0..00000000000
--- a/tensorflow-core/tensorflow-core-api/BUILD
+++ /dev/null
@@ -1,59 +0,0 @@
-load("@org_tensorflow//tensorflow:tensorflow.bzl", "tf_copts", "tf_cc_binary")
-load(":tensorflow-java.bzl", "tf_java_op_gen_srcjar")
-
-tf_java_op_gen_srcjar(
-    name = "java_op_gen_sources",
-    api_def_srcs = [
-        "@org_tensorflow//tensorflow/core/api_def:base_api_def",
-        ":java_api_def",
-    ],
-    base_package = "org.tensorflow.op",
-    gen_tool = ":java_op_gen_tool",
-)
-
-tf_cc_binary(
-    name = "java_op_gen_tool",
-    srcs = [
-        "src/bazel/op_generator/op_gen_main.cc",
-    ],
-    copts = tf_copts(),
-    linkopts = select({
-        "@org_tensorflow//tensorflow:windows": [],
-        "//conditions:default": ["-lm"],
-    }),
-    linkstatic = 1,
-    deps = [
-        ":java_op_gen_lib",
-        "@org_tensorflow//tensorflow/core:framework",
-        "@org_tensorflow//tensorflow/core:lib",
-        "@org_tensorflow//tensorflow/core:ops",
-    ],
-)
-
-cc_library(
-    name = "java_op_gen_lib",
-    srcs = [
-        "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/*"])
-)
diff --git a/tensorflow-core/tensorflow-core-api/WORKSPACE b/tensorflow-core/tensorflow-core-api/WORKSPACE
deleted file mode 100644
index 62edb6ed820..00000000000
--- a/tensorflow-core/tensorflow-core-api/WORKSPACE
+++ /dev/null
@@ -1,51 +0,0 @@
-workspace(name = "tensorflow_core_api")
-
-#local_repository(
-#    name = "tensorflow",
-#    path = "/Users/klessard/Documents/Projects/MachineLearning/Sources/tensorflow",
-#)
-
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
-http_archive(
-    name = "org_tensorflow",
-    patches = [
-        ":tensorflow-windows.patch", # https://github.com/tensorflow/tensorflow/issues/25213
-        ":tensorflow-api-def.patch",
-        ":tensorflow-grpc-fix-for-gettid.patch" # https://github.com/clearlinux-pkgs/tensorflow/blob/master/Add-grpc-fix-for-gettid.patch
-    ],
-    patch_args = ["-p1"],
-    urls = [
-       "https://mirror.bazel.build/github.com/tensorflow/tensorflow/archive/v2.1.0.tar.gz",
-       "https://github.com/tensorflow/tensorflow/archive/v2.1.0.tar.gz",
-    ],
-    sha256 = "638e541a4981f52c69da4a311815f1e7989bf1d67a41d204511966e1daed14f7",
-    strip_prefix = "tensorflow-2.1.0"
-)
-
-# 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
-    ],
-)
-http_archive(
-    name = "bazel_skylib",
-    sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e",
-    urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/0.8.0/bazel-skylib.0.8.0.tar.gz"],
-)
-# END: Upstream TensorFlow dependencies
-load("@org_tensorflow//tensorflow:workspace.bzl", "tf_repositories")
-tf_repositories()
-
-load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")
-closure_repositories()
-
-load("@org_tensorflow//tensorflow:workspace.bzl", "tf_bind")
-tf_bind()
diff --git a/tensorflow-core/tensorflow-core-api/build.sh b/tensorflow-core/tensorflow-core-api/build.sh
deleted file mode 100755
index b0d48e43ad8..00000000000
--- a/tensorflow-core/tensorflow-core-api/build.sh
+++ /dev/null
@@ -1,57 +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
-    export BUILD_FLAGS="$BUILD_FLAGS --config=mkl"
-fi
-
-if [[ "${EXTENSION:-}" == *gpu* ]]; then
-    export BUILD_FLAGS="$BUILD_FLAGS --config=cuda"
-    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 C API of TensorFlow itself including a target to generate ops for Java
-bazel build $BUILD_FLAGS --python_path="$PYTHON_BIN_PATH" --config=monolithic --output_filter=DONT_MATCH_ANYTHING --verbose_failures \
-    @org_tensorflow//tensorflow:tensorflow @org_tensorflow//tensorflow/tools/lib_package:jnilicenses_generate :java_op_gen_sources
-ls -l bazel-bin/external/org_tensorflow/tensorflow/
-
-# Normalize some paths with symbolic links
-TENSORFLOW_SO=(bazel-bin/external/org_tensorflow/tensorflow/libtensorflow.so.?.?.?)
-if [[ -f $TENSORFLOW_SO ]]; then
-    ln -sf $(basename $TENSORFLOW_SO) bazel-bin/external/org_tensorflow/tensorflow/libtensorflow.so
-    ln -sf $(basename $TENSORFLOW_SO) bazel-bin/external/org_tensorflow/tensorflow/libtensorflow.so.2
-fi
-TENSORFLOW_DYLIB=(bazel-bin/external/org_tensorflow/tensorflow/libtensorflow.?.?.?.dylib)
-if [[ -f $TENSORFLOW_DYLIB ]]; then
-    ln -sf $(basename $TENSORFLOW_DYLIB) bazel-bin/external/org_tensorflow/tensorflow/libtensorflow.dylib
-    ln -sf $(basename $TENSORFLOW_DYLIB) bazel-bin/external/org_tensorflow/tensorflow/libtensorflow.2.dylib
-fi
-TENSORFLOW_LIBS=(bazel-bin/external/org_tensorflow/tensorflow/tensorflow.dll.if.lib bazel-bin/external/org_tensorflow/tensorflow/libtensorflow.dll.ifso)
-for TENSORFLOW_LIB in ${TENSORFLOW_LIBS[@]}; do
-    if [[ -f $TENSORFLOW_LIB ]]; then
-        ln -sf $(basename $TENSORFLOW_LIB) bazel-bin/external/org_tensorflow/tensorflow/tensorflow.lib
-    fi
-done
-
-# Copy only main generated Java source files for ops
-mkdir -p src/gen/java/
-cp -r bazel-genfiles/ops/src/* src/gen/java/
diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-api-def.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-api-def.patch
deleted file mode 100644
index 791e0e2e9c6..00000000000
--- a/tensorflow-core/tensorflow-core-api/external/tensorflow-api-def.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/tensorflow/core/api_def/BUILD b/tensorflow/core/api_def/BUILD
-index f96645ad9f..63f94d3b87 100644
---- a/tensorflow/core/api_def/BUILD
-+++ b/tensorflow/core/api_def/BUILD
-@@ -28,7 +28,7 @@ package(
- filegroup(
-     name = "base_api_def",
-     srcs = glob(["base_api/*"]),
--    visibility = ["//tensorflow:internal"],
-+    visibility = ["//visibility:public"],
- )
- 
- filegroup(
diff --git a/tensorflow-core/tensorflow-core-api/external/tensorflow-grpc-fix-for-gettid.patch b/tensorflow-core/tensorflow-core-api/external/tensorflow-grpc-fix-for-gettid.patch
deleted file mode 100644
index 550e2fd6736..00000000000
--- a/tensorflow-core/tensorflow-core-api/external/tensorflow-grpc-fix-for-gettid.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From e50d1fa554154b7e398ef7a0357f646e22cd51cf Mon Sep 17 00:00:00 2001
-From: Jianjun Liu 
-Date: Thu, 29 Aug 2019 14:56:13 +0800
-Subject: [PATCH] Add grpc fix for gettid
-
-Add gettid fix on gettid conflict because of glibc
-
-Signed-off-by: Jianjun Liu 
----
- tensorflow/workspace.bzl                  |  1 +
- third_party/Rename-gettid-functions.patch | 78 +++++++++++++++++++++++
- 2 files changed, 79 insertions(+)
- create mode 100644 third_party/Rename-gettid-functions.patch
-
-diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
-index 55d7eb93..33e86087 100755
---- a/tensorflow/workspace.bzl
-+++ b/tensorflow/workspace.bzl
-@@ -486,6 +486,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
-     # WARNING: make sure ncteisen@ and vpai@ are cc-ed on any CL to change the below rule
-     tf_http_archive(
-         name = "grpc",
-+	patch_file = clean_dep("//third_party:Rename-gettid-functions.patch"),
-         sha256 = "67a6c26db56f345f7cee846e681db2c23f919eba46dd639b09462d1b6203d28c",
-         strip_prefix = "grpc-4566c2a29ebec0835643b972eb99f4306c4234a3",
-         system_build_file = clean_dep("//third_party/systemlibs:grpc.BUILD"),
-diff --git a/third_party/Rename-gettid-functions.patch b/third_party/Rename-gettid-functions.patch
-new file mode 100644
-index 00000000..90bd9115
---- /dev/null
-+++ b/third_party/Rename-gettid-functions.patch
-@@ -0,0 +1,78 @@
-+From d1d017390b799c59d6fdf7b8afa6136d218bdd61 Mon Sep 17 00:00:00 2001
-+From: Benjamin Peterson 
-+Date: Fri, 3 May 2019 08:11:00 -0700
-+Subject: [PATCH] Rename gettid() functions.
-+
-+glibc 2.30 will declare its own gettid; see https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92. Rename the grpc versions to avoid naming conflicts.
-+---
-+ src/core/lib/gpr/log_linux.cc          | 4 ++--
-+ src/core/lib/gpr/log_posix.cc          | 4 ++--
-+ src/core/lib/iomgr/ev_epollex_linux.cc | 4 ++--
-+ 3 files changed, 6 insertions(+), 6 deletions(-)
-+
-+diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
-+index 561276f0c20..8b597b4cf2f 100644
-+--- a/src/core/lib/gpr/log_linux.cc
-++++ b/src/core/lib/gpr/log_linux.cc
-+@@ -40,7 +40,7 @@
-+ #include 
-+ #include 
-+ 
-+-static long gettid(void) { return syscall(__NR_gettid); }
-++static long sys_gettid(void) { return syscall(__NR_gettid); }
-+ 
-+ void gpr_log(const char* file, int line, gpr_log_severity severity,
-+              const char* format, ...) {
-+@@ -70,7 +70,7 @@ void gpr_default_log(gpr_log_func_args* args) {
-+   gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
-+   struct tm tm;
-+   static __thread long tid = 0;
-+-  if (tid == 0) tid = gettid();
-++  if (tid == 0) tid = sys_gettid();
-+ 
-+   timer = static_cast(now.tv_sec);
-+   final_slash = strrchr(args->file, '/');
-+diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc
-+index b6edc14ab6b..2f7c6ce3760 100644
-+--- a/src/core/lib/gpr/log_posix.cc
-++++ b/src/core/lib/gpr/log_posix.cc
-+@@ -31,7 +31,7 @@
-+ #include 
-+ #include 
-+ 
-+-static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
-++static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
-+ 
-+ void gpr_log(const char* file, int line, gpr_log_severity severity,
-+              const char* format, ...) {
-+@@ -86,7 +86,7 @@ void gpr_default_log(gpr_log_func_args* args) {
-+   char* prefix;
-+   gpr_asprintf(&prefix, "%s%s.%09d %7" PRIdPTR " %s:%d]",
-+                gpr_log_severity_string(args->severity), time_buffer,
-+-               (int)(now.tv_nsec), gettid(), display_file, args->line);
-++               (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
-+ 
-+   fprintf(stderr, "%-70s %s\n", prefix, args->message);
-+   gpr_free(prefix);
-+diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
-+index 08116b3ab53..76f59844312 100644
-+--- a/src/core/lib/iomgr/ev_epollex_linux.cc
-++++ b/src/core/lib/iomgr/ev_epollex_linux.cc
-+@@ -1102,7 +1102,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
-+ }
-+ 
-+ #ifndef NDEBUG
-+-static long gettid(void) { return syscall(__NR_gettid); }
-++static long sys_gettid(void) { return syscall(__NR_gettid); }
-+ #endif
-+ 
-+ /* pollset->mu lock must be held by the caller before calling this.
-+@@ -1122,7 +1122,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
-+ #define WORKER_PTR (&worker)
-+ #endif
-+ #ifndef NDEBUG
-+-  WORKER_PTR->originator = gettid();
-++  WORKER_PTR->originator = sys_gettid();
-+ #endif
-+   if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
-+     gpr_log(GPR_INFO,
--- 
-2.22.0
\ 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 15ed9c9bd56..a4cd84dcf20 100644
--- a/tensorflow-core/tensorflow-core-api/pom.xml
+++ b/tensorflow-core/tensorflow-core-api/pom.xml
@@ -6,34 +6,46 @@
   
     org.tensorflow
     tensorflow-core
-    0.1.0-SNAPSHOT
+    1.2.0-SNAPSHOT
   
   tensorflow-core-api
   jar
 
-  TensorFlow Core API Library
+  TensorFlow API
   Platform-dependent native code and pure-Java code for the TensorFlow machine intelligence library.
 
+  
+    1.1.5
+    false
+    ${project.build.directory}/tf-text-download/
+  
+
   
     
-      org.bytedeco
-      javacpp
-      ${javacpp.version}
+      org.tensorflow
+      tensorflow-ndarray
+      ${project.version}
     
     
       org.tensorflow
-      tensorflow-core-generator
+      tensorflow-core-native
       ${project.version}
-      true 
     
     
       org.tensorflow
-      tensorflow-tools
+      tensorflow-core-native
       ${project.version}
+      ${native.classifier}
+      test
+    
+    
+      org.junit.jupiter
+      junit-jupiter-api
+      test
     
     
-      junit
-      junit
+      org.junit.jupiter
+      junit-jupiter-engine
       test
     
     
@@ -41,6 +53,12 @@
       jmh-core
       test
     
+    
+      com.google.truth
+      truth
+      ${truth.version}
+      test
+    
     
       org.openjdk.jmh
       jmh-generator-annprocess
@@ -48,19 +66,131 @@
     
   
 
+  
+    
+      
+      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
+                    
+                  
+                
+              
+            
+          
+        
+      
+    
+  
+
   
     
       
         org.codehaus.mojo
         build-helper-maven-plugin
-        3.0.0
+        3.4.0
         
-          
           
+            
             add-gen-sources
             generate-sources
             
@@ -69,278 +199,55 @@
             
               
                 ${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
-              
-              
-              ${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
-            
-          
-        
-      
-      
-        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
-        
-          
-          
-            -Djava.library.path=${project.build.directory}/native/org/tensorflow/internal/c_api/${native.classifier}
-          
-          ${project.build.directory}/native/
-        
-      
-      
-        maven-source-plugin
-        3.0.1
-        
-          
-            attach-sources
-            leave-disabled-to-not-generate-sources-twice-on-release
-          
-          
-            attach-source
-            
-              jar-no-fork
-            
-          
-        
-      
-      
-        maven-javadoc-plugin
-        3.0.1
-        
-          
-            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/api/api_def_Batch.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_Batch.pbtxt
new file mode 100644
index 00000000000..0204a66e576
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_Batch.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "Batch"
+  visibility: VISIBLE
+}
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/api/api_def_BatchDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchDatasetV2.pbtxt
new file mode 100644
index 00000000000..4fb0ad6f29c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_BatchDatasetV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "BatchDatasetV2"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.BatchDataset"
+  }
+}
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/api/api_def_CheckNumerics.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckNumerics.pbtxt
new file mode 100644
index 00000000000..7bf14dcba10
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_CheckNumerics.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "CheckNumerics"
+  visibility: SKIP
+}
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/api/api_def_ConcatenateDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatenateDataset.pbtxt
new file mode 100644
index 00000000000..d4878f5925b
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ConcatenateDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "ConcatenateDataset"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.ConcatenateDataset"
+  }
+}
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/api/api_def_DebugGradientIdentity.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugGradientIdentity.pbtxt
new file mode 100644
index 00000000000..1729c4a1508
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugGradientIdentity.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "DebugGradientIdentity"
+  endpoint {
+    name: "debugging.DebugGradientIdentity"
+  }
+  visibility: HIDDEN
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugGradientRefIdentity.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugGradientRefIdentity.pbtxt
new file mode 100644
index 00000000000..e892bcefc17
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugGradientRefIdentity.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "DebugGradientRefIdentity"
+  endpoint {
+    name: "debugging.DebugGradientRefIdentity"
+  }
+  visibility: HIDDEN
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentity.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentity.pbtxt
new file mode 100644
index 00000000000..e1d6b305f0f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugIdentity.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "DebugIdentity"
+  visibility: SKIP
+}
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/api/api_def_DebugNanCount.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNanCount.pbtxt
new file mode 100644
index 00000000000..5012ee1e355
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNanCount.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "DebugNanCount"
+  endpoint {
+    name: "debugging.DebugNanCount"
+  }
+  visibility: HIDDEN
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummary.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummary.pbtxt
new file mode 100644
index 00000000000..8a5c173e170
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummary.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "DebugNumericSummary"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummaryV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummaryV2.pbtxt
new file mode 100644
index 00000000000..dd70cac6e61
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DebugNumericSummaryV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "DebugNumericSummaryV2"
+  endpoint {
+    name: "debugging.DebugNumericsSummary"
+  }
+  visibility: HIDDEN
+}
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/api/api_def_DeleteIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteIterator.pbtxt
new file mode 100644
index 00000000000..9a612e9ad6c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_DeleteIterator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "DeleteIterator"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.DeleteIterator"
+  }
+}
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/api/api_def_ExtractGlimpse.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractGlimpse.pbtxt
new file mode 100644
index 00000000000..b44183c1178
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ExtractGlimpse.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "ExtractGlimpse"
+  visibility: SKIP
+}
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/api/api_def_FilterDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FilterDataset.pbtxt
new file mode 100644
index 00000000000..c8e587eeedd
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FilterDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "FilterDataset"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.FilterDataset"
+  }
+}
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/api/api_def_FlatMapDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_FlatMapDataset.pbtxt
new file mode 100644
index 00000000000..54b443d247c
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_FlatMapDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "FlatMapDataset"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.FlatMapDataset"
+  }
+}
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/api/api_def_InterleaveDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_InterleaveDataset.pbtxt
new file mode 100644
index 00000000000..dcc02c855ed
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_InterleaveDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "InterleaveDataset"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.InterleaveDataset"
+  }
+}
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/api/api_def_IteratorGetNext.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNext.pbtxt
new file mode 100644
index 00000000000..b0c4c39a0f9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorGetNext.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "IteratorGetNext"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.IteratorGetNext"
+  }
+}
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/api/api_def_IteratorV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorV2.pbtxt
new file mode 100644
index 00000000000..841bbba687f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_IteratorV2.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "IteratorV2"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.Iterator"
+  }
+}
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/api/api_def_LeakyRelu.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LeakyRelu.pbtxt
new file mode 100644
index 00000000000..3573bff4fa8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LeakyRelu.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "LeakyRelu"
+  visibility: VISIBLE
+  endpoint {
+    name: "nn.LeakyRelu"
+  }
+}
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/api/api_def_LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
new file mode 100644
index 00000000000..2656c561bbb
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
@@ -0,0 +1,7 @@
+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/api/api_def_LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
new file mode 100644
index 00000000000..e6dae92e1f2
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
@@ -0,0 +1,7 @@
+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/api/api_def_MakeIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MakeIterator.pbtxt
new file mode 100644
index 00000000000..cdcae8e5f69
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MakeIterator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "MakeIterator"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.MakeIterator"
+  }
+}
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/api/api_def_MapDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapDataset.pbtxt
new file mode 100644
index 00000000000..11cba7c2c0e
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MapDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "MapDataset"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.MapDataset"
+  }
+}
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/api/api_def_MatrixSetDiagV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSetDiagV2.pbtxt
new file mode 100644
index 00000000000..c6fbcfc235d
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_MatrixSetDiagV2.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "MatrixSetDiagV2"
+  visibility: SKIP
+}
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/api/api_def_OneShotIterator.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_OneShotIterator.pbtxt
new file mode 100644
index 00000000000..18ee5a8cff8
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_OneShotIterator.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "OneShotIterator"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.OneShotIterator"
+  }
+}
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/api/api_def_ParallelInterleaveDatasetV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV2.pbtxt
new file mode 100644
index 00000000000..349769a43cf
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV2.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "ParallelInterleaveDatasetV2"
+  visibility: SKIP
+}
diff --git a/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV3.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV3.pbtxt
new file mode 100644
index 00000000000..b0f3e0f0f62
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelInterleaveDatasetV3.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "ParallelInterleaveDatasetV3"
+  visibility: SKIP
+}
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/api/api_def_ParallelMapDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelMapDataset.pbtxt
new file mode 100644
index 00000000000..64f25b9e5e9
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParallelMapDataset.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "ParallelMapDataset"
+  visibility: SKIP
+}
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/api/api_def_ParseExample.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExample.pbtxt
new file mode 100644
index 00000000000..9b531803889
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_ParseExample.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "ParseExample"
+  visibility: SKIP
+}
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/api/api_def_QuantizedConcatV2.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConcatV2.pbtxt
new file mode 100644
index 00000000000..b88e8e1a96f
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_QuantizedConcatV2.pbtxt
@@ -0,0 +1,4 @@
+op {
+  graph_op_name: "QuantizedConcatV2"
+  visibility: SKIP
+}
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/api/api_def_RangeDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RangeDataset.pbtxt
new file mode 100644
index 00000000000..e4a9af7ea97
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RangeDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "RangeDataset"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.RangeDataset"
+  }
+}
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/api/api_def_RepeatDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RepeatDataset.pbtxt
new file mode 100644
index 00000000000..b64988dd378
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RepeatDataset.pbtxt
@@ -0,0 +1,7 @@
+op {
+  graph_op_name: "RepeatDataset"
+  visibility: VISIBLE
+  endpoint {
+    name: "data.RepeatDataset"
+  }
+}
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/api/api_def_RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
new file mode 100644
index 00000000000..26a810e8794
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.pbtxt
@@ -0,0 +1,7 @@
+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/api/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
new file mode 100644
index 00000000000..71758e43589
--- /dev/null
+++ b/tensorflow-core/tensorflow-core-api/src/api/api_def_RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.pbtxt
@@ -0,0 +1,7 @@
+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: <
 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 63191c080ac..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.cc +++ /dev/null @@ -1,363 +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::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 73f487bb46c..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/source_writer.h +++ /dev/null @@ -1,259 +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); - - 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/gen/annotations/org/tensorflow/op/AudioOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/AudioOps.java index 2ca43fc8c19..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,41 +29,39 @@ /** * 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; - AudioOps(Scope scope) { - this.scope = scope; + private final Ops ops; + + AudioOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; } /** * 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 + * 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. * @@ -71,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, @@ -81,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) { @@ -107,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 */ @@ -126,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 @@ -137,11 +128,18 @@ 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, Mfcc.Options... options) { return Mfcc.create(scope, spectrogram, sampleRate, 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/BitwiseOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/BitwiseOps.java index 8ac6d565e51..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,23 +29,24 @@ /** * 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; - BitwiseOps(Scope scope) { - this.scope = scope; + private final Ops ops; + + BitwiseOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; } /** - * 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,
@@ -58,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) { @@ -70,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,
@@ -89,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) { @@ -101,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,
@@ -120,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) { @@ -132,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
    *
@@ -172,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) { @@ -183,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
@@ -212,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) { @@ -225,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
@@ -257,15 +247,22 @@ 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) { return RightShift.create(scope, x, y); } + + /** + * 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/ClusterOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ClusterOps.java new file mode 100644 index 00000000000..e59e86f23ed --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ClusterOps.java @@ -0,0 +1,85 @@ +// Copyright 2020-2022 The TensorFlow Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================== +// +// This class has been generated, DO NOT EDIT! +// +package org.tensorflow.op; + +import org.tensorflow.Operand; +import org.tensorflow.op.cluster.KMC2ChainInitialization; +import org.tensorflow.op.cluster.KmeansPlusPlusInitialization; +import org.tensorflow.types.TFloat32; +import org.tensorflow.types.TInt64; + +/** + * An API for building {@code cluster} operations as {@link Op Op}s + * + * @see Ops + */ +public final class ClusterOps { + private final Scope scope; + + private final Ops ops; + + ClusterOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Returns the index of a data point that should be added to the seed set. + * Entries in distances are assumed to be squared distances of candidate points to + * the already sampled centers in the seed set. The op constructs one Markov chain + * of the k-MC^2 algorithm and returns the index of one candidate point to be added + * as an additional cluster center. + * + * @param distances Vector with squared distances to the closest previously sampled cluster center + * for each candidate point. + * @param seed Scalar. Seed for initializing the random number generator. + * @return a new instance of KMC2ChainInitialization + */ + public KMC2ChainInitialization kMC2ChainInitialization(Operand distances, + Operand seed) { + return KMC2ChainInitialization.create(scope, distances, seed); + } + + /** + * Selects num_to_sample rows of input using the KMeans++ criterion. + * Rows of points are assumed to be input points. One row is selected at random. + * Subsequent rows are sampled with probability proportional to the squared L2 + * distance from the nearest row selected thus far till num_to_sample rows have + * been sampled. + * + * @param points Matrix of shape (n, d). Rows are assumed to be input points. + * @param numToSample Scalar. The number of rows to sample. This value must not be larger than n. + * @param seed Scalar. Seed for initializing the random number generator. + * @param numRetriesPerSample Scalar. For each row that is sampled, this parameter + * specifies the number of additional points to draw from the current + * distribution before selecting the best. If a negative value is specified, a + * heuristic is used to sample O(log(num_to_sample)) additional points. + * @return a new instance of KmeansPlusPlusInitialization + */ + public KmeansPlusPlusInitialization kmeansPlusPlusInitialization(Operand points, + Operand numToSample, Operand seed, Operand numRetriesPerSample) { + return KmeansPlusPlusInitialization.create(scope, points, numToSample, seed, numRetriesPerSample); + } + + /** + * Get the parent {@link Ops} object. + */ + public final Ops ops() { + return ops; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/CollectiveOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/CollectiveOps.java new file mode 100644 index 00000000000..de786dc95fe --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/CollectiveOps.java @@ -0,0 +1,214 @@ +// Copyright 2020-2022 The TensorFlow Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================== +// +// This class has been generated, DO NOT EDIT! +// +package org.tensorflow.op; + +import org.tensorflow.Operand; +import org.tensorflow.op.collective.CollectiveAllToAll; +import org.tensorflow.op.collective.CollectiveAssignGroup; +import org.tensorflow.op.collective.CollectiveBcastRecv; +import org.tensorflow.op.collective.CollectiveBcastSend; +import org.tensorflow.op.collective.CollectiveGather; +import org.tensorflow.op.collective.CollectiveInitializeCommunicator; +import org.tensorflow.op.collective.CollectivePermute; +import org.tensorflow.op.collective.CollectiveReduce; +import org.tensorflow.op.collective.CollectiveReduceScatter; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; + +/** + * An API for building {@code collective} operations as {@link Op Op}s + * + * @see Ops + */ +public final class CollectiveOps { + private final Scope scope; + + private final Ops ops; + + CollectiveOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Mutually exchanges multiple tensors of identical type and shape. + * + * @param input The input value + * @param communicator The communicator value + * @param groupAssignment The groupAssignment value + * @param options carries optional attribute values + * @param data type for {@code CollectiveAllToAllV3} output and operands + * @return a new instance of CollectiveAllToAll + */ + public CollectiveAllToAll collectiveAllToAll(Operand input, + Operand communicator, Operand groupAssignment, + CollectiveAllToAll.Options... options) { + return CollectiveAllToAll.create(scope, input, communicator, groupAssignment, options); + } + + /** + * Assign group keys based on group assignment. + * + * @param groupAssignment The groupAssignment value + * @param deviceIndex The deviceIndex value + * @param baseKey The baseKey value + * @return a new instance of CollectiveAssignGroup + */ + public CollectiveAssignGroup collectiveAssignGroup(Operand groupAssignment, + Operand deviceIndex, Operand baseKey) { + return CollectiveAssignGroup.create(scope, groupAssignment, deviceIndex, baseKey); + } + + /** + * Receives a tensor value broadcast from another device. + * + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param shape The shape value + * @param T The value of the T attribute + * @param options carries optional attribute values + * @param data type for {@code CollectiveBcastRecvV2} output and operands + * @return a new instance of CollectiveBcastRecv + */ + public CollectiveBcastRecv collectiveBcastRecv(Operand groupSize, + Operand groupKey, Operand instanceKey, Operand shape, + Class T, CollectiveBcastRecv.Options... options) { + return CollectiveBcastRecv.create(scope, groupSize, groupKey, instanceKey, shape, T, options); + } + + /** + * Broadcasts a tensor value to one or more other devices. + * + * @param input The input value + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param options carries optional attribute values + * @param data type for {@code CollectiveBcastSendV2} output and operands + * @return a new instance of CollectiveBcastSend + */ + public CollectiveBcastSend collectiveBcastSend(Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + CollectiveBcastSend.Options... options) { + return CollectiveBcastSend.create(scope, input, groupSize, groupKey, instanceKey, options); + } + + /** + * Mutually accumulates multiple tensors of identical type and shape. + * {@code is_stateless} means each op does not need control dependencies to other + * collective ops. In this case, keys that are unique at runtime + * (e.g. {@code instance_key}) should be used to distinguish collective groups. + * + * @param input The input value + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param orderingToken The orderingToken value + * @param options carries optional attribute values + * @param data type for {@code CollectiveGatherV2} output and operands + * @return a new instance of CollectiveGather + */ + public CollectiveGather collectiveGather(Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + Iterable> orderingToken, CollectiveGather.Options... options) { + return CollectiveGather.create(scope, input, groupSize, groupKey, instanceKey, orderingToken, options); + } + + /** + * Initializes a group for collective operations. + * + * @param groupKey The groupKey value + * @param rank The rank value + * @param groupSize The groupSize value + * @param options carries optional attribute values + * @return a new instance of CollectiveInitializeCommunicator + */ + public CollectiveInitializeCommunicator collectiveInitializeCommunicator(Operand groupKey, + Operand rank, Operand groupSize, + CollectiveInitializeCommunicator.Options... options) { + return CollectiveInitializeCommunicator.create(scope, groupKey, rank, groupSize, options); + } + + /** + * An Op to permute tensors across replicated TPU instances. + * Each instance supplies its own input. + *

For example, suppose there are 4 TPU instances: {@code [A, B, C, D]}. Passing + * source_target_pairs={@code [[0,1],[1,2],[2,3],[3,0]]} gets the outputs: + * {@code [D, A, B, C]}. + * + * @param input The local input to be permuted. Currently only supports float and + * bfloat16. + * @param sourceTargetPairs A tensor with shape [num_pairs, 2]. + * @param data type for {@code CollectivePermute} output and operands + * @return a new instance of CollectivePermute + */ + public CollectivePermute collectivePermute(Operand input, + Operand sourceTargetPairs) { + return CollectivePermute.create(scope, input, sourceTargetPairs); + } + + /** + * Mutually reduces multiple tensors of identical type and shape. + * + * @param input The input value + * @param communicator The communicator value + * @param groupAssignment The groupAssignment value + * @param reduction The value of the reduction attribute + * @param options carries optional attribute values + * @param data type for {@code CollectiveReduceV3} output and operands + * @return a new instance of CollectiveReduce + */ + public CollectiveReduce collectiveReduce(Operand input, + Operand communicator, Operand groupAssignment, String reduction, + CollectiveReduce.Options... options) { + return CollectiveReduce.create(scope, input, communicator, groupAssignment, reduction, options); + } + + /** + * Mutually reduces multiple tensors of identical type and shape and scatters the result. + * {@code is_stateless} means each op does not need control dependencies to other + * collective ops. In this case, keys that are unique at runtime + * (e.g. {@code instance_key}) should be used to distinguish collective groups. + * + * @param input The input value + * @param groupSize The groupSize value + * @param groupKey The groupKey value + * @param instanceKey The instanceKey value + * @param orderingToken The orderingToken value + * @param mergeOp The value of the mergeOp attribute + * @param finalOp The value of the finalOp attribute + * @param options carries optional attribute values + * @param data type for {@code CollectiveReduceScatterV2} output and operands + * @return a new instance of CollectiveReduceScatter + */ + public CollectiveReduceScatter collectiveReduceScatter(Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + Iterable> orderingToken, String mergeOp, String finalOp, + CollectiveReduceScatter.Options... options) { + return CollectiveReduceScatter.create(scope, input, groupSize, groupKey, instanceKey, orderingToken, mergeOp, finalOp, options); + } + + /** + * Get the parent {@link Ops} object. + */ + public final Ops ops() { + return ops; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataExperimentalOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataExperimentalOps.java new file mode 100644 index 00000000000..b5b1ee3750f --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataExperimentalOps.java @@ -0,0 +1,737 @@ +// Copyright 2020-2022 The TensorFlow Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================== +// +// This class has been generated, DO NOT EDIT! +// +package org.tensorflow.op; + +import java.util.List; +import org.tensorflow.ConcreteFunction; +import org.tensorflow.Operand; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.data.experimental.AssertNextDataset; +import org.tensorflow.op.data.experimental.AutoShardDataset; +import org.tensorflow.op.data.experimental.BytesProducedStatsDataset; +import org.tensorflow.op.data.experimental.CSVDataset; +import org.tensorflow.op.data.experimental.ChooseFastestDataset; +import org.tensorflow.op.data.experimental.DatasetCardinality; +import org.tensorflow.op.data.experimental.DatasetToTFRecord; +import org.tensorflow.op.data.experimental.DenseToSparseBatchDataset; +import org.tensorflow.op.data.experimental.DirectedInterleaveDataset; +import org.tensorflow.op.data.experimental.GroupByReducerDataset; +import org.tensorflow.op.data.experimental.GroupByWindowDataset; +import org.tensorflow.op.data.experimental.IgnoreErrorsDataset; +import org.tensorflow.op.data.experimental.IteratorGetDevice; +import org.tensorflow.op.data.experimental.LatencyStatsDataset; +import org.tensorflow.op.data.experimental.LmdbDataset; +import org.tensorflow.op.data.experimental.MapAndBatchDataset; +import org.tensorflow.op.data.experimental.MapDataset; +import org.tensorflow.op.data.experimental.MatchingFilesDataset; +import org.tensorflow.op.data.experimental.MaxIntraOpParallelismDataset; +import org.tensorflow.op.data.experimental.NonSerializableDataset; +import org.tensorflow.op.data.experimental.ParallelInterleaveDataset; +import org.tensorflow.op.data.experimental.ParseExampleDataset; +import org.tensorflow.op.data.experimental.PrivateThreadPoolDataset; +import org.tensorflow.op.data.experimental.RandomDataset; +import org.tensorflow.op.data.experimental.RebatchDataset; +import org.tensorflow.op.data.experimental.ScanDataset; +import org.tensorflow.op.data.experimental.SetStatsAggregatorDataset; +import org.tensorflow.op.data.experimental.SleepDataset; +import org.tensorflow.op.data.experimental.SlidingWindowDataset; +import org.tensorflow.op.data.experimental.SqlDataset; +import org.tensorflow.op.data.experimental.StatsAggregatorHandle; +import org.tensorflow.op.data.experimental.StatsAggregatorSummary; +import org.tensorflow.op.data.experimental.TakeWhileDataset; +import org.tensorflow.op.data.experimental.ThreadPoolDataset; +import org.tensorflow.op.data.experimental.ThreadPoolHandle; +import org.tensorflow.op.data.experimental.UnbatchDataset; +import org.tensorflow.op.data.experimental.UniqueDataset; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; + +/** + * An API for building {@code data.experimental} operations as {@link Op Op}s + * + * @see Ops + */ +public final class DataExperimentalOps { + private final Scope scope; + + private final Ops ops; + + DataExperimentalOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * The ExperimentalAssertNextDataset operation + * + * @param inputDataset The inputDataset value + * @param transformations The transformations value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of AssertNextDataset + */ + public AssertNextDataset assertNextDataset(Operand inputDataset, + Operand transformations, List> outputTypes, + List outputShapes) { + return AssertNextDataset.create(scope, inputDataset, transformations, outputTypes, outputShapes); + } + + /** + * Creates a dataset that shards the input dataset. + * Creates a dataset that shards the input dataset by num_workers, returning a + * sharded dataset for the index-th worker. This attempts to automatically shard + * a dataset by examining the Dataset graph and inserting a shard op before the + * inputs to a reader Dataset (e.g. CSVDataset, TFRecordDataset). + *

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

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

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

    + *
  • One tensor for each component of an element of {@code input_dataset}.
  • + *
  • One tensor for each value in {@code other_arguments}.
  • + *
+ * + * @param inputDataset The inputDataset value + * @param otherArguments A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + * @param predicate A function returning a scalar boolean. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of TakeWhileDataset + */ + public TakeWhileDataset takeWhileDataset(Operand inputDataset, + Iterable> otherArguments, ConcreteFunction predicate, + List> outputTypes, List outputShapes) { + return TakeWhileDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes); + } + + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param threadPool A resource produced by the ThreadPoolHandle op. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ThreadPoolDataset + */ + public ThreadPoolDataset threadPoolDataset(Operand inputDataset, + Operand threadPool, List> outputTypes, + List outputShapes) { + return ThreadPoolDataset.create(scope, inputDataset, threadPool, outputTypes, outputShapes); + } + + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param numThreads The number of threads in the thread pool. + * @param displayName A human-readable name for the threads that may be visible in some + * visualizations. + * @param options carries optional attribute values + * @return a new instance of ThreadPoolHandle + */ + public ThreadPoolHandle threadPoolHandle(Long numThreads, String displayName, + ThreadPoolHandle.Options... options) { + return ThreadPoolHandle.create(scope, numThreads, displayName, options); + } + + /** + * A dataset that splits the elements of its input into multiple elements. + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of UnbatchDataset + */ + public UnbatchDataset unbatchDataset(Operand inputDataset, + List> outputTypes, List outputShapes) { + return UnbatchDataset.create(scope, inputDataset, outputTypes, outputShapes); + } + + /** + * Creates a dataset that contains the unique elements of {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of UniqueDataset + */ + public UniqueDataset uniqueDataset(Operand inputDataset, + List> outputTypes, List outputShapes) { + return UniqueDataset.create(scope, inputDataset, outputTypes, outputShapes); + } + + /** + * Get the parent {@link Ops} object. + */ + public final Ops ops() { + return ops; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java index 13ef38ef856..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,31 +18,572 @@ 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.tools.Shape; +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; + private final Scope scope; - DataOps(Scope scope) { - this.scope = scope; + private final Ops ops; + + DataOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + experimental = new DataExperimentalOps(ops); + } + + /** + * A container for an iterator resource. + * + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of AnonymousIterator + */ + public AnonymousIterator anonymousIterator(List> outputTypes, + List outputShapes) { + return AnonymousIterator.create(scope, outputTypes, outputShapes); + } + + /** + * The AnonymousMemoryCache operation + * + * @return a new instance of AnonymousMemoryCache + */ + public AnonymousMemoryCache anonymousMemoryCache() { + return AnonymousMemoryCache.create(scope); + } + + /** + * A container for a multi device iterator resource. + * + * @param devices The value of the devices attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of AnonymousMultiDeviceIterator + */ + public AnonymousMultiDeviceIterator anonymousMultiDeviceIterator(List devices, + List> outputTypes, List outputShapes) { + return AnonymousMultiDeviceIterator.create(scope, devices, outputTypes, outputShapes); + } + + /** + * The AssertCardinalityDataset operation + * + * @param inputDataset The inputDataset value + * @param cardinality The cardinality value + * @param outputTypes The value of the outputTypes 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 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) { + 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 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, Operand excludeCols, List outputShapes) { + return CSVDataset.create(scope, filenames, compressionType, bufferSize, header, fieldDelim, useQuoteDelim, naValue, selectCols, recordDefaults, excludeCols, outputShapes); + } + + /** + * The CacheDatasetV2 operation + * + * @param inputDataset The inputDataset value + * @param filename The filename value + * @param cache The cache value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of CacheDataset + */ + public CacheDataset cacheDataset(Operand inputDataset, Operand filename, + Operand cache, List> outputTypes, + List outputShapes, CacheDataset.Options... options) { + return CacheDataset.create(scope, inputDataset, filename, cache, outputTypes, outputShapes, options); + } + + /** + * The ChooseFastestBranchDataset operation + * + * @param inputDataset The inputDataset value + * @param ratioNumerator The ratioNumerator value + * @param ratioDenominator The ratioDenominator value + * @param otherArguments The otherArguments value + * @param numElementsPerBranch The value of the numElementsPerBranch attribute + * @param branches The value of the branches attribute + * @param otherArgumentsLengths The value of the otherArgumentsLengths attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ChooseFastestBranchDataset + */ + public ChooseFastestBranchDataset chooseFastestBranchDataset( + Operand inputDataset, Operand ratioNumerator, + Operand ratioDenominator, Iterable> otherArguments, + Long numElementsPerBranch, List branches, List otherArgumentsLengths, + List> outputTypes, List outputShapes) { + return ChooseFastestBranchDataset.create(scope, inputDataset, ratioNumerator, ratioDenominator, otherArguments, numElementsPerBranch, branches, otherArgumentsLengths, outputTypes, outputShapes); + } + + /** + * The ChooseFastestDataset operation + * + * @param inputDatasets The inputDatasets value + * @param numExperiments The value of the numExperiments attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ChooseFastestDataset + */ + public ChooseFastestDataset chooseFastestDataset(Iterable> inputDatasets, + Long numExperiments, List> outputTypes, List outputShapes) { + return ChooseFastestDataset.create(scope, inputDatasets, numExperiments, outputTypes, outputShapes); + } + + /** + * Compresses a dataset element. + * + * @param components The components value + * @return a new instance of CompressElement + */ + public CompressElement compressElement(Iterable> components) { + return CompressElement.create(scope, components); + } + + /** + * Creates a dataset that concatenates {@code input_dataset} with {@code another_dataset}. + * + * @param inputDataset The inputDataset value + * @param anotherDataset The anotherDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ConcatenateDataset + */ + public ConcatenateDataset concatenateDataset(Operand inputDataset, + Operand anotherDataset, List> outputTypes, + List outputShapes, ConcatenateDataset.Options... options) { + return ConcatenateDataset.create(scope, inputDataset, anotherDataset, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that reads data from the tf.data service. + * + * @param datasetId The datasetId value + * @param processingMode The processingMode value + * @param address The address value + * @param protocol The protocol value + * @param jobName The jobName value + * @param consumerIndex The consumerIndex value + * @param numConsumers The numConsumers value + * @param maxOutstandingRequests The maxOutstandingRequests value + * @param iterationCounter The iterationCounter value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param uncompressFn The value of the uncompressFn attribute + * @param options carries optional attribute values + * @return a new instance of DataServiceDataset + */ + public DataServiceDataset dataServiceDataset(Operand datasetId, + Operand processingMode, Operand address, Operand protocol, + Operand jobName, Operand consumerIndex, Operand numConsumers, + Operand maxOutstandingRequests, Operand iterationCounter, + List> outputTypes, List outputShapes, + ConcreteFunction uncompressFn, DataServiceDataset.Options... options) { + return DataServiceDataset.create(scope, datasetId, processingMode, address, protocol, jobName, consumerIndex, numConsumers, maxOutstandingRequests, iterationCounter, outputTypes, outputShapes, uncompressFn, options); + } + + /** + * Returns the cardinality of {@code input_dataset}. + * Returns the cardinality of {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the dataset to return cardinality for. + * @param options carries optional attribute values + * @return a new instance of DatasetCardinality + */ + public DatasetCardinality datasetCardinality(Operand inputDataset, + DatasetCardinality.Options... options) { + return DatasetCardinality.create(scope, inputDataset, options); + } + + /** + * Returns the fingerprint of {@code input_dataset}. + * Returns the fingerprint of {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the dataset to return fingerprint for. + * @return a new instance of DatasetFingerprint + */ + public DatasetFingerprint datasetFingerprint(Operand inputDataset) { + return DatasetFingerprint.create(scope, inputDataset); + } + + /** + * Creates a dataset from the given {@code graph_def}. + * Creates a dataset from the provided {@code graph_def}. + * + * @param graphDef The graph representation of the dataset (as serialized GraphDef). + * @return a new instance of DatasetFromGraph + */ + public DatasetFromGraph datasetFromGraph(Operand graphDef) { + return DatasetFromGraph.create(scope, graphDef); + } + + /** + * Returns a serialized GraphDef representing {@code input_dataset}. + * Returns a graph representation for {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the dataset to return the graph representation for. + * @param options carries optional attribute values + * @return a new instance of DatasetToGraph + */ + public DatasetToGraph datasetToGraph(Operand inputDataset, + DatasetToGraph.Options... options) { + return DatasetToGraph.create(scope, inputDataset, options); + } + + /** + * Outputs the single element from the given dataset. + * + * @param dataset A handle to a dataset that contains a single element. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of DatasetToSingleElement + */ + public DatasetToSingleElement datasetToSingleElement(Operand dataset, + List> outputTypes, List outputShapes, + DatasetToSingleElement.Options... options) { + return DatasetToSingleElement.create(scope, dataset, outputTypes, outputShapes, options); + } + + /** + * Writes the given dataset to the given file using the TFRecord format. + * + * @param inputDataset A variant tensor representing the dataset to write. + * @param filename A scalar string tensor representing the filename to use. + * @param compressionType A scalar string tensor containing either (i) the empty string (no + * compression), (ii) "ZLIB", or (iii) "GZIP". + * @return a new instance of DatasetToTfRecord + */ + public DatasetToTfRecord datasetToTfRecord(Operand inputDataset, + Operand filename, Operand compressionType) { + return DatasetToTfRecord.create(scope, inputDataset, filename, compressionType); + } + + /** + * 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); } /** @@ -53,127 +594,1777 @@ public final class DataOps { * resource. * @return a new instance of DeserializeIterator */ - public DeserializeIterator deserializeIterator(Operand resourceHandle, Operand serialized) { + public DeserializeIterator deserializeIterator(Operand resourceHandle, + Operand serialized) { return DeserializeIterator.create(scope, resourceHandle, serialized); } + /** + * A substitute for {@code InterleaveDataset} on a fixed list of {@code N} datasets. + * + * @param selectorInputDataset A dataset of scalar {@code DT_INT64} elements that determines which of the + * {@code N} data inputs should produce the next output element. + * @param dataInputDatasets {@code N} datasets with the same type that will be interleaved according to + * the values of {@code selector_input_dataset}. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of DirectedInterleaveDataset + */ + public DirectedInterleaveDataset directedInterleaveDataset( + Operand selectorInputDataset, + Iterable> dataInputDatasets, + List> outputTypes, List outputShapes, + DirectedInterleaveDataset.Options... options) { + return DirectedInterleaveDataset.create(scope, selectorInputDataset, dataInputDatasets, outputTypes, outputShapes, options); + } + + /** + * The DummyIterationCounter operation + * + * @return a new instance of DummyIterationCounter + */ + public DummyIterationCounter dummyIterationCounter() { + return DummyIterationCounter.create(scope); + } + + /** + * Creates a dataset containing elements of first component of {@code input_dataset} having true in the last component. + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of FilterByLastComponentDataset + */ + public FilterByLastComponentDataset filterByLastComponentDataset( + Operand inputDataset, List> outputTypes, + List outputShapes) { + return FilterByLastComponentDataset.create(scope, inputDataset, outputTypes, outputShapes); + } + + /** + * Creates a dataset containing elements of {@code input_dataset} matching {@code predicate}. + * The {@code predicate} function must return a scalar boolean and accept the + * following arguments: + *

    + *
  • One tensor for each component of an element of {@code input_dataset}.
  • + *
  • One tensor for each value in {@code other_arguments}.
  • + *
+ * + * @param inputDataset The inputDataset value + * @param otherArguments A list of tensors, typically values that were captured when + * building a closure for {@code predicate}. + * @param predicate A function returning a scalar boolean. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of FilterDataset + */ + public FilterDataset filterDataset(Operand inputDataset, + Iterable> otherArguments, ConcreteFunction predicate, + List> outputTypes, List outputShapes, + FilterDataset.Options... options) { + return FilterDataset.create(scope, inputDataset, otherArguments, predicate, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset by applying {@code tf.data.Options} to {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the input dataset. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of FinalizeDataset + */ + public FinalizeDataset finalizeDataset(Operand inputDataset, + List> outputTypes, List outputShapes, + FinalizeDataset.Options... options) { + return FinalizeDataset.create(scope, inputDataset, outputTypes, outputShapes, options); + } + + /** + * The FixedLengthRecordDatasetV2 operation + * + * @param filenames The filenames value + * @param headerBytes The headerBytes value + * @param recordBytes The recordBytes value + * @param footerBytes The footerBytes value + * @param bufferSize The bufferSize value + * @param compressionType The compressionType value + * @param options carries optional attribute values + * @return a new instance of FixedLengthRecordDataset + */ + public FixedLengthRecordDataset fixedLengthRecordDataset(Operand filenames, + Operand headerBytes, Operand recordBytes, Operand footerBytes, + Operand bufferSize, Operand compressionType, + FixedLengthRecordDataset.Options... options) { + return FixedLengthRecordDataset.create(scope, filenames, headerBytes, recordBytes, footerBytes, bufferSize, compressionType, options); + } + + /** + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. + * Unlike MapDataset, the {@code f} in FlatMapDataset is expected to return a + * Dataset variant, and FlatMapDataset will flatten successive results + * into a single Dataset. + * + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param f A function mapping elements of {@code input_dataset}, concatenated with + * {@code other_arguments}, to a Dataset variant that contains elements matching + * {@code output_types} and {@code output_shapes}. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of FlatMapDataset + */ + public FlatMapDataset flatMapDataset(Operand inputDataset, + Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, + FlatMapDataset.Options... options) { + return FlatMapDataset.create(scope, inputDataset, otherArguments, f, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that invokes a function to generate elements. + * + * @param initFuncOtherArgs The initFuncOtherArgs value + * @param nextFuncOtherArgs The nextFuncOtherArgs value + * @param finalizeFuncOtherArgs The finalizeFuncOtherArgs value + * @param initFunc The value of the initFunc attribute + * @param nextFunc The value of the nextFunc attribute + * @param finalizeFunc The value of the finalizeFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of GeneratorDataset + */ + public GeneratorDataset generatorDataset(Iterable> initFuncOtherArgs, + Iterable> nextFuncOtherArgs, Iterable> finalizeFuncOtherArgs, + ConcreteFunction initFunc, ConcreteFunction nextFunc, ConcreteFunction finalizeFunc, + List> outputTypes, List outputShapes, + GeneratorDataset.Options... options) { + return GeneratorDataset.create(scope, initFuncOtherArgs, nextFuncOtherArgs, finalizeFuncOtherArgs, initFunc, nextFunc, finalizeFunc, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that computes a group-by on {@code input_dataset}. + * Creates a dataset that computes a group-by on {@code input_dataset}. + * + * @param inputDataset A variant tensor representing the input dataset. + * @param keyFuncOtherArguments A list of tensors, typically values that were captured when + * building a closure for {@code key_func}. + * @param initFuncOtherArguments A list of tensors, typically values that were captured when + * building a closure for {@code init_func}. + * @param reduceFuncOtherArguments A list of tensors, typically values that were captured when + * building a closure for {@code reduce_func}. + * @param finalizeFuncOtherArguments A list of tensors, typically values that were captured when + * building a closure for {@code finalize_func}. + * @param keyFunc A function mapping an element of {@code input_dataset}, concatenated + * with {@code key_func_other_arguments} to a scalar value of type DT_INT64. + * @param initFunc A function mapping a key of type DT_INT64, concatenated with + * {@code init_func_other_arguments} to the initial reducer state. + * @param reduceFunc A function mapping the current reducer state and an element of {@code input_dataset}, + * concatenated with {@code reduce_func_other_arguments} to a new reducer state. + * @param finalizeFunc A function mapping the final reducer state to an output element. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of GroupByReducerDataset + */ + public GroupByReducerDataset groupByReducerDataset(Operand inputDataset, + Iterable> keyFuncOtherArguments, Iterable> initFuncOtherArguments, + Iterable> reduceFuncOtherArguments, + Iterable> finalizeFuncOtherArguments, ConcreteFunction keyFunc, + ConcreteFunction initFunc, ConcreteFunction reduceFunc, ConcreteFunction finalizeFunc, + List> outputTypes, List outputShapes) { + return GroupByReducerDataset.create(scope, inputDataset, keyFuncOtherArguments, initFuncOtherArguments, reduceFuncOtherArguments, finalizeFuncOtherArguments, keyFunc, initFunc, reduceFunc, finalizeFunc, outputTypes, outputShapes); + } + + /** + * Creates a dataset that computes a windowed group-by on {@code input_dataset}. + * // TODO(mrry): Support non-int64 keys. + * + * @param inputDataset The inputDataset value + * @param keyFuncOtherArguments The keyFuncOtherArguments value + * @param reduceFuncOtherArguments The reduceFuncOtherArguments value + * @param windowSizeFuncOtherArguments The windowSizeFuncOtherArguments value + * @param keyFunc A function mapping an element of {@code input_dataset}, concatenated + * with {@code key_func_other_arguments} to a scalar value of type DT_INT64. + * @param reduceFunc The value of the reduceFunc attribute + * @param windowSizeFunc The value of the windowSizeFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of GroupByWindowDataset + */ + public GroupByWindowDataset groupByWindowDataset(Operand inputDataset, + Iterable> keyFuncOtherArguments, Iterable> reduceFuncOtherArguments, + Iterable> windowSizeFuncOtherArguments, ConcreteFunction keyFunc, + ConcreteFunction reduceFunc, ConcreteFunction windowSizeFunc, + List> outputTypes, List outputShapes, + GroupByWindowDataset.Options... options) { + return GroupByWindowDataset.create(scope, inputDataset, keyFuncOtherArguments, reduceFuncOtherArguments, windowSizeFuncOtherArguments, keyFunc, reduceFunc, windowSizeFunc, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that contains the elements of {@code input_dataset} ignoring errors. + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of IgnoreErrorsDataset + */ + public IgnoreErrorsDataset ignoreErrorsDataset(Operand inputDataset, + List> outputTypes, List outputShapes, + IgnoreErrorsDataset.Options... options) { + return IgnoreErrorsDataset.create(scope, inputDataset, outputTypes, outputShapes, options); + } + + /** + * The IndexFlatMapDataset operation + * + * @param inputDataset The inputDataset value + * @param mapFuncOtherArgs The mapFuncOtherArgs value + * @param indexMapFuncOtherArgs The indexMapFuncOtherArgs value + * @param outputCardinality The outputCardinality value + * @param mapFunc The value of the mapFunc attribute + * @param indexMapFunc The value of the indexMapFunc attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of IndexFlatMapDataset + */ + public IndexFlatMapDataset indexFlatMapDataset(Operand inputDataset, + Iterable> mapFuncOtherArgs, Iterable> indexMapFuncOtherArgs, + Operand outputCardinality, ConcreteFunction mapFunc, ConcreteFunction indexMapFunc, + List> outputTypes, List outputShapes, + IndexFlatMapDataset.Options... options) { + return IndexFlatMapDataset.create(scope, inputDataset, mapFuncOtherArgs, indexMapFuncOtherArgs, outputCardinality, mapFunc, indexMapFunc, outputTypes, outputShapes, options); + } + + /** + * The InitializeTableFromDataset operation + * + * @param tableHandle The tableHandle value + * @param dataset The dataset value + * @return a new instance of InitializeTableFromDataset + */ + public InitializeTableFromDataset initializeTableFromDataset(Operand tableHandle, + Operand dataset) { + return InitializeTableFromDataset.create(scope, tableHandle, dataset); + } + + /** + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. + * Unlike MapDataset, the {@code f} in InterleaveDataset is expected to return + * a Dataset variant, and InterleaveDataset will flatten successive + * results into a single Dataset. Unlike FlatMapDataset, + * InterleaveDataset will interleave sequences of up to {@code block_length} + * consecutive elements from {@code cycle_length} input elements. + * + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param cycleLength The cycleLength value + * @param blockLength The blockLength value + * @param f A function mapping elements of {@code input_dataset}, concatenated with + * {@code other_arguments}, to a Dataset variant that contains elements matching + * {@code output_types} and {@code output_shapes}. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of InterleaveDataset + */ + public InterleaveDataset interleaveDataset(Operand inputDataset, + Iterable> otherArguments, Operand cycleLength, Operand blockLength, + ConcreteFunction f, List> outputTypes, List outputShapes, + InterleaveDataset.Options... options) { + return InterleaveDataset.create(scope, inputDataset, otherArguments, cycleLength, blockLength, f, outputTypes, outputShapes, options); + } + + /** + * The IteratorV2 operation + * + * @param sharedName The value of the sharedName attribute + * @param container The value of the container attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of Iterator + */ + public Iterator iterator(String sharedName, String container, + List> outputTypes, List outputShapes) { + return Iterator.create(scope, sharedName, container, outputTypes, outputShapes); + } + + /** + * The IteratorFromStringHandleV2 operation + * + * @param stringHandle The stringHandle value + * @param outputTypes The value of the outputTypes attribute + * @param options carries optional attribute values + * @return a new instance of IteratorFromStringHandle + */ + public IteratorFromStringHandle iteratorFromStringHandle(Operand stringHandle, + List> outputTypes, IteratorFromStringHandle.Options... options) { + return IteratorFromStringHandle.create(scope, stringHandle, outputTypes, options); + } + + /** + * Returns the name of the device on which {@code resource} has been placed. + * + * @param resource The resource value + * @return a new instance of IteratorGetDevice + */ + public IteratorGetDevice iteratorGetDevice(Operand resource) { + return IteratorGetDevice.create(scope, resource); + } + /** * Gets the next output from the given iterator . * - * @param iterator - * @param outputTypes - * @param outputShapes + * @param iterator The iterator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of IteratorGetNext */ - public IteratorGetNext iteratorGetNext(Operand iterator, List> outputTypes, - List outputShapes) { + 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 - * @param outputTypes - * @param outputShapes + * @param iterator The iterator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of IteratorGetNextAsOptional */ - public IteratorGetNextAsOptional iteratorGetNextAsOptional(Operand iterator, - List> outputTypes, List outputShapes) { + 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 - * @param outputTypes - * @param outputShapes + * @param iterator The iterator value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute * @return a new instance of IteratorGetNextSync */ - public IteratorGetNextSync iteratorGetNextSync(Operand iterator, List> outputTypes, - List outputShapes) { + public IteratorGetNextSync iteratorGetNextSync(Operand iterator, + List> outputTypes, List outputShapes) { return IteratorGetNextSync.create(scope, iterator, outputTypes, outputShapes); } /** - * Converts the given `resource_handle` representing an iterator to a string. + * 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) { + public IteratorToStringHandle iteratorToStringHandle(Operand resourceHandle) { return IteratorToStringHandle.create(scope, resourceHandle); } /** - * 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 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 dataset - * @param iterator - * @return a new instance of MakeIterator + * @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 MakeIterator makeIterator(Operand dataset, Operand iterator) { - return MakeIterator.create(scope, dataset, iterator); + public LMDBDataset lMDBDataset(Operand filenames, + List> outputTypes, List outputShapes) { + return LMDBDataset.create(scope, filenames, outputTypes, outputShapes); } /** - * Constructs an Optional variant from a tuple of tensors. + * Records the latency of producing {@code input_dataset} elements in a StatsAggregator. * - * @param components - * @return a new instance of OptionalFromValue + * @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 OptionalFromValue optionalFromValue(Iterable> components) { - return OptionalFromValue.create(scope, components); + public LatencyStatsDataset latencyStatsDataset(Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { + return LatencyStatsDataset.create(scope, inputDataset, tag, outputTypes, outputShapes); } /** - * Returns the value stored in an Optional variant or raises an error if none exists. + * Computes rectified linear gradients for a LeakyRelu operation. * - * @param optional - * @param outputTypes - * @param outputShapes - * @return a new instance of OptionalGetValue + * @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 OptionalGetValue optionalGetValue(Operand optional, List> outputTypes, - List outputShapes) { - return OptionalGetValue.create(scope, optional, outputTypes, outputShapes); + public LeakyReluGrad leakyReluGrad(Operand gradients, + Operand features, LeakyReluGrad.Options... options) { + return LeakyReluGrad.create(scope, gradients, features, options); } /** - * Returns true if and only if the given Optional variant has a value. + * 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 optional - * @return a new instance of OptionalHasValue + * @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 OptionalHasValue optionalHasValue(Operand optional) { - return OptionalHasValue.create(scope, optional); + 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 an Optional variant with no value. + * Creates a dataset that emits each of {@code tensors} once. * - * @return a new instance of OptionalNone + * @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 OptionalNone optionalNone() { - return OptionalNone.create(scope); + public ListDataset listDataset(Iterable> tensors, + List> outputTypes, List outputShapes, + ListDataset.Options... options) { + return ListDataset.create(scope, tensors, outputTypes, outputShapes, options); } /** - * Converts the given `resource_handle` representing an iterator to a variant tensor. + * The ListSnapshotChunksDataset operation * - * @param resourceHandle A handle to an iterator resource. - * @return a new instance of SerializeIterator + * @param snapshotPath The snapshotPath value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ListSnapshotChunksDataset + */ + public ListSnapshotChunksDataset listSnapshotChunksDataset(Operand snapshotPath, + List> outputTypes, List outputShapes) { + return ListSnapshotChunksDataset.create(scope, snapshotPath, outputTypes, outputShapes); + } + + /** + * The LoadDataset operation + * + * @param path The path value + * @param readerFuncOtherArgs The readerFuncOtherArgs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param readerFunc The value of the readerFunc attribute + * @param options carries optional attribute values + * @return a new instance of LoadDataset + */ + public LoadDataset loadDataset(Operand path, Iterable> readerFuncOtherArgs, + List> outputTypes, List outputShapes, + ConcreteFunction readerFunc, LoadDataset.Options... options) { + return LoadDataset.create(scope, path, readerFuncOtherArgs, outputTypes, outputShapes, readerFunc, options); + } + + /** + * Makes a new iterator from the given {@code dataset} and stores it in {@code iterator}. + * This operation may be executed multiple times. Each execution will reset the + * iterator in {@code iterator} to the first element of {@code dataset}. + * + * @param dataset The dataset value + * @param iterator The iterator value + * @return a new instance of MakeIterator + */ + public MakeIterator makeIterator(Operand dataset, + Operand iterator) { + return MakeIterator.create(scope, dataset, iterator); + } + + /** + * Creates a dataset that fuses mapping with batching. + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset} and then + * batches {@code batch_size} of them. + *

Unlike a "MapDataset", which applies {@code f} sequentially, this dataset invokes up + * to {@code batch_size * num_parallel_batches} copies of {@code f} in parallel. + * + * @param inputDataset A variant tensor representing the input dataset. + * @param otherArguments A list of tensors, typically values that were captured when building a closure + * for {@code f}. + * @param batchSize A scalar representing the number of elements to accumulate in a + * batch. It determines the number of concurrent invocations of {@code f} that process + * elements from {@code input_dataset} in parallel. + * @param numParallelCalls A scalar representing the maximum number of parallel invocations of the {@code map_fn} + * function. Applying the {@code map_fn} on consecutive input elements in parallel has + * the potential to improve input pipeline throughput. + * @param dropRemainder A scalar representing whether the last batch should be dropped in case its size + * is smaller than desired. + * @param f A function to apply to the outputs of {@code input_dataset}. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of MapAndBatchDataset + */ + public MapAndBatchDataset mapAndBatchDataset(Operand inputDataset, + Iterable> otherArguments, Operand batchSize, + Operand numParallelCalls, Operand dropRemainder, ConcreteFunction f, + List> outputTypes, List outputShapes, + MapAndBatchDataset.Options... options) { + return MapAndBatchDataset.create(scope, inputDataset, otherArguments, batchSize, numParallelCalls, dropRemainder, f, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that applies {@code f} to the outputs of {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param otherArguments The otherArguments value + * @param f The value of the f attribute + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of MapDataset + */ + public MapDataset mapDataset(Operand inputDataset, + Iterable> otherArguments, ConcreteFunction f, + List> outputTypes, List outputShapes, + MapDataset.Options... options) { + return MapDataset.create(scope, inputDataset, otherArguments, f, outputTypes, outputShapes, options); + } + + /** + * The MatchingFilesDataset operation + * + * @param patterns The patterns value + * @return a new instance of MatchingFilesDataset + */ + public MatchingFilesDataset matchingFilesDataset(Operand patterns) { + return MatchingFilesDataset.create(scope, patterns); + } + + /** + * Creates a dataset that overrides the maximum intra-op parallelism. + * + * @param inputDataset The inputDataset value + * @param maxIntraOpParallelism Identifies the maximum intra-op parallelism to use. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of MaxIntraOpParallelismDataset + */ + public MaxIntraOpParallelismDataset maxIntraOpParallelismDataset( + Operand inputDataset, Operand maxIntraOpParallelism, + List> outputTypes, List outputShapes) { + return MaxIntraOpParallelismDataset.create(scope, inputDataset, maxIntraOpParallelism, outputTypes, outputShapes); + } + + /** + * Identity transformation that models performance. + * Identity transformation that models performance. + * + * @param inputDataset A variant tensor representing the input dataset. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of ModelDataset + */ + public ModelDataset modelDataset(Operand inputDataset, + List> outputTypes, List outputShapes, + ModelDataset.Options... options) { + return ModelDataset.create(scope, inputDataset, outputTypes, outputShapes, options); + } + + /** + * Creates a MultiDeviceIterator resource. + * + * @param devices A list of devices the iterator works across. + * @param sharedName If non-empty, this resource will be shared under the given name + * across multiple sessions. + * @param container If non-empty, this resource is placed in the given container. + * Otherwise, a default container is used. + * @param outputTypes The type list for the return values. + * @param outputShapes The list of shapes being produced. + * @return a new instance of MultiDeviceIterator + */ + public MultiDeviceIterator multiDeviceIterator(List devices, String sharedName, + String container, List> outputTypes, List outputShapes) { + return MultiDeviceIterator.create(scope, devices, sharedName, container, outputTypes, outputShapes); + } + + /** + * Generates a MultiDeviceIterator resource from its provided string handle. + * + * @param stringHandle String representing the resource. + * @param outputTypes The type list for the return values. + * @param options carries optional attribute values + * @return a new instance of MultiDeviceIteratorFromStringHandle + */ + public MultiDeviceIteratorFromStringHandle multiDeviceIteratorFromStringHandle( + Operand stringHandle, List> outputTypes, + MultiDeviceIteratorFromStringHandle.Options... options) { + return MultiDeviceIteratorFromStringHandle.create(scope, stringHandle, outputTypes, options); + } + + /** + * Gets next element for the provided shard number. + * + * @param multiDeviceIterator A MultiDeviceIterator resource. + * @param shardNum Integer representing which shard to fetch data for. + * @param incarnationId Which incarnation of the MultiDeviceIterator is running. + * @param outputTypes The type list for the return values. + * @param outputShapes The list of shapes being produced. + * @return a new instance of MultiDeviceIteratorGetNextFromShard + */ + public MultiDeviceIteratorGetNextFromShard multiDeviceIteratorGetNextFromShard( + Operand multiDeviceIterator, Operand shardNum, + Operand incarnationId, List> outputTypes, + List outputShapes) { + return MultiDeviceIteratorGetNextFromShard.create(scope, multiDeviceIterator, shardNum, incarnationId, outputTypes, outputShapes); + } + + /** + * Initializes the multi device iterator with the given dataset. + * + * @param dataset Dataset to be iterated upon. + * @param multiDeviceIterator A MultiDeviceIteratorResource. + * @param maxBufferSize The maximum size of the host side per device buffer to keep. + * @return a new instance of MultiDeviceIteratorInit + */ + public MultiDeviceIteratorInit multiDeviceIteratorInit(Operand dataset, + Operand multiDeviceIterator, Operand maxBufferSize) { + return MultiDeviceIteratorInit.create(scope, dataset, multiDeviceIterator, maxBufferSize); + } + + /** + * Produces a string handle for the given MultiDeviceIterator. + * + * @param multiDeviceIterator A MultiDeviceIterator resource. + * @return a new instance of MultiDeviceIteratorToStringHandle + */ + public MultiDeviceIteratorToStringHandle multiDeviceIteratorToStringHandle( + Operand multiDeviceIterator) { + return MultiDeviceIteratorToStringHandle.create(scope, multiDeviceIterator); + } + + /** + * The NonSerializableDataset operation + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes 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); + } + + /** + * 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 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 OneShotIterator oneShotIterator(ConcreteFunction datasetFactory, + List> outputTypes, List outputShapes, + OneShotIterator.Options... options) { + return OneShotIterator.create(scope, datasetFactory, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset by applying related optimizations to {@code input_dataset}. + * Creates a dataset by applying related optimizations to {@code input_dataset}. + * + * @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 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 The components value + * @return a new instance of OptionalFromValue + */ + public OptionalFromValue optionalFromValue(Iterable> components) { + return OptionalFromValue.create(scope, components); + } + + /** + * Returns the value stored in an Optional variant or raises an error if none exists. + * + * @param optional The optional value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of OptionalGetValue + */ + 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 The optional value + * @return a new instance of OptionalHasValue + */ + public OptionalHasValue optionalHasValue(Operand optional) { + return OptionalHasValue.create(scope, optional); + } + + /** + * Creates an Optional variant with no value. + * + * @return a new instance of OptionalNone + */ + 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 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, + 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 {@code input_dataset} {@code count} times. + * + * @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, + 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 {@code resource_handle} representing an iterator to a variant tensor. + * + * @param resourceHandle A handle to an iterator resource. + * @param options carries optional attribute values + * @return a new instance of SerializeIterator + */ + public SerializeIterator serializeIterator(Operand resourceHandle, + SerializeIterator.Options... options) { + return SerializeIterator.create(scope, resourceHandle, options); + } + + /** + * 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 The inputDataset value + * @param count A scalar representing the number of elements from the {@code input_dataset} + * that should be skipped. If count is -1, skips everything. + * @param outputTypes The value of the outputTypes 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, + SkipDataset.Options... options) { + return SkipDataset.create(scope, inputDataset, count, outputTypes, outputShapes, options); + } + + /** + * The SleepDataset operation + * + * @param inputDataset The inputDataset value + * @param sleepMicroseconds The sleepMicroseconds value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SleepDataset + */ + public SleepDataset sleepDataset(Operand inputDataset, + Operand sleepMicroseconds, List> outputTypes, + List outputShapes) { + return SleepDataset.create(scope, inputDataset, sleepMicroseconds, outputTypes, outputShapes); + } + + /** + * Creates a dataset that passes a sliding window over {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param windowSize A scalar representing the number of elements in the + * sliding window. + * @param windowShift A scalar representing the steps moving the sliding window + * forward in one iteration. It must be positive. + * @param windowStride A scalar representing the stride of the input elements of the sliding window. + * It must be positive. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of SlidingWindowDataset + */ + public SlidingWindowDataset slidingWindowDataset(Operand inputDataset, + Operand windowSize, Operand windowShift, Operand windowStride, + List> outputTypes, List outputShapes, + SlidingWindowDataset.Options... options) { + return SlidingWindowDataset.create(scope, inputDataset, windowSize, windowShift, windowStride, outputTypes, outputShapes, options); + } + + /** + * The SnapshotChunkDataset operation + * + * @param chunkFile The chunkFile value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of SnapshotChunkDataset + */ + public SnapshotChunkDataset snapshotChunkDataset(Operand chunkFile, + List> outputTypes, List outputShapes, + SnapshotChunkDataset.Options... options) { + return SnapshotChunkDataset.create(scope, chunkFile, outputTypes, outputShapes, options); + } + + /** + * Creates a dataset that will write to / read from a snapshot. + * This dataset attempts to determine whether a valid snapshot exists at the + * {@code snapshot_path}, and reads from the snapshot in lieu of using {@code input_dataset}. + * If not, it will run the preprocessing pipeline as usual, and write out a + * snapshot of the data processed for future use. + * + * @param inputDataset A variant tensor representing the input dataset. + * @param path The path we should write snapshots to / read snapshots from. + * @param readerFuncOtherArgs The readerFuncOtherArgs value + * @param shardFuncOtherArgs The shardFuncOtherArgs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param readerFunc Optional. A function to control how to read data from snapshot shards. + * @param shardFunc Optional. A function to control how to shard data when writing a snapshot. + * @param options carries optional attribute values + * @return a new instance of SnapshotDataset + */ + public SnapshotDataset snapshotDataset(Operand inputDataset, + Operand path, Iterable> readerFuncOtherArgs, + Iterable> shardFuncOtherArgs, List> outputTypes, + List outputShapes, ConcreteFunction readerFunc, ConcreteFunction shardFunc, + SnapshotDataset.Options... options) { + return SnapshotDataset.create(scope, inputDataset, path, readerFuncOtherArgs, shardFuncOtherArgs, outputTypes, outputShapes, readerFunc, shardFunc, options); + } + + /** + * The SnapshotDatasetReader operation + * + * @param shardDir The shardDir value + * @param startIndex The startIndex value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param version The value of the version attribute + * @param options carries optional attribute values + * @return a new instance of SnapshotDatasetReader + */ + public SnapshotDatasetReader snapshotDatasetReader(Operand shardDir, + Operand startIndex, List> outputTypes, + List outputShapes, Long version, SnapshotDatasetReader.Options... options) { + return SnapshotDatasetReader.create(scope, shardDir, startIndex, outputTypes, outputShapes, version, options); + } + + /** + * The SnapshotNestedDatasetReader operation + * + * @param inputs The inputs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SnapshotNestedDatasetReader + */ + public SnapshotNestedDatasetReader snapshotNestedDatasetReader( + Iterable> inputs, List> outputTypes, + List outputShapes) { + return SnapshotNestedDatasetReader.create(scope, inputs, outputTypes, outputShapes); + } + + /** + * Creates a dataset that splits a SparseTensor into elements row-wise. + * + * @param indices The indices value + * @param values The values value + * @param denseShape The denseShape value + * @return a new instance of SparseTensorSliceDataset + */ + public SparseTensorSliceDataset sparseTensorSliceDataset(Operand indices, + Operand values, Operand denseShape) { + return SparseTensorSliceDataset.create(scope, indices, values, denseShape); + } + + /** + * Creates a dataset that executes a SQL query and emits rows of the result set. + * + * @param driverName The database type. Currently, the only supported type is 'sqlite'. + * @param dataSourceName A connection string to connect to the database. + * @param query A SQL query to execute. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of SqlDataset + */ + public SqlDataset sqlDataset(Operand driverName, Operand dataSourceName, + Operand query, List> outputTypes, List outputShapes) { + return SqlDataset.create(scope, driverName, dataSourceName, query, outputTypes, outputShapes); + } + + /** + * The StatsAggregatorHandleV2 operation + * + * @param options carries optional attribute values + * @return a new instance of StatsAggregatorHandle + */ + public StatsAggregatorHandle statsAggregatorHandle(StatsAggregatorHandle.Options... options) { + return StatsAggregatorHandle.create(scope, options); + } + + /** + * Set a summary_writer_interface to record statistics using given stats_aggregator. + * + * @param statsAggregator The statsAggregator value + * @param summary The summary value + * @return a new instance of StatsAggregatorSetSummaryWriter + */ + public StatsAggregatorSetSummaryWriter statsAggregatorSetSummaryWriter( + Operand statsAggregator, Operand summary) { + return StatsAggregatorSetSummaryWriter.create(scope, statsAggregator, summary); + } + + /** + * Creates a dataset that contains {@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 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, + 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 {@code components} once. + * + * @param components The components value + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of TensorSliceDataset + */ + public TensorSliceDataset tensorSliceDataset(Iterable> components, + List outputShapes, TensorSliceDataset.Options... options) { + return TensorSliceDataset.create(scope, components, outputShapes, options); + } + + /** + * Creates a dataset that emits the lines of one or more text files. + * + * @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". + * @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, + TextLineDataset.Options... options) { + return TextLineDataset.create(scope, filenames, compressionType, bufferSize, options); + } + + /** + * Creates a dataset that emits the records from one or more TFRecord files. + * + * @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". + * @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, Operand byteOffsets, + TfRecordDataset.Options... options) { + return TfRecordDataset.create(scope, filenames, compressionType, bufferSize, byteOffsets, options); + } + + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param threadPool A resource produced by the ThreadPoolHandle op. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of ThreadPoolDataset + */ + public ThreadPoolDataset threadPoolDataset(Operand inputDataset, + Operand threadPool, List> outputTypes, + List outputShapes) { + return ThreadPoolDataset.create(scope, inputDataset, threadPool, outputTypes, outputShapes); + } + + /** + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. + * + * @param numThreads The number of threads in the thread pool. + * @param displayName A human-readable name for the threads that may be visible in some + * visualizations. + * @param options carries optional attribute values + * @return a new instance of ThreadPoolHandle + */ + public ThreadPoolHandle threadPoolHandle(Long numThreads, String displayName, + ThreadPoolHandle.Options... options) { + return ThreadPoolHandle.create(scope, numThreads, displayName, options); + } + + /** + * A dataset that splits the elements of its input into multiple elements. + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of UnbatchDataset + */ + public UnbatchDataset unbatchDataset(Operand inputDataset, + List> outputTypes, List outputShapes, + UnbatchDataset.Options... options) { + return UnbatchDataset.create(scope, inputDataset, outputTypes, outputShapes, options); + } + + /** + * Uncompresses a compressed dataset element. + * + * @param compressed The compressed value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of UncompressElement + */ + public UncompressElement uncompressElement(Operand compressed, + List> outputTypes, List outputShapes) { + return UncompressElement.create(scope, compressed, outputTypes, outputShapes); + } + + /** + * Creates a dataset that contains the unique elements of {@code input_dataset}. + * + * @param inputDataset The inputDataset value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of UniqueDataset + */ + public UniqueDataset uniqueDataset(Operand inputDataset, + List> outputTypes, List outputShapes, + UniqueDataset.Options... options) { + return UniqueDataset.create(scope, inputDataset, outputTypes, outputShapes, options); + } + + /** + * The UnwrapDatasetVariant operation + * + * @param inputHandle The inputHandle value + * @return a new instance of UnwrapDatasetVariant + */ + public UnwrapDatasetVariant unwrapDatasetVariant(Operand inputHandle) { + return UnwrapDatasetVariant.create(scope, inputHandle); + } + + /** + * Combines (nests of) input elements into a dataset of (nests of) windows. + *

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

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

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

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

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

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

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

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

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

For example: + *

    + *
  • {@code tf.data.Dataset.from_tensor_slices((range(4), range(4))).window(2)} + * produces {@code {({0, 1}, {0, 1}), ({2, 3}, {2, 3})}}
  • + *
  • {@code tf.data.Dataset.from_tensor_slices({"a": range(4)}).window(2)} + * produces {@code {{"a": {0, 1}}, {"a": {2, 3}}}}
  • + *
+ * + * @param inputDataset The inputDataset value + * @param sizeOutput An integer scalar, representing the number of elements + * of the input dataset to combine into a window. Must be positive. + * @param shift An integer scalar, representing the number of input elements + * by which the window moves in each iteration. Defaults to {@code size}. + * Must be positive. + * @param stride An integer scalar, representing the stride of the input elements + * in the sliding window. Must be positive. The default value of 1 means + * "retain every input element". + * @param dropRemainder A Boolean scalar, representing whether the last window should be + * dropped if its size is smaller than {@code window_size}. + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @param options carries optional attribute values + * @return a new instance of WindowDataset + */ + public WindowDataset windowDataset(Operand inputDataset, + Operand sizeOutput, Operand shift, Operand stride, + Operand dropRemainder, List> outputTypes, + List outputShapes, WindowDataset.Options... options) { + return WindowDataset.create(scope, inputDataset, sizeOutput, shift, stride, dropRemainder, outputTypes, outputShapes, options); + } + + /** + * The WindowOp operation + * + * @param inputs The inputs value + * @param outputTypes The value of the outputTypes attribute + * @param outputShapes The value of the outputShapes attribute + * @return a new instance of WindowOp + */ + public WindowOp windowOp(Iterable> inputs, List> outputTypes, + List outputShapes) { + return WindowOp.create(scope, inputs, outputTypes, outputShapes); + } + + /** + * The WrapDatasetVariant operation + * + * @param inputHandle The inputHandle value + * @return a new instance of WrapDatasetVariant + */ + public WrapDatasetVariant wrapDatasetVariant(Operand inputHandle) { + return WrapDatasetVariant.create(scope, inputHandle); + } + + /** + * Creates a dataset that zips together {@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 + * dataset, and no error will be raised if input datasets have different sizes. + * + * @param inputDatasets List of {@code N} variant Tensors representing datasets to be zipped together. + * @param outputTypes The value of the outputTypes 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, + ZipDataset.Options... options) { + return ZipDataset.create(scope, inputDatasets, outputTypes, outputShapes, options); + } + + /** + * Get the parent {@link Ops} object. */ - public SerializeIterator serializeIterator(Operand resourceHandle) { - return SerializeIterator.create(scope, resourceHandle); + public final Ops ops() { + return ops; } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DebuggingOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DebuggingOps.java new file mode 100644 index 00000000000..4ea1efd10db --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DebuggingOps.java @@ -0,0 +1,61 @@ +// Copyright 2020-2022 The TensorFlow Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================== +// +// This class has been generated, DO NOT EDIT! +// +package org.tensorflow.op; + +import org.tensorflow.Operand; +import org.tensorflow.op.debugging.CheckNumerics; +import org.tensorflow.types.family.TNumber; + +/** + * An API for building {@code debugging} operations as {@link Op Op}s + * + * @see Ops + */ +public final class DebuggingOps { + private final Scope scope; + + private final Ops ops; + + DebuggingOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Checks a tensor for NaN, -Inf and +Inf values. + * When run, reports an {@code InvalidArgument} error if {@code tensor} has any values + * that are not a number (NaN) or infinity (Inf). Otherwise, returns the input + * tensor. Unlike CheckNumerics (V1), CheckNumericsV2 distinguishes -Inf and +Inf + * in the errors it throws. + * + * @param tensor The tensor value + * @param message Prefix of the error message. + * @param data type for {@code CheckNumericsV2} output and operands + * @return a new instance of CheckNumerics + */ + public CheckNumerics checkNumerics(Operand tensor, String message) { + return CheckNumerics.create(scope, tensor, message); + } + + /** + * Get the parent {@link Ops} object. + */ + public final Ops ops() { + return ops; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DistributeOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DistributeOps.java new file mode 100644 index 00000000000..4f30df6352d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DistributeOps.java @@ -0,0 +1,110 @@ +// Copyright 2020-2022 The TensorFlow Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ============================================================================== +// +// This class has been generated, DO NOT EDIT! +// +package org.tensorflow.op; + +import org.tensorflow.Operand; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.op.distribute.NcclAllReduce; +import org.tensorflow.op.distribute.NcclBroadcast; +import org.tensorflow.op.distribute.NcclReduce; +import org.tensorflow.types.family.TNumber; + +/** + * An API for building {@code distribute} operations as {@link Op Op}s + * + * @see Ops + */ +public final class DistributeOps { + private final Scope scope; + + private final Ops ops; + + DistributeOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; + } + + /** + * Outputs a tensor containing the reduction across all input tensors. + * Outputs a tensor containing the reduction across all input tensors passed to ops + * within the same `shared_name. + *

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

input: the input to the reduction + * data: the value of the reduction across all {@code num_devices} devices. + * reduction: the reduction operation to perform. + * num_devices: The number of devices participating in this reduction. + * shared_name: Identifier that shared between ops of the same reduction. + * + * @param input The input value + * @param reduction The value of the reduction attribute + * @param numDevices The value of the numDevices attribute + * @param sharedName The value of the sharedName attribute + * @param data type for {@code NcclAllReduce} output and operands + * @return a new instance of NcclAllReduce + */ + public NcclAllReduce ncclAllReduce(Operand input, String reduction, + Long numDevices, String sharedName) { + return NcclAllReduce.create(scope, input, reduction, numDevices, sharedName); + } + + /** + * Sends {@code input} to all devices that are connected to the output. + * Sends {@code input} to all devices that are connected to the output. + *

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

input: The input to the broadcast. + * output: The same as input. + * shape: The shape of the input tensor. + * + * @param input The input value + * @param shape The value of the shape attribute + * @param data type for {@code NcclBroadcast} output and operands + * @return a new instance of NcclBroadcast + */ + public NcclBroadcast ncclBroadcast(Operand input, Shape shape) { + return NcclBroadcast.create(scope, input, shape); + } + + /** + * Reduces {@code input} from {@code num_devices} using {@code reduction} to a single device. + * Reduces {@code input} from {@code num_devices} using {@code reduction} to a single device. + *

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

input: The input to the reduction. + * data: the value of the reduction across all {@code num_devices} devices. + * reduction: the reduction operation to perform. + * + * @param input The input value + * @param reduction The value of the reduction attribute + * @param data type for {@code NcclReduce} output and operands + * @return a new instance of NcclReduce + */ + public NcclReduce ncclReduce(Iterable> input, + String reduction) { + return NcclReduce.create(scope, input, reduction); + } + + /** + * Get the parent {@link Ops} object. + */ + public final Ops ops() { + return ops; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DtypesOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DtypesOps.java index 547d2fd463d..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,82 +17,124 @@ // 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; - DtypesOps(Scope scope) { - this.scope = scope; + private final Ops ops; + + DtypesOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; } /** * 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.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. + */ + public final Ops ops() { + return ops; + } } 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 b101a4e4c79..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,8 +29,10 @@ 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; @@ -39,18 +40,27 @@ 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; @@ -62,31 +72,31 @@ /** * 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; - ImageOps(Scope scope) { - this.scope = scope; + private final Ops ops; + + ImageOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; } /** * 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, @@ -96,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 - * interpretted as channels, and must be three. - *

- * The input image is considered in the RGB colorspace. Conceptually, the RGB + * {@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 * 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) { @@ -115,17 +123,15 @@ public AdjustHue adjustHue(Operand images, Operand - * `images` is a tensor of at least 3 dimensions. The last dimension is - * interpretted as channels, and must be three. - *

- * The input image is considered in the RGB colorspace. Conceptually, the RGB + * {@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 * 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, @@ -135,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 @@ -150,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 + * @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, @@ -174,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); } @@ -220,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); } @@ -247,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, @@ -314,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) { @@ -339,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.image.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 @@ -356,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.image.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) { @@ -394,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.image.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); @@ -430,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.image.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, @@ -495,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) { @@ -532,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. @@ -547,109 +583,90 @@ 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); } /** * Extracts a glimpse from the input tensor. - *

* Returns a set of windows called glimpses extracted at location - * `offsets` from the input tensor. If the windows only partially + * {@code offsets} from the input tensor. If the windows only partially * overlaps the inputs, the non overlapping areas will be filled with * random noise. - *

- * The result is a 4-D tensor of shape `[batch_size, glimpse_height, - * glimpse_width, channels]`. The channels and batch dimensions are the + *

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

- * The argument `normalized` and `centered` controls how the windows are built: + * windows are specified in the {@code size} parameter. + *

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

    - *
  • - * If the coordinates are normalized but not centered, 0.0 and 1.0 - * correspond to the minimum and maximum of each height and width - * dimension. - *
  • - *
  • - * If the coordinates are both normalized and centered, they range from - * -1.0 to 1.0. The coordinates (-1.0, -1.0) correspond to the upper - * left corner, the lower right corner is located at (1.0, 1.0) and the - * center is at (0, 0). - *
  • - *
  • - * If the coordinates are not normalized they are interpreted as - * numbers of pixels. - * - * @param input A 4-D float tensor of shape `[batch_size, height, width, channels]`. - * @param size A 1-D tensor of 2 elements containing the size of the glimpses + *
  • If the coordinates are normalized but not centered, 0.0 and 1.0 + * correspond to the minimum and maximum of each height and width + * dimension.
  • + *
  • If the coordinates are both normalized and centered, they range from + * -1.0 to 1.0. The coordinates (-1.0, -1.0) correspond to the upper + * left corner, the lower right corner is located at (1.0, 1.0) and the + * center is at (0, 0).
  • + *
  • If the coordinates are not normalized they are interpreted as + * numbers of pixels.
  • + *
+ * + * @param input A 4-D float tensor of shape {@code [batch_size, height, width, channels]}. + * @param sizeOutput A 1-D tensor of 2 elements containing the size of the glimpses * to extract. The glimpse height must be specified first, following * by the glimpse width. - * @param offsets A 2-D integer tensor of shape `[batch_size, 2]` containing + * @param offsets A 2-D integer tensor of shape {@code [batch_size, 2]} containing * the y, x locations of the center of each window. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ExtractGlimpse */ - public ExtractGlimpse extractGlimpse(Operand input, Operand size, + public ExtractGlimpse extractGlimpse(Operand input, Operand sizeOutput, Operand offsets, ExtractGlimpse.Options... options) { - return ExtractGlimpse.create(scope, input, size, offsets, options); + return ExtractGlimpse.create(scope, input, sizeOutput, offsets, options); } /** - * Extract `patches` from `images` and put them in the "depth" output dimension. + * Extract {@code patches} from {@code images} and put them in the "depth" output dimension. * - * @param data type for {@code patches()} output - * @param images 4-D Tensor with shape `[batch, in_rows, in_cols, depth]`. - * @param ksizes The size of the sliding window for each dimension of `images`. + * @param images 4-D Tensor with shape {@code [batch, in_rows, in_cols, depth]}. + * @param ksizes The size of the sliding window for each dimension of {@code images}. * @param strides How far the centers of two consecutive patches are in - * the images. Must be: `[1, stride_rows, stride_cols, 1]`. - * @param rates Must be: `[1, rate_rows, rate_cols, 1]`. This is the + * the images. Must be: {@code [1, stride_rows, stride_cols, 1]}. + * @param rates Must be: {@code [1, rate_rows, rate_cols, 1]}. This is the * input stride, specifying how far two consecutive patch samples are in the * input. Equivalent to extracting patches with - * `patch_sizes_eff = patch_sizes + (patch_sizes - 1) * (rates - 1)`, followed by - * subsampling them spatially by a factor of `rates`. This is equivalent to - * `rate` in dilated (a.k.a. Atrous) convolutions. + * {@code patch_sizes_eff = patch_sizes + (patch_sizes - 1) * (rates - 1)}, followed by + * subsampling them spatially by a factor of {@code rates}. This is equivalent to + * {@code rate} in dilated (a.k.a. Atrous) convolutions. * @param padding The type of padding algorithm to use. + * @param data type for {@code ExtractImagePatches} output and operands * @return a new instance of ExtractImagePatches */ - public ExtractImagePatches extractImagePatches(Operand images, + public ExtractImagePatches extractImagePatches(Operand images, List ksizes, List strides, List rates, String padding) { return ExtractImagePatches.create(scope, images, ksizes, strides, rates, padding); } /** * 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); @@ -657,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 @@ -704,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. @@ -725,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, @@ -738,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. @@ -773,132 +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); } /** - * Resize `images` to `size` using bilinear interpolation. - *

+ * 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 {@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([ + * ... 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() + * 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) { @@ -907,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),
@@ -939,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( @@ -963,17 +1120,122 @@ 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); + } + + /** + * 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/IoOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/IoOps.java index e8ba2a4c1c7..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,8 +18,8 @@ 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; import org.tensorflow.op.io.DecodeCompressed; import org.tensorflow.op.io.DecodeCsv; @@ -27,7 +27,9 @@ import org.tensorflow.op.io.DecodePaddedRaw; import org.tensorflow.op.io.DecodeRaw; import org.tensorflow.op.io.DeserializeManySparse; +import org.tensorflow.op.io.DisableCopyOnRead; import org.tensorflow.op.io.EncodeBase64; +import org.tensorflow.op.io.FakeQueue; import org.tensorflow.op.io.FifoQueue; import org.tensorflow.op.io.FixedLengthRecordReader; import org.tensorflow.op.io.IdentityReader; @@ -66,7 +68,6 @@ import org.tensorflow.op.io.TfRecordReader; import org.tensorflow.op.io.WholeFileReader; import org.tensorflow.op.io.WriteFile; -import org.tensorflow.tools.Shape; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; @@ -77,20 +78,23 @@ /** * 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; - IoOps(Scope scope) { - this.scope = scope; + private final Ops ops; + + IoOps(Ops ops) { + this.scope = ops.scope(); + this.ops = ops; } /** * 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 @@ -101,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, @@ -120,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. @@ -130,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, @@ -140,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. @@ -159,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); } @@ -275,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, @@ -285,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) { @@ -299,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) { @@ -308,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. @@ -322,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); } @@ -341,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. @@ -364,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 @@ -393,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); } @@ -419,7 +434,7 @@ public ParseExample parseExample(Operand serialized, Operand n * @param featureListDenseKeys The keys expected in the SequenceExamples' feature_lists associated * with lists of dense values. * @param featureListRaggedKeys The keys expected in the FeatureLists associated with ragged values. - * @param featureListDenseMissingAssumedEmpty A vector corresponding 1:1 with featue_list_dense_keys, indicating which + * @param featureListDenseMissingAssumedEmpty A vector corresponding 1:1 with feature_list_dense_keys, indicating which * features may be missing from the SequenceExamples. If the associated * FeatureList is missing, it is treated as empty. * @param contextDenseDefaults A list of Ncontext_dense Tensors (some may be empty). @@ -436,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, @@ -451,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); } @@ -464,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. @@ -474,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] @@ -496,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); } @@ -537,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, @@ -550,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); } @@ -559,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 @@ -584,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 @@ -602,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); } @@ -751,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); } @@ -759,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); } @@ -770,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) { @@ -779,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); } @@ -796,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). @@ -811,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); } @@ -839,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. * @@ -854,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, @@ -977,8 +967,8 @@ public ShardedFilename shardedFilename(Operand basename, Operand basename, Operand numShards) { @@ -988,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) { @@ -1019,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. @@ -1030,4 +1018,11 @@ public WholeFileReader wholeFileReader(WholeFileReader.Options... options) { public WriteFile writeFile(Operand filename, Operand contents) { return WriteFile.create(scope, filename, contents); } + + /** + * 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/LinalgOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgOps.java index 4ec67e1b38c..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; @@ -48,10 +48,17 @@ import org.tensorflow.op.linalg.MatMul; import org.tensorflow.op.linalg.MatrixDiag; 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; @@ -60,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; @@ -71,64 +80,60 @@ /** * 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; - LinalgOps(Scope scope) { - this.scope = scope; - sparse = new LinalgSparseOps(scope); + private final Ops ops; + + 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 + * Copy a tensor setting everything outside a central band in each innermost matrix to zero. + * 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 data type for {@code output()} output - * @param input + * @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 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 subcripts 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 subcripts 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 subcripts do not contain ellipsis, then an InvalidArgument error + * 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, @@ -902,37 +874,319 @@ public MatrixDiagPart matrixDiagPart(Operand input, Oper return MatrixDiagPart.create(scope, input, k, paddingValue); } + /** + * Returns the batched diagonal part of a batched tensor. + * 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,
+   *      padding_value                 ; otherwise.
+   *  
+ *

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,
+   *      padding_value                 ; otherwise.
+   *  
+ *

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
+   *                                           (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
+   *                                             and `d <= 0`)
+   *           0                          ; otherwise
+   *  
+ *

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

The input must be at least a matrix. + *

For example: + *

+   *  input = np.array([[[1, 2, 3, 4],  # Input shape: (2, 3, 4)
+   *                     [5, 6, 7, 8],
+   *                     [9, 8, 7, 6]],
+   *                    [[5, 4, 3, 2],
+   *                     [1, 2, 3, 4],
+   *                     [5, 6, 7, 8]]])
+   *
+   *  # A main diagonal from each batch.
+   *  tf.matrix_diag_part(input) ==> [[1, 6, 7],  # Output shape: (2, 3)
+   *                                  [5, 2, 7]]
+   *
+   *  # A superdiagonal from each batch.
+   *  tf.matrix_diag_part(input, k = 1)
+   *    ==> [[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)
+   *          [2, 7, 6],
+   *          [1, 6, 7],
+   *          [5, 8, 0]],
+   *         [[0, 3, 4],
+   *          [4, 3, 8],
+   *          [5, 2, 7],
+   *          [1, 6, 0]]]
+   *
+   *  # LEFT_RIGHT alignment.
+   *  tf.matrix_diag_part(input, k = (-1, 2), align="LEFT_RIGHT")
+   *    ==> [[[3, 8, 0],  # Output shape: (2, 4, 3)
+   *          [2, 7, 6],
+   *          [1, 6, 7],
+   *          [0, 5, 8]],
+   *         [[3, 4, 0],
+   *          [4, 3, 8],
+   *          [5, 2, 7],
+   *          [0, 1, 6]]]
+   *
+   *  # max_diag_len can be shorter than the main diagonal.
+   *  tf.matrix_diag_part(input, k = (-2, -1))
+   *    ==> [[[5, 8],
+   *          [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, 3, 8],
+   *          [2, 7, 6]],
+   *         [[9, 9, 2],
+   *          [9, 3, 4],
+   *          [4, 3, 8]]]
+   *
+   *  
+ * + * @param input Rank {@code r} tensor where {@code r >= 2}. + * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * diagonal, and negative value means subdiagonals. {@code k} can be a single integer + * (for a single diagonal) or a pair of integers specifying the low and high ends + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. + * @param paddingValue The value to fill the area outside the specified diagonal band with. + * Default is 0. + * @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, + Operand paddingValue, MatrixDiagPartV3.Options... options) { + return MatrixDiagPartV3.create(scope, input, k, paddingValue, options); + } + + /** + * Returns a batched diagonal tensor with given batched diagonal values. + * 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 {@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 {@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: + *

+   *  output[i, j, ..., l, m, n]
+   *    = diagonal[i, j, ..., l, n-max(d_upper, 0)] ; if n - m == d_upper
+   *      padding_value                             ; otherwise
+   *  
+ *

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]
+   *      padding_value                                     ; otherwise
+   *  
+ *

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
+   *                                           (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
+   *                                             and `d <= 0`)
+   *           0                          ; otherwise
+   *  
+ *

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)
+   *                                 [0, 2, 0, 0],
+   *                                 [0, 0, 3, 0],
+   *                                 [0, 0, 0, 4]],
+   *                                [[5, 0, 0, 0],
+   *                                 [0, 6, 0, 0],
+   *                                 [0, 0, 7, 0],
+   *                                 [0, 0, 0, 8]]]
+   *
+   *  # A superdiagonal (per batch).
+   *  diagonal = np.array([[1, 2, 3],  # Input shape: (2, 3)
+   *                       [4, 5, 6]])
+   *  tf.matrix_diag(diagonal, k = 1)
+   *    ==> [[[0, 1, 0, 0],  # Output shape: (2, 4, 4)
+   *          [0, 0, 2, 0],
+   *          [0, 0, 0, 3],
+   *          [0, 0, 0, 0]],
+   *         [[0, 4, 0, 0],
+   *          [0, 0, 5, 0],
+   *          [0, 0, 0, 6],
+   *          [0, 0, 0, 0]]]
+   *
+   *  # A tridiagonal band (per batch).
+   *  diagonals = np.array([[[0, 8, 9],  # Input shape: (2, 2, 3)
+   *                         [1, 2, 3],
+   *                         [4, 5, 0]],
+   *                        [[0, 2, 3],
+   *                         [6, 7, 9],
+   *                         [9, 1, 0]]])
+   *  tf.matrix_diag(diagonals, k = (-1, 1))
+   *    ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
+   *          [4, 2, 9],
+   *          [0, 5, 3]],
+   *         [[6, 2, 0],
+   *          [9, 7, 3],
+   *          [0, 1, 9]]]
+   *
+   *  # LEFT_RIGHT alignment.
+   *  diagonals = np.array([[[8, 9, 0],  # Input shape: (2, 2, 3)
+   *                         [1, 2, 3],
+   *                         [0, 4, 5]],
+   *                        [[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)
+   *          [4, 2, 9],
+   *          [0, 5, 3]],
+   *         [[6, 2, 0],
+   *          [9, 7, 3],
+   *          [0, 1, 9]]]
+   *
+   *  # Rectangular matrix.
+   *  diagonal = np.array([1, 2])  # Input shape: (2)
+   *  tf.matrix_diag(diagonal, k = -1, num_rows = 3, num_cols = 4)
+   *    ==> [[0, 0, 0, 0],  # Output shape: (3, 4)
+   *         [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)
+   *         [1, 9],
+   *         [9, 2]]
+   *
+   *  
+ * + * @param diagonal Rank {@code r}, where {@code r >= 1} + * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * diagonal, and negative value means subdiagonals. {@code k} can be a single integer + * (for a single diagonal) or a pair of integers specifying the low and high ends + * of a matrix band. {@code k[0]} must not be larger than {@code k[1]}. + * @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 {@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 {@code diagonal}. + * @param paddingValue The number to fill the area outside the specified diagonal band with. + * Default is 0. + * @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, + Operand numRows, Operand numCols, Operand paddingValue, + MatrixDiagV3.Options... options) { + 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)`. - *

- * For example: - *

{@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
+   *                                           (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
+   *                                             and `d <= 0`)
+   *           0                          ; otherwise
+   *  
+ *

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],
@@ -942,16 +1196,17 @@ public  MatrixDiagPart matrixDiagPart(Operand input, Oper
    *                     [7, 7, 7, 7]]])
    *  diagonal = np.array([[1, 2, 3],               # Diagonal shape: (2, 3)
    *                       [4, 5, 6]])
-   *  tf.matrix_set_diag(diagonal) ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
-   *                                     [7, 2, 7, 7],
-   *                                     [7, 7, 3, 7]],
-   *                                    [[4, 7, 7, 7],
-   *                                     [7, 5, 7, 7],
-   *                                     [7, 7, 6, 7]]]
+   *  tf.matrix_set_diag(input, diagonal)
+   *    ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
+   *          [7, 2, 7, 7],
+   *          [7, 7, 3, 7]],
+   *         [[4, 7, 7, 7],
+   *          [7, 5, 7, 7],
+   *          [7, 7, 6, 7]]]
    *
    *  # A superdiagonal (per batch).
-   *  tf.matrix_set_diag(diagonal, k = 1)
-   *    ==> [[[7, 1, 7, 7],  # Output shape: (2, 3, 4)
+   *  tf.matrix_set_diag(input, diagonal, k = 1)
+   *    ==> [[[7, 1, 7, 7],  # Output shape: (2, 3, 4)
    *          [7, 7, 2, 7],
    *          [7, 7, 7, 3]],
    *         [[7, 4, 7, 7],
@@ -959,81 +1214,98 @@ public  MatrixDiagPart matrixDiagPart(Operand input, Oper
    *          [7, 7, 7, 6]]]
    *
    *  # A band of diagonals.
-   *  diagonals = np.array([[[1, 2, 3],  # Diagonal shape: (2, 2, 3)
+   *  diagonals = np.array([[[0, 9, 1],  # Diagonal shape: (2, 4, 3)
+   *                         [6, 5, 8],
+   *                         [1, 2, 3],
    *                         [4, 5, 0]],
-   *                        [[6, 1, 2],
+   *                        [[0, 1, 2],
+   *                         [5, 6, 4],
+   *                         [6, 1, 2],
    *                         [3, 4, 0]]])
-   *  tf.matrix_set_diag(diagonals, k = (-1, 0))
-   *    ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
-   *          [4, 2, 7, 7],
-   *          [0, 5, 3, 7]],
-   *         [[6, 7, 7, 7],
-   *          [3, 1, 7, 7],
-   *          [7, 4, 2, 7]]]
-   *
-   *  }
- * - * @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`. + * tf.matrix_set_diag(input, diagonals, k = (-1, 2)) + * ==> [[[1, 6, 9, 7], # Output shape: (2, 3, 4) + * [4, 2, 5, 1], + * [7, 5, 3, 8]], + * [[6, 5, 1, 7], + * [3, 1, 6, 2], + * [7, 4, 2, 4]]] + * + * # LEFT_RIGHT alignment. + * diagonals = np.array([[[9, 1, 0], # Diagonal shape: (2, 4, 3) + * [6, 5, 8], + * [1, 2, 3], + * [0, 4, 5]], + * [[1, 2, 0], + * [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) + * [4, 2, 5, 1], + * [7, 5, 3, 8]], + * [[6, 5, 1, 7], + * [3, 1, 6, 2], + * [7, 4, 2, 4]]] + * + *
+ * + * @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]`. + * 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, - Operand k) { - return MatrixSetDiag.create(scope, input, diagonal, k); + Operand k, MatrixSetDiag.Options... options) { + return MatrixSetDiag.create(scope, input, diagonal, k, options); } /** * 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, @@ -1043,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) { @@ -1065,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, @@ -1118,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, @@ -1139,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 - * 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 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 {@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) { @@ -1166,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) { @@ -1190,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) { @@ -1218,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) { @@ -1247,40 +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, K]`. - *

- * The output is a tensor of shape `[..., M, K]`. 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]`. - *

- * 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],
@@ -1293,29 +1642,81 @@ 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, TriangularSolve.Options... options) { 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. + */ + public final Ops ops() { + return ops; + } } 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 index 7f8777c883a..7210249ba1f 100644 --- 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 @@ -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,8 +17,9 @@ // package org.tensorflow.op; -import org.tensorflow.DataType; 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; @@ -41,25 +42,57 @@ /** * An API for building {@code linalg.sparse} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class LinalgSparseOps { private final Scope scope; - LinalgSparseOps(Scope scope) { - this.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 data type for {@code values()} output * @param sparseMatrix A (possibly batched) CSRSparseMatrix. - * @param type + * @param type The value of the type attribute + * @param data type for {@code CSRSparseMatrixToSparseTensor} output and operands * @return a new instance of CSRSparseMatrixToSparseTensor */ public CSRSparseMatrixToSparseTensor cSRSparseMatrixToSparseTensor( - Operand sparseMatrix, DataType type) { + Operand sparseMatrix, Class type) { return CSRSparseMatrixToSparseTensor.create(scope, sparseMatrix, type); } @@ -70,14 +103,13 @@ public CSRSparseMatrixToSparseTensor cSRSparseMatrixToSpars * @param indices Indices of nonzero elements. * @return a new instance of DenseToCSRSparseMatrix */ - public DenseToCSRSparseMatrix denseToCSRSparseMatrix(Operand denseInput, + 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). * @@ -85,109 +117,98 @@ public DenseToCSRSparseMatrix denseToCSRSparseMatrix(Operand 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) { + 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: - *

{@code
+   *  

If transpose_output is false, returns: + *

    *    C = A . B
-   *  }
- * If transpose_output is `true`, returns: - *
{@code
+   *  
+ *

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

    *    C = transpose(A . B) = transpose(B) . transpose(A)
-   *  }
- * where the transposition is performed along the two innermost (matrix) + *
+ *

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

- * If conjugate_output is `true`, returns: - *

{@code
+   *  

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

    *    C = conjugate(A . B) = conjugate(A) . conjugate(B)
-   *  }
- * If both conjugate_output and transpose_output are `true`, returns: - *
{@code
+   *  
+ *

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

    *    C = conjugate(transpose(A . B)) = conjugate(transpose(B)) .
    *                                      conjugate(transpose(A))
-   *  }
+ *
* - * @param data type for {@code output()} output * @param a A CSRSparseMatrix. * @param b A dense tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseMatrixMatMul} output and operands * @return a new instance of SparseMatrixMatMul */ - public SparseMatrixMatMul sparseMatrixMatMul(Operand a, Operand b, - SparseMatrixMatMul.Options... options) { + 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 `b` may be either a scalar; otherwise `a` must be a rank-3 - * `SparseMatrix`; in this case `b` must be shaped `[batch_size, 1, 1]` and the + *

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

- * NOTE even if `b` is zero, the sparsity structure of the output does not + *

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

+ * Computes the Approximate Minimum Degree (AMD) ordering of {@code input}. * Computes the Approximate Minimum Degree (AMD) ordering for a sparse matrix. - *

- * The returned permutation may be used to permute the rows and columns of the + *

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

- * The input sparse matrix may have rank 2 or rank 3. The output Tensor, + *

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

- * Each component of the input sparse matrix must represent a square symmetric + *

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

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

- * Usage example: - *

{@code
+   *  

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

Usage example: + *

    *      from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops
    *
    *      a_indices = np.array([[0, 0], [1, 1], [2, 1], [2, 2], [3, 3]])
@@ -196,7 +217,7 @@ public SparseMatrixNNZ sparseMatrixNNZ(Operand sparseMatrix) {
    *
    *      with tf.Session() as sess:
    *        # Define (COO format) SparseTensor over Numpy array.
-   *        a_st = tf.SparseTensor(a_indices, a_values, a_dense_shape)
+   *        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(
@@ -206,33 +227,31 @@ public SparseMatrixNNZ sparseMatrixNNZ(Operand sparseMatrix) {
    *        ordering_amd = sparse_csr_matrix_ops.sparse_matrix_ordering_amd(sparse_matrix)
    *
    *        ordering_amd_value = sess.run(ordering_amd)
-   *  }
- * `ordering_amd_value` stores the AMD ordering: `[1 2 3 0]`. - *

- * input: A `CSRSparseMatrix`. + *

+ *

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

input: A {@code CSRSparseMatrix}. * - * @param input A `CSRSparseMatrix`. + * @param input A {@code CSRSparseMatrix}. * @return a new instance of SparseMatrixOrderingAMD */ - public SparseMatrixOrderingAMD sparseMatrixOrderingAMD(Operand input) { + 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 `-inf` (i.e., logits of zero probability); and + *

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

+ * Computes the sparse Cholesky decomposition of {@code input}. * Computes the Sparse Cholesky decomposition of a sparse matrix, with the given * fill-in reducing permutation. - *

- * The input sparse matrix and the fill-in reducing permutation `permutation` must + *

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

- * Furthermore, each component vector of `permutation` must be of length `N`, - * containing each of the integers {0, 1, ..., N - 1} exactly once, where `N` is + * dimension {@code B}, then the {@code permutation} must be of rank 2; with the same batch + * dimension {@code B}. There is no support for broadcasting. + *

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

- * Each component of the input sparse matrix must represent a symmetric positive + *

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

- * The returned sparse matrix has the same dense shape as the input sparse matrix. - * For each component `A` of the input sparse matrix, the corresponding output - * sparse matrix represents `L`, the lower triangular Cholesky factor satisfying + *

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

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

- * The `type` parameter denotes the type of the matrix elements. The supported - * types are: `float32`, `float64`, `complex64` and `complex128`. - *

- * Usage example: - *

{@code
+   *  
+ *

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

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

Usage example: + *

    *      from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops
    *
    *      a_indices = np.array([[0, 0], [1, 1], [2, 1], [2, 2], [3, 3]])
@@ -292,7 +305,7 @@ public  SparseMatrixSoftmaxGrad sparseMatrixSoftmaxGrad(Opera
    *
    *      with tf.Session() as sess:
    *        # Define (COO format) SparseTensor over Numpy array.
-   *        a_st = tf.SparseTensor(a_indices, a_values, a_dense_shape)
+   *        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(
@@ -311,58 +324,52 @@ public  SparseMatrixSoftmaxGrad sparseMatrixSoftmaxGrad(Opera
    *
    *        # Evaluate the dense Tensor value.
    *        dense_cholesky_value = sess.run(dense_cholesky)
-   *  }
- * `dense_cholesky_value` stores the dense Cholesky factor: - *
{@code
+   *  
+ *

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

    *      [[  1.  0.    0.    0.]
    *       [  0.  1.41  0.    0.]
    *       [  0.  0.70  1.58  0.]
    *       [  0.  0.    0.    2.]]
-   *  }
- * input: A `CSRSparseMatrix`. - * permutation: A `Tensor`. - * type: The type of `input`. + *
+ *

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

- * Performs a matrix multiplication of a sparse matrix `a` with a sparse matrix - * `b`; returns a sparse matrix `a * b`, unless either `a` or `b` is transposed or + * Sparse-matrix-multiplies two CSR matrices {@code a} and {@code b}. + * Performs a matrix multiplication of a sparse matrix {@code a} with a sparse matrix + * {@code b}; returns a sparse matrix {@code a * b}, unless either {@code a} or {@code b} is transposed or * adjointed. - *

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

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

- * The `type` parameter denotes the type of the matrix elements. Both `a` and `b` - * must have the same type. The supported types are: `float32`, `float64`, - * `complex64` and `complex128`. - *

- * Both `a` and `b` must have the same rank. Broadcasting is not supported. If they - * have rank 3, each batch of 2D CSRSparseMatrices within `a` and `b` must have the + *

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

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

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

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

- * The sparse matrix product may have numeric (non-structural) zeros. + *

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

- * Usage example: - *

{@code
+   *  

Usage example: + *

    *      from tensorflow.python.ops.linalg.sparse import sparse_csr_matrix_ops
    *
    *      a_indices = np.array([[0, 0], [2, 3], [2, 4], [3, 0]])
@@ -375,8 +382,8 @@ public  SparseMatrixSparseCholesky sparseMatrixSparseCholesky(O
    *
    *      with tf.Session() as sess:
    *        # Define (COO format) Sparse Tensors over Numpy arrays
-   *        a_st = tf.SparseTensor(a_indices, a_values, a_dense_shape)
-   *        b_st = tf.SparseTensor(b_indices, b_values, b_dense_shape)
+   *        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(
@@ -393,58 +400,61 @@ public  SparseMatrixSparseCholesky sparseMatrixSparseCholesky(O
    *            c_sm, tf.float32)
    *        # Evaluate the dense Tensor value
    *        c_sm_dense_value = sess.run(c_sm_dense)
-   *  }
- * `c_sm_dense_value` stores the dense matrix product: - *
{@code
+   *  
+ *

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

    *      [[  2.   0.   0.]
    *       [  0.   0.   0.]
    *       [ 35.  40.   0.]
    *       [ -4.   0.   0.]]
-   *  }
- * a: A `CSRSparseMatrix`. - * b: A `CSRSparseMatrix` with the same type and rank as `a`. - * type: The type of both `a` and `b`. - * transpose_a: If True, `a` transposed before multiplication. - * transpose_b: If True, `b` transposed before multiplication. - * adjoint_a: If True, `a` adjointed before multiplication. - * adjoint_b: If True, `b` adjointed before multiplication. + *
+ *

a: A {@code CSRSparseMatrix}. + * b: A {@code CSRSparseMatrix} with the same type and rank as {@code a}. + * type: The type of both {@code a} and {@code b}. + * transpose_a: If True, {@code a} transposed before multiplication. + * transpose_b: If True, {@code b} transposed before multiplication. + * adjoint_a: If True, {@code a} adjointed before multiplication. + * adjoint_b: If True, {@code b} adjointed before multiplication. * * @param a A CSRSparseMatrix. * @param b A CSRSparseMatrix. - * @param type - * @param options carries optional attributes values + * @param type The value of the type attribute + * @param options carries optional attribute values + * @param data type for {@code SparseMatrixSparseMatMul} output and operands * @return a new instance of SparseMatrixSparseMatMul */ - public SparseMatrixSparseMatMul sparseMatrixSparseMatMul(Operand a, - Operand b, DataType type, SparseMatrixSparseMatMul.Options... options) { + 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 - * @param options carries optional attributes values + * @param type The value of the type attribute + * @param options carries optional attribute values + * @param data type for {@code SparseMatrixTranspose} output and operands * @return a new instance of SparseMatrixTranspose */ - public SparseMatrixTranspose sparseMatrixTranspose(Operand input, - DataType type, SparseMatrixTranspose.Options... options) { + public SparseMatrixTranspose sparseMatrixTranspose( + Operand input, Class type, SparseMatrixTranspose.Options... options) { return SparseMatrixTranspose.create(scope, input, type, options); } /** - * Creates an all-zeros CSRSparseMatrix with shape `dense_shape`. + * Creates an all-zeros CSRSparseMatrix with shape {@code dense_shape}. * * @param denseShape The desired matrix shape. - * @param type + * @param type The value of the type attribute + * @param data type for {@code SparseMatrixZeros} output and operands * @return a new instance of SparseMatrixZeros */ public SparseMatrixZeros sparseMatrixZeros(Operand denseShape, - DataType type) { + Class type) { return SparseMatrixZeros.create(scope, denseShape, type); } @@ -456,8 +466,15 @@ public SparseMatrixZeros sparseMatrixZeros(Operand den * @param denseShape SparseTensor dense shape. * @return a new instance of SparseTensorToCSRSparseMatrix */ - public SparseTensorToCSRSparseMatrix sparseTensorToCSRSparseMatrix( - Operand indices, Operand values, Operand denseShape) { + 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 874c695fa93..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,8 +17,8 @@ // package org.tensorflow.op; -import org.tensorflow.DataType; import org.tensorflow.Operand; +import org.tensorflow.ndarray.Shape; import org.tensorflow.op.math.Abs; import org.tensorflow.op.math.AccumulateN; import org.tensorflow.op.math.Acos; @@ -34,19 +34,21 @@ 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.CheckNumerics; -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; import org.tensorflow.op.math.DivNoNan; @@ -62,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; @@ -94,36 +97,46 @@ 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; import org.tensorflow.op.math.UnsortedSegmentSum; import org.tensorflow.op.math.Xdivy; +import org.tensorflow.op.math.Xlog1py; import org.tensorflow.op.math.Xlogy; import org.tensorflow.op.math.Zeta; import org.tensorflow.op.math.erfinv; -import org.tensorflow.tools.Shape; import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; @@ -134,24 +147,29 @@ /** * 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; - MathOps(Scope scope) { - this.scope = scope; + private final Ops ops; + + 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) { @@ -160,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) { @@ -181,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) { @@ -192,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) { @@ -210,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) { @@ -225,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) { @@ -243,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, @@ -309,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) { @@ -445,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) { @@ -465,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) { @@ -490,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) { @@ -509,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) { @@ -530,15 +531,21 @@ public Atanh atanh(Operand x) { } /** - * Computes the Bessel i0e function of `x` element-wise. - *

- * Exponentially scaled modified Bessel function of order 0 defined as - * `bessel_i0e(x) = exp(-abs(x)) bessel_i0(x)`. - *

- * This function is faster and numerically stabler than `bessel_i0(x)`. + * The BesselI0 operation + * + * @param x The x value + * @param data type for {@code BesselI0} output and operands + * @return a new instance of BesselI0 + */ + public BesselI0 besselI0(Operand x) { + return BesselI0.create(scope, x); + } + + /** + * The BesselI0e operation * - * @param data type for {@code y()} output - * @param x + * @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) { @@ -546,15 +553,21 @@ public BesselI0e besselI0e(Operand x) { } /** - * Computes the Bessel i1e function of `x` element-wise. - *

- * Exponentially scaled modified Bessel function of order 0 defined as - * `bessel_i1e(x) = exp(-abs(x)) bessel_i1(x)`. - *

- * This function is faster and numerically stabler than `bessel_i1(x)`. + * The BesselI1 operation * - * @param data type for {@code y()} output - * @param x + * @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) { @@ -562,23 +575,18 @@ public BesselI1e besselI1e(Operand x) { } /** - * Compute the regularized incomplete beta integral \\(I_x(a, b)\\). - *

+ * Compute the regularized incomplete beta integral \(I_x(a, b)\). * The regularized incomplete beta integral is defined as: - *

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

- * where - *

- * \\(B(x; a, b) = \int_0^x t^{a-1} (1 - t)^{b-1} dt\\) - *

- * is the incomplete beta function and \\(B(a, b)\\) is the complete + *

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

where + *

\(B(x; a, b) = \int_0^x t^{a-1} (1 - t)^{b-1} dt\) + *

is the incomplete beta function and \(B(a, b)\) is the complete * beta function. * - * @param data type for {@code z()} output - * @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) { @@ -587,140 +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); } - /** - * 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. - * - * @param data type for {@code output()} output - * @param tensor - * @param message Prefix of the error message. - * @return a new instance of CheckNumerics - */ - public CheckNumerics checkNumerics(Operand tensor, String message) { - return CheckNumerics.create(scope, tensor, message); - } - - /** - * 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) { @@ -729,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) { @@ -750,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) { @@ -769,90 +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 {@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 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) { @@ -861,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) { @@ -876,14 +892,12 @@ public Div div(Operand x, Operand y) { /** * Returns 0 if the denominator is zero. - *

- * - * NOTE: `math.DivNoNan` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + * NOTE: {@code math.DivNoNan} supports broadcasting. More about broadcasting + * here * - * @param data type for {@code z()} output - * @param x - * @param y + * @param x The x value + * @param y The y value + * @param data type for {@code DivNoNan} output and operands * @return a new instance of DivNoNan */ public DivNoNan divNoNan(Operand x, Operand y) { @@ -892,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) { @@ -915,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) { @@ -926,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) { @@ -937,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) { @@ -947,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) { @@ -983,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) { @@ -1019,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) { @@ -1029,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) { @@ -1043,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) { @@ -1061,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) { @@ -1086,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) { @@ -1111,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) { @@ -1136,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) { @@ -1162,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) { @@ -1233,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) { @@ -1311,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) { @@ -1336,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) { @@ -1357,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) { @@ -1376,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) { @@ -1395,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) { @@ -1408,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 + * @param x A {@code Tensor} of type {@code bool}. * @return a new instance of LogicalNot */ public LogicalNot logicalNot(Operand x) { @@ -1419,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) { @@ -1432,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) { @@ -1448,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) { @@ -1483,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) { @@ -1501,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) { @@ -1516,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) { @@ -1530,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) { @@ -1541,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) { @@ -1553,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) { @@ -1573,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, @@ -1588,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) { @@ -1608,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) { @@ -1646,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) { @@ -1745,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) { @@ -1778,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) { @@ -1792,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) { @@ -2018,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) { @@ -2038,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) { @@ -2057,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) { @@ -2094,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) { @@ -2110,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) { @@ -2125,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) { @@ -2145,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) { @@ -2165,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) { @@ -2186,201 +2345,291 @@ 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) { return Xdivy.create(scope, x, y); } + /** + * Returns 0 if x == 0, and x * log1p(y) otherwise, elementwise. + * + * @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) { + return Xlog1py.create(scope, x, y); + } + /** * Returns 0 if x == 0, and x * log(y) otherwise, elementwise. * - * @param data type for {@code z()} output - * @param x - * @param y + * @param x The x value + * @param y The y value + * @param data type for {@code Xlogy} output and operands * @return a new instance of Xlogy */ public Xlogy xlogy(Operand x, Operand y) { @@ -2388,18 +2637,23 @@ 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) { return Zeta.create(scope, x, q); } + + /** + * 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/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 16982b062ac..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,17 +56,28 @@ import org.tensorflow.op.nn.Dilation2dBackpropFilter; import org.tensorflow.op.nn.Dilation2dBackpropInput; import org.tensorflow.op.nn.Elu; +import org.tensorflow.op.nn.EluGrad; import org.tensorflow.op.nn.FixedUnigramCandidateSampler; import org.tensorflow.op.nn.FractionalAvgPool; +import org.tensorflow.op.nn.FractionalAvgPoolGrad; import org.tensorflow.op.nn.FractionalMaxPool; +import org.tensorflow.op.nn.FractionalMaxPoolGrad; import org.tensorflow.op.nn.FusedBatchNorm; import org.tensorflow.op.nn.FusedBatchNormGrad; import org.tensorflow.op.nn.FusedPadConv2d; import org.tensorflow.op.nn.FusedResizeAndPadConv2d; +import org.tensorflow.op.nn.GRUBlockCell; +import org.tensorflow.op.nn.GRUBlockCellGrad; import org.tensorflow.op.nn.InTopK; +import org.tensorflow.op.nn.InvGrad; +import org.tensorflow.op.nn.IsotonicRegression; import org.tensorflow.op.nn.L2Loss; +import org.tensorflow.op.nn.LSTMBlockCell; +import org.tensorflow.op.nn.LSTMBlockCellGrad; +import org.tensorflow.op.nn.LeakyRelu; import org.tensorflow.op.nn.LearnedUnigramCandidateSampler; import org.tensorflow.op.nn.LocalResponseNormalization; +import org.tensorflow.op.nn.LocalResponseNormalizationGrad; import org.tensorflow.op.nn.LogSoftmax; import org.tensorflow.op.nn.MaxPool; import org.tensorflow.op.nn.MaxPool3d; @@ -69,12 +86,28 @@ import org.tensorflow.op.nn.MaxPoolGrad; import org.tensorflow.op.nn.MaxPoolGradGrad; import org.tensorflow.op.nn.MaxPoolGradGradWithArgmax; +import org.tensorflow.op.nn.MaxPoolGradWithArgmax; import org.tensorflow.op.nn.MaxPoolWithArgmax; import org.tensorflow.op.nn.NthElement; import org.tensorflow.op.nn.QuantizedAvgPool; import org.tensorflow.op.nn.QuantizedBatchNormWithGlobalNormalization; import org.tensorflow.op.nn.QuantizedBiasAdd; +import org.tensorflow.op.nn.QuantizedConv2DAndRelu; +import org.tensorflow.op.nn.QuantizedConv2DAndReluAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DPerChannel; +import org.tensorflow.op.nn.QuantizedConv2DWithBias; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRelu; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasAndReluAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndRelu; +import org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndReluAndRequantize; import org.tensorflow.op.nn.QuantizedConv2d; +import org.tensorflow.op.nn.QuantizedDepthwiseConv2D; +import org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBias; +import org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndRelu; +import org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize; import org.tensorflow.op.nn.QuantizedInstanceNorm; import org.tensorflow.op.nn.QuantizedMaxPool; import org.tensorflow.op.nn.QuantizedRelu; @@ -82,14 +115,20 @@ import org.tensorflow.op.nn.QuantizedReluX; import org.tensorflow.op.nn.Relu; import org.tensorflow.op.nn.Relu6; +import org.tensorflow.op.nn.Relu6Grad; +import org.tensorflow.op.nn.ReluGrad; import org.tensorflow.op.nn.Selu; +import org.tensorflow.op.nn.SeluGrad; import org.tensorflow.op.nn.Softmax; import org.tensorflow.op.nn.SoftmaxCrossEntropyWithLogits; import org.tensorflow.op.nn.Softsign; +import org.tensorflow.op.nn.SoftsignGrad; import org.tensorflow.op.nn.SpaceToBatch; import org.tensorflow.op.nn.SpaceToDepth; import org.tensorflow.op.nn.SparseSoftmaxCrossEntropyWithLogits; import org.tensorflow.op.nn.TopK; +import org.tensorflow.op.nn.UniformQuantizedConvolution; +import org.tensorflow.op.nn.UniformQuantizedConvolutionHybrid; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; @@ -99,27 +138,29 @@ /** * An API for building {@code nn} operations as {@link Op Op}s * - * @see {@link Ops} + * @see Ops */ public final class NnOps { private final Scope scope; - NnOps(Scope scope) { - this.scope = scope; + private final Ops ops; + + NnOps(Ops ops) { + this.scope = ops.scope(); + this.ops = 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, @@ -129,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, @@ -148,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, @@ -165,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, @@ -181,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( @@ -196,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, @@ -208,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( @@ -223,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, @@ -240,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, @@ -256,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 @@ -267,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, @@ -276,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, @@ -320,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, @@ -343,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, @@ -364,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, @@ -390,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, @@ -413,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, @@ -458,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, @@ -482,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, @@ -501,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. - * num_params_weigths: number of weight parameter matrix for all layers. + * 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( @@ -553,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_weigths: number of weight parameter matrix for all layers. + * 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( @@ -604,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, @@ -659,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. - * - * @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 + * 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 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, @@ -675,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, @@ -767,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, @@ -804,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( @@ -830,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( @@ -853,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, @@ -897,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, @@ -917,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, @@ -935,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. @@ -974,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, @@ -985,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, @@ -1007,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, @@ -1055,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. @@ -1070,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, @@ -1081,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. @@ -1102,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( @@ -1113,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 @@ -1126,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, @@ -1146,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 @@ -1158,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, @@ -1207,30 +1725,159 @@ 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) { return L2Loss.create(scope, t); } + /** + * Computes the LSTM cell forward propagation for 1 time step. + * This implementation uses 1 weight matrix and 1 bias vector, and there's an + * optional peephole connection. + *

This kernel op implements the following mathematical equations: + *

+   *  xh = [x, h_prev]
+   *  [i, f, ci, o] = xh * w + b
+   *  f = f + forget_bias
+   *
+   *  if not use_peephole:
+   *    wci = wcf = wco = 0
+   *
+   *  i = sigmoid(cs_prev * wci + i)
+   *  f = sigmoid(cs_prev * wcf + f)
+   *  ci = tanh(ci)
+   *
+   *  cs = ci .* i + cs_prev .* f
+   *  cs = clip(cs, cell_clip)
+   *
+   *  o = sigmoid(cs * wco + o)
+   *  co = tanh(cs)
+   *  h = co .* o
+   *  
+ * + * @param x The input to the LSTM cell, shape (batch_size, num_inputs). + * @param csPrev Value of the cell state at previous time step. + * @param hPrev Output of the previous cell at previous time step. + * @param w The weight matrix. + * @param wci The weight matrix for input gate peephole connection. + * @param wcf The weight matrix for forget gate peephole connection. + * @param wco The weight matrix for output gate peephole connection. + * @param b The bias vector. + * @param options carries optional attribute values + * @param data type for {@code LSTMBlockCell} output and operands + * @return a new instance of LSTMBlockCell + */ + public LSTMBlockCell lSTMBlockCell(Operand x, Operand csPrev, + Operand hPrev, Operand w, Operand wci, Operand wcf, Operand wco, Operand b, + LSTMBlockCell.Options... options) { + return LSTMBlockCell.create(scope, x, csPrev, hPrev, w, wci, wcf, wco, b, options); + } + + /** + * Computes the LSTM cell backward propagation for 1 timestep. + * This implementation is to be used in conjunction of LSTMBlockCell. + * + * @param x The input to the LSTM cell, shape (batch_size, num_inputs). + * @param csPrev The previous cell state. + * @param hPrev The previous h state. + * @param w The weight matrix. + * @param wci The weight matrix for input gate peephole connection. + * @param wcf The weight matrix for forget gate peephole connection. + * @param wco The weight matrix for output gate peephole connection. + * @param b The bias vector. + * @param i The input gate. + * @param cs The cell state before the tanh. + * @param f The forget gate. + * @param o The output gate. + * @param ci The cell input. + * @param co The cell after the tanh. + * @param csGrad The current gradient of cs. + * @param hGrad The gradient of h vector. + * @param usePeephole Whether the cell uses peephole connections. + * @param data type for {@code LSTMBlockCellGrad} output and operands + * @return a new instance of LSTMBlockCellGrad + */ + public LSTMBlockCellGrad lSTMBlockCellGrad(Operand x, Operand csPrev, + Operand hPrev, Operand w, Operand wci, Operand wcf, Operand wco, Operand b, + Operand i, Operand cs, Operand f, Operand o, Operand ci, Operand co, + Operand csGrad, Operand hGrad, Boolean usePeephole) { + return LSTMBlockCellGrad.create(scope, x, csPrev, hPrev, w, wci, wcf, wco, b, i, cs, f, o, ci, co, csGrad, hGrad, usePeephole); + } + + /** + * Computes rectified linear: {@code max(features, features * alpha)}. + * + * @param 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, + LeakyRelu.Options... options) { + return LeakyRelu.create(scope, features, options); + } + /** * 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. @@ -1243,7 +1890,7 @@ public L2Loss l2Loss(Operand t) { * 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, @@ -1254,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( @@ -1277,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) { @@ -1295,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); } @@ -1312,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, @@ -1328,18 +1990,19 @@ public MaxPool3d maxPool3d(Operand input, List k } /** - * Computes gradients of max pooling function. + * 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, @@ -1351,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, @@ -1372,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, @@ -1392,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, @@ -1412,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) { @@ -1460,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, @@ -1514,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. @@ -1523,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); @@ -1533,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. @@ -1556,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); } @@ -1643,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. @@ -1652,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) { @@ -1735,33 +2818,68 @@ 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) { return Selu.create(scope, features); } + /** + * Computes gradients for the scaled exponential linear (Selu) operation. + * + * @param gradients The backpropagated gradients to the corresponding Selu operation. + * @param outputs The outputs of the corresponding Selu operation. + * @param data type for {@code SeluGrad} output and operands + * @return a new instance of SeluGrad + */ + public SeluGrad seluGrad(Operand gradients, Operand outputs) { + return SeluGrad.create(scope, gradients, outputs); + } + /** * Computes softmax activations. - *

- * For each batch `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) { @@ -1770,14 +2888,13 @@ public Softmax softmax(Operand logits) { /** * Computes softmax cross entropy cost and gradients to backpropagate. - *

* Inputs are the logits, not probabilities. * - * @param data type for {@code loss()} output * @param features batch_size x num_classes matrix * @param labels batch_size x num_classes matrix * The caller must ensure that each batch of labels represents a valid * probability distribution. + * @param data type for {@code SoftmaxCrossEntropyWithLogits} output and operands * @return a new instance of SoftmaxCrossEntropyWithLogits */ public SoftmaxCrossEntropyWithLogits softmaxCrossEntropyWithLogits( @@ -1786,186 +2903,191 @@ public SoftmaxCrossEntropyWithLogits softmaxCrossEntropyW } /** - * 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, @@ -1975,48 +3097,190 @@ public SpaceToDepth spaceToDepth(Operand input, Long blo /** * Computes softmax cross entropy cost and gradients to backpropagate. - *

- * Unlike `SoftmaxCrossEntropyWithLogits`, this operation does not accept + * 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. + *

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. + * @param data type for {@code SparseSoftmaxCrossEntropyWithLogits} output and operands * @return a new instance of SparseSoftmaxCrossEntropyWithLogits */ - public SparseSoftmaxCrossEntropyWithLogits sparseSoftmaxCrossEntropyWithLogits( - Operand features, Operand labels) { + 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. + */ + 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 6be58021dc1..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. @@ -17,21 +17,41 @@ // package org.tensorflow.op; -import java.nio.ByteBuffer; -import java.nio.DoubleBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; -import java.nio.LongBuffer; 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; +import org.tensorflow.ndarray.DoubleNdArray; +import org.tensorflow.ndarray.FloatNdArray; +import org.tensorflow.ndarray.IntNdArray; +import org.tensorflow.ndarray.LongNdArray; +import org.tensorflow.ndarray.NdArray; +import org.tensorflow.ndarray.Shape; +import org.tensorflow.ndarray.buffer.BooleanDataBuffer; +import org.tensorflow.ndarray.buffer.ByteDataBuffer; +import org.tensorflow.ndarray.buffer.DataBuffer; +import org.tensorflow.ndarray.buffer.DoubleDataBuffer; +import org.tensorflow.ndarray.buffer.FloatDataBuffer; +import org.tensorflow.ndarray.buffer.IntDataBuffer; +import org.tensorflow.ndarray.buffer.LongDataBuffer; +import org.tensorflow.ndarray.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; @@ -46,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; @@ -81,8 +125,10 @@ 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.InitializeTable; import org.tensorflow.op.core.InitializeTableFromTextFile; @@ -90,14 +136,19 @@ 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; @@ -108,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; @@ -128,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; @@ -156,6 +221,8 @@ import org.tensorflow.op.core.ResourceScatterMin; import org.tensorflow.op.core.ResourceScatterMul; import org.tensorflow.op.core.ResourceScatterNdAdd; +import org.tensorflow.op.core.ResourceScatterNdMax; +import org.tensorflow.op.core.ResourceScatterNdMin; import org.tensorflow.op.core.ResourceScatterNdSub; import org.tensorflow.op.core.ResourceScatterNdUpdate; import org.tensorflow.op.core.ResourceScatterSub; @@ -164,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; @@ -172,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; @@ -190,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; @@ -231,35 +314,39 @@ import org.tensorflow.op.core.TensorListSetItem; import org.tensorflow.op.core.TensorListSplit; import org.tensorflow.op.core.TensorListStack; +import org.tensorflow.op.core.TensorMapErase; +import org.tensorflow.op.core.TensorMapHasKey; +import org.tensorflow.op.core.TensorMapInsert; +import org.tensorflow.op.core.TensorMapLookup; +import org.tensorflow.op.core.TensorMapSize; +import org.tensorflow.op.core.TensorMapStackKeys; import org.tensorflow.op.core.TensorScatterNdAdd; +import org.tensorflow.op.core.TensorScatterNdMax; +import org.tensorflow.op.core.TensorScatterNdMin; import org.tensorflow.op.core.TensorScatterNdSub; import org.tensorflow.op.core.TensorScatterNdUpdate; 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.While; import org.tensorflow.op.core.Zeros; import org.tensorflow.op.core.ZerosLike; -import org.tensorflow.tools.Shape; -import org.tensorflow.tools.ndarray.BooleanNdArray; -import org.tensorflow.tools.ndarray.ByteNdArray; -import org.tensorflow.tools.ndarray.DoubleNdArray; -import org.tensorflow.tools.ndarray.FloatNdArray; -import org.tensorflow.tools.ndarray.IntNdArray; -import org.tensorflow.tools.ndarray.LongNdArray; -import org.tensorflow.tools.ndarray.NdArray; import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TFloat64; @@ -281,13 +368,13 @@ * Ops tf = Ops.create(g); * // Operations are typed classes with convenience * // builders in Ops. - * Constant three = tf.val(3); + * Constant three = tf.constant(3); * // Single-result operations implement the Operand * // interface, so this works too. - * Operand four = tf.val(4); + * Operand four = tf.constant(4); * // Most builders are found within a group, and accept * // Operand types as operands - * Operand nine = tf.math.add(four, tf.val(5)); + * Operand nine = tf.math.add(four, tf.constant(5)); * // Multi-result operations however offer methods to * // select a particular result for use. * Operand result = @@ -295,37 +382,33 @@ * // Optional attributes * tf.linalg.matMul(a, b, MatMul.transposeA(true)); * // Naming operators - * tf.withName("foo").val(5); // name "foo" + * tf.withName("foo").constant(5); // name "foo" * // Names can exist in a hierarchy * Ops sub = tf.withSubScope("sub"); - * sub.withName("bar").val(4); // "sub/bar" + * sub.withName("bar").constant(4); // "sub/bar" * } * }

*/ public final class Ops { public final NnOps nn; - public final SummaryOps summary; - - public final ImageOps image; + public final ClusterOps cluster; public final DataOps data; - public final IoOps io; - - public final DtypesOps dtypes; - - 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; @@ -335,37 +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(scope); - summary = new SummaryOps(scope); - image = new ImageOps(scope); - data = new DataOps(scope); - io = new IoOps(scope); - dtypes = new DtypesOps(scope); - linalg = new LinalgOps(scope); - random = new RandomOps(scope); - strings = new StringsOps(scope); - sparse = new SparseOps(scope); - bitwise = new BitwiseOps(scope); - math = new MathOps(scope); - audio = new AudioOps(scope); - signal = new SignalOps(scope); - train = new TrainOps(scope); - quantization = new QuantizationOps(scope); + nn = new NnOps(this); + cluster = new ClusterOps(this); + data = new DataOps(this); + math = new MathOps(this); + random = new RandomOps(this); + strings = new StringsOps(this); + bitwise = new BitwiseOps(this); + debugging = new DebuggingOps(this); + collective = new CollectiveOps(this); + distribute = new DistributeOps(this); + audio = new AudioOps(this); + signal = new SignalOps(this); + train = new TrainOps(this); + quantization = new QuantizationOps(this); + summary = new SummaryOps(this); + 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) { @@ -373,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 */ @@ -479,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 */ @@ -487,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. @@ -502,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, @@ -518,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, @@ -535,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, @@ -552,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. * @@ -560,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, @@ -584,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. * @@ -592,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 @@ -643,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) { @@ -662,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 @@ -675,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); } @@ -692,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. @@ -705,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, @@ -766,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, @@ -989,1923 +1296,1303 @@ 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]`. + * [[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, {@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, {@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); } /** - * Create a constant from a Java object. - * - *

The argument {@code object} is first converted into a Tensor using {@link - * org.tensorflow.Tensor#create(Object)}, so only Objects supported by this method must be - * provided. For example: + * 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;
+   *  }
+   *  ```
+   *  
* - *
{@code
-   *  Constant.create(scope, new int[]{{1, 2}, {3, 4}}, TInt32.DTYPE); // returns a 2x2 integer matrix
-   *  }
+ *

Selects between {@link StatefulCase} and {@link StatelessCase} based on the statefulness of the function arguments. * - * @param scope is a scope used to add the underlying operation. - * @param object a Java object representing the constant. - * @return a constant of type `type` - * @see org.tensorflow.Tensor#create(Object) Tensor.create - * @deprecated use {@link Ops#val(Tensor)} instead + * @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 */ - @Deprecated - public Constant constant(Object object, DataType type) { - return Constant.create(scope, object, type); + public Case caseOp(Operand branchIndex, Iterable> input, + List> Tout, List branches, Case.Options... options) { + return Case.create(scope, branchIndex, input, Tout, branches, options); } /** - * Create a {@link TInt32} constant with data from the given buffer. - * - *

Creates a constant with the given shape by copying elements from the buffer (starting from - * its current position) into the tensor. For example, if {@code shape = {2,3} } (which represents - * a 2x3 matrix) then the buffer must have 6 elements remaining, which will be consumed by this - * method. + * 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 shape the tensor shape. - * @param data a buffer containing the tensor data. - * @return an integer constant - * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer - * @deprecated use {@link Ops#val(Tensor) Ops.constant(Tensor<TInt32>)} instead + * @param tensor The tensor value + * @param data type for {@code CheckPinned} output and operands + * @return a new instance of CheckPinned */ - @Deprecated - public Constant constant(long[] shape, IntBuffer data) { - return Constant.create(scope, shape, data); + public CheckPinned checkPinned(Operand tensor) { + return CheckPinned.create(scope, tensor); } /** - * Create a {@link TInt64} constant with data from the given buffer. - * - *

Creates a constant with the given shape by copying elements from the buffer (starting from - * its current position) into the tensor. For example, if {@code shape = {2,3} } (which represents - * a 2x3 matrix) then the buffer must have 6 elements remaining, which will be consumed by this - * method. - * - * @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 - * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer - * @deprecated use {@link Ops#val(Tensor) Ops.constant(Tensor<TInt64>)} instead + * 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 */ - @Deprecated - public Constant constant(long[] shape, LongBuffer data) { - return Constant.create(scope, shape, data); + public ClipByValue clipByValue(Operand t, Operand clipValueMin, + Operand clipValueMax) { + return ClipByValue.create(scope, t, clipValueMin, clipValueMax); } /** - * Create a {@link TFloat64} constant with data from the given buffer. + * 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. * - *

Creates a constant with the given shape by copying elements from the buffer (starting from - * its current position) into the tensor. For example, if {@code shape = {2,3} } (which represents - * a 2x3 matrix) then the buffer must have 6 elements remaining, which will be consumed by this - * method. - * - * @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 - * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer - * @deprecated use {@link Ops#val(Tensor) Ops.constant(Tensor<TFloat64>)} instead + * @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 */ - @Deprecated - public Constant constant(long[] shape, DoubleBuffer data) { - return Constant.create(scope, shape, data); + public CompositeTensorVariantFromComponents compositeTensorVariantFromComponents( + Iterable> components, String metadata) { + return CompositeTensorVariantFromComponents.create(scope, components, metadata); } /** - * Create a {@link TFloat32} constant with data from the given buffer. - * - *

Creates a constant with the given shape by copying elements from the buffer (starting from - * its current position) into the tensor. For example, if {@code shape = {2,3} } (which represents - * a 2x3 matrix) then the buffer must have 6 elements remaining, which will be consumed by this - * method. + * 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 shape the tensor shape. - * @param data a buffer containing the tensor data. - * @return a float constant - * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer - * @deprecated use {@link Ops#val(Tensor) Ops.constant(Tensor<TFloat32>)} instead + * @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 */ - @Deprecated - public Constant constant(long[] shape, FloatBuffer data) { - return Constant.create(scope, shape, data); + public CompositeTensorVariantToComponents compositeTensorVariantToComponents( + Operand encoded, String metadata, List> Tcomponents) { + return CompositeTensorVariantToComponents.create(scope, encoded, metadata, Tcomponents); } /** - * Create a constant with data from the given buffer. - * - *

Creates a Constant with the provided shape of any type where the constant data has been - * encoded into {@code data} as per the specification of the TensorFlow C - * API. + * Concatenates tensors along one dimension. * - * @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 - * @deprecated use {@link Ops#val(Tensor)} instead + * @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 */ - @Deprecated - public Constant constant(DataType type, long[] shape, ByteBuffer data) { - return Constant.create(scope, type, shape, data); + public Concat concat(Iterable> values, + Operand axis) { + return Concat.create(scope, values, axis); } /** - * This op consumes a lock created by `MutexLock`. - *

- * This op exists to consume a tensor created by `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. - * - * @param mutexLock A tensor returned by `MutexLock`. - * @return a new instance of ConsumeMutexLock - */ - public ConsumeMutexLock consumeMutexLock(Operand mutexLock) { - return ConsumeMutexLock.create(scope, mutexLock); + * 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); } /** - * Does nothing. Serves as a control trigger for scheduling. - *

- * Only useful as a placeholder for control edges. + * Creates a constant containing a single {@code int} element. * - * @return a new instance of ControlTrigger + * @param data The value to put into the new constant. + * @return an integer constant */ - public ControlTrigger controlTrigger() { - return ControlTrigger.create(scope); + public Constant constant(int data) { + return Constant.scalarOf(scope, data); } /** - * Increments 'ref' until it reaches 'limit'. + * Creates a rank-3 constant of {@code double} elements. * - * @param data type for {@code output()} output - * @param ref Should be from a scalar `Variable` node. - * @param limit If incrementing ref would bring it above limit, instead generates an - * 'OutOfRange' error. - * @return a new instance of CountUpTo + * @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 CountUpTo countUpTo(Operand ref, Long limit) { - return CountUpTo.create(scope, ref, limit); + public Constant constant(double[][][] data) { + return Constant.tensorOf(scope, data); } /** - * Makes a copy of `x`. + * Creates a rank-5 constant of {@code byte} elements. * - * @param data type for {@code y()} output - * @param x The source tensor of type `T`. - * @return a new instance of DeepCopy + * @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 DeepCopy deepCopy(Operand x) { - return DeepCopy.create(scope, x); + public Constant constant(byte[][][][][] data) { + return Constant.tensorOf(scope, data); } /** - * Delete the tensor specified by its handle in the session. + * Creates a rank-4 constant of {@code int} elements. * - * @param handle The handle for a tensor stored in the session state. - * @return a new instance of DeleteSessionTensor + * @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 DeleteSessionTensor deleteSessionTensor(Operand handle) { - return DeleteSessionTensor.create(scope, handle); + public Constant constant(int[][][][] data) { + return Constant.tensorOf(scope, data); } /** - * Deletes the resource specified by the handle. - *

- * All subsequent operations using the resource will result in a NotFound - * error status. + * Creates a constant containing a single {@code byte} element. * - * @param resource handle to the resource to delete. - * @param options carries optional attributes values - * @return a new instance of DestroyResourceOp + * @param data The value to put into the new constant. + * @return a byte constant */ - public DestroyResourceOp destroyResourceOp(Operand resource, - DestroyResourceOp.Options... options) { - return DestroyResourceOp.create(scope, resource, options); + public Constant constant(byte data) { + return Constant.scalarOf(scope, data); } /** - * 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. - * 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'. + * Creates a rank-6 constant of {@code float} elements. * - * @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. - * @return a new instance of DestroyTemporaryVariable + * @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 DestroyTemporaryVariable destroyTemporaryVariable(Operand ref, - String varName) { - return DestroyTemporaryVariable.create(scope, ref, varName); + public Constant constant(float[][][][][][] data) { + return Constant.tensorOf(scope, data); } /** - * 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`. - * 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
-   *      # Scalar partitions.
-   *      partitions = 1
-   *      num_partitions = 2
-   *      data = [10, 20]
-   *      outputs[0] = []  # Empty with shape [0, 2]
-   *      outputs[1] = [[10, 20]]
-   *
-   *      # Vector partitions.
-   *      partitions = [0, 0, 1, 1, 0]
-   *      num_partitions = 2
-   *      data = [10, 20, 30, 40, 50]
-   *      outputs[0] = [10, 20, 50]
-   *      outputs[1] = [30, 40]
-   *  }
- * See `dynamic_stitch` for an example on how to merge partitions back. - *

- *

- * - *
+ * Creates a rank-6 constant of {@code boolean} elements. * - * @param data type for {@code outputs()} output - * @param data - * @param partitions Any shape. Indices in the range `[0, num_partitions)`. - * @param numPartitions The number of partitions to output. - * @return a new instance of DynamicPartition + * @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 DynamicPartition dynamicPartition(Operand data, - Operand partitions, Long numPartitions) { - return DynamicPartition.create(scope, data, partitions, numPartitions); + public Constant constant(boolean[][][][][][] data) { + return Constant.tensorOf(scope, data); } /** - * Interleave the values from the `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
-   *      # 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 - * merged result. If you do not need this guarantee, ParallelDynamicStitch might - * perform better on some devices. - *

- * For example: - *

{@code
-   *      indices[0] = 6
-   *      indices[1] = [4, 1]
-   *      indices[2] = [[5, 2], [0, 3]]
-   *      data[0] = [61, 62]
-   *      data[1] = [[41, 42], [11, 12]]
-   *      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` - * 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])
-   *      condition_mask=tf.not_equal(x,tf.constant(-1.))
-   *      partitioned_data = tf.dynamic_partition(
-   *          x, tf.cast(condition_mask, tf.int32) , 2)
-   *      partitioned_data[1] = partitioned_data[1] + 1.0
-   *      condition_indices = tf.dynamic_partition(
-   *          tf.range(tf.shape(x)[0]), tf.cast(condition_mask, tf.int32) , 2)
-   *      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.
-   *  }
- *
- * - *
+ * Creates a rank-4 constant of {@code boolean} elements. * - * @param data type for {@code merged()} output - * @param indices - * @param data - * @return a new instance of DynamicStitch + * @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 DynamicStitch dynamicStitch(Iterable> indices, - Iterable> data) { - return DynamicStitch.create(scope, indices, data); + public Constant constant(boolean[][][][] data) { + return Constant.tensorOf(scope, data); } /** - * Computes the (possibly normalized) Levenshtein Edit Distance. - *

- * The inputs are variable-length sequences provided by SparseTensors - * (hypothesis_indices, hypothesis_values, hypothesis_shape) - * and - * (truth_indices, truth_values, truth_shape). - *

- * The inputs are: + * Creates a rank-5 constant of {@code long} elements. * - * @param hypothesisIndices The indices of the hypothesis list SparseTensor. - * This is an N x R int64 matrix. - * @param hypothesisValues The values of the hypothesis list SparseTensor. - * This is an N-length vector. - * @param hypothesisShape The shape of the hypothesis list SparseTensor. - * This is an R-length vector. - * @param truthIndices The indices of the truth list SparseTensor. - * This is an M x R int64 matrix. - * @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 - * @return a new instance of EditDistance + * @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 EditDistance editDistance(Operand hypothesisIndices, - Operand hypothesisValues, Operand hypothesisShape, Operand truthIndices, - Operand truthValues, Operand truthShape, EditDistance.Options... options) { - return EditDistance.create(scope, hypothesisIndices, hypothesisValues, hypothesisShape, truthIndices, truthValues, truthShape, options); + public Constant constant(long[][][][][] data) { + return Constant.tensorOf(scope, data); } /** - * Creates a tensor with the given shape. - *

- * This operation creates a tensor of `shape` and `dtype`. + * Creates a rank-1 constant of {@code int} elements. * - * @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 - * @return a new instance of Empty + * @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 Empty empty(Operand shape, DataType dtype, - Empty.Options... options) { - return Empty.create(scope, shape, dtype, options); + public Constant constant(int[] data) { + return Constant.vectorOf(scope, data); } /** - * 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. - * element_dtype: the type of elements in the list. - * element_shape: a shape compatible with that of elements in the list. + * Creates a rank-2 constant of {@code boolean} elements. * - * @param elementShape - * @param maxNumElements - * @param elementDtype - * @return a new instance of EmptyTensorList + * @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 EmptyTensorList emptyTensorList( - Operand elementShape, Operand maxNumElements, DataType elementDtype) { - return EmptyTensorList.create(scope, elementShape, maxNumElements, elementDtype); + public Constant constant(boolean[][] data) { + return Constant.tensorOf(scope, data); } /** - * 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. + * Creates a constant of {@code boolean} elements that is a copy of a given n-dimensional array. * - * @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. - * @return a new instance of EnsureShape + * @param data an n-dimensional array of {@code boolean} elements. + * @return a boolean constant */ - public EnsureShape ensureShape(Operand input, Shape shape) { - return EnsureShape.create(scope, input, shape); + public Constant constant(BooleanNdArray data) { + return Constant.tensorOf(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 - * 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
-   *  # '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]
-   *
-   *  # '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 - * size 1. + * Creates a rank-1 constant of {@code double} elements. * - * @param data type for {@code output()} output - * @param input - * @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)]`. - * @return a new instance of ExpandDims + * @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 ExpandDims expandDims(Operand input, - Operand axis) { - return ExpandDims.create(scope, input, axis); + public Constant constant(double[] data) { + return Constant.vectorOf(scope, data); } /** - * Extract `patches` from `input` and put them in the "depth" output dimension. 3D extension of `extract_image_patches`. + * Creates a constant of {@code long} elements that is a copy of a given n-dimensional array. * - * @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 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]`. - * @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]
-   *  }
- * @return a new instance of ExtractVolumePatches + * @param data an n-dimensional array of {@code long} elements. + * @return a long constant */ - public ExtractVolumePatches extractVolumePatches(Operand input, - List ksizes, List strides, String padding) { - return ExtractVolumePatches.create(scope, input, ksizes, strides, padding); + public Constant constant(LongNdArray data) { + return Constant.tensorOf(scope, data); } /** - * Creates a tensor filled with a scalar value. - *

- * This operation creates a tensor of shape `dims` and fills it with `value`. - *

- * For example: - *

{@code
-   *  # Output tensor has shape [2, 3].
-   *  fill([2, 3], 9) ==> [[9, 9, 9]
-   *                       [9, 9, 9]]
-   *  }
- * `tf.fill` differs from `tf.constant` in a few ways: - *