From b0b3df0b24c5e3514f7756aa45a2bfccea3a5236 Mon Sep 17 00:00:00 2001 From: Adam Pocock Date: Fri, 7 Jun 2024 13:00:13 -0400 Subject: [PATCH] Javadoc updates. --- pom.xml | 2 +- tensorflow-core/tensorflow-core-api/pom.xml | 6 ++++++ .../src/main/java/org/tensorflow/Session.java | 17 ++++------------- .../src/main/java/org/tensorflow/Tensor.java | 2 +- tensorflow-core/tensorflow-core-native/pom.xml | 8 +++++++- .../internal/c_api/AbstractTF_Buffer.java | 2 +- .../internal/c_api/AbstractTF_Graph.java | 2 +- 7 files changed, 21 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 41d80cf24fa..1df4476f916 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ https://github.com/tensorflow/java.git - git@github.com:tensorflow/java.git + scm:git@github.com:tensorflow/java.git scm:git:https://github.com/tensorflow/java.git diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml index 70150b68fde..d08f7733cba 100644 --- a/tensorflow-core/tensorflow-core-api/pom.xml +++ b/tensorflow-core/tensorflow-core-api/pom.xml @@ -230,6 +230,12 @@ jar + + -Xmaxerrs + 65536 + -Xmaxwarns + 65536 + false 256m 2048m diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java index 8e65425cf35..53334983e33 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java @@ -222,7 +222,7 @@ public final class Runner { * * @param operation Is either the string name of the operation, in which case this method is a * shorthand for {@code feed(operation, 0)}, or it is a string of the form - * operation_name:output_index , in which case this method acts like {@code + * {@code operation_name:output_index}, in which case this method acts like {@code * feed(operation_name, output_index)}. These colon-separated names are commonly used in the * {@code SignatureDef} protocol buffer messages that are included in {@link * SavedModelBundle#metaGraphDef()}. @@ -284,7 +284,7 @@ public Runner feed(Operand operand, Tensor t) { * * @param operation Is either the string name of the operation, in which case this method is a * shorthand for {@code fetch(operation, 0)}, or it is a string of the form - * operation_name:output_index , in which case this method acts like {@code + * {@code operation_name:output_index}, in which case this method acts like {@code * fetch(operation_name, output_index)}. These colon-separated names are commonly used in * the {@code SignatureDef} protocol buffer messages that are included in {@link * SavedModelBundle#metaGraphDef()}. @@ -403,7 +403,7 @@ public Runner fetch(Operand operand) { * Tensors}. * * @param operation Is either the string name of the operation or it is a string of the form - * operation_name:output_index, where output_index will simply be ignored. + * {@code operation_name:output_index}, where {@code output_index} will simply be ignored. * @return this session runner * @throws IllegalArgumentException if no operation exists with the provided name */ @@ -467,16 +467,7 @@ public boolean isEmpty() { * Execute the graph fragments necessary to compute all requested fetches. * *

WARNING: The caller assumes ownership of all returned {@link Tensor Tensors}, i.e., - * the caller must call {@link Tensor#close} on all elements of the returned list to free up - * resources. - * - *

TODO(ashankar): Reconsider the return type here. Two things in particular: (a) Make it - * easier for the caller to cleanup (perhaps returning something like AutoCloseableList in - * SessionTest.java), and (b) Evaluate whether the return value should be a list, or maybe a - * {@code Map}? - * - *

TODO(andrewmyers): It would also be good if whatever is returned here made it easier to - * extract output tensors in a type-safe way. + * the caller must call {@link Result#close} to free up resources. * * @return list of resulting tensors fetched by this session runner */ diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java index 4d9f2a453b7..004269d69ea 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java @@ -100,7 +100,7 @@ static T of(Class type, Shape shape, long size) { * *

The amount of memory to allocate is derived from the datatype and the shape of the tensor. * Tensor data is initialized by calling the {@code dataInitializer}, which receives in argument - * the value returned by {@link #data()} on the allocated tensor. For example: + * the value returned by {@code data()} on the allocated tensor. For example: * *

{@code
    * FloatNdArray data = ...
diff --git a/tensorflow-core/tensorflow-core-native/pom.xml b/tensorflow-core/tensorflow-core-native/pom.xml
index fff8f9c5756..1ac8b62c95c 100644
--- a/tensorflow-core/tensorflow-core-native/pom.xml
+++ b/tensorflow-core/tensorflow-core-native/pom.xml
@@ -641,7 +641,7 @@
 
       
         maven-javadoc-plugin
-        3.6.0
+        3.7.0
         
           
             attach-javadocs
@@ -649,6 +649,12 @@
               jar
             
             
+              
+                -Xmaxerrs
+                65536
+                -Xmaxwarns
+                65536
+              
               false
               256m
               2048m
diff --git a/tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java b/tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java
index 108549a875b..e494920ee0c 100644
--- a/tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java
+++ b/tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java
@@ -56,7 +56,7 @@ public static TF_Buffer newBuffer() {
     return b;
   }
 
-  /** Returns {@code newBufferFromString(new BytePointer(proto.toByteArray())), or null if proto is null or empty. */
+  /** Returns {@code newBufferFromString(new BytePointer(proto.toByteArray()))}, or null if proto is null or empty. */
   public static TF_Buffer newBufferFromString(Message proto) {
     if (proto == null) {
       return null;
diff --git a/tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Graph.java b/tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Graph.java
index 3cc7624ab71..3795f19f30f 100644
--- a/tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Graph.java
+++ b/tensorflow-core/tensorflow-core-native/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Graph.java
@@ -44,7 +44,7 @@ public AbstractTF_Graph(Pointer p) {
   /**
    * Calls TF_NewGraph(), and registers a deallocator.
    *
-   * 

Note {@link org.tensorflow.Graph} will call TF_DeleteGraph on close, so do not use this + *

Note {@code org.tensorflow.Graph} will call TF_DeleteGraph on close, so do not use this * method when constructing a reference for use inside a {@code Graph} object. * * @return TF_Graph created. Do not call TF_DeleteGraph() on it.