tensorflow-core-api
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core-api</artifactId>
<version>1.2.0</version>
</dependency><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core</artifactId>
<version>1.2.0</version>
</parent>
<artifactId>tensorflow-core-api</artifactId>
<packaging>jar</packaging>
<name>TensorFlow API</name>
<description>Platform-dependent native code and pure-Java code for the TensorFlow machine intelligence library.</description>
<properties>
<truth.version>1.1.5</truth.version>
<test.download.skip>false</test.download.skip>
<test.download.folder>${project.build.directory}/tf-text-download/</test.download.folder>
</properties>
<dependencies>
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-ndarray</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core-native</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core-native</artifactId>
<version>${project.version}</version>
<classifier>${native.classifier}</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>${truth.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<!--
Native Build Profile
By default, TensorFlow Java build downloads the native runtime libraries from the official Python wheels distribution
to generate Java bindings and bundle them into a JAR. This is only possible if a full TensorFlow build has been done
previously, which will take care of generating the Java protos and operators.
If you want to upgrade the version of TensorFlow in your distribution, or if you need to build TensorFlow for
a platform that is not supported officially by TensorFlow Java, you need to run locally a native build. On a
TensorFlow version upgrade, files generated by the native build can then be pushed back to TensorFlow Java GitHub
repository.
-->
<id>generating</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<!--
Execute the op class generator to generate the operators (which lives in tensorflow-core-generator).
Must be ran after native_build.sh, which generates the ops.pb file it reads.
Will be ran during the generate-sources phase.
-->
<id>generate-ops</id>
<goals>
<goal>java</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<includeProjectDependencies>false</includeProjectDependencies>
<includePluginDependencies>true</includePluginDependencies>
<mainClass>org.tensorflow.generator.op.OpGenerator</mainClass>
<arguments>
<argument>-a</argument>
<argument>${project.basedir}/src/api</argument>
<argument>-o</argument>
<argument>${project.basedir}/src/gen/java</argument>
<argument>-c</argument>
</arguments>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core-generator</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<executions>
<execution>
<!--
Generate Ops classes
All classes found in the source path that are annotated with `@Operator` are processed
to be added as an endpoint to one of the generated Ops class
-->
<id>default-compile</id>
<configuration>
<annotationProcessors>
<annotationProcessor>org.tensorflow.generator.op.processor.OperatorProcessor</annotationProcessor>
</annotationProcessors>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.tensorflow</groupId>
<artifactId>tensorflow-core-generator</artifactId>
<version>${project.version}</version>
</annotationProcessorPath>
</annotationProcessorPaths>
<!-- Important: Cannot be ${project.basedir}/src/gen/java or wherever the ops are -->
<generatedSourcesDirectory>${project.basedir}/src/gen/annotations</generatedSourcesDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.3.2</version>
<executions>
<execution>
<!--
Clean generated source files and resources
-->
<id>generated-sources-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
<configuration>
<filesets>
<fileset>
<directory>src/gen</directory>
</fileset>
</filesets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<!--
Add generated classes to the source path
These classes include TensorFlow operations wrappers, C API Java bindings and TensorFlow protos.
To regenerate these classes, use the `generating` Maven profile
-->
<id>add-gen-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/src/gen/java</source>
<source>${project.basedir}/src/gen/annotations</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<!--
Download TF-Text for the custom op loading test.
-->
<id>dist-download</id>
<phase>test-compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${test.download.skip}</skip>
<executable>bash</executable>
<arguments>
<argument>scripts/test_download.sh</argument>
<argument>${test.download.folder}</argument>
</arguments>
<environmentVariables>
<PLATFORM>${native.classifier}</PLATFORM>
</environmentVariables>
<workingDirectory>${project.basedir}</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>