Fix some javadoc warnings

PiperOrigin-RevId: 262063250
This commit is contained in:
James Ring 2019-08-06 21:58:40 -07:00 committed by TensorFlower Gardener
parent 0a25f061dd
commit a1e4ab848a
5 changed files with 29 additions and 40 deletions
tensorflow/java/src/main/java/org/tensorflow

View File

@ -141,7 +141,7 @@ public final class EagerSession implements ExecutionEnvironment, AutoCloseable {
* <p>{@link DevicePlacementPolicy#SILENT} is used by default. * <p>{@link DevicePlacementPolicy#SILENT} is used by default.
* *
* @param value policy to apply * @param value policy to apply
* @see {@link DevicePlacementPolicy} * @see DevicePlacementPolicy
*/ */
public Options devicePlacementPolicy(DevicePlacementPolicy value) { public Options devicePlacementPolicy(DevicePlacementPolicy value) {
devicePlacementPolicy = value; devicePlacementPolicy = value;
@ -154,7 +154,7 @@ public final class EagerSession implements ExecutionEnvironment, AutoCloseable {
* <p>{@link ResourceCleanupStrategy#IN_BACKGROUND} is used by default. * <p>{@link ResourceCleanupStrategy#IN_BACKGROUND} is used by default.
* *
* @param value strategy to use * @param value strategy to use
* @see {@link ResourceCleanupStrategy} * @see ResourceCleanupStrategy
*/ */
public Options resourceCleanupStrategy(ResourceCleanupStrategy value) { public Options resourceCleanupStrategy(ResourceCleanupStrategy value) {
resourceCleanupStrategy = value; resourceCleanupStrategy = value;
@ -169,8 +169,8 @@ public final class EagerSession implements ExecutionEnvironment, AutoCloseable {
* not be supported on public endpoints in the future. * not be supported on public endpoints in the future.
* *
* @param value a serialized config proto * @param value a serialized config proto
* @see * @see <a
* https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/config.proto * href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/protobuf/config.proto"/>
*/ */
public Options config(byte[] value) { public Options config(byte[] value) {
config = value; config = value;
@ -231,7 +231,7 @@ public final class EagerSession implements ExecutionEnvironment, AutoCloseable {
* @param options options to use to build default session * @param options options to use to build default session
* @return default eager session * @return default eager session
* @throws IllegalStateException if the default session is already initialized * @throws IllegalStateException if the default session is already initialized
* @see {@link #getDefault()} * @see #getDefault()
*/ */
public static EagerSession initDefault(Options options) { public static EagerSession initDefault(Options options) {
synchronized (EagerSession.class) { synchronized (EagerSession.class) {
@ -262,12 +262,12 @@ public final class EagerSession implements ExecutionEnvironment, AutoCloseable {
* Ops tf = Ops.create(); * Ops tf = Ops.create();
* *
* // Starting to build eager operations using default session, by calling * // Starting to build eager operations using default session, by calling
* // EagerSession.getDefault() explictly * // EagerSession.getDefault() explicitly
* Ops tf = Ops.create(EagerSession.getDefault()); * Ops tf = Ops.create(EagerSession.getDefault());
* }</pre> * }</pre>
* *
* @return default eager session * @return default eager session
* @see {@link #initDefault(Options)} * @see #initDefault
*/ */
public static EagerSession getDefault() { public static EagerSession getDefault() {
if (defaultSession == null) { if (defaultSession == null) {

View File

@ -226,8 +226,8 @@ public final class Graph implements ExecutionEnvironment, AutoCloseable {
* Adds operations to compute the partial derivatives of sum of {@code y}s w.r.t {@code x}s, * Adds operations to compute the partial derivatives of sum of {@code y}s w.r.t {@code x}s,
* i.e., {@code dy/dx_1, dy/dx_2...} * i.e., {@code dy/dx_1, dy/dx_2...}
* <p> * <p>
* This is a simplified version of {@link #addGradients(Output[], Output[], Output[]) where {@code y} is * This is a simplified version of {@link #addGradients(String, Output[], Output[], Output[])
* a single output, {@code dx} is null and {@code prefix} is null. * where {@code y} is a single output, {@code dx} is null and {@code prefix} is null.
* *
* @param y output of the function to derive * @param y output of the function to derive
* @param x inputs of the function for which partial derivatives are computed * @param x inputs of the function for which partial derivatives are computed

View File

@ -22,7 +22,7 @@ import java.util.List;
* Driver for {@link Graph} execution. * Driver for {@link Graph} execution.
* *
* <p>A {@code Session} instance encapsulates the environment in which {@link Operation}s in a * <p>A {@code Session} instance encapsulates the environment in which {@link Operation}s in a
* {@link Graph} are executed to compute {@link Tensor}s. For example: * {@link Graph} are executed to compute {@link Tensor Tensors}. For example:
* *
* <pre>{@code * <pre>{@code
* // Let's say graph is an instance of the Graph class * // Let's say graph is an instance of the Graph class
@ -109,12 +109,13 @@ public final class Session implements AutoCloseable {
} }
/** /**
* Run {@link Operation}s and evaluate {@link Tensor}s. * Run {@link Operation}s and evaluate {@link Tensor Tensors}.
* *
* <p>A Runner runs the necessary graph fragments to execute every {@link Operation} required to * <p>A Runner runs the necessary graph fragments to execute every {@link Operation} required to
* evaluate the {@link Tensor}s to fetch. The {@link #feed(String,int,Tensor)} call allows callers * evaluate the {@link Tensor Tensors} to fetch. The {@link #feed(String,int,Tensor)} call allows
* to override the value of {@link Tensor}s in the graph by substituting the provided {@link * callers to override the value of {@link Tensor Tensors} in the graph by substituting the
* Tensor}s for the outputs of the operations provided to {@link #feed(String,int,Tensor)}. * provided {@link Tensor Tensors} for the outputs of the operations provided to {@link
* #feed(String,int,Tensor)}.
*/ */
public final class Runner { public final class Runner {
/** /**
@ -201,7 +202,8 @@ public final class Session implements AutoCloseable {
} }
/** /**
* Make {@link #run()} execute {@code operation}, but not return any evaluated {@link Tensor}s. * Make {@link #run()} execute {@code operation}, but not return any evaluated {@link Tensor
* Tensors}.
*/ */
public Runner addTarget(String operation) { public Runner addTarget(String operation) {
GraphOperation op = operationByName(operation); GraphOperation op = operationByName(operation);
@ -212,9 +214,10 @@ public final class Session implements AutoCloseable {
} }
/** /**
* Make {@link #run()} execute {@code operation}, but not return any evaluated {@link Tensor}s. * Make {@link #run()} execute {@code operation}, but not return any evaluated {@link Tensor
* Tensors}.
* *
* @throws execption if the operation is not a {@link GraphOperation} * @throws IllegalArgumentException if the operation is not a {@link GraphOperation}
*/ */
public Runner addTarget(Operation operation) { public Runner addTarget(Operation operation) {
if (!(operation instanceof GraphOperation)) { if (!(operation instanceof GraphOperation)) {
@ -228,7 +231,8 @@ public final class Session implements AutoCloseable {
} }
/** /**
* Make {@link #run()} execute {@code operand}, but not return any evaluated {@link Tensor}s. * Make {@link #run} execute {@code operand}, but not return any evaluated {@link Tensor
* Tensors}.
*/ */
public Runner addTarget(Operand<?> operand) { public Runner addTarget(Operand<?> operand) {
return addTarget(operand.asOutput().op()); return addTarget(operand.asOutput().op());
@ -256,8 +260,8 @@ public final class Session implements AutoCloseable {
/** /**
* Execute the graph fragments necessary to compute all requested fetches. * Execute the graph fragments necessary to compute all requested fetches.
* *
* <p><b>WARNING:</b> The caller assumes ownership of all returned {@link Tensor}s, i.e., the * <p><b>WARNING:</b> The caller assumes ownership of all returned {@link Tensor Tensors}, i.e.,
* caller must call {@link Tensor#close()} on all elements of the returned list to free up * the caller must call {@link Tensor#close} on all elements of the returned list to free up
* resources. * resources.
* *
* <p>TODO(ashankar): Reconsider the return type here. Two things in particular: (a) Make it * <p>TODO(ashankar): Reconsider the return type here. Two things in particular: (a) Make it
@ -458,7 +462,7 @@ public final class Session implements AutoCloseable {
* @param inputOpIndices (see inputTensorHandles) * @param inputOpIndices (see inputTensorHandles)
* @param inputTensorHandles together with inputOpHandles and inputOpIndices specifies the values * @param inputTensorHandles together with inputOpHandles and inputOpIndices specifies the values
* that are being "fed" (do not need to be computed) during graph execution. * that are being "fed" (do not need to be computed) during graph execution.
* inputTensorHandles[i] (which correponds to a Tensor.nativeHandle) is considered to be the * inputTensorHandles[i] (which corresponds to a Tensor.nativeHandle) is considered to be the
* inputOpIndices[i]-th output of the Operation inputOpHandles[i]. Thus, it is required that * inputOpIndices[i]-th output of the Operation inputOpHandles[i]. Thus, it is required that
* inputOpHandles.length == inputOpIndices.length == inputTensorHandles.length. * inputOpHandles.length == inputOpIndices.length == inputTensorHandles.length.
* @param outputOpHandles (see outputOpIndices) * @param outputOpHandles (see outputOpIndices)

View File

@ -247,23 +247,8 @@ public final class Tensor<T> implements AutoCloseable {
return ret; return ret;
} }
/**
* Creates a Tensor of any type with data from the given buffer.
*
* <p>Creates a Tensor with the provided shape of any type where the tensor's data has been
* encoded into {@code data} as per the specification of the TensorFlow <a
* href="https://www.tensorflow.org/code/tensorflow/c/c_api.h">C
* API</a>.
*
* @param <T> The tensor element type
* @param type the tensor element type, specified as a DataType. This must agree with T.
* @param shape the tensor shape.
* @param data a buffer containing the tensor data.
* @throws IllegalArgumentException If the tensor datatype or shape is not compatible with the
* buffer
*/
private static Tensor<?> create(DataType dtype, long[] shape, ByteBuffer data) { private static Tensor<?> create(DataType dtype, long[] shape, ByteBuffer data) {
int nremaining = 0; int nremaining;
if (dtype != DataType.STRING) { if (dtype != DataType.STRING) {
int elemBytes = elemByteSize(dtype); int elemBytes = elemByteSize(dtype);
if (data.remaining() % elemBytes != 0) { if (data.remaining() % elemBytes != 0) {
@ -633,7 +618,7 @@ public final class Tensor<T> implements AutoCloseable {
* *
* <p>This helper class wraps the tensor native handle and support both situations; If an eager * <p>This helper class wraps the tensor native handle and support both situations; If an eager
* reference to the tensor exists, it will take care of releasing the tensor at the end of its * reference to the tensor exists, it will take care of releasing the tensor at the end of its
* life. If the tensor is being explicetly closed before this happens, it will take cake of * life. If the tensor is being explicitly closed before this happens, it will take cake of
* clearing its association with any eager session before cleaning up the resources. * clearing its association with any eager session before cleaning up the resources.
*/ */
private static class NativeReference { private static class NativeReference {

View File

@ -24,6 +24,6 @@ limitations under the License.
* *
* <p>TensorFlow element types are also separately represented by the {@link * <p>TensorFlow element types are also separately represented by the {@link
* org.tensorflow.DataType} enum, with one enum value per element type. The enum representation is * org.tensorflow.DataType} enum, with one enum value per element type. The enum representation is
* not usually needed, but can be obtained using {@link org.tensorflow.DataType.fromClass}. * not usually needed, but can be obtained using {@link org.tensorflow.DataType#fromClass}.
*/ */
package org.tensorflow.types; package org.tensorflow.types;