Skip to content

Commit 52f51f1

Browse files
authored
Small docs fixes (#622)
* Adding requirements.txt for doc generation and a few small Javadoc fixes. * Bumping maven-javadoc-plugin version. * Spotless fixes. * Module info help text. * Fixing the pom files so the Javadoc generates correctly.
1 parent 1f18a23 commit 52f51f1

File tree

11 files changed

+49
-70
lines changed

11 files changed

+49
-70
lines changed

docs/tools/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
GitPython
2+
requests
3+
tensorflow-docs

pom.xml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -546,16 +546,37 @@
546546
</plugin>
547547
<plugin>
548548
<artifactId>maven-javadoc-plugin</artifactId>
549-
<version>3.6.0</version>
549+
<version>3.12.0</version>
550+
<configuration>
551+
<overview>./docs/overview.md</overview>
552+
<!--<includeDependencySources>true</includeDependencySources>-->
553+
<bottom>Copyright 2015, 2025 The TensorFlow Authors. All Rights Reserved.</bottom>
554+
<additionalJOptions>
555+
<additionalJOption>-Xmaxerrs</additionalJOption>
556+
<additionalJOption>65536</additionalJOption>
557+
<additionalJOption>-Xmaxwarns</additionalJOption>
558+
<additionalJOption>65536</additionalJOption>
559+
</additionalJOptions>
560+
<failOnError>false</failOnError>
561+
<minmemory>256m</minmemory>
562+
<maxmemory>2048m</maxmemory>
563+
<links>
564+
<link>https://protobuf.dev/reference/java/api-docs</link>
565+
<link>https://bytedeco.org/javacpp/apidocs</link>
566+
</links>
567+
</configuration>
550568
<executions>
569+
<execution>
570+
<id>javadoc-site</id>
571+
<goals>
572+
<goal>javadoc</goal>
573+
</goals>
574+
</execution>
551575
<execution>
552576
<id>attach-javadocs</id>
553577
<goals>
554578
<goal>jar</goal>
555579
</goals>
556-
<configuration>
557-
<quiet>true</quiet>
558-
</configuration>
559580
</execution>
560581
</executions>
561582
</plugin>

tensorflow-core/tensorflow-core-api/pom.xml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -220,30 +220,6 @@
220220
</executions>
221221
</plugin>
222222

223-
<plugin>
224-
<artifactId>maven-javadoc-plugin</artifactId>
225-
<version>3.6.0</version>
226-
<executions>
227-
<execution>
228-
<id>attach-javadocs</id>
229-
<goals>
230-
<goal>jar</goal>
231-
</goals>
232-
<configuration>
233-
<additionalJOptions>
234-
<additionalJOption>-Xmaxerrs</additionalJOption>
235-
<additionalJOption>65536</additionalJOption>
236-
<additionalJOption>-Xmaxwarns</additionalJOption>
237-
<additionalJOption>65536</additionalJOption>
238-
</additionalJOptions>
239-
<failOnError>false</failOnError>
240-
<minmemory>256m</minmemory>
241-
<maxmemory>2048m</maxmemory>
242-
</configuration>
243-
</execution>
244-
</executions>
245-
</plugin>
246-
247223
<plugin>
248224
<groupId>org.codehaus.mojo</groupId>
249225
<artifactId>exec-maven-plugin</artifactId>

tensorflow-core/tensorflow-core-api/src/main/java/module-info.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
limitations under the License.
1515
=======================================================================
1616
*/
17+
18+
/** Core module implementing the TensorFlow Java API and operator definitions. */
1719
module tensorflow {
1820
requires transitive org.tensorflow.ndarray;
1921
requires transitive tensorflow.nativelib;

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/ByteSequenceTensorBuffer.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,11 @@
2323
import static org.tensorflow.internal.c_api.global.tensorflow.TF_TString_GetSize;
2424

2525
import java.nio.ReadOnlyBufferException;
26-
import java.util.function.Function;
2726
import org.bytedeco.javacpp.BytePointer;
2827
import org.bytedeco.javacpp.Loader;
2928
import org.bytedeco.javacpp.Pointer;
3029
import org.bytedeco.javacpp.PointerScope;
3130
import org.tensorflow.internal.c_api.TF_TString;
32-
import org.tensorflow.ndarray.NdArray;
3331
import org.tensorflow.ndarray.buffer.DataBuffer;
3432
import org.tensorflow.ndarray.impl.buffer.AbstractDataBuffer;
3533
import org.tensorflow.ndarray.impl.buffer.Validator;
@@ -40,10 +38,9 @@
4038
* <p>The values are stored as an array of {@link TF_TString}, internally wrapped with {@code
4139
* tensorflow::tstring}, which is essentially a portable version of {@code std::string}.
4240
*
43-
* <p>The data of the buffer must be initialized only once, by calling {@link #init(NdArray,
44-
* Function)}, and the buffer must have been allocated with enough space (use {@link
45-
* #computeSize(NdArray, Function)} priory to know exactly how many bytes are required to store the
46-
* data).
41+
* <p>The data of the buffer must be initialized only once, by calling {@link #init}, and the buffer
42+
* must have been allocated with enough space (use {@link #computeSize} priory to know exactly how
43+
* many bytes are required to store the data).
4744
*
4845
* <p>After its data has been initialized, the buffer is read-only as it is not possible to change
4946
* safely a value without reinitializing the whole data.
@@ -66,8 +63,8 @@ public static <T> long computeSize(ByteSequenceProvider<?> byteSequenceProvider)
6663
*
6764
* <p>While it is not enforced programmatically, it is mandatory that this method is called only
6865
* once after the creation of the buffer. The buffer must have been allocated according to the
69-
* same set of data, calling {@link #computeSize(NdArray, Function)} priory to make sure there is
70-
* enough space to store it.
66+
* same set of data, calling {@link #computeSize} priory to make sure there is enough space to
67+
* store it.
7168
*
7269
* @param byteSequenceProvider produces sequences of bytes to use as the tensor data
7370
*/

tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types/TUint16Mapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.tensorflow.types.TUint16;
3030

3131
/**
32-
* Maps memory of {@link org.tensorflow.proto.DataType#DT_Uint16} tensors to a n-dimensional data
32+
* Maps memory of {@link org.tensorflow.proto.DataType#DT_UINT16} tensors to a n-dimensional data
3333
* space.
3434
*/
3535
public final class TUint16Mapper extends TensorMapper<TUint16> {

tensorflow-core/tensorflow-core-generator/src/main/java/module-info.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414
limitations under the License.
1515
=======================================================================
1616
*/
17+
18+
/**
19+
* Code to generate the Java side implementations of TensorFlow's ops based on the TensorFlow op
20+
* definition files.
21+
*/
1722
module tensorflow.generator {
1823
requires tensorflow.nativelib;
19-
requires java.compiler;
24+
requires transitive java.compiler;
2025
requires com.github.javaparser.core;
2126
requires com.google.protobuf;
2227
requires com.google.common;
23-
requires com.squareup.javapoet;
28+
requires transitive com.squareup.javapoet;
2429
requires org.commonmark;
2530
requires spring.core;
2631

tensorflow-core/tensorflow-core-native/pom.xml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -639,34 +639,6 @@
639639
</execution>
640640
</executions>
641641
</plugin>
642-
643-
<plugin>
644-
<artifactId>maven-javadoc-plugin</artifactId>
645-
<version>3.7.0</version>
646-
<executions>
647-
<execution>
648-
<id>attach-javadocs</id>
649-
<goals>
650-
<goal>jar</goal>
651-
</goals>
652-
<configuration>
653-
<additionalJOptions>
654-
<additionalJOption>-Xmaxerrs</additionalJOption>
655-
<additionalJOption>65536</additionalJOption>
656-
<additionalJOption>-Xmaxwarns</additionalJOption>
657-
<additionalJOption>65536</additionalJOption>
658-
</additionalJOptions>
659-
<failOnError>false</failOnError>
660-
<minmemory>256m</minmemory>
661-
<maxmemory>2048m</maxmemory>
662-
<links>
663-
<link>https://protobuf.dev/reference/java/api-docs</link>
664-
<link>http://bytedeco.org/javacpp/apidocs</link>
665-
</links>
666-
</configuration>
667-
</execution>
668-
</executions>
669-
</plugin>
670642
</plugins>
671643
</build>
672644
</project>

tensorflow-core/tensorflow-core-native/src/main/java/module-info.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
limitations under the License.
1515
=======================================================================
1616
*/
17+
18+
/** Native interop with the TensorFlow C API. */
1719
module tensorflow.nativelib {
1820
requires transitive org.bytedeco.javacpp;
1921
requires transitive com.google.protobuf;

tensorflow-framework/src/main/java/module-info.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
limitations under the License.
1515
=======================================================================
1616
*/
17+
18+
/** Higher level TensorFlow framework containing model definition and training operations. */
1719
module tensorflow.framework {
18-
requires tensorflow;
19-
requires org.tensorflow.ndarray;
20+
requires transitive tensorflow;
21+
requires transitive org.tensorflow.ndarray;
2022

2123
exports org.tensorflow.framework.activations;
2224
exports org.tensorflow.framework.constraints;

0 commit comments

Comments
 (0)