diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java index 6d53cfe0347..def97e77e47 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/AudioSpectrogram.java @@ -29,69 +29,61 @@ /** * 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 * 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. */ -@Operator(group = "audio") +@Operator( + group = "audio" +) public final class AudioSpectrogram extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.audio.AudioSpectrogram} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param magnitudeSquared Whether to return the squared magnitude or just the - * magnitude. Using squared magnitude can avoid extra calculations. - */ - public Options magnitudeSquared(Boolean magnitudeSquared) { - this.magnitudeSquared = magnitudeSquared; - return this; - } - - private Boolean magnitudeSquared; - - private Options() { - } + public static final String OP_NAME = "AudioSpectrogram"; + + private Output spectrogram; + + private AudioSpectrogram(Operation operation) { + super(operation); + int outputIdx = 0; + spectrogram = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AudioSpectrogram operation. - * + * * @param scope current scope * @param input Float representation of audio data. * @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 */ - @Endpoint(describeByClass = true) - public static AudioSpectrogram create(Scope scope, Operand input, Long windowSize, Long stride, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AudioSpectrogram create(Scope scope, Operand input, Long windowSize, + Long stride, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AudioSpectrogram", scope.makeOpName("AudioSpectrogram")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -106,35 +98,51 @@ public static AudioSpectrogram create(Scope scope, Operand input, Long } return new AudioSpectrogram(opBuilder.build()); } - + /** + * Sets the magnitudeSquared option. + * * @param magnitudeSquared Whether to return the squared magnitude or just the * magnitude. Using squared magnitude can avoid extra calculations. + * @return this Options instance. */ public static Options magnitudeSquared(Boolean magnitudeSquared) { return new Options().magnitudeSquared(magnitudeSquared); } - + /** + * Gets spectrogram. * 3D representation of the audio frequencies as an image. + * @return spectrogram. */ public Output spectrogram() { return spectrogram; } - + @Override public Output asOutput() { return spectrogram; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AudioSpectrogram"; - - private Output spectrogram; - - private AudioSpectrogram(Operation operation) { - super(operation); - int outputIdx = 0; - spectrogram = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.audio.AudioSpectrogram} + */ + public static class Options { + private Boolean magnitudeSquared; + + private Options() { + } + + /** + * Sets the magnitudeSquared option. + * + * @param magnitudeSquared Whether to return the squared magnitude or just the + * magnitude. Using squared magnitude can avoid extra calculations. + * @return this Options instance. + */ + public Options magnitudeSquared(Boolean magnitudeSquared) { + this.magnitudeSquared = magnitudeSquared; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/DecodeWav.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/DecodeWav.java index 09dfa3af31f..2d69fa63df2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/DecodeWav.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/DecodeWav.java @@ -31,62 +31,49 @@ /** * 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]. */ -@Operator(group = "audio") +@Operator( + group = "audio" +) public final class DecodeWav extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.audio.DecodeWav} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param desiredChannels Number of sample channels wanted. - */ - public Options desiredChannels(Long desiredChannels) { - this.desiredChannels = desiredChannels; - return this; - } - - /** - * @param desiredSamples Length of audio requested. - */ - public Options desiredSamples(Long desiredSamples) { - this.desiredSamples = desiredSamples; - return this; - } - - private Long desiredChannels; - private Long desiredSamples; - - private Options() { - } + public static final String OP_NAME = "DecodeWav"; + + private Output audio; + + private Output sampleRate; + + private DecodeWav(Operation operation) { + super(operation); + int outputIdx = 0; + audio = operation.output(outputIdx++); + sampleRate = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeWav operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeWav create(Scope scope, Operand contents, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeWav", scope.makeOpName("DecodeWav")); opBuilder.addInput(contents.asOutput()); @@ -103,45 +90,76 @@ public static DecodeWav create(Scope scope, Operand contents, Options.. } return new DecodeWav(opBuilder.build()); } - + /** + * Sets the desiredChannels option. + * * @param desiredChannels Number of sample channels wanted. + * @return this Options instance. */ public static Options desiredChannels(Long desiredChannels) { return new Options().desiredChannels(desiredChannels); } - + /** + * Sets the desiredSamples option. + * * @param desiredSamples Length of audio requested. + * @return this Options instance. */ public static Options desiredSamples(Long desiredSamples) { return new Options().desiredSamples(desiredSamples); } - + /** - * 2-D with shape `[length, channels]`. + * Gets audio. + * 2-D with shape {@code [length, channels]}. + * @return audio. */ public Output audio() { return audio; } - + /** + * Gets sampleRate. * Scalar holding the sample rate found in the WAV header. + * @return sampleRate. */ public Output sampleRate() { return sampleRate; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeWav"; - - private Output audio; - private Output sampleRate; - - private DecodeWav(Operation operation) { - super(operation); - int outputIdx = 0; - audio = operation.output(outputIdx++); - sampleRate = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.audio.DecodeWav} + */ + public static class Options { + private Long desiredChannels; + + private Long desiredSamples; + + private Options() { + } + + /** + * Sets the desiredChannels option. + * + * @param desiredChannels Number of sample channels wanted. + * @return this Options instance. + */ + public Options desiredChannels(Long desiredChannels) { + this.desiredChannels = desiredChannels; + return this; + } + + /** + * Sets the desiredSamples option. + * + * @param desiredSamples Length of audio requested. + * @return this Options instance. + */ + public Options desiredSamples(Long desiredSamples) { + this.desiredSamples = desiredSamples; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/EncodeWav.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/EncodeWav.java index a1128280152..4eca7ec84fd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/EncodeWav.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/EncodeWav.java @@ -31,27 +31,41 @@ /** * 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). */ -@Operator(group = "audio") +@Operator( + group = "audio" +) public final class EncodeWav extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EncodeWav"; + + private Output contents; + + private EncodeWav(Operation operation) { + super(operation); + int outputIdx = 0; + contents = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EncodeWav operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static EncodeWav create(Scope scope, Operand audio, Operand sampleRate) { OperationBuilder opBuilder = scope.env().opBuilder("EncodeWav", scope.makeOpName("EncodeWav")); opBuilder.addInput(audio.asOutput()); @@ -59,27 +73,18 @@ public static EncodeWav create(Scope scope, Operand audio, Operand contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeWav"; - - private Output contents; - - private EncodeWav(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/Mfcc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/Mfcc.java index a7b618fd070..22ae99ad3c8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/Mfcc.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/audio/Mfcc.java @@ -30,7 +30,6 @@ /** * 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 @@ -38,69 +37,38 @@ * history in the speech recognition world, and https://en.wikipedia.org/wiki/Mel-frequency_cepstrum * is a good resource to learn more. */ -@Operator(group = "audio") +@Operator( + group = "audio" +) public final class Mfcc extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.audio.Mfcc} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param upperFrequencyLimit The highest frequency to use when calculating the - * ceptstrum. - */ - public Options upperFrequencyLimit(Float upperFrequencyLimit) { - this.upperFrequencyLimit = upperFrequencyLimit; - return this; - } - - /** - * @param lowerFrequencyLimit The lowest frequency to use when calculating the - * ceptstrum. - */ - public Options lowerFrequencyLimit(Float lowerFrequencyLimit) { - this.lowerFrequencyLimit = lowerFrequencyLimit; - return this; - } - - /** - * @param filterbankChannelCount Resolution of the Mel bank used internally. - */ - public Options filterbankChannelCount(Long filterbankChannelCount) { - this.filterbankChannelCount = filterbankChannelCount; - return this; - } - - /** - * @param dctCoefficientCount How many output channels to produce per time slice. - */ - public Options dctCoefficientCount(Long dctCoefficientCount) { - this.dctCoefficientCount = dctCoefficientCount; - return this; - } - - private Float upperFrequencyLimit; - private Float lowerFrequencyLimit; - private Long filterbankChannelCount; - private Long dctCoefficientCount; - - private Options() { - } + public static final String OP_NAME = "Mfcc"; + + private Output output; + + private Mfcc(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Mfcc operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static Mfcc create(Scope scope, Operand spectrogram, Operand sampleRate, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Mfcc create(Scope scope, Operand spectrogram, Operand sampleRate, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Mfcc", scope.makeOpName("Mfcc")); opBuilder.addInput(spectrogram.asOutput()); opBuilder.addInput(sampleRate.asOutput()); @@ -123,56 +91,122 @@ public static Mfcc create(Scope scope, Operand spectrogram, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Mfcc"; - - private Output output; - - private Mfcc(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.audio.Mfcc} + */ + public static class Options { + private Float upperFrequencyLimit; + + private Float lowerFrequencyLimit; + + private Long filterbankChannelCount; + + private Long dctCoefficientCount; + + private Options() { + } + + /** + * Sets the upperFrequencyLimit option. + * + * @param upperFrequencyLimit The highest frequency to use when calculating the + * ceptstrum. + * @return this Options instance. + */ + public Options upperFrequencyLimit(Float upperFrequencyLimit) { + this.upperFrequencyLimit = upperFrequencyLimit; + return this; + } + + /** + * Sets the lowerFrequencyLimit option. + * + * @param lowerFrequencyLimit The lowest frequency to use when calculating the + * ceptstrum. + * @return this Options instance. + */ + public Options lowerFrequencyLimit(Float lowerFrequencyLimit) { + this.lowerFrequencyLimit = lowerFrequencyLimit; + return this; + } + + /** + * Sets the filterbankChannelCount option. + * + * @param filterbankChannelCount Resolution of the Mel bank used internally. + * @return this Options instance. + */ + public Options filterbankChannelCount(Long filterbankChannelCount) { + this.filterbankChannelCount = filterbankChannelCount; + return this; + } + + /** + * Sets the dctCoefficientCount option. + * + * @param dctCoefficientCount How many output channels to produce per time slice. + * @return this Options instance. + */ + public Options dctCoefficientCount(Long dctCoefficientCount) { + this.dctCoefficientCount = dctCoefficientCount; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseAnd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseAnd.java index 86fad697878..4cfde6b7c7a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseAnd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseAnd.java @@ -28,69 +28,75 @@ import org.tensorflow.types.family.TNumber; /** - * 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,
  *               tf.uint8, tf.uint16, tf.uint32, tf.uint64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([0, 5, 3, 14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
  *   exp = tf.constant([0, 0, 3, 10], dtype=tf.float32)
- * 
+ *
  *   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 data type for {@code z} output */ -@Operator(group = "bitwise") +@Operator( + group = "bitwise" +) public final class BitwiseAnd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BitwiseAnd"; + + private Output z; + + private BitwiseAnd(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BitwiseAnd operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BitwiseAnd create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("BitwiseAnd", scope.makeOpName("BitwiseAnd")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new BitwiseAnd(opBuilder.build()); + return new BitwiseAnd<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BitwiseAnd"; - - private Output z; - - private BitwiseAnd(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseOr.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseOr.java index cea0b766cfe..d8d0eb67edf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseOr.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseOr.java @@ -28,69 +28,75 @@ import org.tensorflow.types.family.TNumber; /** - * 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,
  *               tf.uint8, tf.uint16, tf.uint32, tf.uint64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([0, 5, 3, 14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
  *   exp = tf.constant([5, 5, 7, 15], dtype=tf.float32)
- * 
+ *
  *   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 data type for {@code z} output */ -@Operator(group = "bitwise") +@Operator( + group = "bitwise" +) public final class BitwiseOr extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BitwiseOr"; + + private Output z; + + private BitwiseOr(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BitwiseOr operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BitwiseOr create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("BitwiseOr", scope.makeOpName("BitwiseOr")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new BitwiseOr(opBuilder.build()); + return new BitwiseOr<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BitwiseOr"; - - private Output z; - - private BitwiseOr(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseXor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseXor.java index f209732bb5c..6749b9427dd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseXor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/BitwiseXor.java @@ -28,69 +28,75 @@ import org.tensorflow.types.family.TNumber; /** - * 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,
  *               tf.uint8, tf.uint16, tf.uint32, tf.uint64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([0, 5, 3, 14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
  *   exp = tf.constant([5, 5, 4, 5],  dtype=tf.float32)
- * 
+ *
  *   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 data type for {@code z} output */ -@Operator(group = "bitwise") +@Operator( + group = "bitwise" +) public final class BitwiseXor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BitwiseXor"; + + private Output z; + + private BitwiseXor(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BitwiseXor operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BitwiseXor create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("BitwiseXor", scope.makeOpName("BitwiseXor")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new BitwiseXor(opBuilder.build()); + return new BitwiseXor<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BitwiseXor"; - - private Output z; - - private BitwiseXor(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/Invert.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/Invert.java index 4f4e063ed50..f3e64ead598 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/Invert.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/Invert.java @@ -28,22 +28,20 @@ import org.tensorflow.types.family.TNumber; /** - * 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
- * 
+ *
  * # flip 2 (00000010) to -3 (11111101)
  * tf.assert_equal(-3, bitwise_ops.invert(2))
- * 
+ *
  * dtype_list = [dtypes.int8, dtypes.int16, dtypes.int32, dtypes.int64,
  *               dtypes.uint8, dtypes.uint16, dtypes.uint32, dtypes.uint64]
- * 
+ *
  * inputs = [0, 5, 3, 14]
  * for dtype in dtype_list:
  *   # Because of issues with negative numbers, let's test this indirectly.
@@ -56,60 +54,68 @@
  *                                       input_tensor, bitwise_ops.invert(input_tensor)),
  *                                     bitwise_ops.invert(
  *                                       tf.constant(0, dtype=dtype))]
- * 
+ *
  *   expected = tf.constant([0, 0, 0, 0], dtype=tf.float32)
  *   tf.assert_equal(tf.cast(not_a_and_a, tf.float32), expected)
- * 
+ *
  *   expected = tf.cast([not_0] * 4, tf.float32)
  *   tf.assert_equal(tf.cast(not_a_or_a, tf.float32), expected)
- * 
+ *
  *   # For unsigned dtypes let's also check the result directly.
  *   if dtype.is_unsigned:
  *     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 data type for {@code y} output */ -@Operator(group = "bitwise") +@Operator( + group = "bitwise" +) public final class Invert extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Invert"; + + private Output y; + + private Invert(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Invert operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Invert} output and operands * @return a new instance of Invert */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Invert create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Invert", scope.makeOpName("Invert")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Invert(opBuilder.build()); + return new Invert<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Invert"; - - private Output y; - - private Invert(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/LeftShift.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/LeftShift.java index 98ca43ae889..ad6bfc18f5c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/LeftShift.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/LeftShift.java @@ -28,80 +28,86 @@ import org.tensorflow.types.family.TNumber; /** - * 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
  * dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([-1, -5, -3, -14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
- * 
+ *
  *   left_shift_result = bitwise_ops.left_shift(lhs, rhs)
- * 
+ *
  *   print(left_shift_result)
- * 
+ *
  * # This will print:
  * # tf.Tensor([ -32   -5 -128    0], shape=(4,), dtype=int8)
  * # tf.Tensor([   -32     -5   -384 -28672], shape=(4,), dtype=int16)
  * # tf.Tensor([   -32     -5   -384 -28672], shape=(4,), dtype=int32)
  * # tf.Tensor([   -32     -5   -384 -28672], shape=(4,), dtype=int64)
- * 
+ *
  * 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)
- * # 
- * }
- * - * - * @param data type for {@code z()} output + * # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)> + *
+ * + * @param data type for {@code z} output */ -@Operator(group = "bitwise") +@Operator( + group = "bitwise" +) public final class LeftShift extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LeftShift"; + + private Output z; + + private LeftShift(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LeftShift operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LeftShift create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("LeftShift", scope.makeOpName("LeftShift")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new LeftShift(opBuilder.build()); + return new LeftShift<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LeftShift"; - - private Output z; - - private LeftShift(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/RightShift.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/RightShift.java index 4d08a05bf1a..5660c65ea14 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/RightShift.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/bitwise/RightShift.java @@ -28,83 +28,88 @@ import org.tensorflow.types.family.TNumber; /** - * 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
  * dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64]
- * 
+ *
  * for dtype in dtype_list:
  *   lhs = tf.constant([-1, -5, -3, -14], dtype=dtype)
  *   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
- * 
+ *
  *   right_shift_result = bitwise_ops.right_shift(lhs, rhs)
- * 
+ *
  *   print(right_shift_result)
- * 
+ *
  * # This will print:
  * # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int8)
  * # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int16)
  * # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int32)
  * # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int64)
- * 
+ *
  * 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)
- * # 
- * }
- * - * - * @param data type for {@code z()} output + * # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)> + *
+ * + * @param data type for {@code z} output */ -@Operator(group = "bitwise") +@Operator( + group = "bitwise" +) public final class RightShift extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RightShift"; + + private Output z; + + private RightShift(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RightShift operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RightShift create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("RightShift", scope.makeOpName("RightShift")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new RightShift(opBuilder.build()); + return new RightShift<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RightShift"; - - private Output z; - - private RightShift(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KMC2ChainInitialization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KMC2ChainInitialization.java index 82e9b43cf61..b8cf65899ca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KMC2ChainInitialization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KMC2ChainInitialization.java @@ -24,58 +24,62 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; /** * 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. */ public final class KMC2ChainInitialization extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "KMC2ChainInitialization"; + + private Output index; + + private KMC2ChainInitialization(Operation operation) { + super(operation); + int outputIdx = 0; + index = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new KMC2ChainInitialization operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static KMC2ChainInitialization create(Scope scope, Operand distances, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static KMC2ChainInitialization create(Scope scope, Operand distances, + Operand seed) { OperationBuilder opBuilder = scope.env().opBuilder("KMC2ChainInitialization", scope.makeOpName("KMC2ChainInitialization")); opBuilder.addInput(distances.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.apply(opBuilder); return new KMC2ChainInitialization(opBuilder.build()); } - + /** + * Gets index. * Scalar with the index of the sampled point. + * @return index. */ public Output index() { return index; } - + @Override public Output asOutput() { return index; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "KMC2ChainInitialization"; - - private Output index; - - private KMC2ChainInitialization(Operation operation) { - super(operation); - int outputIdx = 0; - index = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KmeansPlusPlusInitialization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KmeansPlusPlusInitialization.java index cc163969960..79ebec34735 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KmeansPlusPlusInitialization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/cluster/KmeansPlusPlusInitialization.java @@ -24,23 +24,33 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; /** * 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. */ public final class KmeansPlusPlusInitialization extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "KmeansPlusPlusInitialization"; + + private Output samples; + + private KmeansPlusPlusInitialization(Operation operation) { + super(operation); + int outputIdx = 0; + samples = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new KmeansPlusPlusInitialization operation. - * + * * @param scope current scope * @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. @@ -51,8 +61,11 @@ public final class KmeansPlusPlusInitialization extends RawOp implements Operand * heuristic is used to sample O(log(num_to_sample)) additional points. * @return a new instance of KmeansPlusPlusInitialization */ - @Endpoint(describeByClass = true) - public static KmeansPlusPlusInitialization create(Scope scope, Operand points, Operand numToSample, Operand seed, Operand numRetriesPerSample) { + @Endpoint( + describeByClass = true + ) + public static KmeansPlusPlusInitialization create(Scope scope, Operand points, + Operand numToSample, Operand seed, Operand numRetriesPerSample) { OperationBuilder opBuilder = scope.env().opBuilder("KmeansPlusPlusInitialization", scope.makeOpName("KmeansPlusPlusInitialization")); opBuilder.addInput(points.asOutput()); opBuilder.addInput(numToSample.asOutput()); @@ -61,27 +74,18 @@ public static KmeansPlusPlusInitialization create(Scope scope, Operand opBuilder = scope.apply(opBuilder); return new KmeansPlusPlusInitialization(opBuilder.build()); } - + /** + * Gets samples. * Matrix of shape (num_to_sample, d). The sampled rows. + * @return samples. */ public Output samples() { return samples; } - + @Override public Output asOutput() { return samples; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "KmeansPlusPlusInitialization"; - - private Output samples; - - private KmeansPlusPlusInitialization(Operation operation) { - super(operation); - int outputIdx = 0; - samples = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java index 443ca7dfb98..f6eef64971b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/AllReduce.java @@ -17,6 +17,7 @@ package org.tensorflow.op.collective; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,69 +26,51 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Mutually reduces multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output + * + * @deprecated use {@link org.tensorflow.op.collective.Reduce} instead */ +@Deprecated public final class AllReduce extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.collective.AllReduce} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param waitFor - */ - public Options waitFor(List waitFor) { - this.waitFor = waitFor; - return this; - } - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private List waitFor; - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } + public static final String OP_NAME = "CollectiveReduce"; + + private Output data; + + private AllReduce(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new AllReduce operation. - * + * Factory method to create a class wrapping a new CollectiveReduce operation. + * * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param mergeOp - * @param finalOp - * @param subdivOffsets - * @param options carries optional attributes values + * @param input the input value + * @param groupSize the value of the groupSize property + * @param groupKey the value of the groupKey property + * @param instanceKey the value of the instanceKey property + * @param mergeOp the value of the mergeOp property + * @param finalOp the value of the finalOp property + * @param subdivOffsets the value of the subdivOffsets property + * @param options carries optional attribute values + * @param data type for {@code CollectiveReduce} output and operands * @return a new instance of AllReduce */ - @Endpoint(describeByClass = true) - public static AllReduce create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, String mergeOp, String finalOp, List subdivOffsets, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AllReduce create(Scope scope, Operand input, + Long groupSize, Long groupKey, Long instanceKey, String mergeOp, String finalOp, + List subdivOffsets, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveReduce", scope.makeOpName("AllReduce")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -97,7 +80,7 @@ public static AllReduce create(Scope scope, Operand in opBuilder.setAttr("merge_op", mergeOp); opBuilder.setAttr("final_op", finalOp); long[] subdivOffsetsArray = new long[subdivOffsets.size()]; - for (int i = 0; i < subdivOffsetsArray.length; ++i) { + for (int i = 0 ; i < subdivOffsetsArray.length ; i++) { subdivOffsetsArray[i] = subdivOffsets.get(i); } opBuilder.setAttr("subdiv_offsets", subdivOffsetsArray); @@ -105,7 +88,7 @@ public static AllReduce create(Scope scope, Operand in for (Options opts : options) { if (opts.waitFor != null) { long[] waitForArray = new long[opts.waitFor.size()]; - for (int i = 0; i < waitForArray.length; ++i) { + for (int i = 0 ; i < waitForArray.length ; i++) { waitForArray[i] = opts.waitFor.get(i); } opBuilder.setAttr("wait_for", waitForArray); @@ -118,49 +101,118 @@ public static AllReduce create(Scope scope, Operand in } } } - return new AllReduce(opBuilder.build()); + return new AllReduce<>(opBuilder.build()); } - + /** - * @param waitFor + * Sets the waitFor option. + * + * @param waitFor the waitFor option + * @return this Options instance. */ public static Options waitFor(List waitFor) { return new Options().waitFor(waitFor); } - + /** - * @param communicationHint + * Sets the waitFor option. + * + * @param waitFor the waitFor option + * @return this Options instance. + */ + public static Options waitFor(Long[] waitFor) { + return new Options().waitFor(waitFor); + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. */ public static Options communicationHint(String communicationHint) { return new Options().communicationHint(communicationHint); } - + /** - * @param timeoutSeconds + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. */ public static Options timeoutSeconds(Float timeoutSeconds) { return new Options().timeoutSeconds(timeoutSeconds); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveReduce"; - - private Output data; - - private AllReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.collective.AllReduce} + */ + public static class Options { + private List waitFor; + + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the waitFor option. + * + * @param waitFor the waitFor option + * @return this Options instance. + */ + public Options waitFor(List waitFor) { + this.waitFor = waitFor; + return this; + } + + /** + * Sets the waitFor option. + * + * @param waitFor the waitFor option + * @return this Options instance. + */ + public Options waitFor(Long... waitFor) { + this.waitFor = Arrays.asList(waitFor); + return this; + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java index 4ade0cfc0a6..94999f5884f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastRecv.java @@ -26,58 +26,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Receives a tensor value broadcast from another device. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output */ public final class BroadcastRecv extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.collective.BroadcastRecv} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } + public static final String OP_NAME = "CollectiveBcastRecv"; + + private Output data; + + private BroadcastRecv(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BroadcastRecv operation. - * + * Factory method to create a class wrapping a new CollectiveBcastRecv operation. + * * @param scope current scope - * @param T - * @param groupSize - * @param groupKey - * @param instanceKey - * @param shape - * @param options carries optional attributes values + * @param T the value of the T property + * @param groupSize the value of the groupSize property + * @param groupKey the value of the groupKey property + * @param instanceKey the value of the instanceKey property + * @param shape the value of the shape property + * @param options carries optional attribute values + * @param data type for {@code CollectiveBcastRecv} output and operands * @return a new instance of BroadcastRecv */ - @Endpoint(describeByClass = true) - public static BroadcastRecv create(Scope scope, Class T, Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BroadcastRecv create(Scope scope, Class T, Long groupSize, + Long groupKey, Long instanceKey, Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveBcastRecv", scope.makeOpName("BroadcastRecv")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("T", Operands.toDataType(T)); @@ -95,42 +82,74 @@ public static BroadcastRecv create(Scope scope, Class T, } } } - return new BroadcastRecv(opBuilder.build()); + return new BroadcastRecv<>(opBuilder.build()); } - + /** - * @param communicationHint + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. */ public static Options communicationHint(String communicationHint) { return new Options().communicationHint(communicationHint); } - + /** - * @param timeoutSeconds + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. */ public static Options timeoutSeconds(Float timeoutSeconds) { return new Options().timeoutSeconds(timeoutSeconds); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveBcastRecv"; - - private Output data; - - private BroadcastRecv(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.collective.BroadcastRecv} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java index 9a2646dc630..f2290763758 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/BroadcastSend.java @@ -25,58 +25,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Broadcasts a tensor value to one or more other devices. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output */ public final class BroadcastSend extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.collective.BroadcastSend} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } + public static final String OP_NAME = "CollectiveBcastSend"; + + private Output data; + + private BroadcastSend(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BroadcastSend operation. - * + * Factory method to create a class wrapping a new CollectiveBcastSend operation. + * * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param shape - * @param options carries optional attributes values + * @param input the input value + * @param groupSize the value of the groupSize property + * @param groupKey the value of the groupKey property + * @param instanceKey the value of the instanceKey property + * @param shape the value of the shape property + * @param options carries optional attribute values + * @param data type for {@code CollectiveBcastSend} output and operands * @return a new instance of BroadcastSend */ - @Endpoint(describeByClass = true) - public static BroadcastSend create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BroadcastSend create(Scope scope, Operand input, + Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveBcastSend", scope.makeOpName("BroadcastSend")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -94,42 +81,74 @@ public static BroadcastSend create(Scope scope, Operand } } } - return new BroadcastSend(opBuilder.build()); + return new BroadcastSend<>(opBuilder.build()); } - + /** - * @param communicationHint + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. */ public static Options communicationHint(String communicationHint) { return new Options().communicationHint(communicationHint); } - + /** - * @param timeoutSeconds + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. */ public static Options timeoutSeconds(Float timeoutSeconds) { return new Options().timeoutSeconds(timeoutSeconds); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveBcastSend"; - - private Output data; - - private BroadcastSend(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.collective.BroadcastSend} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Gather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Gather.java index be698afc2e7..8d8f7cc3cbb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Gather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Gather.java @@ -25,58 +25,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Mutually accumulates multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output */ public final class Gather extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.collective.Gather} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } + public static final String OP_NAME = "CollectiveGather"; + + private Output data; + + private Gather(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Gather operation. - * + * Factory method to create a class wrapping a new CollectiveGather operation. + * * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param shape - * @param options carries optional attributes values + * @param input the input value + * @param groupSize the value of the groupSize property + * @param groupKey the value of the groupKey property + * @param instanceKey the value of the instanceKey property + * @param shape the value of the shape property + * @param options carries optional attribute values + * @param data type for {@code CollectiveGather} output and operands * @return a new instance of Gather */ - @Endpoint(describeByClass = true) - public static Gather create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Gather create(Scope scope, Operand input, Long groupSize, + Long groupKey, Long instanceKey, Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveGather", scope.makeOpName("Gather")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -94,42 +81,74 @@ public static Gather create(Scope scope, Operand input } } } - return new Gather(opBuilder.build()); + return new Gather<>(opBuilder.build()); } - + /** - * @param communicationHint + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. */ public static Options communicationHint(String communicationHint) { return new Options().communicationHint(communicationHint); } - + /** - * @param timeoutSeconds + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. */ public static Options timeoutSeconds(Float timeoutSeconds) { return new Options().timeoutSeconds(timeoutSeconds); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveGather"; - - private Output data; - - private Gather(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.collective.Gather} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java index 0b90160e904..aaeee6f00f8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java @@ -24,58 +24,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Mutually accumulates multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output */ public final class GatherV2 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.collective.GatherV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } + public static final String OP_NAME = "CollectiveGatherV2"; + + private Output data; + + private GatherV2(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new GatherV2 operation. - * + * Factory method to create a class wrapping a new CollectiveGatherV2 operation. + * * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param options carries optional attributes values + * @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 CollectiveGatherV2} output and operands * @return a new instance of GatherV2 */ - @Endpoint(describeByClass = true) - public static GatherV2 create(Scope scope, Operand input, Operand groupSize, Operand groupKey, Operand instanceKey, Options... options) { + @Endpoint( + describeByClass = true + ) + public static GatherV2 create(Scope scope, Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveGatherV2", scope.makeOpName("GatherV2")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(groupSize.asOutput()); @@ -92,42 +80,74 @@ public static GatherV2 create(Scope scope, Operand inp } } } - return new GatherV2(opBuilder.build()); + return new GatherV2<>(opBuilder.build()); } - + /** - * @param communicationHint + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. */ public static Options communicationHint(String communicationHint) { return new Options().communicationHint(communicationHint); } - + /** - * @param timeoutSeconds + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. */ public static Options timeoutSeconds(Float timeoutSeconds) { return new Options().timeoutSeconds(timeoutSeconds); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveGatherV2"; - - private Output data; - - private GatherV2(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.collective.GatherV2} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java index 71f4b0804e8..ea031c4e91d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/Reduce.java @@ -17,6 +17,7 @@ package org.tensorflow.op.collective; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,69 +26,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Mutually reduces multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output */ public final class Reduce extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.collective.Reduce} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param waitFor - */ - public Options waitFor(List waitFor) { - this.waitFor = waitFor; - return this; - } - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private List waitFor; - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } + public static final String OP_NAME = "CollectiveReduce"; + + private Output data; + + private Reduce(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Reduce operation. - * + * Factory method to create a class wrapping a new CollectiveReduce operation. + * * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param mergeOp - * @param finalOp - * @param subdivOffsets - * @param options carries optional attributes values + * @param input the input value + * @param groupSize the value of the groupSize property + * @param groupKey the value of the groupKey property + * @param instanceKey the value of the instanceKey property + * @param mergeOp the value of the mergeOp property + * @param finalOp the value of the finalOp property + * @param subdivOffsets the value of the subdivOffsets property + * @param options carries optional attribute values + * @param data type for {@code CollectiveReduce} output and operands * @return a new instance of Reduce */ - @Endpoint(describeByClass = true) - public static Reduce create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, String mergeOp, String finalOp, List subdivOffsets, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Reduce create(Scope scope, Operand input, Long groupSize, + Long groupKey, Long instanceKey, String mergeOp, String finalOp, List subdivOffsets, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveReduce", scope.makeOpName("Reduce")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -97,7 +77,7 @@ public static Reduce create(Scope scope, Operand input opBuilder.setAttr("merge_op", mergeOp); opBuilder.setAttr("final_op", finalOp); long[] subdivOffsetsArray = new long[subdivOffsets.size()]; - for (int i = 0; i < subdivOffsetsArray.length; ++i) { + for (int i = 0 ; i < subdivOffsetsArray.length ; i++) { subdivOffsetsArray[i] = subdivOffsets.get(i); } opBuilder.setAttr("subdiv_offsets", subdivOffsetsArray); @@ -105,7 +85,7 @@ public static Reduce create(Scope scope, Operand input for (Options opts : options) { if (opts.waitFor != null) { long[] waitForArray = new long[opts.waitFor.size()]; - for (int i = 0; i < waitForArray.length; ++i) { + for (int i = 0 ; i < waitForArray.length ; i++) { waitForArray[i] = opts.waitFor.get(i); } opBuilder.setAttr("wait_for", waitForArray); @@ -118,49 +98,118 @@ public static Reduce create(Scope scope, Operand input } } } - return new Reduce(opBuilder.build()); + return new Reduce<>(opBuilder.build()); } - + /** - * @param waitFor + * Sets the waitFor option. + * + * @param waitFor the waitFor option + * @return this Options instance. */ public static Options waitFor(List waitFor) { return new Options().waitFor(waitFor); } - + /** - * @param communicationHint + * Sets the waitFor option. + * + * @param waitFor the waitFor option + * @return this Options instance. + */ + public static Options waitFor(Long[] waitFor) { + return new Options().waitFor(waitFor); + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. */ public static Options communicationHint(String communicationHint) { return new Options().communicationHint(communicationHint); } - + /** - * @param timeoutSeconds + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. */ public static Options timeoutSeconds(Float timeoutSeconds) { return new Options().timeoutSeconds(timeoutSeconds); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveReduce"; - - private Output data; - - private Reduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.collective.Reduce} + */ + public static class Options { + private List waitFor; + + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the waitFor option. + * + * @param waitFor the waitFor option + * @return this Options instance. + */ + public Options waitFor(List waitFor) { + this.waitFor = waitFor; + return this; + } + + /** + * Sets the waitFor option. + * + * @param waitFor the waitFor option + * @return this Options instance. + */ + public Options waitFor(Long... waitFor) { + this.waitFor = Arrays.asList(waitFor); + return this; + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java index 3e57567a099..33c7a1da9f7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java @@ -24,60 +24,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Mutually reduces multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output */ public final class ReduceV2 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.collective.ReduceV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } + public static final String OP_NAME = "CollectiveReduceV2"; + + private Output data; + + private ReduceV2(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceV2 operation. - * + * Factory method to create a class wrapping a new CollectiveReduceV2 operation. + * * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param mergeOp - * @param finalOp - * @param options carries optional attributes values + * @param input the input value + * @param groupSize the groupSize value + * @param groupKey the groupKey value + * @param instanceKey the instanceKey value + * @param mergeOp the value of the mergeOp property + * @param finalOp the value of the finalOp property + * @param options carries optional attribute values + * @param data type for {@code CollectiveReduceV2} output and operands * @return a new instance of ReduceV2 */ - @Endpoint(describeByClass = true) - public static ReduceV2 create(Scope scope, Operand input, Operand groupSize, Operand groupKey, Operand instanceKey, String mergeOp, String finalOp, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReduceV2 create(Scope scope, Operand input, + Operand groupSize, Operand groupKey, Operand instanceKey, + String mergeOp, String finalOp, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveReduceV2", scope.makeOpName("ReduceV2")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(groupSize.asOutput()); @@ -96,42 +84,74 @@ public static ReduceV2 create(Scope scope, Operand inp } } } - return new ReduceV2(opBuilder.build()); + return new ReduceV2<>(opBuilder.build()); } - + /** - * @param communicationHint + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. */ public static Options communicationHint(String communicationHint) { return new Options().communicationHint(communicationHint); } - + /** - * @param timeoutSeconds + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. */ public static Options timeoutSeconds(Float timeoutSeconds) { return new Options().timeoutSeconds(timeoutSeconds); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveReduceV2"; - - private Output data; - - private ReduceV2(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.collective.ReduceV2} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java index 9ba58260fda..acc328c114b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Abort.java @@ -26,51 +26,31 @@ /** * 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. */ @Operator public final class Abort extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.Abort} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errorMsg A string which is the message associated with the exception. - */ - public Options errorMsg(String errorMsg) { - this.errorMsg = errorMsg; - return this; - } - - /** - * @param exitWithoutError - */ - public Options exitWithoutError(Boolean exitWithoutError) { - this.exitWithoutError = exitWithoutError; - return this; - } - - private String errorMsg; - private Boolean exitWithoutError; - - private Options() { - } + public static final String OP_NAME = "Abort"; + + private Abort(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new Abort operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Abort */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Abort create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Abort", scope.makeOpName("Abort")); opBuilder = scope.apply(opBuilder); @@ -86,25 +66,58 @@ public static Abort create(Scope scope, Options... options) { } return new Abort(opBuilder.build()); } - + /** + * Sets the errorMsg option. + * * @param errorMsg A string which is the message associated with the exception. + * @return this Options instance. */ public static Options errorMsg(String errorMsg) { return new Options().errorMsg(errorMsg); } - + /** - * @param exitWithoutError + * Sets the exitWithoutError option. + * + * @param exitWithoutError the exitWithoutError option + * @return this Options instance. */ public static Options exitWithoutError(Boolean exitWithoutError) { return new Options().exitWithoutError(exitWithoutError); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Abort"; - - private Abort(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Abort} + */ + public static class Options { + private String errorMsg; + + private Boolean exitWithoutError; + + private Options() { + } + + /** + * Sets the errorMsg option. + * + * @param errorMsg A string which is the message associated with the exception. + * @return this Options instance. + */ + public Options errorMsg(String errorMsg) { + this.errorMsg = errorMsg; + return this; + } + + /** + * Sets the exitWithoutError option. + * + * @param exitWithoutError the exitWithoutError option + * @return this Options instance. + */ + public Options exitWithoutError(Boolean exitWithoutError) { + this.exitWithoutError = exitWithoutError; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/All.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/All.java index c0d9108cc7f..73f3fa1af9f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/All.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/All.java @@ -29,47 +29,42 @@ import org.tensorflow.types.family.TNumber; /** - * 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. */ @Operator public final class All extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.All} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "All"; + + private Output output; + + private All(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new All operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static All create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static All create(Scope scope, Operand input, Operand axis, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("All", scope.makeOpName("All")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,34 +78,49 @@ public static All create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "All"; - - private Output output; - - private All(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.All} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Any.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Any.java index d9b339923a0..63f4c45dcd9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Any.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Any.java @@ -29,47 +29,42 @@ import org.tensorflow.types.family.TNumber; /** - * 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 + * 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. */ @Operator public final class Any extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Any} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Any"; + + private Output output; + + private Any(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Any operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static Any create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Any create(Scope scope, Operand input, Operand axis, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Any", scope.makeOpName("Any")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,34 +78,49 @@ public static Any create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Any"; - - private Output output; - - private Any(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Any} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertThat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertThat.java index 18b628ac153..f0aa019e759 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertThat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertThat.java @@ -29,43 +29,34 @@ /** * 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. */ @Operator public final class AssertThat extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.AssertThat} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param summarize Print this many entries of each tensor. - */ - public Options summarize(Long summarize) { - this.summarize = summarize; - return this; - } - - private Long summarize; - - private Options() { - } + public static final String OP_NAME = "Assert"; + + private AssertThat(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new AssertThat operation. - * + * Factory method to create a class wrapping a new Assert operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static AssertThat create(Scope scope, Operand condition, Iterable> data, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AssertThat create(Scope scope, Operand condition, Iterable> data, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Assert", scope.makeOpName("AssertThat")); opBuilder.addInput(condition.asOutput()); opBuilder.addInputList(Operands.asOutputs(data)); @@ -79,18 +70,35 @@ public static AssertThat create(Scope scope, Operand condition, Iterable< } return new AssertThat(opBuilder.build()); } - + /** + * Sets the summarize option. + * * @param summarize Print this many entries of each tensor. + * @return this Options instance. */ public static Options summarize(Long summarize) { return new Options().summarize(summarize); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Assert"; - - private AssertThat(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.AssertThat} + */ + public static class Options { + private Long summarize; + + private Options() { + } + + /** + * Sets the summarize option. + * + * @param summarize Print this many entries of each tensor. + * @return this Options instance. + */ + public Options summarize(Long summarize) { + this.summarize = summarize; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Assign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Assign.java index e1a52db8d79..c20b3d4f0c9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Assign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Assign.java @@ -29,57 +29,41 @@ /** * 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 data type for {@code output_ref} output */ @Operator public final class Assign extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Assign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateShape If true, the operation will validate that the shape - * of 'value' matches the shape of the Tensor being assigned to. If false, - * 'ref' will take on the shape of 'value'. - */ - public Options validateShape(Boolean validateShape) { - this.validateShape = validateShape; - return this; - } - - /** - * @param useLocking If True, the assignment will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean validateShape; - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "Assign"; + + private Output outputRef; + + private Assign(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Assign operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Assign create(Scope scope, Operand ref, Operand value, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Assign create(Scope scope, Operand ref, Operand value, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Assign", scope.makeOpName("Assign")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(value.asOutput()); @@ -94,47 +78,81 @@ public static Assign create(Scope scope, Operand ref, Op } } } - return new Assign(opBuilder.build()); + return new Assign<>(opBuilder.build()); } - + /** + * Sets the validateShape option. + * * @param validateShape If true, the operation will validate that the shape * of 'value' matches the shape of the Tensor being assigned to. If false, * 'ref' will take on the shape of 'value'. + * @return this Options instance. */ public static Options validateShape(Boolean validateShape) { return new Options().validateShape(validateShape); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the assignment will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as "ref". Returned as a convenience for operations that want + * Gets outputRef. + * = Same as "ref". Returned as a convenience for operations that want * to use the new value after the variable has been reset. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Assign"; - - private Output outputRef; - - private Assign(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Assign} + */ + public static class Options { + private Boolean validateShape; + + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the validateShape option. + * + * @param validateShape If true, the operation will validate that the shape + * of 'value' matches the shape of the Tensor being assigned to. If false, + * 'ref' will take on the shape of 'value'. + * @return this Options instance. + */ + public Options validateShape(Boolean validateShape) { + this.validateShape = validateShape; + return this; + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the assignment will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAdd.java index 9aa0c54959a..1b5e0e89d40 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAdd.java @@ -29,46 +29,41 @@ /** * 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 data type for {@code output_ref} output */ @Operator public final class AssignAdd extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.AssignAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the addition will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "AssignAdd"; + + private Output outputRef; + + private AssignAdd(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AssignAdd operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static AssignAdd create(Scope scope, Operand ref, Operand value, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AssignAdd create(Scope scope, Operand ref, Operand value, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AssignAdd", scope.makeOpName("AssignAdd")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(value.asOutput()); @@ -80,38 +75,54 @@ public static AssignAdd create(Scope scope, Operand ref, } } } - return new AssignAdd(opBuilder.build()); + return new AssignAdd<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the addition will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as "ref". Returned as a convenience for operations that want + * Gets outputRef. + * = Same as "ref". Returned as a convenience for operations that want * to use the new value after the variable has been updated. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignAdd"; - - private Output outputRef; - - private AssignAdd(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.AssignAdd} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the addition will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAddVariableOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAddVariableOp.java index 6bb441bd9c7..eabf77fddae 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAddVariableOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignAddVariableOp.java @@ -28,34 +28,37 @@ /** * 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. */ @Operator public final class AssignAddVariableOp extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssignAddVariableOp"; + + private AssignAddVariableOp(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new AssignAddVariableOp operation. - * + * * @param scope current scope * @param resource handle to the resource in which to store the variable. * @param value the value by which the variable will be incremented. * @return a new instance of AssignAddVariableOp */ - @Endpoint(describeByClass = true) - public static AssignAddVariableOp create(Scope scope, Operand resource, Operand value) { + @Endpoint( + describeByClass = true + ) + public static AssignAddVariableOp create(Scope scope, Operand resource, + Operand value) { OperationBuilder opBuilder = scope.env().opBuilder("AssignAddVariableOp", scope.makeOpName("AssignAddVariableOp")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); return new AssignAddVariableOp(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignAddVariableOp"; - - private AssignAddVariableOp(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSub.java index 5b7a24d763a..97483964362 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSub.java @@ -29,46 +29,41 @@ /** * 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 data type for {@code output_ref} output */ @Operator public final class AssignSub extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.AssignSub} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "AssignSub"; + + private Output outputRef; + + private AssignSub(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AssignSub operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static AssignSub create(Scope scope, Operand ref, Operand value, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AssignSub create(Scope scope, Operand ref, Operand value, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AssignSub", scope.makeOpName("AssignSub")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(value.asOutput()); @@ -80,38 +75,54 @@ public static AssignSub create(Scope scope, Operand ref, } } } - return new AssignSub(opBuilder.build()); + return new AssignSub<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as "ref". Returned as a convenience for operations that want + * Gets outputRef. + * = Same as "ref". Returned as a convenience for operations that want * to use the new value after the variable has been updated. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignSub"; - - private Output outputRef; - - private AssignSub(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.AssignSub} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSubVariableOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSubVariableOp.java index dc2ce281c7e..37fb16f97ce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSubVariableOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignSubVariableOp.java @@ -28,34 +28,37 @@ /** * 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. */ @Operator public final class AssignSubVariableOp extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssignSubVariableOp"; + + private AssignSubVariableOp(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new AssignSubVariableOp operation. - * + * * @param scope current scope * @param resource handle to the resource in which to store the variable. * @param value the value by which the variable will be incremented. * @return a new instance of AssignSubVariableOp */ - @Endpoint(describeByClass = true) - public static AssignSubVariableOp create(Scope scope, Operand resource, Operand value) { + @Endpoint( + describeByClass = true + ) + public static AssignSubVariableOp create(Scope scope, Operand resource, + Operand value) { OperationBuilder opBuilder = scope.env().opBuilder("AssignSubVariableOp", scope.makeOpName("AssignSubVariableOp")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); return new AssignSubVariableOp(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignSubVariableOp"; - - private AssignSubVariableOp(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignVariableOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignVariableOp.java index 4fd1a56a06f..47423220ecb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignVariableOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssignVariableOp.java @@ -28,34 +28,37 @@ /** * 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. */ @Operator public final class AssignVariableOp extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssignVariableOp"; + + private AssignVariableOp(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new AssignVariableOp operation. - * + * * @param scope current scope * @param resource handle to the resource in which to store the variable. * @param value the value to set the new tensor to use. * @return a new instance of AssignVariableOp */ - @Endpoint(describeByClass = true) - public static AssignVariableOp create(Scope scope, Operand resource, Operand value) { + @Endpoint( + describeByClass = true + ) + public static AssignVariableOp create(Scope scope, Operand resource, + Operand value) { OperationBuilder opBuilder = scope.env().opBuilder("AssignVariableOp", scope.makeOpName("AssignVariableOp")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); return new AssignVariableOp(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssignVariableOp"; - - private AssignVariableOp(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Barrier.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Barrier.java index b429cce3084..b18d8ad1b1c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Barrier.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Barrier.java @@ -17,6 +17,7 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -33,11 +34,9 @@ /** * 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, @@ -45,68 +44,32 @@ */ @Operator public final class Barrier extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Barrier} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shapes The shape of each component in a value. Each shape must be 1 in the - * first dimension. The length of this attr must be the same as the length of - * component_types. - */ - public Options shapes(List shapes) { - this.shapes = shapes; - return this; - } - - /** - * @param capacity The capacity of the barrier. The default capacity is MAX_INT32, - * which is the largest capacity of the underlying queue. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param container If non-empty, this barrier is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this barrier will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private List shapes; - private Long capacity; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "Barrier"; + + private Output handle; + + private Barrier(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Barrier operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static Barrier create(Scope scope, List> componentTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Barrier create(Scope scope, List> componentTypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Barrier", scope.makeOpName("Barrier")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); @@ -114,7 +77,7 @@ public static Barrier create(Scope scope, List> component for (Options opts : options) { if (opts.shapes != null) { Shape[] shapesArray = new Shape[opts.shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = opts.shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -132,60 +95,153 @@ public static Barrier create(Scope scope, List> component } return new Barrier(opBuilder.build()); } - + /** + * Sets the shapes option. + * * @param shapes The shape of each component in a value. Each shape must be 1 in the * first dimension. The length of this attr must be the same as the length of * component_types. + * @return this Options instance. */ public static Options shapes(List shapes) { return new Options().shapes(shapes); } - + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. Each shape must be 1 in the + * first dimension. The length of this attr must be the same as the length of + * component_types. + * @return this Options instance. + */ + public static Options shapes(Shape[] shapes) { + return new Options().shapes(shapes); + } + /** + * Sets the capacity option. + * * @param capacity The capacity of the barrier. The default capacity is MAX_INT32, * which is the largest capacity of the underlying queue. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the container option. + * * @param container If non-empty, this barrier is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this barrier will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the barrier. + * @return handle. */ public Output handle() { return handle; } - + @Override public Output asOutput() { return handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Barrier"; - - private Output handle; - - private Barrier(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Barrier} + */ + public static class Options { + private List shapes; + + private Long capacity; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. Each shape must be 1 in the + * first dimension. The length of this attr must be the same as the length of + * component_types. + * @return this Options instance. + */ + public Options shapes(List shapes) { + this.shapes = shapes; + return this; + } + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. Each shape must be 1 in the + * first dimension. The length of this attr must be the same as the length of + * component_types. + * @return this Options instance. + */ + public Options shapes(Shape... shapes) { + this.shapes = Arrays.asList(shapes); + return this; + } + + /** + * Sets the capacity option. + * + * @param capacity The capacity of the barrier. The default capacity is MAX_INT32, + * which is the largest capacity of the underlying queue. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this barrier is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this barrier will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierClose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierClose.java index 6cb3ba70661..09ad79d51bd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierClose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierClose.java @@ -28,7 +28,6 @@ /** * 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 @@ -38,37 +37,26 @@ */ @Operator public final class BarrierClose extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.BarrierClose} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param cancelPendingEnqueues If true, all pending enqueue requests that are - * blocked on the barrier's queue will be canceled. InsertMany will fail, even - * if no new key is introduced. - */ - public Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { - this.cancelPendingEnqueues = cancelPendingEnqueues; - return this; - } - - private Boolean cancelPendingEnqueues; - - private Options() { - } + public static final String OP_NAME = "BarrierClose"; + + private BarrierClose(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new BarrierClose operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BarrierClose create(Scope scope, Operand handle, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BarrierClose", scope.makeOpName("BarrierClose")); opBuilder.addInput(handle.asOutput()); @@ -82,20 +70,39 @@ public static BarrierClose create(Scope scope, Operand handle, Options. } return new BarrierClose(opBuilder.build()); } - + /** + * Sets the cancelPendingEnqueues option. + * * @param cancelPendingEnqueues If true, all pending enqueue requests that are * blocked on the barrier's queue will be canceled. InsertMany will fail, even * if no new key is introduced. + * @return this Options instance. */ public static Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { return new Options().cancelPendingEnqueues(cancelPendingEnqueues); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierClose"; - - private BarrierClose(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.BarrierClose} + */ + public static class Options { + private Boolean cancelPendingEnqueues; + + private Options() { + } + + /** + * Sets the cancelPendingEnqueues option. + * + * @param cancelPendingEnqueues If true, all pending enqueue requests that are + * blocked on the barrier's queue will be canceled. InsertMany will fail, even + * if no new key is introduced. + * @return this Options instance. + */ + public Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { + this.cancelPendingEnqueues = cancelPendingEnqueues; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierIncompleteSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierIncompleteSize.java index e7775646c69..7c30abc15f1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierIncompleteSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierIncompleteSize.java @@ -33,43 +33,48 @@ */ @Operator public final class BarrierIncompleteSize extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BarrierIncompleteSize"; + + private Output output; + + private BarrierIncompleteSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BarrierIncompleteSize operation. - * + * * @param scope current scope * @param handle The handle to a barrier. * @return a new instance of BarrierIncompleteSize */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BarrierIncompleteSize create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("BarrierIncompleteSize", scope.makeOpName("BarrierIncompleteSize")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); return new BarrierIncompleteSize(opBuilder.build()); } - + /** + * Gets output. * The number of incomplete elements (i.e. those with some of their value * components not set) in the barrier. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierIncompleteSize"; - - private Output output; - - private BarrierIncompleteSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierInsertMany.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierInsertMany.java index 5bd70a0a197..f321bf67018 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierInsertMany.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierInsertMany.java @@ -29,7 +29,6 @@ /** * 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 @@ -37,10 +36,18 @@ */ @Operator public final class BarrierInsertMany extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BarrierInsertMany"; + + private BarrierInsertMany(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new BarrierInsertMany operation. - * + * * @param scope current scope * @param handle The handle to a barrier. * @param keys A one-dimensional tensor of keys, with length n. @@ -49,8 +56,11 @@ public final class BarrierInsertMany extends RawOp { * @param componentIndex The component of the barrier elements that is being assigned. * @return a new instance of BarrierInsertMany */ - @Endpoint(describeByClass = true) - public static BarrierInsertMany create(Scope scope, Operand handle, Operand keys, Operand values, Long componentIndex) { + @Endpoint( + describeByClass = true + ) + public static BarrierInsertMany create(Scope scope, Operand handle, + Operand keys, Operand values, Long componentIndex) { OperationBuilder opBuilder = scope.env().opBuilder("BarrierInsertMany", scope.makeOpName("BarrierInsertMany")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(keys.asOutput()); @@ -59,11 +69,4 @@ public static BarrierInsertMany create(Scope scope, Operand handle, Ope opBuilder.setAttr("component_index", componentIndex); return new BarrierInsertMany(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierInsertMany"; - - private BarrierInsertMany(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierReadySize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierReadySize.java index 61c7412a003..6f296a79f28 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierReadySize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierReadySize.java @@ -33,43 +33,48 @@ */ @Operator public final class BarrierReadySize extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BarrierReadySize"; + + private Output output; + + private BarrierReadySize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BarrierReadySize operation. - * + * * @param scope current scope * @param handle The handle to a barrier. * @return a new instance of BarrierReadySize */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BarrierReadySize create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("BarrierReadySize", scope.makeOpName("BarrierReadySize")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); return new BarrierReadySize(opBuilder.build()); } - + /** + * Gets output. * The number of complete elements (i.e. those with all of their value * components set) in the barrier. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierReadySize"; - - private Output output; - - private BarrierReadySize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierTakeMany.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierTakeMany.java index 4bf16ef62e0..69499753169 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierTakeMany.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BarrierTakeMany.java @@ -35,71 +35,54 @@ /** * 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. */ @Operator public final class BarrierTakeMany extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.BarrierTakeMany} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param allowSmallBatch Allow to return less than num_elements items if barrier is - * already closed. - */ - public Options allowSmallBatch(Boolean allowSmallBatch) { - this.allowSmallBatch = allowSmallBatch; - return this; - } - - /** - * @param waitForIncomplete - */ - public Options waitForIncomplete(Boolean waitForIncomplete) { - this.waitForIncomplete = waitForIncomplete; - return this; - } - - /** - * @param timeoutMs If the queue is empty, this operation will block for up to - * timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Boolean allowSmallBatch; - private Boolean waitForIncomplete; - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "BarrierTakeMany"; + + private Output indices; + + private Output keys; + + private List> values; + + @SuppressWarnings("unchecked") + private BarrierTakeMany(Operation operation) { + super(operation); + int outputIdx = 0; + indices = operation.output(outputIdx++); + keys = operation.output(outputIdx++); + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new BarrierTakeMany operation. - * + * * @param scope current scope * @param handle The handle to a barrier. * @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 */ - @Endpoint(describeByClass = true) - public static BarrierTakeMany create(Scope scope, Operand handle, Operand numElements, List> componentTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BarrierTakeMany create(Scope scope, Operand handle, + Operand numElements, List> componentTypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BarrierTakeMany", scope.makeOpName("BarrierTakeMany")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numElements.asOutput()); @@ -120,69 +103,117 @@ public static BarrierTakeMany create(Scope scope, Operand handle, Opera } return new BarrierTakeMany(opBuilder.build()); } - + /** + * Sets the allowSmallBatch option. + * * @param allowSmallBatch Allow to return less than num_elements items if barrier is * already closed. + * @return this Options instance. */ public static Options allowSmallBatch(Boolean allowSmallBatch) { return new Options().allowSmallBatch(allowSmallBatch); } - + /** - * @param waitForIncomplete + * Sets the waitForIncomplete option. + * + * @param waitForIncomplete the waitForIncomplete option + * @return this Options instance. */ public static Options waitForIncomplete(Boolean waitForIncomplete) { return new Options().waitForIncomplete(waitForIncomplete); } - + /** + * Sets the timeoutMs option. + * * @param timeoutMs If the queue is empty, this operation will block for up to * timeout_ms milliseconds. * Note: This option is not supported yet. + * @return this Options instance. */ public static Options timeoutMs(Long timeoutMs) { return new Options().timeoutMs(timeoutMs); } - + /** + * Gets indices. * A one-dimensional tensor of indices, with length num_elems. * These indices refer to the batch in which the values were placed into the * barrier (starting with MIN_LONG and increasing with each BarrierInsertMany). + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets keys. * A one-dimensional tensor of keys, with length num_elements. + * @return keys. */ public Output keys() { return keys; } - + /** + * Gets values. * One any-dimensional tensor per component in a barrier element. All * values have length num_elements in the 0th dimension. + * @return values. */ public List> values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BarrierTakeMany"; - - private Output indices; - private Output keys; - private List> values; - - private BarrierTakeMany(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - keys = operation.output(outputIdx++); - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.BarrierTakeMany} + */ + public static class Options { + private Boolean allowSmallBatch; + + private Boolean waitForIncomplete; + + private Long timeoutMs; + + private Options() { + } + + /** + * Sets the allowSmallBatch option. + * + * @param allowSmallBatch Allow to return less than num_elements items if barrier is + * already closed. + * @return this Options instance. + */ + public Options allowSmallBatch(Boolean allowSmallBatch) { + this.allowSmallBatch = allowSmallBatch; + return this; + } + + /** + * Sets the waitForIncomplete option. + * + * @param waitForIncomplete the waitForIncomplete option + * @return this Options instance. + */ + public Options waitForIncomplete(Boolean waitForIncomplete) { + this.waitForIncomplete = waitForIncomplete; + return this; + } + + /** + * Sets the timeoutMs option. + * + * @param timeoutMs If the queue is empty, this operation will block for up to + * timeout_ms milliseconds. + * Note: This option is not supported yet. + * @return this Options instance. + */ + public Options timeoutMs(Long timeoutMs) { + this.timeoutMs = timeoutMs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Batch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Batch.java index d68ed353822..066c44a18b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Batch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Batch.java @@ -32,116 +32,79 @@ /** * 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. */ @Operator public final class Batch extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.Batch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxEnqueuedBatches - */ - public Options maxEnqueuedBatches(Long maxEnqueuedBatches) { - this.maxEnqueuedBatches = maxEnqueuedBatches; - return this; - } - - /** - * @param allowedBatchSizes - */ - public Options allowedBatchSizes(List allowedBatchSizes) { - this.allowedBatchSizes = allowedBatchSizes; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param batchingQueue - */ - public Options batchingQueue(String batchingQueue) { - this.batchingQueue = batchingQueue; - return this; - } - - private Long maxEnqueuedBatches; - private List allowedBatchSizes; - private String container; - private String sharedName; - private String batchingQueue; - - private Options() { - } + public static final String OP_NAME = "Batch"; + + private List> batchedTensors; + + private Output batchIndex; + + private Output id; + + @SuppressWarnings("unchecked") + private Batch(Operation operation) { + super(operation); + int outputIdx = 0; + int batchedTensorsLength = operation.outputListLength("batched_tensors"); + batchedTensors = Arrays.asList(operation.outputList(outputIdx, batchedTensorsLength)); + outputIdx += batchedTensorsLength; + batchIndex = operation.output(outputIdx++); + id = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Batch operation. - * + * * @param scope current scope - * @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 property + * @param maxBatchSize the value of the maxBatchSize property + * @param batchTimeoutMicros the value of the batchTimeoutMicros property + * @param gradTimeoutMicros the value of the gradTimeoutMicros property + * @param options carries optional attribute values * @return a new instance of Batch */ - @Endpoint(describeByClass = true) - public static Batch create(Scope scope, Iterable> inTensors, Long numBatchThreads, Long maxBatchSize, Long batchTimeoutMicros, Long gradTimeoutMicros, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Batch create(Scope scope, Iterable> inTensors, Long numBatchThreads, + Long maxBatchSize, Long batchTimeoutMicros, Long gradTimeoutMicros, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Batch", scope.makeOpName("Batch")); opBuilder.addInputList(Operands.asOutputs(inTensors)); opBuilder = scope.apply(opBuilder); @@ -156,7 +119,7 @@ public static Batch create(Scope scope, Iterable> inTensors, Long num } if (opts.allowedBatchSizes != null) { long[] allowedBatchSizesArray = new long[opts.allowedBatchSizes.size()]; - for (int i = 0; i < allowedBatchSizesArray.length; ++i) { + for (int i = 0 ; i < allowedBatchSizesArray.length ; i++) { allowedBatchSizesArray[i] = opts.allowedBatchSizes.get(i); } opBuilder.setAttr("allowed_batch_sizes", allowedBatchSizesArray); @@ -174,74 +137,175 @@ public static Batch create(Scope scope, Iterable> inTensors, Long num } return new Batch(opBuilder.build()); } - + /** - * @param maxEnqueuedBatches + * Sets the maxEnqueuedBatches option. + * + * @param maxEnqueuedBatches the maxEnqueuedBatches option + * @return this Options instance. */ public static Options maxEnqueuedBatches(Long maxEnqueuedBatches) { return new Options().maxEnqueuedBatches(maxEnqueuedBatches); } - + /** - * @param allowedBatchSizes + * Sets the allowedBatchSizes option. + * + * @param allowedBatchSizes the allowedBatchSizes option + * @return this Options instance. */ public static Options allowedBatchSizes(List allowedBatchSizes) { return new Options().allowedBatchSizes(allowedBatchSizes); } - + /** - * @param container + * Sets the allowedBatchSizes option. + * + * @param allowedBatchSizes the allowedBatchSizes option + * @return this Options instance. + */ + public static Options allowedBatchSizes(Long[] allowedBatchSizes) { + return new Options().allowedBatchSizes(allowedBatchSizes); + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param batchingQueue + * Sets the batchingQueue option. + * + * @param batchingQueue the batchingQueue option + * @return this Options instance. */ public static Options batchingQueue(String batchingQueue) { return new Options().batchingQueue(batchingQueue); } - + /** + * Gets batchedTensors. + * + * @return batchedTensors. */ public List> batchedTensors() { return batchedTensors; } - + /** + * Gets batchIndex. + * + * @return batchIndex. */ public Output batchIndex() { return batchIndex; } - + /** + * Gets id. + * + * @return id. */ public Output id() { return id; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Batch"; - - private List> batchedTensors; - private Output batchIndex; - private Output id; - - private Batch(Operation operation) { - super(operation); - int outputIdx = 0; - int batchedTensorsLength = operation.outputListLength("batched_tensors"); - batchedTensors = Arrays.asList(operation.outputList(outputIdx, batchedTensorsLength)); - outputIdx += batchedTensorsLength; - batchIndex = operation.output(outputIdx++); - id = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Batch} + */ + public static class Options { + private Long maxEnqueuedBatches; + + private List allowedBatchSizes; + + private String container; + + private String sharedName; + + private String batchingQueue; + + private Options() { + } + + /** + * Sets the maxEnqueuedBatches option. + * + * @param maxEnqueuedBatches the maxEnqueuedBatches option + * @return this Options instance. + */ + public Options maxEnqueuedBatches(Long maxEnqueuedBatches) { + this.maxEnqueuedBatches = maxEnqueuedBatches; + return this; + } + + /** + * Sets the allowedBatchSizes option. + * + * @param allowedBatchSizes the allowedBatchSizes option + * @return this Options instance. + */ + public Options allowedBatchSizes(List allowedBatchSizes) { + this.allowedBatchSizes = allowedBatchSizes; + return this; + } + + /** + * Sets the allowedBatchSizes option. + * + * @param allowedBatchSizes the allowedBatchSizes option + * @return this Options instance. + */ + public Options allowedBatchSizes(Long... allowedBatchSizes) { + this.allowedBatchSizes = Arrays.asList(allowedBatchSizes); + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the batchingQueue option. + * + * @param batchingQueue the batchingQueue option + * @return this Options instance. + */ + public Options batchingQueue(String batchingQueue) { + this.batchingQueue = batchingQueue; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpace.java index bf5100836e8..1e706ba8f9e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpace.java @@ -30,118 +30,120 @@ /** * 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. - * - * @param data type for {@code output()} output + * 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 */ @Operator public final class BatchToSpace extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchToSpace"; + + private Output output; + + private BatchToSpace(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchToSpace operation. - * + * * @param scope current scope * @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 property + * @param data type for {@code BatchToSpace} output and operands * @return a new instance of BatchToSpace */ - @Endpoint(describeByClass = true) - public static BatchToSpace create(Scope scope, Operand input, Operand crops, Long blockSize) { + @Endpoint( + describeByClass = true + ) + public static BatchToSpace create(Scope scope, Operand input, + Operand crops, Long blockSize) { OperationBuilder opBuilder = scope.env().opBuilder("BatchToSpace", scope.makeOpName("BatchToSpace")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(crops.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("block_size", blockSize); - return new BatchToSpace(opBuilder.build()); + return new BatchToSpace<>(opBuilder.build()); } - + /** - * 4-D with shape `[batch, height, width, depth]`, where: - *

- * height = height_pad - crop_top - crop_bottom - * width = width_pad - crop_left - crop_right - *

- * The attr `block_size` must be greater than one. It indicates the block size. - *

- * Some examples: - *

- * (1) For the following input of shape `[4, 1, 1, 1]` and block_size of 2: - *

{@code
+   * Gets output.
+   * 4-D with shape {@code [batch, height, width, depth]}, where:
+   * 
+   *   height = height_pad - crop_top - crop_bottom
+   *   width = width_pad - crop_left - crop_right
+   * 
+ *

The attr {@code block_size} must be greater than one. It indicates the block size. + *

Some examples: + *

(1) For the following input of shape {@code [4, 1, 1, 1]} and block_size of 2: + *

    * [[[[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]` and block_size of 2: - *
{@code
+   * 
+ *

(2) For the following input of shape {@code [4, 1, 1, 3]} and block_size of 2: + *

    * [[[[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]` and block_size of 2: - *
{@code
+   * 
+ *

(3) For the following input of shape {@code [4, 2, 2, 1]} and block_size of 2: + *

    * 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, 2, 1]` and block_size of 2: - *
{@code
+   * 
+ *

(4) For the following input of shape {@code [8, 1, 2, 1]} and block_size of 2: + *

    * x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],
    *      [[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[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], [3]], [[5], [7]]],
    *      [[[2], [4]], [[10], [12]]],
    *      [[[5], [7]], [[13], [15]]],
    *      [[[6], [8]], [[14], [16]]]]
-   * }
- * + *
+ * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchToSpace"; - - private Output output; - - private BatchToSpace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpaceNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpaceNd.java index 1890b0e5d54..f8ffc060c71 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpaceNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchToSpaceNd.java @@ -30,152 +30,155 @@ /** * 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 data type for {@code output} output */ @Operator public final class BatchToSpaceNd extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchToSpaceNd operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchToSpaceND"; + + private Output output; + + private BatchToSpaceNd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchToSpaceND operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchToSpaceNd create(Scope scope, Operand input, Operand blockShape, Operand crops) { + @Endpoint( + describeByClass = true + ) + public static BatchToSpaceNd create(Scope scope, Operand input, + Operand blockShape, Operand crops) { OperationBuilder opBuilder = scope.env().opBuilder("BatchToSpaceND", scope.makeOpName("BatchToSpaceNd")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(blockShape.asOutput()); opBuilder.addInput(crops.asOutput()); opBuilder = scope.apply(opBuilder); - return new BatchToSpaceNd(opBuilder.build()); + return new BatchToSpaceNd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchToSpaceND"; - - private Output output; - - private BatchToSpaceNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bitcast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bitcast.java index e9176b8dd99..88536734ce8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bitcast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bitcast.java @@ -30,99 +30,114 @@ /** * 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 + * [[ 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 data type for {@code output} output */ @Operator public final class Bitcast extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Bitcast"; + + private Output output; + + private Bitcast(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Bitcast operation. - * + * * @param scope current scope - * @param input - * @param type + * @param input the input value + * @param type the value of the type property + * @param data type for {@code Bitcast} output and operands * @return a new instance of Bitcast */ - @Endpoint(describeByClass = true) - public static Bitcast create(Scope scope, Operand input, Class type) { + @Endpoint( + describeByClass = true + ) + public static Bitcast create(Scope scope, Operand input, + Class type) { OperationBuilder opBuilder = scope.env().opBuilder("Bitcast", scope.makeOpName("Bitcast")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); - return new Bitcast(opBuilder.build()); + return new Bitcast<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Bitcast"; - - private Output output; - - private Bitcast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastDynamicShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastDynamicShape.java index 91611ab6888..8aa3a3a7151 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastDynamicShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastDynamicShape.java @@ -29,51 +29,58 @@ /** * 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. - * - * @param data type for {@code r0()} output + * 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 */ @Operator public final class BroadcastDynamicShape extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BroadcastDynamicShape operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BroadcastArgs"; + + private Output r0; + + private BroadcastDynamicShape(Operation operation) { + super(operation); + int outputIdx = 0; + r0 = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BroadcastArgs operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BroadcastDynamicShape create(Scope scope, Operand s0, Operand s1) { + @Endpoint( + describeByClass = true + ) + public static BroadcastDynamicShape create(Scope scope, Operand s0, + Operand s1) { OperationBuilder opBuilder = scope.env().opBuilder("BroadcastArgs", scope.makeOpName("BroadcastDynamicShape")); opBuilder.addInput(s0.asOutput()); opBuilder.addInput(s1.asOutput()); opBuilder = scope.apply(opBuilder); - return new BroadcastDynamicShape(opBuilder.build()); + return new BroadcastDynamicShape<>(opBuilder.build()); } - + /** + * Gets r0. + * + * @return r0. */ public Output r0() { return r0; } - + @Override public Output asOutput() { return r0; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BroadcastArgs"; - - private Output r0; - - private BroadcastDynamicShape(Operation operation) { - super(operation); - int outputIdx = 0; - r0 = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastGradientArgs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastGradientArgs.java index 8aa19f97259..0da00a87d58 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastGradientArgs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastGradientArgs.java @@ -24,57 +24,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * 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 data type for {@code r0()} output + * + * @param data type for {@code r0} output */ public final class BroadcastGradientArgs extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BroadcastGradientArgs"; + + private Output r0; + + private Output r1; + + private BroadcastGradientArgs(Operation operation) { + super(operation); + int outputIdx = 0; + r0 = operation.output(outputIdx++); + r1 = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BroadcastGradientArgs operation. - * + * * @param scope current scope - * @param s0 - * @param s1 + * @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 */ - @Endpoint(describeByClass = true) - public static BroadcastGradientArgs create(Scope scope, Operand s0, Operand s1) { + @Endpoint( + describeByClass = true + ) + public static BroadcastGradientArgs create(Scope scope, Operand s0, + Operand s1) { OperationBuilder opBuilder = scope.env().opBuilder("BroadcastGradientArgs", scope.makeOpName("BroadcastGradientArgs")); opBuilder.addInput(s0.asOutput()); opBuilder.addInput(s1.asOutput()); opBuilder = scope.apply(opBuilder); - return new BroadcastGradientArgs(opBuilder.build()); + return new BroadcastGradientArgs<>(opBuilder.build()); } - + /** + * Gets r0. + * + * @return r0. */ public Output r0() { return r0; } - + /** + * Gets r1. + * + * @return r1. */ public Output r1() { return r1; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BroadcastGradientArgs"; - - private Output r0; - private Output r1; - - private BroadcastGradientArgs(Operation operation) { - super(operation); - int outputIdx = 0; - r0 = operation.output(outputIdx++); - r1 = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastTo.java index 5cdf860d611..670ac6cc074 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BroadcastTo.java @@ -30,77 +30,84 @@ /** * 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) + *

For example, + *

+ *
+ *
+ *

x = tf.constant([1, 2, 3]) + * y = tf.broadcast_to(x, [3, 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]`. - *

- * When doing broadcasted operations such as multiplying a 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 {@code [1, 3]} + * is broadcasted to output Tensor with shape of {@code [3, 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, `broadcast_to` does not carry with it any such benefits. + *

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, `broadcast_to` might be fused to + * 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 data type for {@code output} output */ @Operator public final class BroadcastTo extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BroadcastTo"; + + private Output output; + + private BroadcastTo(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BroadcastTo operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static BroadcastTo create(Scope scope, Operand input, Operand shape) { + @Endpoint( + describeByClass = true + ) + public static BroadcastTo create(Scope scope, Operand input, + Operand shape) { OperationBuilder opBuilder = scope.env().opBuilder("BroadcastTo", scope.makeOpName("BroadcastTo")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); - return new BroadcastTo(opBuilder.build()); + return new BroadcastTo<>(opBuilder.build()); } - + /** + * Gets output. * A Tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BroadcastTo"; - - private Output output; - - private BroadcastTo(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bucketize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bucketize.java index 355c7b7a46e..603a8624fd0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bucketize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Bucketize.java @@ -31,66 +31,69 @@ /** * 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]] */ @Operator public final class Bucketize extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Bucketize"; + + private Output output; + + private Bucketize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Bucketize operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static Bucketize create(Scope scope, Operand input, List boundaries) { + @Endpoint( + describeByClass = true + ) + public static Bucketize create(Scope scope, Operand input, + List boundaries) { OperationBuilder opBuilder = scope.env().opBuilder("Bucketize", scope.makeOpName("Bucketize")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); float[] boundariesArray = new float[boundaries.size()]; - for (int i = 0; i < boundariesArray.length; ++i) { + for (int i = 0 ; i < boundariesArray.length ; i++) { boundariesArray[i] = boundaries.get(i); } opBuilder.setAttr("boundaries", boundariesArray); return new Bucketize(opBuilder.build()); } - + /** + * Gets output. * Same shape with 'input', each value of input replaced with bucket index. - *

- * @compatibility(numpy) + *

{@literal @}compatibility(numpy)
* Equivalent to np.digitize. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Bucketize"; - - private Output output; - - private Bucketize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ClipByValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ClipByValue.java index 97740997852..5d5a0309f73 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ClipByValue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ClipByValue.java @@ -29,58 +29,64 @@ /** * 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`. - * - * @param data type for {@code output()} output + * 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 data type for {@code output} output */ @Operator public final class ClipByValue extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ClipByValue"; + + private Output output; + + private ClipByValue(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ClipByValue operation. - * + * * @param scope current scope - * @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. + * @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 */ - @Endpoint(describeByClass = true) - public static ClipByValue create(Scope scope, Operand t, Operand clipValueMin, Operand clipValueMax) { + @Endpoint( + describeByClass = true + ) + public static ClipByValue create(Scope scope, Operand t, + Operand clipValueMin, Operand clipValueMax) { OperationBuilder opBuilder = scope.env().opBuilder("ClipByValue", scope.makeOpName("ClipByValue")); opBuilder.addInput(t.asOutput()); opBuilder.addInput(clipValueMin.asOutput()); opBuilder.addInput(clipValueMax.asOutput()); opBuilder = scope.apply(opBuilder); - return new ClipByValue(opBuilder.build()); + return new ClipByValue<>(opBuilder.build()); } - + /** - * A clipped `Tensor` with the same shape as input 't'. + * Gets output. + * A clipped {@code Tensor} with the same shape as input 't'. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ClipByValue"; - - private Output output; - - private ClipByValue(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java index 97fbec16aaf..f6351158b4c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectiveGather.java @@ -25,58 +25,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Mutually accumulates multiple tensors of identical type and shape. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output + * + * @deprecated use {@link org.tensorflow.op.collective.Gather} instead */ +@Deprecated public final class CollectiveGather extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.CollectiveGather} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param communicationHint - */ - public Options communicationHint(String communicationHint) { - this.communicationHint = communicationHint; - return this; - } - - /** - * @param timeoutSeconds - */ - public Options timeoutSeconds(Float timeoutSeconds) { - this.timeoutSeconds = timeoutSeconds; - return this; - } - - private String communicationHint; - private Float timeoutSeconds; - - private Options() { - } + public static final String OP_NAME = "CollectiveGather"; + + private Output data; + + private CollectiveGather(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CollectiveGather operation. - * + * * @param scope current scope - * @param input - * @param groupSize - * @param groupKey - * @param instanceKey - * @param shape - * @param options carries optional attributes values + * @param input the input value + * @param groupSize the value of the groupSize property + * @param groupKey the value of the groupKey property + * @param instanceKey the value of the instanceKey property + * @param shape the value of the shape property + * @param options carries optional attribute values + * @param data type for {@code CollectiveGather} output and operands * @return a new instance of CollectiveGather */ - @Endpoint(describeByClass = true) - public static CollectiveGather create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CollectiveGather create(Scope scope, Operand input, + Long groupSize, Long groupKey, Long instanceKey, Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveGather", scope.makeOpName("CollectiveGather")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -94,42 +84,74 @@ public static CollectiveGather create(Scope scope, Operan } } } - return new CollectiveGather(opBuilder.build()); + return new CollectiveGather<>(opBuilder.build()); } - + /** - * @param communicationHint + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. */ public static Options communicationHint(String communicationHint) { return new Options().communicationHint(communicationHint); } - + /** - * @param timeoutSeconds + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. */ public static Options timeoutSeconds(Float timeoutSeconds) { return new Options().timeoutSeconds(timeoutSeconds); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectiveGather"; - - private Output data; - - private CollectiveGather(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.CollectiveGather} + */ + public static class Options { + private String communicationHint; + + private Float timeoutSeconds; + + private Options() { + } + + /** + * Sets the communicationHint option. + * + * @param communicationHint the communicationHint option + * @return this Options instance. + */ + public Options communicationHint(String communicationHint) { + this.communicationHint = communicationHint; + return this; + } + + /** + * Sets the timeoutSeconds option. + * + * @param timeoutSeconds the timeoutSeconds option + * @return this Options instance. + */ + public Options timeoutSeconds(Float timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Concat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Concat.java index 279ae8e4b2f..5e7a33542b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Concat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Concat.java @@ -31,53 +31,60 @@ /** * Concatenates tensors along one dimension. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class Concat extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Concat operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConcatV2"; + + private Output output; + + private Concat(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ConcatV2 operation. + * * @param scope current scope - * @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 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 */ - @Endpoint(describeByClass = true) - public static Concat create(Scope scope, Iterable> values, Operand axis) { + @Endpoint( + describeByClass = true + ) + public static Concat create(Scope scope, Iterable> values, + Operand axis) { OperationBuilder opBuilder = scope.env().opBuilder("ConcatV2", scope.makeOpName("Concat")); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder.addInput(axis.asOutput()); opBuilder = scope.apply(opBuilder); - return new Concat(opBuilder.build()); + return new Concat<>(opBuilder.build()); } - + /** - * A `Tensor` with the concatenation of values stacked along the - * `concat_dim` dimension. This tensor's shape matches that of `values` except - * in `concat_dim` where it has the sum of the sizes. + * Gets output. + * A {@code Tensor} with the concatenation of values stacked along the + * {@code concat_dim} dimension. This tensor's shape matches that of {@code values} except + * in {@code concat_dim} where it has the sum of the sizes. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConcatV2"; - - private Output output; - - private Concat(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConsumeMutexLock.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConsumeMutexLock.java index 13f4905076b..f32dd58b6bc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConsumeMutexLock.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConsumeMutexLock.java @@ -24,40 +24,42 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** - * This op consumes a lock created by `MutexLock`. - *

- * This op exists to consume a tensor created by `MutexLock` (other than + * This op consumes a lock created by {@code MutexLock}. + * This op exists to consume a tensor created by {@code 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. + *

NOTE: This operation must run on the same device as its input. This may + * be enforced via the {@code colocate_with} mechanism. */ @Operator public final class ConsumeMutexLock extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConsumeMutexLock"; + + private ConsumeMutexLock(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ConsumeMutexLock operation. - * + * * @param scope current scope - * @param mutexLock A tensor returned by `MutexLock`. + * @param mutexLock A tensor returned by {@code MutexLock}. * @return a new instance of ConsumeMutexLock */ - @Endpoint(describeByClass = true) - public static ConsumeMutexLock create(Scope scope, Operand mutexLock) { + @Endpoint( + describeByClass = true + ) + public static ConsumeMutexLock create(Scope scope, Operand mutexLock) { OperationBuilder opBuilder = scope.env().opBuilder("ConsumeMutexLock", scope.makeOpName("ConsumeMutexLock")); opBuilder.addInput(mutexLock.asOutput()); opBuilder = scope.apply(opBuilder); return new ConsumeMutexLock(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConsumeMutexLock"; - - private ConsumeMutexLock(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ControlTrigger.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ControlTrigger.java index fa1281f84fa..a5c5037acf0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ControlTrigger.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ControlTrigger.java @@ -26,29 +26,31 @@ /** * Does nothing. Serves as a control trigger for scheduling. - *

* Only useful as a placeholder for control edges. */ @Operator public final class ControlTrigger extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ControlTrigger"; + + private ControlTrigger(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ControlTrigger operation. - * + * * @param scope current scope * @return a new instance of ControlTrigger */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ControlTrigger create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("ControlTrigger", scope.makeOpName("ControlTrigger")); opBuilder = scope.apply(opBuilder); return new ControlTrigger(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ControlTrigger"; - - private ControlTrigger(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Copy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Copy.java index 7a314be7993..d038d538036 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Copy.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Copy.java @@ -17,6 +17,7 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,67 +26,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Copy a tensor from CPU-to-CPU or GPU-to-GPU. - *

* Performs CPU-to-CPU or GPU-to-GPU deep-copying of tensor, depending on the * device on which the tensor is allocated. * N.B.: If the all downstream attached debug ops are disabled given the current * gRPC gating status, the output will simply forward the input tensor without * deep-copying. See the documentation of Debug* ops for more details. - *

- * Unlike the CopyHost Op, this op does not have HostMemory constraint on its + *

Unlike the CopyHost Op, this op does not have HostMemory constraint on its * input or output. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class Copy extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Copy} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tensorName The name of the input tensor. - */ - public Options tensorName(String tensorName) { - this.tensorName = tensorName; - return this; - } - - /** - * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug - * ops. Each element of the list has the format - * ;;, wherein gated_grpc is boolean represented - * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", - * "DebugIdentity;file:///tmp/tfdbg_1;0". - */ - public Options debugOpsSpec(List debugOpsSpec) { - this.debugOpsSpec = debugOpsSpec; - return this; - } - - private String tensorName; - private List debugOpsSpec; - - private Options() { - } + public static final String OP_NAME = "Copy"; + + private Output output; + + private Copy(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Copy operation. - * + * * @param scope current scope * @param input Input tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Copy} output and operands * @return a new instance of Copy */ - @Endpoint(describeByClass = true) - public static Copy create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Copy create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Copy", scope.makeOpName("Copy")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -96,53 +78,118 @@ public static Copy create(Scope scope, Operand input, Op } if (opts.debugOpsSpec != null) { String[] debugOpsSpecArray = new String[opts.debugOpsSpec.size()]; - for (int i = 0; i < debugOpsSpecArray.length; ++i) { + for (int i = 0 ; i < debugOpsSpecArray.length ; i++) { debugOpsSpecArray[i] = opts.debugOpsSpec.get(i); } opBuilder.setAttr("debug_ops_spec", debugOpsSpecArray); } } } - return new Copy(opBuilder.build()); + return new Copy<>(opBuilder.build()); } - + /** + * Sets the tensorName option. + * * @param tensorName The name of the input tensor. + * @return this Options instance. */ public static Options tensorName(String tensorName) { return new Options().tensorName(tensorName); } - + /** + * Sets the debugOpsSpec option. + * * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug * ops. Each element of the list has the format - * ;;, wherein gated_grpc is boolean represented - * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", - * "DebugIdentity;file:///tmp/tfdbg_1;0". + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + * @return this Options instance. */ public static Options debugOpsSpec(List debugOpsSpec) { return new Options().debugOpsSpec(debugOpsSpec); } - + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug + * ops. Each element of the list has the format + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + * @return this Options instance. + */ + public static Options debugOpsSpec(String[] debugOpsSpec) { + return new Options().debugOpsSpec(debugOpsSpec); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Copy"; - - private Output output; - - private Copy(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Copy} + */ + public static class Options { + private String tensorName; + + private List debugOpsSpec; + + private Options() { + } + + /** + * Sets the tensorName option. + * + * @param tensorName The name of the input tensor. + * @return this Options instance. + */ + public Options tensorName(String tensorName) { + this.tensorName = tensorName; + return this; + } + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug + * ops. Each element of the list has the format + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + * @return this Options instance. + */ + public Options debugOpsSpec(List debugOpsSpec) { + this.debugOpsSpec = debugOpsSpec; + return this; + } + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug + * ops. Each element of the list has the format + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + * @return this Options instance. + */ + public Options debugOpsSpec(String... debugOpsSpec) { + this.debugOpsSpec = Arrays.asList(debugOpsSpec); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyHost.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyHost.java index b638d662f9f..03bb0ca7ee2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyHost.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CopyHost.java @@ -17,6 +17,7 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,65 +26,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Copy a tensor to host. - *

* Performs CPU-to-CPU deep-copying of tensor. * N.B.: If the all downstream attached debug ops are disabled given the current * gRPC gating status, the output will simply forward the input tensor without * deep-copying. See the documentation of Debug* ops for more details. - *

- * Unlike the Copy Op, this op has HostMemory constraint on its input or output. - * - * @param data type for {@code output()} output + *

Unlike the Copy Op, this op has HostMemory constraint on its input or output. + * + * @param data type for {@code output} output */ public final class CopyHost extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.CopyHost} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tensorName The name of the input tensor. - */ - public Options tensorName(String tensorName) { - this.tensorName = tensorName; - return this; - } - - /** - * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug - * ops. Each element of the list has the format - * ;;, wherein gated_grpc is boolean represented - * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", - * "DebugIdentity;file:///tmp/tfdbg_1;0". - */ - public Options debugOpsSpec(List debugOpsSpec) { - this.debugOpsSpec = debugOpsSpec; - return this; - } - - private String tensorName; - private List debugOpsSpec; - - private Options() { - } + public static final String OP_NAME = "CopyHost"; + + private Output output; + + private CopyHost(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CopyHost operation. - * + * * @param scope current scope * @param input Input tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code CopyHost} output and operands * @return a new instance of CopyHost */ - @Endpoint(describeByClass = true) - public static CopyHost create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CopyHost create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CopyHost", scope.makeOpName("CopyHost")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -94,53 +76,118 @@ public static CopyHost create(Scope scope, Operand input } if (opts.debugOpsSpec != null) { String[] debugOpsSpecArray = new String[opts.debugOpsSpec.size()]; - for (int i = 0; i < debugOpsSpecArray.length; ++i) { + for (int i = 0 ; i < debugOpsSpecArray.length ; i++) { debugOpsSpecArray[i] = opts.debugOpsSpec.get(i); } opBuilder.setAttr("debug_ops_spec", debugOpsSpecArray); } } } - return new CopyHost(opBuilder.build()); + return new CopyHost<>(opBuilder.build()); } - + /** + * Sets the tensorName option. + * * @param tensorName The name of the input tensor. + * @return this Options instance. */ public static Options tensorName(String tensorName) { return new Options().tensorName(tensorName); } - + /** + * Sets the debugOpsSpec option. + * * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug * ops. Each element of the list has the format - * ;;, wherein gated_grpc is boolean represented - * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", - * "DebugIdentity;file:///tmp/tfdbg_1;0". + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + * @return this Options instance. */ public static Options debugOpsSpec(List debugOpsSpec) { return new Options().debugOpsSpec(debugOpsSpec); } - + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug + * ops. Each element of the list has the format + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + * @return this Options instance. + */ + public static Options debugOpsSpec(String[] debugOpsSpec) { + return new Options().debugOpsSpec(debugOpsSpec); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CopyHost"; - - private Output output; - - private CopyHost(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.CopyHost} + */ + public static class Options { + private String tensorName; + + private List debugOpsSpec; + + private Options() { + } + + /** + * Sets the tensorName option. + * + * @param tensorName The name of the input tensor. + * @return this Options instance. + */ + public Options tensorName(String tensorName) { + this.tensorName = tensorName; + return this; + } + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug + * ops. Each element of the list has the format + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + * @return this Options instance. + */ + public Options debugOpsSpec(List debugOpsSpec) { + this.debugOpsSpec = debugOpsSpec; + return this; + } + + /** + * Sets the debugOpsSpec option. + * + * @param debugOpsSpec A list of debug op spec (op, url, gated_grpc) for attached debug + * ops. Each element of the list has the format + * <debug_op>;<grpc_url>;<gated_grpc>, wherein gated_grpc is boolean represented + * as 0/1. E.g., "DebugIdentity;grpc://foo:3333;1", + * "DebugIdentity;file:///tmp/tfdbg_1;0". + * @return this Options instance. + */ + public Options debugOpsSpec(String... debugOpsSpec) { + this.debugOpsSpec = Arrays.asList(debugOpsSpec); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CountUpTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CountUpTo.java index 5d518629b78..ffa579e9b04 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CountUpTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CountUpTo.java @@ -29,51 +29,57 @@ /** * Increments 'ref' until it reaches 'limit'. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class CountUpTo extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CountUpTo"; + + private Output output; + + private CountUpTo(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CountUpTo operation. - * + * * @param scope current scope - * @param ref Should be from a scalar `Variable` node. + * @param ref Should be from a scalar {@code Variable} node. * @param limit If incrementing ref would bring it above limit, instead generates an * 'OutOfRange' error. + * @param data type for {@code CountUpTo} output and operands * @return a new instance of CountUpTo */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static CountUpTo create(Scope scope, Operand ref, Long limit) { OperationBuilder opBuilder = scope.env().opBuilder("CountUpTo", scope.makeOpName("CountUpTo")); opBuilder.addInput(ref.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("limit", limit); - return new CountUpTo(opBuilder.build()); + return new CountUpTo<>(opBuilder.build()); } - + /** + * Gets output. * A copy of the input before increment. If nothing else modifies the * input, the values produced will all be distinct. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CountUpTo"; - - private Output output; - - private CountUpTo(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodeProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodeProto.java index 807aa992ba9..dbf9a464425 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodeProto.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodeProto.java @@ -34,116 +34,102 @@ /** * The op extracts fields from a serialized protocol buffers message into tensors. - *

- * The `decode_proto` op extracts fields from a serialized protocol buffers - * message into tensors. The fields in `field_names` are decoded and converted - * to the corresponding `output_types` if possible. - *

- * A `message_type` name must be provided to give context for the field names. + * The {@code decode_proto} op extracts fields from a serialized protocol buffers + * message into tensors. The fields in {@code field_names} are decoded and converted + * to the corresponding {@code output_types} if possible. + *

A {@code message_type} name must be provided to give context for the field names. * The actual message descriptor can be looked up either in the linked-in * descriptor pool or a filename provided by the caller using the - * `descriptor_source` attribute. - *

- * Each output tensor is a dense tensor. This means that it is padded to hold + * {@code descriptor_source} attribute. + *

Each output tensor is a dense tensor. This means that it is padded to hold * the largest number of repeated elements seen in the input minibatch. (The * shape is also padded by one to prevent zero-sized dimensions). The actual - * repeat counts for each example in the minibatch can be found in the `sizes` - * output. In many cases the output of `decode_proto` is fed immediately into + * repeat counts for each example in the minibatch can be found in the {@code sizes} + * output. In many cases the output of {@code decode_proto} is fed immediately into * tf.squeeze if missing values are not a concern. When using tf.squeeze, always * pass the squeeze dimension explicitly to avoid surprises. - *

- * For the most part, the mapping between Proto field types and TensorFlow dtypes + *

For the most part, the mapping between Proto field types and TensorFlow dtypes * is straightforward. However, there are a few special cases: - *

- * - A proto field that contains a submessage or group can only be converted - * to `DT_STRING` (the serialized submessage). This is to reduce the complexity + *

    + *
  • + *

    A proto field that contains a submessage or group can only be converted + * to {@code DT_STRING} (the serialized submessage). This is to reduce the complexity * of the API. The resulting string can be used as input to another instance of * the decode_proto op. - *

    - * - TensorFlow lacks support for unsigned integers. The ops represent uint64 - * types as a `DT_INT64` with the same twos-complement bit pattern (the obvious + *

  • + *
  • + *

    TensorFlow lacks support for unsigned integers. The ops represent uint64 + * types as a {@code DT_INT64} with the same twos-complement bit pattern (the obvious * way). Unsigned int32 values can be represented exactly by specifying type - * `DT_INT64`, or using twos-complement if the caller specifies `DT_INT32` in - * the `output_types` attribute. - *

    - * Both binary and text proto serializations are supported, and can be - * chosen using the `format` attribute. - *

    - * The `descriptor_source` attribute selects the source of protocol - * descriptors to consult when looking up `message_type`. This may be: - *

    - * - An empty string or "local://", in which case protocol descriptors are + * {@code DT_INT64}, or using twos-complement if the caller specifies {@code DT_INT32} in + * the {@code output_types} attribute. + *

  • + *
+ *

Both binary and text proto serializations are supported, and can be + * chosen using the {@code format} attribute. + *

The {@code descriptor_source} attribute selects the source of protocol + * descriptors to consult when looking up {@code message_type}. This may be: + *

    + *
  • + *

    An empty string or "local://", in which case protocol descriptors are * created for C++ (not Python) proto definitions linked to the binary. - *

    - * - A file, in which case protocol descriptors are created from the file, - * which is expected to contain a `FileDescriptorSet` serialized as a string. - * NOTE: You can build a `descriptor_source` file using the `--descriptor_set_out` - * and `--include_imports` options to the protocol compiler `protoc`. - *

    - * - A "bytes://", in which protocol descriptors are created from ``, - * which is expected to be a `FileDescriptorSet` serialized as a string. + *

  • + *
  • + *

    A file, in which case protocol descriptors are created from the file, + * which is expected to contain a {@code FileDescriptorSet} serialized as a string. + * NOTE: You can build a {@code descriptor_source} file using the {@code --descriptor_set_out} + * and {@code --include_imports} options to the protocol compiler {@code protoc}. + *

  • + *
  • + *

    A "bytes://<bytes>", in which protocol descriptors are created from {@code }, + * which is expected to be a {@code FileDescriptorSet} serialized as a string. + *

  • + *
*/ @Operator public final class DecodeProto extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.DecodeProto} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param descriptorSource Either the special value `local://` or a path to a file containing - * a serialized `FileDescriptorSet`. - */ - public Options descriptorSource(String descriptorSource) { - this.descriptorSource = descriptorSource; - return this; - } - - /** - * @param messageFormat Either `binary` or `text`. - */ - public Options messageFormat(String messageFormat) { - this.messageFormat = messageFormat; - return this; - } - - /** - * @param sanitize Whether to sanitize the result or not. - */ - public Options sanitize(Boolean sanitize) { - this.sanitize = sanitize; - return this; - } - - private String descriptorSource; - private String messageFormat; - private Boolean sanitize; - - private Options() { - } + public static final String OP_NAME = "DecodeProtoV2"; + + private Output sizes; + + private List> values; + + @SuppressWarnings("unchecked") + private DecodeProto(Operation operation) { + super(operation); + int outputIdx = 0; + sizes = operation.output(outputIdx++); + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** - * Factory method to create a class wrapping a new DecodeProto operation. - * + * Factory method to create a class wrapping a new DecodeProtoV2 operation. + * * @param scope current scope - * @param bytes Tensor of serialized protos with shape `batch_shape`. + * @param bytes Tensor of serialized protos with shape {@code batch_shape}. * @param messageType Name of the proto message type to decode. * @param fieldNames List of strings containing proto field names. An extension field can be decoded * by using its full name, e.g. EXT_PACKAGE.EXT_FIELD_NAME. * @param outputTypes List of TF types to use for the respective field in field_names. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DecodeProto */ - @Endpoint(describeByClass = true) - public static DecodeProto create(Scope scope, Operand bytes, String messageType, List fieldNames, List> outputTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodeProto create(Scope scope, Operand bytes, String messageType, + List fieldNames, List> outputTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeProtoV2", scope.makeOpName("DecodeProto")); opBuilder.addInput(bytes.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("message_type", messageType); String[] fieldNamesArray = new String[fieldNames.size()]; - for (int i = 0; i < fieldNamesArray.length; ++i) { + for (int i = 0 ; i < fieldNamesArray.length ; i++) { fieldNamesArray[i] = fieldNames.get(i); } opBuilder.setAttr("field_names", fieldNamesArray); @@ -163,59 +149,105 @@ public static DecodeProto create(Scope scope, Operand bytes, String mes } return new DecodeProto(opBuilder.build()); } - + /** - * @param descriptorSource Either the special value `local://` or a path to a file containing - * a serialized `FileDescriptorSet`. + * Sets the descriptorSource option. + * + * @param descriptorSource Either the special value {@code local://} or a path to a file containing + * a serialized {@code FileDescriptorSet}. + * @return this Options instance. */ public static Options descriptorSource(String descriptorSource) { return new Options().descriptorSource(descriptorSource); } - + /** - * @param messageFormat Either `binary` or `text`. + * Sets the messageFormat option. + * + * @param messageFormat Either {@code binary} or {@code text}. + * @return this Options instance. */ public static Options messageFormat(String messageFormat) { return new Options().messageFormat(messageFormat); } - + /** + * Sets the sanitize option. + * * @param sanitize Whether to sanitize the result or not. + * @return this Options instance. */ public static Options sanitize(Boolean sanitize) { return new Options().sanitize(sanitize); } - + /** - * Tensor of int32 with shape `[batch_shape, len(field_names)]`. + * Gets sizes. + * Tensor of int32 with shape {@code [batch_shape, len(field_names)]}. * Each entry is the number of values found for the corresponding field. * Optional fields may have 0 or 1 values. + * @return sizes. */ public Output sizes() { return sizes; } - + /** + * Gets values. * List of tensors containing values for the corresponding field. - * `values[i]` has datatype `output_types[i]` - * and shape `[batch_shape, max(sizes[...,i])]`. + * {@code values[i]} has datatype {@code output_types[i]} + * and shape {@code [batch_shape, max(sizes[...,i])]}. + * @return values. */ public List> values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeProtoV2"; - - private Output sizes; - private List> values; - - private DecodeProto(Operation operation) { - super(operation); - int outputIdx = 0; - sizes = operation.output(outputIdx++); - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.DecodeProto} + */ + public static class Options { + private String descriptorSource; + + private String messageFormat; + + private Boolean sanitize; + + private Options() { + } + + /** + * Sets the descriptorSource option. + * + * @param descriptorSource Either the special value {@code local://} or a path to a file containing + * a serialized {@code FileDescriptorSet}. + * @return this Options instance. + */ + public Options descriptorSource(String descriptorSource) { + this.descriptorSource = descriptorSource; + return this; + } + + /** + * Sets the messageFormat option. + * + * @param messageFormat Either {@code binary} or {@code text}. + * @return this Options instance. + */ + public Options messageFormat(String messageFormat) { + this.messageFormat = messageFormat; + return this; + } + + /** + * Sets the sanitize option. + * + * @param sanitize Whether to sanitize the result or not. + * @return this Options instance. + */ + public Options sanitize(Boolean sanitize) { + this.sanitize = sanitize; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeepCopy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeepCopy.java index 4d8e8268d8c..a5da8c99bbd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeepCopy.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeepCopy.java @@ -28,49 +28,57 @@ import org.tensorflow.types.family.TType; /** - * Makes a copy of `x`. - * - * @param data type for {@code y()} output + * Makes a copy of {@code x}. + * + * @param data type for {@code y} output */ @Operator public final class DeepCopy extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeepCopy"; + + private Output y; + + private DeepCopy(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DeepCopy operation. - * + * * @param scope current scope - * @param x The source tensor of type `T`. + * @param x The source tensor of type {@code T}. + * @param data type for {@code DeepCopy} output and operands * @return a new instance of DeepCopy */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DeepCopy create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("DeepCopy", scope.makeOpName("DeepCopy")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new DeepCopy(opBuilder.build()); + return new DeepCopy<>(opBuilder.build()); } - + /** - * y: A `Tensor` of type `T`. A copy of `x`. Guaranteed that `y` - * is not an alias of `x`. + * Gets y. + *
+   * y: A `Tensor` of type `T`. A copy of `x`. Guaranteed that `y`
+   *   is not an alias of `x`.
+   * 
+ * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeepCopy"; - - private Output y; - - private DeepCopy(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeleteSessionTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeleteSessionTensor.java index bbcfafde693..6526e917d48 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeleteSessionTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeleteSessionTensor.java @@ -31,26 +31,29 @@ */ @Operator public final class DeleteSessionTensor extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeleteSessionTensor"; + + private DeleteSessionTensor(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new DeleteSessionTensor operation. - * + * * @param scope current scope * @param handle The handle for a tensor stored in the session state. * @return a new instance of DeleteSessionTensor */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DeleteSessionTensor create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("DeleteSessionTensor", scope.makeOpName("DeleteSessionTensor")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); return new DeleteSessionTensor(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteSessionTensor"; - - private DeleteSessionTensor(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyResourceOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyResourceOp.java index ea487a4d415..68c9ec3f0fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyResourceOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyResourceOp.java @@ -24,46 +24,37 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Deletes the resource specified by the handle. - *

* All subsequent operations using the resource will result in a NotFound * error status. */ @Operator public final class DestroyResourceOp extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.DestroyResourceOp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param ignoreLookupError whether to ignore the error when the resource - * doesn't exist. - */ - public Options ignoreLookupError(Boolean ignoreLookupError) { - this.ignoreLookupError = ignoreLookupError; - return this; - } - - private Boolean ignoreLookupError; - - private Options() { - } + public static final String OP_NAME = "DestroyResourceOp"; + + private DestroyResourceOp(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new DestroyResourceOp operation. - * + * * @param scope current scope * @param resource handle to the resource to delete. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DestroyResourceOp */ - @Endpoint(describeByClass = true) - public static DestroyResourceOp create(Scope scope, Operand resource, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DestroyResourceOp create(Scope scope, Operand resource, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DestroyResourceOp", scope.makeOpName("DestroyResourceOp")); opBuilder.addInput(resource.asOutput()); opBuilder = scope.apply(opBuilder); @@ -76,19 +67,37 @@ public static DestroyResourceOp create(Scope scope, Operand resource, Options } return new DestroyResourceOp(opBuilder.build()); } - + /** + * Sets the ignoreLookupError option. + * * @param ignoreLookupError whether to ignore the error when the resource * doesn't exist. + * @return this Options instance. */ public static Options ignoreLookupError(Boolean ignoreLookupError) { return new Options().ignoreLookupError(ignoreLookupError); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DestroyResourceOp"; - - private DestroyResourceOp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.DestroyResourceOp} + */ + public static class Options { + private Boolean ignoreLookupError; + + private Options() { + } + + /** + * Sets the ignoreLookupError option. + * + * @param ignoreLookupError whether to ignore the error when the resource + * doesn't exist. + * @return this Options instance. + */ + public Options ignoreLookupError(Boolean ignoreLookupError) { + this.ignoreLookupError = ignoreLookupError; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyTemporaryVariable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyTemporaryVariable.java index 25b2ef684c5..556966198fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyTemporaryVariable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DestroyTemporaryVariable.java @@ -29,57 +29,63 @@ /** * 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. + * 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'. - * - * @param data type for {@code value()} output + *

Outputs the final value of the tensor pointed to by 'ref'. + * + * @param data type for {@code value} output */ @Operator public final class DestroyTemporaryVariable extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DestroyTemporaryVariable"; + + private Output value; + + private DestroyTemporaryVariable(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DestroyTemporaryVariable operation. - * + * * @param scope current scope * @param ref A reference to the temporary variable tensor. * @param varName Name of the temporary variable, usually the name of the matching * 'TemporaryVariable' op. + * @param data type for {@code DestroyTemporaryVariable} output and operands * @return a new instance of DestroyTemporaryVariable */ - @Endpoint(describeByClass = true) - public static DestroyTemporaryVariable create(Scope scope, Operand ref, String varName) { + @Endpoint( + describeByClass = true + ) + public static DestroyTemporaryVariable create(Scope scope, Operand ref, + String varName) { OperationBuilder opBuilder = scope.env().opBuilder("DestroyTemporaryVariable", scope.makeOpName("DestroyTemporaryVariable")); opBuilder.addInput(ref.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("var_name", varName); - return new DestroyTemporaryVariable(opBuilder.build()); + return new DestroyTemporaryVariable<>(opBuilder.build()); } - + /** + * Gets value. + * + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DestroyTemporaryVariable"; - - private Output value; - - private DestroyTemporaryVariable(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeviceIndex.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeviceIndex.java index cf0b0279c63..f3eb69df194 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeviceIndex.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DeviceIndex.java @@ -25,57 +25,61 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; /** * Return the index of device the op runs. - *

* Given a list of device names, this operation returns the index of the device * this op runs. The length of the list is returned in two cases: * (1) Device does not exist in the given device list. * (2) It is in XLA compilation. */ public final class DeviceIndex extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeviceIndex"; + + private Output index; + + private DeviceIndex(Operation operation) { + super(operation); + int outputIdx = 0; + index = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DeviceIndex operation. - * + * * @param scope current scope - * @param deviceNames + * @param deviceNames the value of the deviceNames property * @return a new instance of DeviceIndex */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DeviceIndex create(Scope scope, List deviceNames) { OperationBuilder opBuilder = scope.env().opBuilder("DeviceIndex", scope.makeOpName("DeviceIndex")); opBuilder = scope.apply(opBuilder); String[] deviceNamesArray = new String[deviceNames.size()]; - for (int i = 0; i < deviceNamesArray.length; ++i) { + for (int i = 0 ; i < deviceNamesArray.length ; i++) { deviceNamesArray[i] = deviceNames.get(i); } opBuilder.setAttr("device_names", deviceNamesArray); return new DeviceIndex(opBuilder.build()); } - + /** + * Gets index. + * + * @return index. */ public Output index() { return index; } - + @Override public Output asOutput() { return index; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeviceIndex"; - - private Output index; - - private DeviceIndex(Operation operation) { - super(operation); - int outputIdx = 0; - index = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DummyMemoryCache.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DummyMemoryCache.java index 615f2f8bdad..23b589d33da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DummyMemoryCache.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DummyMemoryCache.java @@ -24,46 +24,53 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The DummyMemoryCache operation */ public final class DummyMemoryCache extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DummyMemoryCache"; + + private Output handle; + + @SuppressWarnings("unchecked") + private DummyMemoryCache(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DummyMemoryCache operation. - * + * * @param scope current scope * @return a new instance of DummyMemoryCache */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DummyMemoryCache create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("DummyMemoryCache", scope.makeOpName("DummyMemoryCache")); opBuilder = scope.apply(opBuilder); return new DummyMemoryCache(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DummyMemoryCache"; - - private Output handle; - - private DummyMemoryCache(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicPartition.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicPartition.java index 76bad0aecb7..c3048d289b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicPartition.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicPartition.java @@ -32,89 +32,94 @@ import org.tensorflow.types.family.TType; /** - * 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`. + * Partitions {@code data} into {@code num_partitions} tensors using indices from {@code partitions}. + * For each index tuple {@code js} of size {@code partitions.ndim}, the slice {@code data[js, ...]} + * becomes part of {@code outputs[partitions[js]]}. The slices with {@code partitions[js] = i} + * are placed in {@code outputs[i]} in lexicographic order of {@code js}, and the first + * dimension of {@code outputs[i]} is the number of entries in {@code partitions} equal to {@code 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
+ * 
+ *

{@code data.shape} must start with {@code partitions.shape}. + *

For example: + *

  *     # 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. - *

+ *

+ *

See {@code dynamic_stitch} for an example on how to merge partitions back. *

* *
- * - * @param data type for {@code outputs()} output + * + * @param data type for {@code outputs} output */ @Operator public final class DynamicPartition extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DynamicPartition"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private DynamicPartition(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + /** * Factory method to create a class wrapping a new DynamicPartition operation. - * + * * @param scope current scope - * @param data - * @param partitions Any shape. Indices in the range `[0, num_partitions)`. + * @param data the data value + * @param partitions Any shape. Indices in the range {@code [0, num_partitions)}. * @param numPartitions The number of partitions to output. + * @param data type for {@code DynamicPartition} output and operands * @return a new instance of DynamicPartition */ - @Endpoint(describeByClass = true) - public static DynamicPartition create(Scope scope, Operand data, Operand partitions, Long numPartitions) { + @Endpoint( + describeByClass = true + ) + public static DynamicPartition create(Scope scope, Operand data, + Operand partitions, Long numPartitions) { OperationBuilder opBuilder = scope.env().opBuilder("DynamicPartition", scope.makeOpName("DynamicPartition")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(partitions.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_partitions", numPartitions); - return new DynamicPartition(opBuilder.build()); + return new DynamicPartition<>(opBuilder.build()); } - + /** + * Gets outputs. + * + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DynamicPartition"; - - private List> outputs; - - @SuppressWarnings("unchecked") - private DynamicPartition(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList((Output[])operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicStitch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicStitch.java index 5ec783fde16..61263d0e65c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicStitch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DynamicStitch.java @@ -30,34 +30,32 @@ import org.tensorflow.types.family.TType; /** - * Interleave the values from the `data` tensors into a single tensor. - *

+ * Interleave the values from the {@code 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
+ * 
+ *

For example, if each {@code indices[m]} is scalar or vector, we have + *

  *     # 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 + *

+ *

Each {@code data[i].shape} must start with the corresponding {@code indices[i].shape}, + * and the rest of {@code data[i].shape} must be constant w.r.t. {@code i}. That is, we + * must have {@code data[i].shape = indices[i].shape + constant}. In terms of this + * {@code constant}, the output shape is + *

+ * merged.shape = [max(indices)] + constant
+ * 
+ *

Values are merged in order, so if an index appears in both {@code indices[m][i]} and + * {@code indices[n][j]} for {@code (m,i) < (n,j)} the slice {@code 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
+ * 

For example: + *

  *     indices[0] = 6
  *     indices[1] = [4, 1]
  *     indices[2] = [[5, 2], [0, 3]]
@@ -66,10 +64,10 @@
  *     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` + *
+ *

This method can be used to merge partitions created by {@code 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])
@@ -82,52 +80,60 @@
  *     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.
- * }
+ *
*
* *
- * - * @param data type for {@code merged()} output + * + * @param data type for {@code merged} output */ @Operator public final class DynamicStitch extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DynamicStitch"; + + private Output merged; + + private DynamicStitch(Operation operation) { + super(operation); + int outputIdx = 0; + merged = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DynamicStitch operation. - * + * * @param scope current scope - * @param indices - * @param data + * @param indices the indices value + * @param data the data value + * @param data type for {@code DynamicStitch} output and operands * @return a new instance of DynamicStitch */ - @Endpoint(describeByClass = true) - public static DynamicStitch create(Scope scope, Iterable> indices, Iterable> data) { + @Endpoint( + describeByClass = true + ) + public static DynamicStitch create(Scope scope, + Iterable> indices, Iterable> data) { OperationBuilder opBuilder = scope.env().opBuilder("DynamicStitch", scope.makeOpName("DynamicStitch")); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(data)); opBuilder = scope.apply(opBuilder); - return new DynamicStitch(opBuilder.build()); + return new DynamicStitch<>(opBuilder.build()); } - + /** + * Gets merged. + * + * @return merged. */ public Output merged() { return merged; } - + @Override public Output asOutput() { return merged; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DynamicStitch"; - - private Output merged; - - private DynamicStitch(Operation operation) { - super(operation); - int outputIdx = 0; - merged = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EditDistance.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EditDistance.java index 8ae42ad6218..7d233a705ea 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EditDistance.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EditDistance.java @@ -31,41 +31,30 @@ /** * Computes the (possibly normalized) Levenshtein Edit Distance. - *

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

- * The inputs are: + * (truth_indices, truth_values, truth_shape). + *

The inputs are: */ @Operator public final class EditDistance extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.EditDistance} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param normalize boolean (if true, edit distances are normalized by length of truth). - *

- * The output is: - */ - public Options normalize(Boolean normalize) { - this.normalize = normalize; - return this; - } - - private Boolean normalize; - - private Options() { - } + public static final String OP_NAME = "EditDistance"; + + private Output output; + + private EditDistance(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EditDistance operation. - * + * * @param scope current scope * @param hypothesisIndices The indices of the hypothesis list SparseTensor. * This is an N x R int64 matrix. @@ -78,11 +67,17 @@ private Options() { * @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 + * @param options carries optional attribute values + * @param data type for {@code EditDistance} output and operands * @return a new instance of EditDistance */ - @Endpoint(describeByClass = true) - public static EditDistance create(Scope scope, Operand hypothesisIndices, Operand hypothesisValues, Operand hypothesisShape, Operand truthIndices, Operand truthValues, Operand truthShape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static EditDistance create(Scope scope, + Operand hypothesisIndices, Operand hypothesisValues, + Operand hypothesisShape, Operand truthIndices, Operand truthValues, + Operand truthShape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EditDistance", scope.makeOpName("EditDistance")); opBuilder.addInput(hypothesisIndices.asOutput()); opBuilder.addInput(hypothesisValues.asOutput()); @@ -100,65 +95,80 @@ public static EditDistance create(Scope scope, Operand } return new EditDistance(opBuilder.build()); } - + /** + * Sets the normalize option. + * * @param normalize boolean (if true, edit distances are normalized by length of truth). - *

- * The output is: + *

The output is: + * @return this Options instance. */ public static Options normalize(Boolean normalize) { return new Options().normalize(normalize); } - + /** + * Gets output. * A dense float tensor with rank R - 1. - *

- * For the example input: - *

- * // hypothesis represents a 2x1 matrix with variable-length values: - * // (0,0) = ["a"] - * // (1,0) = ["b"] - * hypothesis_indices = [[0, 0, 0], - * [1, 0, 0]] - * hypothesis_values = ["a", "b"] - * hypothesis_shape = [2, 1, 1] - *

- * // truth represents a 2x2 matrix with variable-length values: - * // (0,0) = [] - * // (0,1) = ["a"] - * // (1,0) = ["b", "c"] - * // (1,1) = ["a"] - * truth_indices = [[0, 1, 0], - * [1, 0, 0], - * [1, 0, 1], - * [1, 1, 0]] - * truth_values = ["a", "b", "c", "a"] - * truth_shape = [2, 2, 2] - * normalize = true - *

- * The output will be: - *

- * // output is a 2x2 matrix with edit distances normalized by truth lengths. - * output = [[inf, 1.0], // (0,0): no truth, (0,1): no hypothesis - * [0.5, 1.0]] // (1,0): addition, (1,1): no hypothesis + *

For the example input: + *

+   * // hypothesis represents a 2x1 matrix with variable-length values:
+   * //   (0,0) = ["a"]
+   * //   (1,0) = ["b"]
+   * hypothesis_indices = [[0, 0, 0],
+   *                       [1, 0, 0]]
+   * hypothesis_values = ["a", "b"]
+   * hypothesis_shape = [2, 1, 1]
+   *
+   * // truth represents a 2x2 matrix with variable-length values:
+   * //   (0,0) = []
+   * //   (0,1) = ["a"]
+   * //   (1,0) = ["b", "c"]
+   * //   (1,1) = ["a"]
+   * truth_indices = [[0, 1, 0],
+   *                  [1, 0, 0],
+   *                  [1, 0, 1],
+   *                  [1, 1, 0]]
+   * truth_values = ["a", "b", "c", "a"]
+   * truth_shape = [2, 2, 2]
+   * normalize = true
+   * 
+ *

The output will be: + *

+   * // output is a 2x2 matrix with edit distances normalized by truth lengths.
+   * output = [[inf, 1.0],  // (0,0): no truth, (0,1): no hypothesis
+   *           [0.5, 1.0]]  // (1,0): addition, (1,1): no hypothesis
+   * 
+ * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EditDistance"; - - private Output output; - - private EditDistance(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.EditDistance} + */ + public static class Options { + private Boolean normalize; + + private Options() { + } + + /** + * Sets the normalize option. + * + * @param normalize boolean (if true, edit distances are normalized by length of truth). + *

The output is: + * @return this Options instance. + */ + public Options normalize(Boolean normalize) { + this.normalize = normalize; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Empty.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Empty.java index 7e7140b9015..e49c9330262 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Empty.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Empty.java @@ -31,44 +31,40 @@ /** * Creates a tensor with the given shape. - *

- * This operation creates a tensor of `shape` and `dtype`. - * - * @param data type for {@code output()} output + *

This operation creates a tensor of {@code shape} and {@code dtype}. + * + * @param data type for {@code output} output */ @Operator public final class Empty extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Empty} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param init If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content. - */ - public Options init(Boolean init) { - this.init = init; - return this; - } - - private Boolean init; - - private Options() { - } + public static final String OP_NAME = "Empty"; + + private Output output; + + private Empty(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Empty operation. - * + * * @param scope current scope * @param shape 1-D. Represents the shape of the output tensor. - * @param dtype - * @param options carries optional attributes values + * @param dtype the value of the dtype property + * @param options carries optional attribute values + * @param data type for {@code Empty} output and operands * @return a new instance of Empty */ - @Endpoint(describeByClass = true) - public static Empty create(Scope scope, Operand shape, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Empty create(Scope scope, Operand shape, + Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Empty", scope.makeOpName("Empty")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); @@ -80,36 +76,51 @@ public static Empty create(Scope scope, Operand sha } } } - return new Empty(opBuilder.build()); + return new Empty<>(opBuilder.build()); } - + /** + * Sets the init option. + * * @param init If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content. + * @return this Options instance. */ public static Options init(Boolean init) { return new Options().init(init); } - + /** - * A `Tensor` of type `T`. + * Gets output. + * A {@code Tensor} of type {@code T}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Empty"; - - private Output output; - - private Empty(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Empty} + */ + public static class Options { + private Boolean init; + + private Options() { + } + + /** + * Sets the init option. + * + * @param init If True, initialize the returned tensor with the default value of dtype. Otherwise, the implementation is free not to initializethe tensor's content. + * @return this Options instance. + */ + public Options init(Boolean init) { + this.init = init; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorList.java index db314701fe6..974c8c4a4fe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorList.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorList.java @@ -32,28 +32,44 @@ /** * 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. + *

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. */ @Operator public final class EmptyTensorList extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EmptyTensorList"; + + private Output handle; + + @SuppressWarnings("unchecked") + private EmptyTensorList(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EmptyTensorList operation. - * + * * @param scope current scope - * @param elementShape - * @param maxNumElements - * @param elementDtype + * @param elementShape the elementShape value + * @param maxNumElements the maxNumElements value + * @param elementDtype the value of the elementDtype property + * @param data type for {@code EmptyTensorList} output and operands * @return a new instance of EmptyTensorList */ - @Endpoint(describeByClass = true) - public static EmptyTensorList create(Scope scope, Operand elementShape, Operand maxNumElements, Class elementDtype) { + @Endpoint( + describeByClass = true + ) + public static EmptyTensorList create(Scope scope, + Operand elementShape, Operand maxNumElements, + Class elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("EmptyTensorList", scope.makeOpName("EmptyTensorList")); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(maxNumElements.asOutput()); @@ -61,27 +77,19 @@ public static EmptyTensorList create(Scope scope, Operand handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EmptyTensorList"; - - private Output handle; - - private EmptyTensorList(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorMap.java index 6a2474076cf..3602dd5b457 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EmptyTensorMap.java @@ -29,45 +29,51 @@ /** * Creates and returns an empty tensor map. - *

* handle: an empty tensor map */ @Operator public final class EmptyTensorMap extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EmptyTensorMap"; + + private Output handle; + + @SuppressWarnings("unchecked") + private EmptyTensorMap(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EmptyTensorMap operation. - * + * * @param scope current scope * @return a new instance of EmptyTensorMap */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static EmptyTensorMap create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("EmptyTensorMap", scope.makeOpName("EmptyTensorMap")); opBuilder = scope.apply(opBuilder); return new EmptyTensorMap(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EmptyTensorMap"; - - private Output handle; - - private EmptyTensorMap(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EncodeProto.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EncodeProto.java index f0d22e0f6c1..d8d4cd12ef8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EncodeProto.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EncodeProto.java @@ -32,89 +32,89 @@ /** * The op serializes protobuf messages provided in the input tensors. - *

- * The types of the tensors in `values` must match the schema for the fields - * specified in `field_names`. All the tensors in `values` must have a common - * shape prefix, batch_shape. - *

- * The `sizes` tensor specifies repeat counts for each field. The repeat count - * (last dimension) of a each tensor in `values` must be greater than or equal - * to corresponding repeat count in `sizes`. - *

- * A `message_type` name must be provided to give context for the field names. + * The types of the tensors in {@code values} must match the schema for the fields + * specified in {@code field_names}. All the tensors in {@code values} must have a common + * shape prefix, batch_shape. + *

The {@code sizes} tensor specifies repeat counts for each field. The repeat count + * (last dimension) of a each tensor in {@code values} must be greater than or equal + * to corresponding repeat count in {@code sizes}. + *

A {@code message_type} name must be provided to give context for the field names. * The actual message descriptor can be looked up either in the linked-in * descriptor pool or a filename provided by the caller using the - * `descriptor_source` attribute. - *

- * For the most part, the mapping between Proto field types and TensorFlow dtypes + * {@code descriptor_source} attribute. + *

For the most part, the mapping between Proto field types and TensorFlow dtypes * is straightforward. However, there are a few special cases: - *

- * - A proto field that contains a submessage or group can only be converted - * to `DT_STRING` (the serialized submessage). This is to reduce the complexity + *

    + *
  • + *

    A proto field that contains a submessage or group can only be converted + * to {@code DT_STRING} (the serialized submessage). This is to reduce the complexity * of the API. The resulting string can be used as input to another instance of * the decode_proto op. - *

    - * - TensorFlow lacks support for unsigned integers. The ops represent uint64 - * types as a `DT_INT64` with the same twos-complement bit pattern (the obvious + *

  • + *
  • + *

    TensorFlow lacks support for unsigned integers. The ops represent uint64 + * types as a {@code DT_INT64} with the same twos-complement bit pattern (the obvious * way). Unsigned int32 values can be represented exactly by specifying type - * `DT_INT64`, or using twos-complement if the caller specifies `DT_INT32` in - * the `output_types` attribute. - *

    - * The `descriptor_source` attribute selects the source of protocol - * descriptors to consult when looking up `message_type`. This may be: - *

    - * - An empty string or "local://", in which case protocol descriptors are + * {@code DT_INT64}, or using twos-complement if the caller specifies {@code DT_INT32} in + * the {@code output_types} attribute. + *

  • + *
+ *

The {@code descriptor_source} attribute selects the source of protocol + * descriptors to consult when looking up {@code message_type}. This may be: + *

    + *
  • + *

    An empty string or "local://", in which case protocol descriptors are * created for C++ (not Python) proto definitions linked to the binary. - *

    - * - A file, in which case protocol descriptors are created from the file, - * which is expected to contain a `FileDescriptorSet` serialized as a string. - * NOTE: You can build a `descriptor_source` file using the `--descriptor_set_out` - * and `--include_imports` options to the protocol compiler `protoc`. - *

    - * - A "bytes://", in which protocol descriptors are created from ``, - * which is expected to be a `FileDescriptorSet` serialized as a string. + *

  • + *
  • + *

    A file, in which case protocol descriptors are created from the file, + * which is expected to contain a {@code FileDescriptorSet} serialized as a string. + * NOTE: You can build a {@code descriptor_source} file using the {@code --descriptor_set_out} + * and {@code --include_imports} options to the protocol compiler {@code protoc}. + *

  • + *
  • + *

    A "bytes://<bytes>", in which protocol descriptors are created from {@code }, + * which is expected to be a {@code FileDescriptorSet} serialized as a string. + *

  • + *
*/ @Operator public final class EncodeProto extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.EncodeProto} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param descriptorSource - */ - public Options descriptorSource(String descriptorSource) { - this.descriptorSource = descriptorSource; - return this; - } - - private String descriptorSource; - - private Options() { - } + public static final String OP_NAME = "EncodeProto"; + + private Output bytes; + + private EncodeProto(Operation operation) { + super(operation); + int outputIdx = 0; + bytes = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EncodeProto operation. - * + * * @param scope current scope - * @param sizes Tensor of int32 with shape `[batch_shape, len(field_names)]`. + * @param sizes Tensor of int32 with shape {@code [batch_shape, len(field_names)]}. * @param values List of tensors containing values for the corresponding field. * @param fieldNames List of strings containing proto field names. * @param messageType Name of the proto message type to decode. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EncodeProto */ - @Endpoint(describeByClass = true) - public static EncodeProto create(Scope scope, Operand sizes, Iterable> values, List fieldNames, String messageType, Options... options) { + @Endpoint( + describeByClass = true + ) + public static EncodeProto create(Scope scope, Operand sizes, Iterable> values, + List fieldNames, String messageType, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EncodeProto", scope.makeOpName("EncodeProto")); opBuilder.addInput(sizes.asOutput()); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder = scope.apply(opBuilder); String[] fieldNamesArray = new String[fieldNames.size()]; - for (int i = 0; i < fieldNamesArray.length; ++i) { + for (int i = 0 ; i < fieldNamesArray.length ; i++) { fieldNamesArray[i] = fieldNames.get(i); } opBuilder.setAttr("field_names", fieldNamesArray); @@ -128,34 +128,49 @@ public static EncodeProto create(Scope scope, Operand sizes, Iterable bytes() { return bytes; } - + @Override public Output asOutput() { return bytes; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeProto"; - - private Output bytes; - - private EncodeProto(Operation operation) { - super(operation); - int outputIdx = 0; - bytes = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.EncodeProto} + */ + public static class Options { + private String descriptorSource; + + private Options() { + } + + /** + * Sets the descriptorSource option. + * + * @param descriptorSource the descriptorSource option + * @return this Options instance. + */ + public Options descriptorSource(String descriptorSource) { + this.descriptorSource = descriptorSource; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnsureShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnsureShape.java index f8c8b232554..113f88c1238 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnsureShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnsureShape.java @@ -30,52 +30,58 @@ /** * 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. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class EnsureShape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EnsureShape"; + + private Output output; + + private EnsureShape(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EnsureShape operation. - * + * * @param scope current scope * @param input A tensor, whose shape is to be validated. * @param shape The expected (possibly partially specified) shape of the input tensor. + * @param data type for {@code EnsureShape} output and operands * @return a new instance of EnsureShape */ - @Endpoint(describeByClass = true) - public static EnsureShape create(Scope scope, Operand input, Shape shape) { + @Endpoint( + describeByClass = true + ) + public static EnsureShape create(Scope scope, Operand input, + Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("EnsureShape", scope.makeOpName("EnsureShape")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new EnsureShape(opBuilder.build()); + return new EnsureShape<>(opBuilder.build()); } - + /** + * Gets output. * A tensor with the same shape and contents as the input tensor or value. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnsureShape"; - - private Output output; - - private EnsureShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Enter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Enter.java index a958d23c259..f65f5cff7e2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Enter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Enter.java @@ -24,61 +24,47 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates or finds a child frame, and makes `data` available to the child frame. - *

- * This op is used together with `Exit` to create loops in the graph. - * The unique `frame_name` is used by the `Executor` to identify frames. If - * `is_constant` is true, `output` is a constant in the child frame; otherwise - * it may be changed in the child frame. At most `parallel_iterations` iterations + * Creates or finds a child frame, and makes {@code data} available to the child frame. + * This op is used together with {@code Exit} to create loops in the graph. + * The unique {@code frame_name} is used by the {@code Executor} to identify frames. If + * {@code is_constant} is true, {@code output} is a constant in the child frame; otherwise + * it may be changed in the child frame. At most {@code parallel_iterations} iterations * are run in parallel in the child frame. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class Enter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Enter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param isConstant If true, the output is constant within the child frame. - */ - public Options isConstant(Boolean isConstant) { - this.isConstant = isConstant; - return this; - } - - /** - * @param parallelIterations The number of iterations allowed to run in parallel. - */ - public Options parallelIterations(Long parallelIterations) { - this.parallelIterations = parallelIterations; - return this; - } - - private Boolean isConstant; - private Long parallelIterations; - - private Options() { - } + public static final String OP_NAME = "Enter"; + + private Output output; + + private Enter(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Enter operation. - * + * * @param scope current scope * @param data The tensor to be made available to the child frame. * @param frameName The name of the child frame. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Enter} output and operands * @return a new instance of Enter */ - @Endpoint(describeByClass = true) - public static Enter create(Scope scope, Operand data, String frameName, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Enter create(Scope scope, Operand data, String frameName, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Enter", scope.makeOpName("Enter")); opBuilder.addInput(data.asOutput()); opBuilder = scope.apply(opBuilder); @@ -93,43 +79,74 @@ public static Enter create(Scope scope, Operand data, St } } } - return new Enter(opBuilder.build()); + return new Enter<>(opBuilder.build()); } - + /** + * Sets the isConstant option. + * * @param isConstant If true, the output is constant within the child frame. + * @return this Options instance. */ public static Options isConstant(Boolean isConstant) { return new Options().isConstant(isConstant); } - + /** + * Sets the parallelIterations option. + * * @param parallelIterations The number of iterations allowed to run in parallel. + * @return this Options instance. */ public static Options parallelIterations(Long parallelIterations) { return new Options().parallelIterations(parallelIterations); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Enter"; - - private Output output; - - private Enter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Enter} + */ + public static class Options { + private Boolean isConstant; + + private Long parallelIterations; + + private Options() { + } + + /** + * Sets the isConstant option. + * + * @param isConstant If true, the output is constant within the child frame. + * @return this Options instance. + */ + public Options isConstant(Boolean isConstant) { + this.isConstant = isConstant; + return this; + } + + /** + * Sets the parallelIterations option. + * + * @param parallelIterations The number of iterations allowed to run in parallel. + * @return this Options instance. + */ + public Options parallelIterations(Long parallelIterations) { + this.parallelIterations = parallelIterations; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Exit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Exit.java index 8f0562469c6..2d2c1499c29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Exit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Exit.java @@ -24,53 +24,57 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Exits the current frame to its parent frame. - *

- * Exit makes its input `data` available to the parent frame. - * - * @param data type for {@code output()} output + * Exit makes its input {@code data} available to the parent frame. + * + * @param data type for {@code output} output */ public final class Exit extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Exit"; + + private Output output; + + private Exit(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Exit operation. - * + * * @param scope current scope * @param data The tensor to be made available to the parent frame. + * @param data type for {@code Exit} output and operands * @return a new instance of Exit */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Exit create(Scope scope, Operand data) { OperationBuilder opBuilder = scope.env().opBuilder("Exit", scope.makeOpName("Exit")); opBuilder.addInput(data.asOutput()); opBuilder = scope.apply(opBuilder); - return new Exit(opBuilder.build()); + return new Exit<>(opBuilder.build()); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Exit"; - - private Output output; - - private Exit(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExpandDims.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExpandDims.java index c80e1809420..f36d595669c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExpandDims.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExpandDims.java @@ -30,81 +30,82 @@ /** * 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 + * Given a tensor {@code input}, this operation inserts a dimension of 1 at the + * dimension index {@code axis} of {@code input}'s shape. The dimension index {@code axis} starts at + * zero; if you specify a negative number for {@code 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
+ * 

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 {@code [height, width, channels]}, you can make it a batch of 1 image with {@code expand_dims(image, 0)}, + * which will make the shape {@code [1, height, width, channels]}. + *

Other examples: + *

  * # '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]
- * 
+ * 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 + * 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: + *

{@code -1-input.dims() <= dim <= input.dims()} + *

This operation is related to {@code squeeze()}, which removes dimensions of * size 1. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class ExpandDims extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExpandDims"; + + private Output output; + + private ExpandDims(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ExpandDims operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @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)]`. + * expand the shape of {@code input}. Must be in the range + * {@code [-rank(input) - 1, rank(input)]}. + * @param data type for {@code ExpandDims} output and operands * @return a new instance of ExpandDims */ - @Endpoint(describeByClass = true) - public static ExpandDims create(Scope scope, Operand input, Operand axis) { + @Endpoint( + describeByClass = true + ) + public static ExpandDims create(Scope scope, Operand input, + Operand axis) { OperationBuilder opBuilder = scope.env().opBuilder("ExpandDims", scope.makeOpName("ExpandDims")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); opBuilder = scope.apply(opBuilder); - return new ExpandDims(opBuilder.build()); + return new ExpandDims<>(opBuilder.build()); } - + /** - * Contains the same data as `input`, but its shape has an additional + * Gets output. + * Contains the same data as {@code input}, but its shape has an additional * dimension of size 1 added. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExpandDims"; - - private Output output; - - private ExpandDims(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExtractVolumePatches.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExtractVolumePatches.java index e733d79233a..eb6f8b4bc34 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExtractVolumePatches.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExtractVolumePatches.java @@ -29,74 +29,78 @@ import org.tensorflow.types.family.TNumber; /** - * Extract `patches` from `input` and put them in the `"depth"` output dimension. 3D extension of `extract_image_patches`. - * - * @param data type for {@code patches()} output + * Extract {@code patches} from {@code input} and put them in the {@code "depth"} output dimension. 3D extension of {@code extract_image_patches}. + * + * @param data type for {@code patches} output */ @Operator public final class ExtractVolumePatches extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExtractVolumePatches"; + + private Output patches; + + private ExtractVolumePatches(Operation operation) { + super(operation); + int outputIdx = 0; + patches = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ExtractVolumePatches operation. - * + * * @param scope current scope - * @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 input 5-D Tensor with shape {@code [batch, in_planes, in_rows, in_cols, depth]}. + * @param ksizes The size of the sliding window for each dimension of {@code 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]`. + * {@code input}. Must be: {@code [1, stride_planes, stride_rows, stride_cols, 1]}. * @param padding The type of padding algorithm to use. - *

- * The size-related attributes are specified as follows: - *

{@code
+   * 

The size-related attributes are specified as follows: + *

    * ksizes = [1, ksize_planes, ksize_rows, ksize_cols, 1]
    * strides = [1, stride_planes, strides_rows, strides_cols, 1]
-   * }
- * + *
+ * @param data type for {@code ExtractVolumePatches} output and operands * @return a new instance of ExtractVolumePatches */ - @Endpoint(describeByClass = true) - public static ExtractVolumePatches create(Scope scope, Operand input, List ksizes, List strides, String padding) { + @Endpoint( + describeByClass = true + ) + public static ExtractVolumePatches create(Scope scope, Operand input, + List ksizes, List strides, String padding) { OperationBuilder opBuilder = scope.env().opBuilder("ExtractVolumePatches", scope.makeOpName("ExtractVolumePatches")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizesArray = new long[ksizes.size()]; - for (int i = 0; i < ksizesArray.length; ++i) { + for (int i = 0 ; i < ksizesArray.length ; i++) { ksizesArray[i] = ksizes.get(i); } opBuilder.setAttr("ksizes", ksizesArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); opBuilder.setAttr("padding", padding); - return new ExtractVolumePatches(opBuilder.build()); + return new ExtractVolumePatches<>(opBuilder.build()); } - + /** - * 5-D Tensor with shape `[batch, out_planes, out_rows, out_cols, - * ksize_planes * ksize_rows * ksize_cols * depth]` containing patches - * with size `ksize_planes x ksize_rows x ksize_cols x depth` vectorized - * in the "depth" dimension. Note `out_planes`, `out_rows` and `out_cols` + * Gets patches. + * 5-D Tensor with shape {@code [batch, out_planes, out_rows, out_cols, ksize_planes * ksize_rows * ksize_cols * depth]} containing patches + * with size {@code ksize_planes x ksize_rows x ksize_cols x depth} vectorized + * in the "depth" dimension. Note {@code out_planes}, {@code out_rows} and {@code out_cols} * are the dimensions of the output patches. + * @return patches. */ public Output patches() { return patches; } - + @Override public Output asOutput() { return patches; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExtractVolumePatches"; - - private Output patches; - - private ExtractVolumePatches(Operation operation) { - super(operation); - int outputIdx = 0; - patches = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fill.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fill.java index fac22b5f885..1aacfb1bd75 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fill.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fill.java @@ -30,75 +30,76 @@ /** * Creates a tensor filled with a scalar value. - *

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

- * For example: - *

{@code
+ * This operation creates a tensor of shape {@code dims} and fills it with {@code value}.
+ * 

For example: + *

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

{@code tf.fill} differs from {@code tf.constant} in a few ways: *

    - *
  • - * `tf.fill` only supports scalar contents, whereas `tf.constant` supports - * Tensor values. - *
  • - *
  • - * `tf.fill` creates an Op in the computation graph that constructs the actual - * Tensor value at runtime. This is in contrast to `tf.constant` which embeds - * the entire Tensor into the graph with a `Const` node. - *
  • - *
  • - * Because `tf.fill` evaluates at graph runtime, it supports dynamic shapes - * based on other runtime Tensors, unlike `tf.constant`. - * - * @param data type for {@code output()} output + *
  • {@code tf.fill} only supports scalar contents, whereas {@code tf.constant} supports + * Tensor values.
  • + *
  • {@code tf.fill} creates an Op in the computation graph that constructs the actual + * Tensor value at runtime. This is in contrast to {@code tf.constant} which embeds + * the entire Tensor into the graph with a {@code Const} node.
  • + *
  • Because {@code tf.fill} evaluates at graph runtime, it supports dynamic shapes + * based on other runtime Tensors, unlike {@code tf.constant}.
  • + *
+ * + * @param data type for {@code output} output */ @Operator public final class Fill extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Fill"; + + private Output output; + + private Fill(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Fill operation. - * + * * @param scope current scope * @param dims 1-D. Represents the shape of the output tensor. * @param value 0-D (scalar). Value to fill the returned tensor. - *

- * @compatibility(numpy) + *

{@literal @}compatibility(numpy)
* Equivalent to np.full - * @end_compatibility + *
{@literal @}end_compatibility + * @param data type for {@code Fill} output and operands * @return a new instance of Fill */ - @Endpoint(describeByClass = true) - public static Fill create(Scope scope, Operand dims, Operand value) { + @Endpoint( + describeByClass = true + ) + public static Fill create(Scope scope, Operand dims, + Operand value) { OperationBuilder opBuilder = scope.env().opBuilder("Fill", scope.makeOpName("Fill")); opBuilder.addInput(dims.asOutput()); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); - return new Fill(opBuilder.build()); + return new Fill<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Fill"; - - private Output output; - - private Fill(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fingerprint.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fingerprint.java index 5911fa07e40..0e4dfcb233d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fingerprint.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Fingerprint.java @@ -31,79 +31,79 @@ /** * Generates fingerprint values. - *

- * Generates fingerprint values of `data`. - *

- * Fingerprint op considers the first dimension of `data` as the batch dimension, - * and `output[i]` contains the fingerprint value generated from contents in - * `data[i, ...]` for all `i`. - *

- * Fingerprint op writes fingerprint values as byte arrays. For example, the - * default method `farmhash64` generates a 64-bit fingerprint value at a time. - * This 8-byte value is written out as an `uint8` array of size 8, in little-endian + * Generates fingerprint values of {@code data}. + *

Fingerprint op considers the first dimension of {@code data} as the batch dimension, + * and {@code output[i]} contains the fingerprint value generated from contents in + * {@code data[i, ...]} for all {@code i}. + *

Fingerprint op writes fingerprint values as byte arrays. For example, the + * default method {@code farmhash64} generates a 64-bit fingerprint value at a time. + * This 8-byte value is written out as an {@code uint8} array of size 8, in little-endian * order. - *

- * For example, suppose that `data` has data type `DT_INT32` and shape (2, 3, 4), - * and that the fingerprint method is `farmhash64`. In this case, the output shape - * is (2, 8), where 2 is the batch dimension size of `data`, and 8 is the size of - * each fingerprint value in bytes. `output[0, :]` is generated from 12 integers in - * `data[0, :, :]` and similarly `output[1, :]` is generated from other 12 integers - * in `data[1, :, :]`. - *

- * Note that this op fingerprints the raw underlying buffer, and it does not + *

For example, suppose that {@code data} has data type {@code DT_INT32} and shape (2, 3, 4), + * and that the fingerprint method is {@code farmhash64}. In this case, the output shape + * is (2, 8), where 2 is the batch dimension size of {@code data}, and 8 is the size of + * each fingerprint value in bytes. {@code output[0, :]} is generated from 12 integers in + * {@code data[0, :, :]} and similarly {@code output[1, :]} is generated from other 12 integers + * in {@code data[1, :, :]}. + *

Note that this op fingerprints the raw underlying buffer, and it does not * fingerprint Tensor's metadata such as data type and/or shape. For example, the * fingerprint values are invariant under reshapes and bitcasts as long as the * batch dimension remain the same: - *

{@code
+ * 
  * Fingerprint(data) == Fingerprint(Reshape(data, ...))
  * Fingerprint(data) == Fingerprint(Bitcast(data, ...))
- * }
- * For string data, one should expect `Fingerprint(data) != - * Fingerprint(ReduceJoin(data))` in general. + *
+ *

For string data, one should expect {@code Fingerprint(data) != Fingerprint(ReduceJoin(data))} in general. */ @Operator public final class Fingerprint extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Fingerprint"; + + private Output fingerprint; + + private Fingerprint(Operation operation) { + super(operation); + int outputIdx = 0; + fingerprint = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Fingerprint operation. - * + * * @param scope current scope * @param data Must have rank 1 or higher. * @param method Fingerprint method used by this op. Currently available method is - * `farmhash::fingerprint64`. + * {@code farmhash::fingerprint64}. * @return a new instance of Fingerprint */ - @Endpoint(describeByClass = true) - public static Fingerprint create(Scope scope, Operand data, Operand method) { + @Endpoint( + describeByClass = true + ) + public static Fingerprint create(Scope scope, Operand data, + Operand method) { OperationBuilder opBuilder = scope.env().opBuilder("Fingerprint", scope.makeOpName("Fingerprint")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(method.asOutput()); opBuilder = scope.apply(opBuilder); return new Fingerprint(opBuilder.build()); } - + /** - * A two-dimensional `Tensor` of type `tf.uint8`. The first dimension equals to - * `data`'s first dimension, and the second dimension size depends on the + * Gets fingerprint. + * A two-dimensional {@code Tensor} of type {@code tf.uint8}. The first dimension equals to + * {@code data}'s first dimension, and the second dimension size depends on the * fingerprint algorithm. + * @return fingerprint. */ public Output fingerprint() { return fingerprint; } - + @Override public Output asOutput() { return fingerprint; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Fingerprint"; - - private Output fingerprint; - - private Fingerprint(Operation operation) { - super(operation); - int outputIdx = 0; - fingerprint = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Gather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Gather.java index e4a366d96f3..cd090bfee84 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Gather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Gather.java @@ -29,72 +29,65 @@ import org.tensorflow.types.family.TType; /** - * Gather slices from `params` axis `axis` according to `indices`. - *

- * `indices` must be an integer tensor of any dimension (usually 0-D or 1-D). - * Produces an output tensor with shape `params.shape[:axis] + - * indices.shape[batch_dims:] + params.shape[axis + 1:]` where: - *

{@code
+ * Gather slices from {@code params} axis {@code axis} according to {@code indices}.
+ * {@code indices} must be an integer tensor of any dimension (usually 0-D or 1-D).
+ * Produces an output tensor with shape {@code params.shape[:axis] + indices.shape[batch_dims:] + params.shape[axis + 1:]} where:
+ * 
  *     # Scalar indices (output is rank(params) - 1).
  *     output[a_0, ..., a_n, b_0, ..., b_n] =
  *       params[a_0, ..., a_n, indices, b_0, ..., b_n]
- * 
+ *
  *     # Vector indices (output is rank(params)).
  *     output[a_0, ..., a_n, i, b_0, ..., b_n] =
  *       params[a_0, ..., a_n, indices[i], b_0, ..., b_n]
- * 
+ *
  *     # Higher rank indices (output is rank(params) + rank(indices) - 1).
  *     output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] =
  *       params[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n]
- * }
+ *
*
* *
- *

- * Note that on CPU, if an out of bound index is found, an error is returned. + *

Note that on CPU, if an out of bound index is found, an error is returned. * On GPU, if an out of bound index is found, a 0 is stored in the * corresponding output value. - *

- * See also `tf.batch_gather` and `tf.gather_nd`. - * - * @param data type for {@code output()} output + *

See also {@code tf.batch_gather} and {@code tf.gather_nd}. + * + * @param data type for {@code output} output */ @Operator public final class Gather extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Gather} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param batchDims - */ - public Options batchDims(Long batchDims) { - this.batchDims = batchDims; - return this; - } - - private Long batchDims; - - private Options() { - } + public static final String OP_NAME = "GatherV2"; + + private Output output; + + private Gather(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Gather operation. - * + * Factory method to create a class wrapping a new GatherV2 operation. + * * @param scope current scope * @param params The tensor from which to gather values. Must be at least rank - * `axis + 1`. - * @param indices Index tensor. Must be in range `[0, params.shape[axis])`. - * @param axis The axis in `params` to gather `indices` from. Defaults to the first + * {@code axis + 1}. + * @param indices Index tensor. Must be in range {@code [0, params.shape[axis])}. + * @param axis The axis in {@code params} to gather {@code indices} from. Defaults to the first * dimension. Supports negative indexes. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code GatherV2} output and operands * @return a new instance of Gather */ - @Endpoint(describeByClass = true) - public static Gather create(Scope scope, Operand params, Operand indices, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Gather create(Scope scope, Operand params, + Operand indices, Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("GatherV2", scope.makeOpName("Gather")); opBuilder.addInput(params.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -107,37 +100,52 @@ public static Gather create(Scope scope, Operand params, } } } - return new Gather(opBuilder.build()); + return new Gather<>(opBuilder.build()); } - + /** - * @param batchDims + * Sets the batchDims option. + * + * @param batchDims the batchDims option + * @return this Options instance. */ public static Options batchDims(Long batchDims) { return new Options().batchDims(batchDims); } - + /** - * Values from `params` gathered from indices given by `indices`, with - * shape `params.shape[:axis] + indices.shape + params.shape[axis + 1:]`. + * Gets output. + * Values from {@code params} gathered from indices given by {@code indices}, with + * shape {@code params.shape[:axis] + indices.shape + params.shape[axis + 1:]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GatherV2"; - - private Output output; - - private Gather(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Gather} + */ + public static class Options { + private Long batchDims; + + private Options() { + } + + /** + * Sets the batchDims option. + * + * @param batchDims the batchDims option + * @return this Options instance. + */ + public Options batchDims(Long batchDims) { + this.batchDims = batchDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GatherNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GatherNd.java index d7a5fa04b7e..c61a86dcd5f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GatherNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GatherNd.java @@ -29,144 +29,147 @@ import org.tensorflow.types.family.TType; /** - * Gather slices from `params` into a Tensor with shape specified by `indices`. - *

- * `indices` is a K-dimensional integer tensor, best thought of as a - * (K-1)-dimensional tensor of indices into `params`, where each element defines a - * slice of `params`: - *

- * output[\\(i_0, ..., i_{K-2}\\)] = params[indices[\\(i_0, ..., i_{K-2}\\)]] - *

- * Whereas in `tf.gather` `indices` defines slices into the `axis` - * dimension of `params`, in `tf.gather_nd`, `indices` defines slices into the - * first `N` dimensions of `params`, where `N = indices.shape[-1]`. - *

- * The last dimension of `indices` can be at most the rank of - * `params`: - *

- * indices.shape[-1] <= params.rank - *

- * The last dimension of `indices` corresponds to elements - * (if `indices.shape[-1] == params.rank`) or slices - * (if `indices.shape[-1] < params.rank`) along dimension `indices.shape[-1]` - * of `params`. The output tensor has shape - *

- * indices.shape[:-1] + params.shape[indices.shape[-1]:] - *

- * Note that on CPU, if an out of bound index is found, an error is returned. + * Gather slices from {@code params} into a Tensor with shape specified by {@code indices}. + * {@code indices} is a K-dimensional integer tensor, best thought of as a + * (K-1)-dimensional tensor of indices into {@code params}, where each element defines a + * slice of {@code params}: + *

+ * output[\\(i_0, ..., i_{K-2}\\)] = params[indices[\\(i_0, ..., i_{K-2}\\)]]
+ * 
+ *

Whereas in {@code tf.gather} {@code indices} defines slices into the {@code axis} + * dimension of {@code params}, in {@code tf.gather_nd}, {@code indices} defines slices into the + * first {@code N} dimensions of {@code params}, where {@code N = indices.shape[-1]}. + *

The last dimension of {@code indices} can be at most the rank of + * {@code params}: + *

+ * indices.shape[-1] <= params.rank
+ * 
+ *

The last dimension of {@code indices} corresponds to elements + * (if {@code indices.shape[-1] == params.rank}) or slices + * (if {@code indices.shape[-1] < params.rank}) along dimension {@code indices.shape[-1]} + * of {@code params}. The output tensor has shape + *

+ * indices.shape[:-1] + params.shape[indices.shape[-1]:]
+ * 
+ *

Note that on CPU, if an out of bound index is found, an error is returned. * On GPU, if an out of bound index is found, a 0 is stored in the * corresponding output value. - *

- * Some examples below. - *

- * Simple indexing into a matrix: - *

{@code
+ * 

Some examples below. + *

Simple indexing into a matrix: + *

  *     indices = [[0, 0], [1, 1]]
  *     params = [['a', 'b'], ['c', 'd']]
  *     output = ['a', 'd']
- * }
- * Slice indexing into a matrix: - *
{@code
+ * 
+ *

Slice indexing into a matrix: + *

  *     indices = [[1], [0]]
  *     params = [['a', 'b'], ['c', 'd']]
  *     output = [['c', 'd'], ['a', 'b']]
- * }
- * Indexing into a 3-tensor: - *
{@code
+ * 
+ *

Indexing into a 3-tensor: + *

  *     indices = [[1]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [[['a1', 'b1'], ['c1', 'd1']]]
- * 
- * 
+ *
+ *
  *     indices = [[0, 1], [1, 0]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [['c0', 'd0'], ['a1', 'b1']]
- * 
- * 
+ *
+ *
  *     indices = [[0, 0, 1], [1, 0, 1]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = ['b0', 'b1']
- * }
- * Batched indexing into a matrix: - *
{@code
+ * 
+ *

Batched indexing into a matrix: + *

  *     indices = [[[0, 0]], [[0, 1]]]
  *     params = [['a', 'b'], ['c', 'd']]
  *     output = [['a'], ['b']]
- * }
- * Batched slice indexing into a matrix: - *
{@code
+ * 
+ *

Batched slice indexing into a matrix: + *

  *     indices = [[[1]], [[0]]]
  *     params = [['a', 'b'], ['c', 'd']]
  *     output = [[['c', 'd']], [['a', 'b']]]
- * }
- * Batched indexing into a 3-tensor: - *
{@code
+ * 
+ *

Batched indexing into a 3-tensor: + *

  *     indices = [[[1]], [[0]]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [[[['a1', 'b1'], ['c1', 'd1']]],
  *               [[['a0', 'b0'], ['c0', 'd0']]]]
- * 
+ *
  *     indices = [[[0, 1], [1, 0]], [[0, 0], [1, 1]]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [[['c0', 'd0'], ['a1', 'b1']],
  *               [['a0', 'b0'], ['c1', 'd1']]]
- * 
- * 
+ *
+ *
  *     indices = [[[0, 0, 1], [1, 0, 1]], [[0, 1, 1], [1, 1, 0]]]
  *     params = [[['a0', 'b0'], ['c0', 'd0']],
  *               [['a1', 'b1'], ['c1', 'd1']]]
  *     output = [['b0', 'b1'], ['d0', 'c1']]
- * }
- * See also `tf.gather` and `tf.batch_gather`. - * - * @param data type for {@code output()} output + *
+ *

See also {@code tf.gather} and {@code tf.batch_gather}. + * + * @param data type for {@code output} output */ @Operator public final class GatherNd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GatherNd"; + + private Output output; + + private GatherNd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GatherNd operation. - * + * * @param scope current scope * @param params The tensor from which to gather values. * @param indices Index tensor. + * @param data type for {@code GatherNd} output and operands * @return a new instance of GatherNd */ - @Endpoint(describeByClass = true) - public static GatherNd create(Scope scope, Operand params, Operand indices) { + @Endpoint( + describeByClass = true + ) + public static GatherNd create(Scope scope, Operand params, + Operand indices) { OperationBuilder opBuilder = scope.env().opBuilder("GatherNd", scope.makeOpName("GatherNd")); opBuilder.addInput(params.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder = scope.apply(opBuilder); - return new GatherNd(opBuilder.build()); + return new GatherNd<>(opBuilder.build()); } - + /** - * Values from `params` gathered from indices given by `indices`, with - * shape `indices.shape[:-1] + params.shape[indices.shape[-1]:]`. + * Gets output. + * Values from {@code params} gathered from indices given by {@code indices}, with + * shape {@code indices.shape[:-1] + params.shape[indices.shape[-1]:]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GatherNd"; - - private Output output; - - private GatherNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionHandle.java index e3a46804398..be00df796d7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionHandle.java @@ -32,44 +32,50 @@ */ @Operator public final class GetSessionHandle extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new GetSessionHandle operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetSessionHandleV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private GetSessionHandle(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new GetSessionHandleV2 operation. + * * @param scope current scope * @param value The tensor to be stored. * @return a new instance of GetSessionHandle */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static GetSessionHandle create(Scope scope, Operand value) { OperationBuilder opBuilder = scope.env().opBuilder("GetSessionHandleV2", scope.makeOpName("GetSessionHandle")); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); return new GetSessionHandle(opBuilder.build()); } - + /** + * Gets handle. * The handle for the tensor stored in the session state, represented * as a ResourceHandle object. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GetSessionHandleV2"; - - private Output handle; - - private GetSessionHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionTensor.java index 8a04f173ef8..c4b4d9603d1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GetSessionTensor.java @@ -31,49 +31,56 @@ /** * Get the value of the tensor specified by its handle. - * - * @param data type for {@code value()} output + * + * @param data type for {@code value} output */ @Operator public final class GetSessionTensor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GetSessionTensor"; + + private Output value; + + private GetSessionTensor(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GetSessionTensor operation. - * + * * @param scope current scope * @param handle The handle for a tensor stored in the session state. * @param dtype The type of the output value. + * @param data type for {@code GetSessionTensor} output and operands * @return a new instance of GetSessionTensor */ - @Endpoint(describeByClass = true) - public static GetSessionTensor create(Scope scope, Operand handle, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static GetSessionTensor create(Scope scope, Operand handle, + Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("GetSessionTensor", scope.makeOpName("GetSessionTensor")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new GetSessionTensor(opBuilder.build()); + return new GetSessionTensor<>(opBuilder.build()); } - + /** + * Gets value. * The tensor for the given handle. + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GetSessionTensor"; - - private Output value; - - private GetSessionTensor(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GuaranteeConst.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GuaranteeConst.java index aeab16c7c6c..e03e5079309 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GuaranteeConst.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GuaranteeConst.java @@ -29,53 +29,57 @@ /** * Gives a guarantee to the TF runtime that the input tensor is a constant. - *

* The runtime is then free to make optimizations based on this. - *

- * Only accepts value typed tensors as inputs and rejects resource variable handles + *

Only accepts value typed tensors as inputs and rejects resource variable handles * as input. - *

- * Returns the input tensor without modification. - * - * @param data type for {@code output()} output + *

Returns the input tensor without modification. + * + * @param data type for {@code output} output */ @Operator public final class GuaranteeConst extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GuaranteeConst"; + + private Output output; + + private GuaranteeConst(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GuaranteeConst operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code GuaranteeConst} output and operands * @return a new instance of GuaranteeConst */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static GuaranteeConst create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("GuaranteeConst", scope.makeOpName("GuaranteeConst")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new GuaranteeConst(opBuilder.build()); + return new GuaranteeConst<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GuaranteeConst"; - - private Output output; - - private GuaranteeConst(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HashTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HashTable.java index 75f53539f84..bd0b930f591 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HashTable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HashTable.java @@ -30,65 +30,42 @@ /** * Creates a non-initialized hash table. - *

* This op creates a hash table, specifying the type of its keys and values. * Before using the table you will have to initialize it. After initialization the * table will be immutable. */ @Operator public final class HashTable extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.HashTable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this table is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this table is shared under the given name across - * multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param useNodeNameSharing If true and shared_name is empty, the table is shared - * using the node name. - */ - public Options useNodeNameSharing(Boolean useNodeNameSharing) { - this.useNodeNameSharing = useNodeNameSharing; - return this; - } - - private String container; - private String sharedName; - private Boolean useNodeNameSharing; - - private Options() { - } + public static final String OP_NAME = "HashTableV2"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + private HashTable(Operation operation) { + super(operation); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new HashTable operation. - * + * Factory method to create a class wrapping a new HashTableV2 operation. + * * @param scope current scope * @param keyDtype Type of the table keys. * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code HashTableV2} output and operands + * @param data type for {@code HashTableV2} output and operands * @return a new instance of HashTable */ - @Endpoint(describeByClass = true) - public static HashTable create(Scope scope, Class keyDtype, Class valueDtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static HashTable create(Scope scope, Class keyDtype, + Class valueDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("HashTableV2", scope.makeOpName("HashTable")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); @@ -108,52 +85,102 @@ public static HashTable create(Scope scope, C } return new HashTable(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this table is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this table is shared under the given name across * multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Sets the useNodeNameSharing option. + * * @param useNodeNameSharing If true and shared_name is empty, the table is shared * using the node name. + * @return this Options instance. */ public static Options useNodeNameSharing(Boolean useNodeNameSharing) { return new Options().useNodeNameSharing(useNodeNameSharing); } - + /** + * Gets tableHandle. * Handle to a table. + * @return tableHandle. */ - public Output tableHandle() { + public Output tableHandle() { return tableHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) tableHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "HashTableV2"; - - private Output tableHandle; - - private HashTable(Operation operation) { - super(operation); - int outputIdx = 0; - tableHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.HashTable} + */ + public static class Options { + private String container; + + private String sharedName; + + private Boolean useNodeNameSharing; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this table is shared under the given name across + * multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing If true and shared_name is empty, the table is shared + * using the node name. + * @return this Options instance. + */ + public Options useNodeNameSharing(Boolean useNodeNameSharing) { + this.useNodeNameSharing = useNodeNameSharing; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HistogramFixedWidth.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HistogramFixedWidth.java index 86e6cce541a..b6ac22168d1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HistogramFixedWidth.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/HistogramFixedWidth.java @@ -31,87 +31,97 @@ /** * Return histogram of values. - *

- * Given the tensor `values`, this operation returns a rank 1 histogram counting - * the number of entries in `values` that fall into every bin. The bins are - * equal width and determined by the arguments `value_range` and `nbins`. - *

{@code
+ * Given the tensor {@code values}, this operation returns a rank 1 histogram counting
+ * the number of entries in {@code values} that fall into every bin.  The bins are
+ * equal width and determined by the arguments {@code value_range} and {@code nbins}.
+ * 
  * # Bins will be:  (-inf, 1), [1, 2), [2, 3), [3, 4), [4, inf)
  * nbins = 5
  * value_range = [0.0, 5.0]
  * new_values = [-1.0, 0.0, 1.5, 2.0, 5.0, 15]
- * 
+ *
  * with tf.get_default_session() as sess:
  *   hist = tf.histogram_fixed_width(new_values, value_range, nbins=5)
  *   variables.global_variables_initializer().run()
- *   sess.run(hist) => [2, 1, 1, 0, 2]
- * }
- * - * - * @param data type for {@code out()} output + * sess.run(hist) => [2, 1, 1, 0, 2] + *
+ * + * @param data type for {@code out} output */ @Operator public final class HistogramFixedWidth extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "HistogramFixedWidth"; + + private Output out; + + private HistogramFixedWidth(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new HistogramFixedWidth operation. - * + * * @param scope current scope - * @param values Numeric `Tensor`. - * @param valueRange Shape [2] `Tensor` of same `dtype` as `values`. - * values <= value_range[0] will be mapped to hist[0], - * values >= value_range[1] will be mapped to hist[-1]. - * @param nbins Scalar `int32 Tensor`. Number of histogram bins. - * @param dtype + * @param values Numeric {@code Tensor}. + * @param valueRange Shape [2] {@code Tensor} of same {@code dtype} as {@code values}. + * values <= value_range[0] will be mapped to hist[0], + * values >= value_range[1] will be mapped to hist[-1]. + * @param nbins Scalar {@code int32 Tensor}. Number of histogram bins. + * @param dtype the value of the dtype property + * @param data type for {@code HistogramFixedWidth} output and operands + * @param data type for {@code HistogramFixedWidth} output and operands * @return a new instance of HistogramFixedWidth */ - @Endpoint(describeByClass = true) - public static HistogramFixedWidth create(Scope scope, Operand values, Operand valueRange, Operand nbins, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static HistogramFixedWidth create(Scope scope, + Operand values, Operand valueRange, Operand nbins, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("HistogramFixedWidth", scope.makeOpName("HistogramFixedWidth")); opBuilder.addInput(values.asOutput()); opBuilder.addInput(valueRange.asOutput()); opBuilder.addInput(nbins.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new HistogramFixedWidth(opBuilder.build()); + return new HistogramFixedWidth<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new HistogramFixedWidth operation using default output types. - * + * Factory method to create a class wrapping a new HistogramFixedWidth operation, with the default output types. + * * @param scope current scope - * @param values Numeric `Tensor`. - * @param valueRange Shape [2] `Tensor` of same `dtype` as `values`. - * values <= value_range[0] will be mapped to hist[0], - * values >= value_range[1] will be mapped to hist[-1]. - * @param nbins Scalar `int32 Tensor`. Number of histogram bins. - * @return a new instance of HistogramFixedWidth + * @param values Numeric {@code Tensor}. + * @param valueRange Shape [2] {@code Tensor} of same {@code dtype} as {@code values}. + * values <= value_range[0] will be mapped to hist[0], + * values >= value_range[1] will be mapped to hist[-1]. + * @param nbins Scalar {@code int32 Tensor}. Number of histogram bins. + * @param data type for {@code HistogramFixedWidth} output and operands + * @return a new instance of HistogramFixedWidth, with default output types */ - @Endpoint(describeByClass = true) - public static HistogramFixedWidth create(Scope scope, Operand values, Operand valueRange, Operand nbins) { + @Endpoint( + describeByClass = true + ) + public static HistogramFixedWidth create(Scope scope, + Operand values, Operand valueRange, Operand nbins) { return create(scope, values, valueRange, nbins, TInt32.class); } - + /** - * A 1-D `Tensor` holding histogram of values. + * Gets out. + * A 1-D {@code Tensor} holding histogram of values. + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "HistogramFixedWidth"; - - private Output out; - - private HistogramFixedWidth(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Identity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Identity.java index 51030fd8349..aaed04c8743 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Identity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Identity.java @@ -29,46 +29,53 @@ /** * Return a tensor with the same shape and contents as the input tensor or value. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class Identity extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Identity"; + + private Output output; + + private Identity(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Identity operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code Identity} output and operands * @return a new instance of Identity */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Identity create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Identity", scope.makeOpName("Identity")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Identity(opBuilder.build()); + return new Identity<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Identity"; - - private Output output; - - private Identity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IdentityN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IdentityN.java index 02bf0f00422..dc658b90eb8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IdentityN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IdentityN.java @@ -33,63 +33,67 @@ /** * Returns a list of tensors with the same shapes and contents as the input - *

* tensors. - *

- * This op can be used to override the gradient for complicated functions. For + *

This op can be used to override the gradient for complicated functions. For * example, suppose y = f(x) and we wish to apply a custom function g for backprop * such that dx = g(dy). In Python, - *

{@code
+ * 
  * with tf.get_default_graph().gradient_override_map(
  *     {'IdentityN': 'OverrideGradientWithG'}):
  *   y, _ = identity_n([f(x), x])
- * 
- * @tf.RegisterGradient('OverrideGradientWithG')
+ *
+ * {@literal @}tf.RegisterGradient('OverrideGradientWithG')
  * def ApplyG(op, dy, _):
  *   return [None, g(dy)]  # Do not backprop to f(x).
- * }
- * + *
*/ @Operator public final class IdentityN extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IdentityN"; + + private List> output; + + @SuppressWarnings("unchecked") + private IdentityN(Operation operation) { + super(operation); + int outputIdx = 0; + int outputLength = operation.outputListLength("output"); + output = Arrays.asList(operation.outputList(outputIdx, outputLength)); + outputIdx += outputLength; + } + /** * Factory method to create a class wrapping a new IdentityN operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of IdentityN */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IdentityN create(Scope scope, Iterable> input) { OperationBuilder opBuilder = scope.env().opBuilder("IdentityN", scope.makeOpName("IdentityN")); opBuilder.addInputList(Operands.asOutputs(input)); opBuilder = scope.apply(opBuilder); return new IdentityN(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IdentityN"; - - private List> output; - - private IdentityN(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList(operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ImmutableConst.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ImmutableConst.java index 319304aff8b..7dd2c608b9f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ImmutableConst.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ImmutableConst.java @@ -31,53 +31,60 @@ /** * Returns immutable tensor from memory region. - *

* The current implementation memmaps the tensor from a file. - * - * @param data type for {@code tensor()} output + * + * @param data type for {@code tensor} output */ @Operator public final class ImmutableConst extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ImmutableConst"; + + private Output tensor; + + private ImmutableConst(Operation operation) { + super(operation); + int outputIdx = 0; + tensor = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ImmutableConst operation. - * + * * @param scope current scope * @param dtype Type of the returned tensor. * @param shape Shape of the returned tensor. * @param memoryRegionName Name of readonly memory region used by the tensor, see * NewReadOnlyMemoryRegionFromFile in tensorflow::Env. + * @param data type for {@code ImmutableConst} output and operands * @return a new instance of ImmutableConst */ - @Endpoint(describeByClass = true) - public static ImmutableConst create(Scope scope, Class dtype, Shape shape, String memoryRegionName) { + @Endpoint( + describeByClass = true + ) + public static ImmutableConst create(Scope scope, Class dtype, Shape shape, + String memoryRegionName) { OperationBuilder opBuilder = scope.env().opBuilder("ImmutableConst", scope.makeOpName("ImmutableConst")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); opBuilder.setAttr("memory_region_name", memoryRegionName); - return new ImmutableConst(opBuilder.build()); + return new ImmutableConst<>(opBuilder.build()); } - + /** + * Gets tensor. + * + * @return tensor. */ public Output tensor() { return tensor; } - + @Override public Output asOutput() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImmutableConst"; - - private Output tensor; - - private ImmutableConst(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTable.java index d873004b378..20ef82fc0b6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTable.java @@ -31,18 +31,29 @@ */ @Operator public final class InitializeTable extends RawOp { - /** - * Factory method to create a class wrapping a new InitializeTable operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InitializeTableV2"; + + private InitializeTable(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new InitializeTableV2 operation. + * * @param scope current scope * @param tableHandle Handle to a table which will be initialized. * @param keys Keys of type Tkey. * @param values Values of type Tval. * @return a new instance of InitializeTable */ - @Endpoint(describeByClass = true) - public static InitializeTable create(Scope scope, Operand tableHandle, Operand keys, Operand values) { + @Endpoint( + describeByClass = true + ) + public static InitializeTable create(Scope scope, Operand tableHandle, + Operand keys, Operand values) { OperationBuilder opBuilder = scope.env().opBuilder("InitializeTableV2", scope.makeOpName("InitializeTable")); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); @@ -50,11 +61,4 @@ public static InitializeTable create(Scope scope, Operand tableHandle, Operan opBuilder = scope.apply(opBuilder); return new InitializeTable(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InitializeTableV2"; - - private InitializeTable(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTableFromTextFile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTableFromTextFile.java index 43c72730eb2..529ba4c4ac1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTableFromTextFile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InitializeTableFromTextFile.java @@ -25,66 +25,51 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Initializes a table from a text file. - *

* It inserts one key-value pair into the table for each line of the file. * The key and value is extracted from the whole line content, elements from the - * split line based on `delimiter` or the line number (starting from zero). - * Where to extract the key and value from a line is specified by `key_index` and - * `value_index`. - *

- * - A value of -1 means use the line number(starting from zero), expects `int64`. - * - A value of -2 means use the whole line content, expects `string`. - * - A value >= 0 means use the index (starting at zero) of the split line based - * on `delimiter`. + * split line based on {@code delimiter} or the line number (starting from zero). + * Where to extract the key and value from a line is specified by {@code key_index} and + * {@code value_index}. + *

    + *
  • A value of -1 means use the line number(starting from zero), expects {@code int64}.
  • + *
  • A value of -2 means use the whole line content, expects {@code string}.
  • + *
  • A value >= 0 means use the index (starting at zero) of the split line based + * on {@code delimiter}.
  • + *
*/ @Operator public final class InitializeTableFromTextFile extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.InitializeTableFromTextFile} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param vocabSize Number of elements of the file, use -1 if unknown. - */ - public Options vocabSize(Long vocabSize) { - this.vocabSize = vocabSize; - return this; - } - - /** - * @param delimiter Delimiter to separate fields in a line. - */ - public Options delimiter(String delimiter) { - this.delimiter = delimiter; - return this; - } - - private Long vocabSize; - private String delimiter; - - private Options() { - } + public static final String OP_NAME = "InitializeTableFromTextFileV2"; + + private InitializeTableFromTextFile(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new InitializeTableFromTextFile operation. - * + * Factory method to create a class wrapping a new InitializeTableFromTextFileV2 operation. + * * @param scope current scope * @param tableHandle Handle to a table which will be initialized. * @param filename Filename of a vocabulary text file. - * @param keyIndex Column index in a line to get the table `key` values from. + * @param keyIndex Column index in a line to get the table {@code key} values from. * @param valueIndex Column index that represents information of a line to get the table - * `value` values from. - * @param options carries optional attributes values + * {@code value} values from. + * @param options carries optional attribute values * @return a new instance of InitializeTableFromTextFile */ - @Endpoint(describeByClass = true) - public static InitializeTableFromTextFile create(Scope scope, Operand tableHandle, Operand filename, Long keyIndex, Long valueIndex, Options... options) { + @Endpoint( + describeByClass = true + ) + public static InitializeTableFromTextFile create(Scope scope, + Operand tableHandle, Operand filename, Long keyIndex, + Long valueIndex, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("InitializeTableFromTextFileV2", scope.makeOpName("InitializeTableFromTextFile")); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(filename.asOutput()); @@ -103,25 +88,58 @@ public static InitializeTableFromTextFile create(Scope scope, Operand tableHa } return new InitializeTableFromTextFile(opBuilder.build()); } - + /** + * Sets the vocabSize option. + * * @param vocabSize Number of elements of the file, use -1 if unknown. + * @return this Options instance. */ public static Options vocabSize(Long vocabSize) { return new Options().vocabSize(vocabSize); } - + /** + * Sets the delimiter option. + * * @param delimiter Delimiter to separate fields in a line. + * @return this Options instance. */ public static Options delimiter(String delimiter) { return new Options().delimiter(delimiter); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InitializeTableFromTextFileV2"; - - private InitializeTableFromTextFile(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.InitializeTableFromTextFile} + */ + public static class Options { + private Long vocabSize; + + private String delimiter; + + private Options() { + } + + /** + * Sets the vocabSize option. + * + * @param vocabSize Number of elements of the file, use -1 if unknown. + * @return this Options instance. + */ + public Options vocabSize(Long vocabSize) { + this.vocabSize = vocabSize; + return this; + } + + /** + * Sets the delimiter option. + * + * @param delimiter Delimiter to separate fields in a line. + * @return this Options instance. + */ + public Options delimiter(String delimiter) { + this.delimiter = delimiter; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java index c5a3e7516b5..9fc6cc0c0b0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java @@ -29,54 +29,63 @@ import org.tensorflow.types.family.TType; /** - * Adds v into specified rows of x. - *

- * Computes y = x; y[i, :] += v; return y. - * - * @param data type for {@code y()} output + *

+ * Adds v into specified rows of x.
+ *
+ * Computes y = x; y[i, :] += v; return y.
+ * 
+ * + * @param data type for {@code y} output */ @Operator public final class InplaceAdd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InplaceAdd"; + + private Output y; + + private InplaceAdd(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InplaceAdd operation. - * + * * @param scope current scope - * @param x A `Tensor` of type T. - * @param i A vector. Indices into the left-most dimension of `x`. - * @param v A `Tensor` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @param x A {@code Tensor} of type T. + * @param i A vector. Indices into the left-most dimension of {@code x}. + * @param v A {@code Tensor} of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @param data type for {@code InplaceAdd} output and operands * @return a new instance of InplaceAdd */ - @Endpoint(describeByClass = true) - public static InplaceAdd create(Scope scope, Operand x, Operand i, Operand v) { + @Endpoint( + describeByClass = true + ) + public static InplaceAdd create(Scope scope, Operand x, Operand i, + Operand v) { OperationBuilder opBuilder = scope.env().opBuilder("InplaceAdd", scope.makeOpName("InplaceAdd")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(i.asOutput()); opBuilder.addInput(v.asOutput()); opBuilder = scope.apply(opBuilder); - return new InplaceAdd(opBuilder.build()); + return new InplaceAdd<>(opBuilder.build()); } - + /** - * A `Tensor` of type T. An alias of `x`. The content of `y` is undefined if there are duplicates in `i`. + * Gets y. + * A {@code Tensor} of type T. An alias of {@code x}. The content of {@code y} is undefined if there are duplicates in {@code i}. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InplaceAdd"; - - private Output y; - - private InplaceAdd(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceSub.java index 6e5f157cbe7..f84e7ece5e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceSub.java @@ -29,54 +29,63 @@ import org.tensorflow.types.family.TType; /** - * Subtracts `v` into specified rows of `x`. - *

- * Computes y = x; y[i, :] -= v; return y. - * - * @param data type for {@code y()} output + *

+ * Subtracts `v` into specified rows of `x`.
+ *
+ * Computes y = x; y[i, :] -= v; return y.
+ * 
+ * + * @param data type for {@code y} output */ @Operator public final class InplaceSub extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InplaceSub"; + + private Output y; + + private InplaceSub(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InplaceSub operation. - * + * * @param scope current scope - * @param x A `Tensor` of type T. - * @param i A vector. Indices into the left-most dimension of `x`. - * @param v A `Tensor` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @param x A {@code Tensor} of type T. + * @param i A vector. Indices into the left-most dimension of {@code x}. + * @param v A {@code Tensor} of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @param data type for {@code InplaceSub} output and operands * @return a new instance of InplaceSub */ - @Endpoint(describeByClass = true) - public static InplaceSub create(Scope scope, Operand x, Operand i, Operand v) { + @Endpoint( + describeByClass = true + ) + public static InplaceSub create(Scope scope, Operand x, Operand i, + Operand v) { OperationBuilder opBuilder = scope.env().opBuilder("InplaceSub", scope.makeOpName("InplaceSub")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(i.asOutput()); opBuilder.addInput(v.asOutput()); opBuilder = scope.apply(opBuilder); - return new InplaceSub(opBuilder.build()); + return new InplaceSub<>(opBuilder.build()); } - + /** - * A `Tensor` of type T. An alias of `x`. The content of `y` is undefined if there are duplicates in `i`. + * Gets y. + * A {@code Tensor} of type T. An alias of {@code x}. The content of {@code y} is undefined if there are duplicates in {@code i}. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InplaceSub"; - - private Output y; - - private InplaceSub(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceUpdate.java index 4c05b4bff27..c7543a8b780 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceUpdate.java @@ -30,56 +30,61 @@ /** * Updates specified rows 'i' with values 'v'. - *

- * Computes `x[i, :] = v; return x`. - *

- * Originally this function is mutative however for compilation we make this - * operation create / operate on a copy of `x`. - * - * @param data type for {@code y()} output + * Computes {@code x[i, :] = v; return x}. + *

Originally this function is mutative however for compilation we make this + * operation create / operate on a copy of {@code x}. + * + * @param data type for {@code y} output */ @Operator public final class InplaceUpdate extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InplaceUpdate"; + + private Output y; + + private InplaceUpdate(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InplaceUpdate operation. - * + * * @param scope current scope - * @param x A tensor of type `T`. - * @param i A vector. Indices into the left-most dimension of `x`. - * @param v A `Tensor` of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @param x A tensor of type {@code T}. + * @param i A vector. Indices into the left-most dimension of {@code x}. + * @param v A {@code Tensor} of type T. Same dimension sizes as x except the first dimension, which must be the same as i's size. + * @param data type for {@code InplaceUpdate} output and operands * @return a new instance of InplaceUpdate */ - @Endpoint(describeByClass = true) - public static InplaceUpdate create(Scope scope, Operand x, Operand i, Operand v) { + @Endpoint( + describeByClass = true + ) + public static InplaceUpdate create(Scope scope, Operand x, + Operand i, Operand v) { OperationBuilder opBuilder = scope.env().opBuilder("InplaceUpdate", scope.makeOpName("InplaceUpdate")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(i.asOutput()); opBuilder.addInput(v.asOutput()); opBuilder = scope.apply(opBuilder); - return new InplaceUpdate(opBuilder.build()); + return new InplaceUpdate<>(opBuilder.build()); } - + /** - * A `Tensor` of type T. An alias of `x`. The content of `y` is undefined if there are duplicates in `i`. + * Gets y. + * A {@code Tensor} of type T. An alias of {@code x}. The content of {@code y} is undefined if there are duplicates in {@code i}. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InplaceUpdate"; - - private Output y; - - private InplaceUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsVariableInitialized.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsVariableInitialized.java index aea759600e0..e18d8d61178 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsVariableInitialized.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsVariableInitialized.java @@ -30,46 +30,51 @@ /** * Checks whether a tensor has been initialized. - *

* Outputs boolean scalar indicating whether the tensor has been initialized. */ @Operator public final class IsVariableInitialized extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsVariableInitialized"; + + private Output isInitialized; + + private IsVariableInitialized(Operation operation) { + super(operation); + int outputIdx = 0; + isInitialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsVariableInitialized operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. May be uninitialized. + * @param ref Should be from a {@code Variable} node. May be uninitialized. * @return a new instance of IsVariableInitialized */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsVariableInitialized create(Scope scope, Operand ref) { OperationBuilder opBuilder = scope.env().opBuilder("IsVariableInitialized", scope.makeOpName("IsVariableInitialized")); opBuilder.addInput(ref.asOutput()); opBuilder = scope.apply(opBuilder); return new IsVariableInitialized(opBuilder.build()); } - + /** + * Gets isInitialized. + * + * @return isInitialized. */ public Output isInitialized() { return isInitialized; } - + @Override public Output asOutput() { return isInitialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsVariableInitialized"; - - private Output isInitialized; - - private IsVariableInitialized(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KthOrderStatistic.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KthOrderStatistic.java index c52e07c05dd..b67996f7a77 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KthOrderStatistic.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KthOrderStatistic.java @@ -29,7 +29,6 @@ /** * Computes the Kth order statistic of a data set. The current - *

* implementation uses a binary search requiring exactly 32 passes over * the input data. The running time is linear with respect to input * size. The median-of-medians algorithm is probably faster, but is @@ -47,16 +46,30 @@ */ @Operator public final class KthOrderStatistic extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "KthOrderStatistic"; + + private Output output; + + private KthOrderStatistic(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new KthOrderStatistic operation. - * + * * @param scope current scope - * @param input - * @param k + * @param input the input value + * @param k the value of the k property * @return a new instance of KthOrderStatistic */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static KthOrderStatistic create(Scope scope, Operand input, Long k) { OperationBuilder opBuilder = scope.env().opBuilder("KthOrderStatistic", scope.makeOpName("KthOrderStatistic")); opBuilder.addInput(input.asOutput()); @@ -64,26 +77,18 @@ public static KthOrderStatistic create(Scope scope, Operand input, Lon opBuilder.setAttr("k", k); return new KthOrderStatistic(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "KthOrderStatistic"; - - private Output output; - - private KthOrderStatistic(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LinSpace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LinSpace.java index 086bd32278d..14764b62003 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LinSpace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LinSpace.java @@ -24,65 +24,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Generates values in an interval. - *

- * A sequence of `num` evenly-spaced values are generated beginning at `start`. - * If `num > 1`, the values in the sequence increase by `stop - start / num - 1`, - * so that the last one is exactly `stop`. - *

- * For example: - *

{@code
- * tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0  11.0  12.0]
- * }
- * - * - * @param data type for {@code output()} output + * A sequence of {@code num} evenly-spaced values are generated beginning at {@code start}. + * If {@code num > 1}, the values in the sequence increase by {@code stop - start / num - 1}, + * so that the last one is exactly {@code stop}. + *

For example: + *

+ * tf.linspace(10.0, 12.0, 3, name="linspace") => [ 10.0  11.0  12.0]
+ * 
+ * + * @param data type for {@code output} output */ public final class LinSpace extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LinSpace"; + + private Output output; + + private LinSpace(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LinSpace operation. - * + * * @param scope current scope * @param start 0-D tensor. First entry in the range. * @param stop 0-D tensor. Last entry in the range. * @param num 0-D tensor. Number of values to generate. + * @param data type for {@code LinSpace} output and operands * @return a new instance of LinSpace */ - @Endpoint(describeByClass = true) - public static LinSpace create(Scope scope, Operand start, Operand stop, Operand num) { + @Endpoint( + describeByClass = true + ) + public static LinSpace create(Scope scope, Operand start, + Operand stop, Operand num) { OperationBuilder opBuilder = scope.env().opBuilder("LinSpace", scope.makeOpName("LinSpace")); opBuilder.addInput(start.asOutput()); opBuilder.addInput(stop.asOutput()); opBuilder.addInput(num.asOutput()); opBuilder = scope.apply(opBuilder); - return new LinSpace(opBuilder.build()); + return new LinSpace<>(opBuilder.build()); } - + /** + * Gets output. * 1-D. The generated values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LinSpace"; - - private Output output; - - private LinSpace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableExport.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableExport.java index 7685fa5e7b4..524064d6b52 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableExport.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableExport.java @@ -30,56 +30,68 @@ /** * Outputs all keys and values in the table. - * - * @param data type for {@code keys()} output - * @param data type for {@code values()} output + * + * @param data type for {@code keys} output + * + * @param data type for {@code values} output */ @Operator public final class LookupTableExport extends RawOp { - /** - * Factory method to create a class wrapping a new LookupTableExport operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableExportV2"; + + private Output keys; + + private Output values; + + private LookupTableExport(Operation operation) { + super(operation); + int outputIdx = 0; + keys = operation.output(outputIdx++); + values = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new LookupTableExportV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. - * @param Tkeys - * @param Tvalues + * @param Tkeys the value of the Tkeys property + * @param Tvalues the value of the Tvalues property + * @param data type for {@code LookupTableExportV2} output and operands + * @param data type for {@code LookupTableExportV2} output and operands * @return a new instance of LookupTableExport */ - @Endpoint(describeByClass = true) - public static LookupTableExport create(Scope scope, Operand tableHandle, Class Tkeys, Class Tvalues) { + @Endpoint( + describeByClass = true + ) + public static LookupTableExport create(Scope scope, + Operand tableHandle, Class Tkeys, Class Tvalues) { OperationBuilder opBuilder = scope.env().opBuilder("LookupTableExportV2", scope.makeOpName("LookupTableExport")); opBuilder.addInput(tableHandle.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tkeys", Operands.toDataType(Tkeys)); opBuilder.setAttr("Tvalues", Operands.toDataType(Tvalues)); - return new LookupTableExport(opBuilder.build()); + return new LookupTableExport<>(opBuilder.build()); } - + /** + * Gets keys. * Vector of all keys present in the table. + * @return keys. */ public Output keys() { return keys; } - + /** - * Tensor of all values in the table. Indexed in parallel with `keys`. + * Gets values. + * Tensor of all values in the table. Indexed in parallel with {@code keys}. + * @return values. */ public Output values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableExportV2"; - - private Output keys; - private Output values; - - private LookupTableExport(Operation operation) { - super(operation); - int outputIdx = 0; - keys = operation.output(outputIdx++); - values = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableFind.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableFind.java index 930f30b8ea7..6e4f6f597ba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableFind.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableFind.java @@ -29,58 +29,64 @@ /** * Looks up keys in a table, outputs the corresponding values. - *

- * The tensor `keys` must of the same type as the keys of the table. - * The output `values` is of the type of the table values. - *

- * The scalar `default_value` is the value output for keys not present in the + * The tensor {@code keys} must of the same type as the keys of the table. + * The output {@code values} is of the type of the table values. + *

The scalar {@code default_value} is the value output for keys not present in the * table. It must also be of the same type as the table values. - * - * @param data type for {@code values()} output + * + * @param data type for {@code values} output */ @Operator public final class LookupTableFind extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new LookupTableFind operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableFindV2"; + + private Output values; + + private LookupTableFind(Operation operation) { + super(operation); + int outputIdx = 0; + values = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new LookupTableFindV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. - * @param defaultValue + * @param defaultValue the defaultValue value + * @param data type for {@code LookupTableFindV2} output and operands * @return a new instance of LookupTableFind */ - @Endpoint(describeByClass = true) - public static LookupTableFind create(Scope scope, Operand tableHandle, Operand keys, Operand defaultValue) { + @Endpoint( + describeByClass = true + ) + public static LookupTableFind create(Scope scope, + Operand tableHandle, Operand keys, + Operand defaultValue) { OperationBuilder opBuilder = scope.env().opBuilder("LookupTableFindV2", scope.makeOpName("LookupTableFind")); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); opBuilder.addInput(defaultValue.asOutput()); opBuilder = scope.apply(opBuilder); - return new LookupTableFind(opBuilder.build()); + return new LookupTableFind<>(opBuilder.build()); } - + /** - * Same shape as `keys`. Values found in the table, or `default_values` + * Gets values. + * Same shape as {@code keys}. Values found in the table, or {@code default_values} * for missing keys. + * @return values. */ public Output values() { return values; } - + @Override public Output asOutput() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableFindV2"; - - private Output values; - - private LookupTableFind(Operation operation) { - super(operation); - int outputIdx = 0; - values = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableImport.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableImport.java index b7957c394ce..3a670d9de68 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableImport.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableImport.java @@ -28,24 +28,34 @@ /** * Replaces the contents of the table with the specified keys and values. - *

- * The tensor `keys` must be of the same type as the keys of the table. - * The tensor `values` must be of the type of the table values. + * The tensor {@code keys} must be of the same type as the keys of the table. + * The tensor {@code values} must be of the type of the table values. */ @Operator public final class LookupTableImport extends RawOp { - /** - * Factory method to create a class wrapping a new LookupTableImport operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableImportV2"; + + private LookupTableImport(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new LookupTableImportV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. * @param values Values to associate with keys. * @return a new instance of LookupTableImport */ - @Endpoint(describeByClass = true) - public static LookupTableImport create(Scope scope, Operand tableHandle, Operand keys, Operand values) { + @Endpoint( + describeByClass = true + ) + public static LookupTableImport create(Scope scope, Operand tableHandle, + Operand keys, Operand values) { OperationBuilder opBuilder = scope.env().opBuilder("LookupTableImportV2", scope.makeOpName("LookupTableImport")); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); @@ -53,11 +63,4 @@ public static LookupTableImport create(Scope scope, Operand tableHandle, Oper opBuilder = scope.apply(opBuilder); return new LookupTableImport(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableImportV2"; - - private LookupTableImport(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableInsert.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableInsert.java index c444db4fe52..c235064e1bf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableInsert.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableInsert.java @@ -28,24 +28,34 @@ /** * Updates the table to associates keys with values. - *

- * The tensor `keys` must be of the same type as the keys of the table. - * The tensor `values` must be of the type of the table values. + * The tensor {@code keys} must be of the same type as the keys of the table. + * The tensor {@code values} must be of the type of the table values. */ @Operator public final class LookupTableInsert extends RawOp { - /** - * Factory method to create a class wrapping a new LookupTableInsert operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableInsertV2"; + + private LookupTableInsert(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new LookupTableInsertV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @param keys Any shape. Keys to look up. * @param values Values to associate with keys. * @return a new instance of LookupTableInsert */ - @Endpoint(describeByClass = true) - public static LookupTableInsert create(Scope scope, Operand tableHandle, Operand keys, Operand values) { + @Endpoint( + describeByClass = true + ) + public static LookupTableInsert create(Scope scope, Operand tableHandle, + Operand keys, Operand values) { OperationBuilder opBuilder = scope.env().opBuilder("LookupTableInsertV2", scope.makeOpName("LookupTableInsert")); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); @@ -53,11 +63,4 @@ public static LookupTableInsert create(Scope scope, Operand tableHandle, Oper opBuilder = scope.apply(opBuilder); return new LookupTableInsert(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableInsertV2"; - - private LookupTableInsert(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableRemove.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableRemove.java index 2965fd839da..5d3ca1e8507 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableRemove.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableRemove.java @@ -23,38 +23,40 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Removes keys and its associated values from a table. - *

- * The tensor `keys` must of the same type as the keys of the table. Keys not + * The tensor {@code keys} must of the same type as the keys of the table. Keys not * already in the table are silently ignored. */ public final class LookupTableRemove extends RawOp { - /** - * Factory method to create a class wrapping a new LookupTableRemove operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableRemoveV2"; + + private LookupTableRemove(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new LookupTableRemoveV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @param keys Any shape. Keys of the elements to remove. * @return a new instance of LookupTableRemove */ - @Endpoint(describeByClass = true) - public static LookupTableRemove create(Scope scope, Operand tableHandle, Operand keys) { + @Endpoint( + describeByClass = true + ) + public static LookupTableRemove create(Scope scope, Operand tableHandle, + Operand keys) { OperationBuilder opBuilder = scope.env().opBuilder("LookupTableRemoveV2", scope.makeOpName("LookupTableRemove")); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(keys.asOutput()); opBuilder = scope.apply(opBuilder); return new LookupTableRemove(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableRemoveV2"; - - private LookupTableRemove(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableSize.java index 8960fb28f2a..eb41130753f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LookupTableSize.java @@ -26,48 +26,54 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Computes the number of elements in the given table. */ @Operator public final class LookupTableSize extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new LookupTableSize operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LookupTableSizeV2"; + + private Output output; + + private LookupTableSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new LookupTableSizeV2 operation. + * * @param scope current scope * @param tableHandle Handle to the table. * @return a new instance of LookupTableSize */ - @Endpoint(describeByClass = true) - public static LookupTableSize create(Scope scope, Operand tableHandle) { + @Endpoint( + describeByClass = true + ) + public static LookupTableSize create(Scope scope, Operand tableHandle) { OperationBuilder opBuilder = scope.env().opBuilder("LookupTableSizeV2", scope.makeOpName("LookupTableSize")); opBuilder.addInput(tableHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new LookupTableSize(opBuilder.build()); } - + /** + * Gets output. * Scalar that contains number of elements in the table. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LookupTableSizeV2"; - - private Output output; - - private LookupTableSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoopCond.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoopCond.java index 45744e7ce9f..0c6321bafcc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoopCond.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoopCond.java @@ -29,48 +29,52 @@ /** * Forwards the input to the output. - *

* This operator represents the loop termination condition used by the - * "pivot" switches of a loop. + * "pivot" switches of a loop. */ @Operator public final class LoopCond extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LoopCond"; + + private Output output; + + private LoopCond(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LoopCond operation. - * + * * @param scope current scope * @param input A boolean scalar, representing the branch predicate of the Switch op. * @return a new instance of LoopCond */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LoopCond create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("LoopCond", scope.makeOpName("LoopCond")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new LoopCond(opBuilder.build()); } - + /** - * The same tensor as `input`. + * Gets output. + * The same tensor as {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoopCond"; - - private Output output; - - private LoopCond(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LowerBound.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LowerBound.java index 1aa8badb5a1..9f16a1bcc93 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LowerBound.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LowerBound.java @@ -25,92 +25,98 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Applies lower_bound(sorted_search_values, values) along each row. - *

* Each set of rows with the same index in (sorted_inputs, values) is treated * independently. The resulting row is the equivalent of calling - * `np.searchsorted(sorted_inputs, values, side='left')`. - *

- * The result is not a global index to the entire - * `Tensor`, but rather just the index in the last dimension. - *

- * A 2-D example: - * sorted_sequence = [[0, 3, 9, 9, 10], - * [1, 2, 3, 4, 5]] - * values = [[2, 4, 9], - * [0, 2, 6]] - *

- * result = LowerBound(sorted_sequence, values) - *

- * result == [[1, 2, 2], - * [0, 1, 5]] - * - * @param data type for {@code output()} output + * {@code np.searchsorted(sorted_inputs, values, side='left')}. + *

The result is not a global index to the entire + * {@code Tensor}, but rather just the index in the last dimension. + *

A 2-D example: + * sorted_sequence = [[0, 3, 9, 9, 10], + * [1, 2, 3, 4, 5]] + * values = [[2, 4, 9], + * [0, 2, 6]] + *

result = LowerBound(sorted_sequence, values) + *

result == [[1, 2, 2], + * [0, 1, 5]] + * + * @param data type for {@code output} output */ public final class LowerBound extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LowerBound"; + + private Output output; + + private LowerBound(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LowerBound operation. - * + * * @param scope current scope * @param sortedInputs 2-D Tensor where each row is ordered. - * @param values 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains - * the values that will be searched for in `sorted_search_values`. - * @param outType + * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + * @param outType the value of the outType property + * @param data type for {@code LowerBound} output and operands + * @param data type for {@code LowerBound} output and operands * @return a new instance of LowerBound */ - @Endpoint(describeByClass = true) - public static LowerBound create(Scope scope, Operand sortedInputs, Operand values, Class outType) { + @Endpoint( + describeByClass = true + ) + public static LowerBound create(Scope scope, + Operand sortedInputs, Operand values, Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("LowerBound", scope.makeOpName("LowerBound")); opBuilder.addInput(sortedInputs.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new LowerBound(opBuilder.build()); + return new LowerBound<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new LowerBound operation using default output types. - * + * Factory method to create a class wrapping a new LowerBound operation, with the default output types. + * * @param scope current scope * @param sortedInputs 2-D Tensor where each row is ordered. - * @param values 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains - * the values that will be searched for in `sorted_search_values`. - * @return a new instance of LowerBound + * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + * @param data type for {@code LowerBound} output and operands + * @return a new instance of LowerBound, with default output types */ - @Endpoint(describeByClass = true) - public static LowerBound create(Scope scope, Operand sortedInputs, Operand values) { + @Endpoint( + describeByClass = true + ) + public static LowerBound create(Scope scope, Operand sortedInputs, + Operand values) { return create(scope, sortedInputs, values, TInt32.class); } - + /** - * A `Tensor` with the same shape as `values`. It contains the first scalar index + * Gets output. + * A {@code Tensor} with the same shape as {@code values}. It contains the first scalar index * into the last dimension where values can be inserted without changing the * ordered property. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LowerBound"; - - private Output output; - - private LowerBound(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MakeUnique.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MakeUnique.java index f4366722c28..3d0e3be8a16 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MakeUnique.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MakeUnique.java @@ -28,8 +28,7 @@ import org.tensorflow.types.TFloat32; /** - * Make all elements in the non-Batch dimension unique, but \"close\" to - *

+ * Make all elements in the non-Batch dimension unique, but "close" to * their initial value. Never returns a sub-normal number. Never returns * zero. The sign of each input element is always identical to the sign * of the corresponding output element. Behavior for infinite elements is @@ -37,41 +36,47 @@ */ @Operator public final class MakeUnique extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MakeUnique"; + + private Output output; + + private MakeUnique(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MakeUnique operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of MakeUnique */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MakeUnique create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("MakeUnique", scope.makeOpName("MakeUnique")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new MakeUnique(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MakeUnique"; - - private Output output; - - private MakeUnique(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapClear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapClear.java index e680e7db08a..ea67839c337 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapClear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapClear.java @@ -32,63 +32,28 @@ */ @Operator public final class MapClear extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapClear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapClear"; + + private MapClear(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new MapClear operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of MapClear */ - @Endpoint(describeByClass = true) - public static MapClear create(Scope scope, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MapClear create(Scope scope, List> dtypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapClear", scope.makeOpName("MapClear")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); @@ -110,39 +75,104 @@ public static MapClear create(Scope scope, List> dtypes, } return new MapClear(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapClear"; - - private MapClear(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapClear} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapIncompleteSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapIncompleteSize.java index 6fa921bb408..0a533d39d69 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapIncompleteSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapIncompleteSize.java @@ -35,63 +35,32 @@ */ @Operator public final class MapIncompleteSize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapIncompleteSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapIncompleteSize"; + + private Output output; + + private MapIncompleteSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MapIncompleteSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of MapIncompleteSize */ - @Endpoint(describeByClass = true) - public static MapIncompleteSize create(Scope scope, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MapIncompleteSize create(Scope scope, List> dtypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapIncompleteSize", scope.makeOpName("MapIncompleteSize")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); @@ -113,54 +82,118 @@ public static MapIncompleteSize create(Scope scope, List> } return new MapIncompleteSize(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapIncompleteSize"; - - private Output output; - - private MapIncompleteSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapIncompleteSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapPeek.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapPeek.java index 316bc08c64c..b6a9896d220 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapPeek.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapPeek.java @@ -35,71 +35,42 @@ /** * Op peeks at the values at the specified key. If the - *

* underlying container does not contain this key * this op will block until it does. */ @Operator public final class MapPeek extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapPeek} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapPeek"; + + private List> values; + + @SuppressWarnings("unchecked") + private MapPeek(Operation operation) { + super(operation); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new MapPeek operation. - * + * * @param scope current scope - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @param key the key value + * @param indices the indices value + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of MapPeek */ - @Endpoint(describeByClass = true) - public static MapPeek create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MapPeek create(Scope scope, Operand key, Operand indices, + List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapPeek", scope.makeOpName("MapPeek")); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -123,57 +94,119 @@ public static MapPeek create(Scope scope, Operand key, Operand i } return new MapPeek(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets values. + * + * @return values. */ public List> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapPeek"; - - private List> values; - - private MapPeek(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapPeek} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapSize.java index 0cd9510a8f7..874a1e86618 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapSize.java @@ -35,63 +35,32 @@ */ @Operator public final class MapSize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapSize"; + + private Output output; + + private MapSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MapSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of MapSize */ - @Endpoint(describeByClass = true) - public static MapSize create(Scope scope, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MapSize create(Scope scope, List> dtypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapSize", scope.makeOpName("MapSize")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); @@ -113,54 +82,118 @@ public static MapSize create(Scope scope, List> dtypes, O } return new MapSize(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapSize"; - - private Output output; - - private MapSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapStage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapStage.java index 76f9086f46e..1b6835d287a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapStage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapStage.java @@ -35,69 +35,32 @@ */ @Operator public final class MapStage extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapStage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts - * on the container will block when the capacity is reached. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. Otherwise, - * a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName It is necessary to match this name to the matching Unstage Op. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapStage"; + + private MapStage(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new MapStage operation. - * + * * @param scope current scope * @param key int64 - * @param indices + * @param indices the indices value * @param values a list of tensors * dtypes A list of data types that inserted values should adhere to. - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of MapStage */ - @Endpoint(describeByClass = true) - public static MapStage create(Scope scope, Operand key, Operand indices, Iterable> values, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MapStage create(Scope scope, Operand key, Operand indices, + Iterable> values, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapStage", scope.makeOpName("MapStage")); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -122,41 +85,108 @@ public static MapStage create(Scope scope, Operand key, Operand } return new MapStage(opBuilder.build()); } - + /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts * on the container will block when the capacity is reached. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. Otherwise, * a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapStage"; - - private MapStage(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapStage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * on the container will block when the capacity is reached. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. Otherwise, + * a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstage.java index 6d189a50d7b..c3c9bc34cdb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstage.java @@ -35,71 +35,42 @@ /** * Op removes and returns the values associated with the key - *

* from the underlying container. If the underlying container * does not contain this key, the op will block until it does. */ @Operator public final class MapUnstage extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapUnstage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapUnstage"; + + private List> values; + + @SuppressWarnings("unchecked") + private MapUnstage(Operation operation) { + super(operation); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new MapUnstage operation. - * + * * @param scope current scope - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @param key the key value + * @param indices the indices value + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of MapUnstage */ - @Endpoint(describeByClass = true) - public static MapUnstage create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MapUnstage create(Scope scope, Operand key, Operand indices, + List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapUnstage", scope.makeOpName("MapUnstage")); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -123,57 +94,119 @@ public static MapUnstage create(Scope scope, Operand key, Operand> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapUnstage"; - - private List> values; - - private MapUnstage(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapUnstage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstageNoKey.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstageNoKey.java index 9848ab2d845..aab2555eb9b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstageNoKey.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MapUnstageNoKey.java @@ -34,70 +34,44 @@ /** * Op removes and returns a random (key, value) - *

* from the underlying container. If the underlying container * does not contain elements, the op will block until it does. */ @Operator public final class MapUnstageNoKey extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.MapUnstageNoKey} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MapUnstageNoKey"; + + private Output key; + + private List> values; + + @SuppressWarnings("unchecked") + private MapUnstageNoKey(Operation operation) { + super(operation); + int outputIdx = 0; + key = operation.output(outputIdx++); + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new MapUnstageNoKey operation. - * + * * @param scope current scope - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @param indices the indices value + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of MapUnstageNoKey */ - @Endpoint(describeByClass = true) - public static MapUnstageNoKey create(Scope scope, Operand indices, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MapUnstageNoKey create(Scope scope, Operand indices, + List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapUnstageNoKey", scope.makeOpName("MapUnstageNoKey")); opBuilder.addInput(indices.asOutput()); opBuilder = scope.apply(opBuilder); @@ -120,59 +94,122 @@ public static MapUnstageNoKey create(Scope scope, Operand indices, List< } return new MapUnstageNoKey(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets key. + * + * @return key. */ public Output key() { return key; } - + /** + * Gets values. + * + * @return values. */ public List> values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MapUnstageNoKey"; - - private Output key; - private List> values; - - private MapUnstageNoKey(Operation operation) { - super(operation); - int outputIdx = 0; - key = operation.output(outputIdx++); - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.MapUnstageNoKey} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Max.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Max.java index 690767e561a..4109afa098f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Max.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Max.java @@ -26,52 +26,47 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; /** * Computes the maximum 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 data type for {@code output} output */ @Operator -public final class Max extends RawOp implements Operand { - +public final class Max extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.core.Max} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Max"; + + private Output output; + + private Max(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Max operation. - * + * * @param scope current scope * @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 Max} output and operands * @return a new instance of Max */ - @Endpoint(describeByClass = true) - public static Max create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Max create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Max", scope.makeOpName("Max")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +78,51 @@ public static Max create(Scope scope, Operand input, Ope } } } - return new Max(opBuilder.build()); + return new Max<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Max"; - - private Output output; - - private Max(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Max} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Merge.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Merge.java index a4229d80ec3..e8ce85de4cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Merge.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Merge.java @@ -30,58 +30,65 @@ import org.tensorflow.types.family.TType; /** - * Forwards the value of an available tensor from `inputs` to `output`. - *

- * `Merge` waits for at least one of the tensors in `inputs` to become available. - * It is usually combined with `Switch` to implement branching. - *

- * `Merge` forwards the first tensor to become available to `output`, and sets - * `value_index` to its index in `inputs`. - * - * @param data type for {@code output()} output + * Forwards the value of an available tensor from {@code inputs} to {@code output}. + * {@code Merge} waits for at least one of the tensors in {@code inputs} to become available. + * It is usually combined with {@code Switch} to implement branching. + *

{@code Merge} forwards the first tensor to become available to {@code output}, and sets + * {@code value_index} to its index in {@code inputs}. + * + * @param data type for {@code output} output */ @Operator public final class Merge extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Merge"; + + private Output output; + + private Output valueIndex; + + private Merge(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + valueIndex = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Merge operation. - * + * * @param scope current scope * @param inputs The input tensors, exactly one of which will become available. + * @param data type for {@code Merge} output and operands * @return a new instance of Merge */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Merge create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("Merge", scope.makeOpName("Merge")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); - return new Merge(opBuilder.build()); + return new Merge<>(opBuilder.build()); } - + /** + * Gets output. * Will be set to the available input tensor. + * @return output. */ public Output output() { return output; } - + /** - * The index of the chosen input tensor in `inputs`. + * Gets valueIndex. + * The index of the chosen input tensor in {@code inputs}. + * @return valueIndex. */ public Output valueIndex() { return valueIndex; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Merge"; - - private Output output; - private Output valueIndex; - - private Merge(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - valueIndex = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Min.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Min.java index bc06376c01f..b438709b808 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Min.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Min.java @@ -26,52 +26,47 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; /** * Computes the minimum 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 data type for {@code output} output */ @Operator -public final class Min extends RawOp implements Operand { - +public final class Min extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.core.Min} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Min"; + + private Output output; + + private Min(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Min operation. - * + * * @param scope current scope * @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 Min} output and operands * @return a new instance of Min */ - @Endpoint(describeByClass = true) - public static Min create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Min create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Min", scope.makeOpName("Min")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +78,51 @@ public static Min create(Scope scope, Operand input, Ope } } } - return new Min(opBuilder.build()); + return new Min<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Min"; - - private Output output; - - private Min(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Min} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPad.java index 717a77c7a6a..793b4a133fc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPad.java @@ -30,82 +30,84 @@ /** * Pads a tensor with mirrored values. - *

- * This operation pads a `input` with mirrored values according to the `paddings` - * you specify. `paddings` is an integer tensor with shape `[n, 2]`, where n is - * the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates - * how many values to add before the contents of `input` in that dimension, and - * `paddings[D, 1]` indicates how many values to add after the contents of `input` - * in that dimension. Both `paddings[D, 0]` and `paddings[D, 1]` must be no greater - * than `input.dim_size(D)` (or `input.dim_size(D) - 1`) if `copy_border` is true + * This operation pads a {@code input} with mirrored values according to the {@code paddings} + * you specify. {@code paddings} is an integer tensor with shape {@code [n, 2]}, where n is + * the rank of {@code input}. For each dimension D of {@code input}, {@code paddings[D, 0]} indicates + * how many values to add before the contents of {@code input} in that dimension, and + * {@code paddings[D, 1]} indicates how many values to add after the contents of {@code input} + * in that dimension. Both {@code paddings[D, 0]} and {@code paddings[D, 1]} must be no greater + * than {@code input.dim_size(D)} (or {@code input.dim_size(D) - 1}) if {@code copy_border} is true * (if false, respectively). - *

- * The padded size of each dimension D of the output is: - *

- * `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` - *

- * For example: - *

{@code
+ * 

The padded size of each dimension D of the output is: + *

{@code paddings(D, 0) + input.dim_size(D) + paddings(D, 1)} + *

For example: + *

  * # 't' is [[1, 2, 3], [4, 5, 6]].
  * # 'paddings' is [[1, 1]], [2, 2]].
  * # 'mode' is SYMMETRIC.
  * # rank of 't' is 2.
- * pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
+ * pad(t, paddings) ==> [[2, 1, 1, 2, 3, 3, 2]
  *                       [2, 1, 1, 2, 3, 3, 2]
  *                       [5, 4, 4, 5, 6, 6, 5]
  *                       [5, 4, 4, 5, 6, 6, 5]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ @Operator public final class MirrorPad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MirrorPad"; + + private Output output; + + private MirrorPad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MirrorPad operation. - * + * * @param scope current scope * @param input The input tensor to be padded. * @param paddings A two-column matrix specifying the padding sizes. The number of - * rows must be the same as the rank of `input`. - * @param mode Either `REFLECT` or `SYMMETRIC`. In reflect mode the padded regions + * rows must be the same as the rank of {@code input}. + * @param mode Either {@code REFLECT} or {@code SYMMETRIC}. In reflect mode the padded regions * do not include the borders, while in symmetric mode the padded regions - * do include the borders. For example, if `input` is `[1, 2, 3]` and `paddings` - * is `[0, 2]`, then the output is `[1, 2, 3, 2, 1]` in reflect mode, and - * it is `[1, 2, 3, 3, 2]` in symmetric mode. + * do include the borders. For example, if {@code input} is {@code [1, 2, 3]} and {@code paddings} + * is {@code [0, 2]}, then the output is {@code [1, 2, 3, 2, 1]} in reflect mode, and + * it is {@code [1, 2, 3, 3, 2]} in symmetric mode. + * @param data type for {@code MirrorPad} output and operands * @return a new instance of MirrorPad */ - @Endpoint(describeByClass = true) - public static MirrorPad create(Scope scope, Operand input, Operand paddings, String mode) { + @Endpoint( + describeByClass = true + ) + public static MirrorPad create(Scope scope, Operand input, + Operand paddings, String mode) { OperationBuilder opBuilder = scope.env().opBuilder("MirrorPad", scope.makeOpName("MirrorPad")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("mode", mode); - return new MirrorPad(opBuilder.build()); + return new MirrorPad<>(opBuilder.build()); } - + /** + * Gets output. * The padded tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MirrorPad"; - - private Output output; - - private MirrorPad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPadGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPadGrad.java index 901620aa27d..6e87eaa45ac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPadGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MirrorPadGrad.java @@ -24,76 +24,77 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** - * Gradient op for `MirrorPad` op. This op folds a mirror-padded tensor. - *

- * This operation folds the padded areas of `input` by `MirrorPad` according to the - * `paddings` you specify. `paddings` must be the same as `paddings` argument - * given to the corresponding `MirrorPad` op. - *

- * The folded size of each dimension D of the output is: - *

- * `input.dim_size(D) - paddings(D, 0) - paddings(D, 1)` - *

- * For example: - *

{@code
+ * Gradient op for {@code MirrorPad} op. This op folds a mirror-padded tensor.
+ * This operation folds the padded areas of {@code input} by {@code MirrorPad} according to the
+ * {@code paddings} you specify. {@code paddings} must be the same as {@code paddings} argument
+ * given to the corresponding {@code MirrorPad} op.
+ * 

The folded size of each dimension D of the output is: + *

{@code input.dim_size(D) - paddings(D, 0) - paddings(D, 1)} + *

For example: + *

  * # 't' is [[1, 2, 3], [4, 5, 6], [7, 8, 9]].
  * # 'paddings' is [[0, 1]], [0, 1]].
  * # 'mode' is SYMMETRIC.
  * # rank of 't' is 2.
- * pad(t, paddings) ==> [[ 1,  5]
+ * pad(t, paddings) ==> [[ 1,  5]
  *                       [11, 28]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ public final class MirrorPadGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MirrorPadGrad"; + + private Output output; + + private MirrorPadGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MirrorPadGrad operation. - * + * * @param scope current scope * @param input The input tensor to be folded. * @param paddings A two-column matrix specifying the padding sizes. The number of - * rows must be the same as the rank of `input`. - * @param mode The mode used in the `MirrorPad` op. + * rows must be the same as the rank of {@code input}. + * @param mode The mode used in the {@code MirrorPad} op. + * @param data type for {@code MirrorPadGrad} output and operands * @return a new instance of MirrorPadGrad */ - @Endpoint(describeByClass = true) - public static MirrorPadGrad create(Scope scope, Operand input, Operand paddings, String mode) { + @Endpoint( + describeByClass = true + ) + public static MirrorPadGrad create(Scope scope, Operand input, + Operand paddings, String mode) { OperationBuilder opBuilder = scope.env().opBuilder("MirrorPadGrad", scope.makeOpName("MirrorPadGrad")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("mode", mode); - return new MirrorPadGrad(opBuilder.build()); + return new MirrorPadGrad<>(opBuilder.build()); } - + /** + * Gets output. * The folded tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MirrorPadGrad"; - - private Output output; - - private MirrorPadGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MlirPassthroughOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MlirPassthroughOp.java index e80af4ecee8..648bd01bf02 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MlirPassthroughOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MlirPassthroughOp.java @@ -33,7 +33,6 @@ /** * Wraps an arbitrary MLIR computation expressed as a module with a main() function. - *

* This operation does not have an associated kernel and is not intended to be * executed in a regular TensorFlow session. Instead it is intended to be used for * testing or for special case where a user intends to pass custom MLIR computation @@ -45,39 +44,56 @@ * main() function and the returned values of the main function mapped to the * outputs. * Example usage: - *

{@code
+ * 
  * import tensorflow as tf
  * from tensorflow.compiler.mlir.tensorflow.gen_mlir_passthrough_op import mlir_passthrough_op
- * 
+ *
  * mlir_module = '''python
- * func @main(%arg0 : tensor<10xf32>, %arg1 : tensor<10xf32>) -> tensor<10x10xf32> {
- *    %add = "magic.op"(%arg0, %arg1) : (tensor<10xf32>, tensor<10xf32>) -> tensor<10x10xf32>
- *    return %ret : tensor<10x10xf32>
+ * func {@literal @}main(%arg0 : tensor<10xf32>, %arg1 : tensor<10xf32>) -> tensor<10x10xf32> {
+ *    %add = "magic.op"(%arg0, %arg1) : (tensor<10xf32>, tensor<10xf32>) -> tensor<10x10xf32>
+ *    return %ret : tensor<10x10xf32>
  * }
  * '''
- * 
- * @tf.function
+ *
+ * {@literal @}tf.function
  * def foo(x, y):
  *   return mlir_passthrough_op([x, y], mlir_module, Toutputs=[tf.float32])
- * 
+ *
  * graph_def = foo.get_concrete_function(tf.TensorSpec([10], tf.float32), tf.TensorSpec([10], tf.float32)).graph.as_graph_def()
- * }
- * + *
*/ @Operator public final class MlirPassthroughOp extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MlirPassthroughOp"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private MlirPassthroughOp(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + /** * Factory method to create a class wrapping a new MlirPassthroughOp operation. - * + * * @param scope current scope - * @param inputs - * @param mlirModule - * @param Toutputs + * @param inputs the inputs value + * @param mlirModule the value of the mlirModule property + * @param Toutputs the value of the Toutputs property * @return a new instance of MlirPassthroughOp */ - @Endpoint(describeByClass = true) - public static MlirPassthroughOp create(Scope scope, Iterable> inputs, String mlirModule, List> Toutputs) { + @Endpoint( + describeByClass = true + ) + public static MlirPassthroughOp create(Scope scope, Iterable> inputs, + String mlirModule, List> Toutputs) { OperationBuilder opBuilder = scope.env().opBuilder("MlirPassthroughOp", scope.makeOpName("MlirPassthroughOp")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); @@ -85,29 +101,19 @@ public static MlirPassthroughOp create(Scope scope, Iterable> inputs, opBuilder.setAttr("Toutputs", Operands.toDataTypes(Toutputs)); return new MlirPassthroughOp(opBuilder.build()); } - + /** + * Gets outputs. + * + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MlirPassthroughOp"; - - private List> outputs; - - private MlirPassthroughOp(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableDenseHashTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableDenseHashTable.java index 28a85dc0082..b94faeb89c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableDenseHashTable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableDenseHashTable.java @@ -31,98 +31,46 @@ /** * Creates an empty hash table that uses tensors as the backing store. - *

- * It uses "open addressing" with quadratic reprobing to resolve + * It uses "open addressing" with quadratic reprobing to resolve * collisions. - *

- * This op creates a mutable hash table, specifying the type of its keys and + *

This op creates a mutable hash table, specifying the type of its keys and * values. Each value must be a scalar. Data can be inserted into the table using * the insert operations. It does not support the initialization operation. */ @Operator public final class MutableDenseHashTable extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.MutableDenseHashTable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this table is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this table is shared under the given name across - * multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param useNodeNameSharing - */ - public Options useNodeNameSharing(Boolean useNodeNameSharing) { - this.useNodeNameSharing = useNodeNameSharing; - return this; - } - - /** - * @param valueShape The shape of each value. - */ - public Options valueShape(Shape valueShape) { - this.valueShape = valueShape; - return this; - } - - /** - * @param initialNumBuckets The initial number of hash table buckets. Must be a power - * to 2. - */ - public Options initialNumBuckets(Long initialNumBuckets) { - this.initialNumBuckets = initialNumBuckets; - return this; - } - - /** - * @param maxLoadFactor The maximum ratio between number of entries and number of - * buckets before growing the table. Must be between 0 and 1. - */ - public Options maxLoadFactor(Float maxLoadFactor) { - this.maxLoadFactor = maxLoadFactor; - return this; - } - - private String container; - private String sharedName; - private Boolean useNodeNameSharing; - private Shape valueShape; - private Long initialNumBuckets; - private Float maxLoadFactor; - - private Options() { - } + public static final String OP_NAME = "MutableDenseHashTableV2"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + private MutableDenseHashTable(Operation operation) { + super(operation); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MutableDenseHashTable operation. - * + * Factory method to create a class wrapping a new MutableDenseHashTableV2 operation. + * * @param scope current scope * @param emptyKey The key used to represent empty key buckets internally. Must not * be used in insert or lookup operations. - * @param deletedKey + * @param deletedKey the deletedKey value * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MutableDenseHashTableV2} output and operands + * @param data type for {@code MutableDenseHashTableV2} output and operands * @return a new instance of MutableDenseHashTable */ - @Endpoint(describeByClass = true) - public static MutableDenseHashTable create(Scope scope, Operand emptyKey, Operand deletedKey, Class valueDtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MutableDenseHashTable create(Scope scope, + Operand emptyKey, Operand deletedKey, Class valueDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MutableDenseHashTableV2", scope.makeOpName("MutableDenseHashTable")); opBuilder.addInput(emptyKey.asOutput()); opBuilder.addInput(deletedKey.asOutput()); @@ -152,74 +100,173 @@ public static MutableDenseHashTable create(Sc } return new MutableDenseHashTable(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this table is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this table is shared under the given name across * multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param useNodeNameSharing + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing the useNodeNameSharing option + * @return this Options instance. */ public static Options useNodeNameSharing(Boolean useNodeNameSharing) { return new Options().useNodeNameSharing(useNodeNameSharing); } - + /** + * Sets the valueShape option. + * * @param valueShape The shape of each value. + * @return this Options instance. */ public static Options valueShape(Shape valueShape) { return new Options().valueShape(valueShape); } - + /** + * Sets the initialNumBuckets option. + * * @param initialNumBuckets The initial number of hash table buckets. Must be a power * to 2. + * @return this Options instance. */ public static Options initialNumBuckets(Long initialNumBuckets) { return new Options().initialNumBuckets(initialNumBuckets); } - + /** + * Sets the maxLoadFactor option. + * * @param maxLoadFactor The maximum ratio between number of entries and number of * buckets before growing the table. Must be between 0 and 1. + * @return this Options instance. */ public static Options maxLoadFactor(Float maxLoadFactor) { return new Options().maxLoadFactor(maxLoadFactor); } - + /** + * Gets tableHandle. * Handle to a table. + * @return tableHandle. */ - public Output tableHandle() { + public Output tableHandle() { return tableHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) tableHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutableDenseHashTableV2"; - - private Output tableHandle; - - private MutableDenseHashTable(Operation operation) { - super(operation); - int outputIdx = 0; - tableHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MutableDenseHashTable} + */ + public static class Options { + private String container; + + private String sharedName; + + private Boolean useNodeNameSharing; + + private Shape valueShape; + + private Long initialNumBuckets; + + private Float maxLoadFactor; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this table is shared under the given name across + * multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing the useNodeNameSharing option + * @return this Options instance. + */ + public Options useNodeNameSharing(Boolean useNodeNameSharing) { + this.useNodeNameSharing = useNodeNameSharing; + return this; + } + + /** + * Sets the valueShape option. + * + * @param valueShape The shape of each value. + * @return this Options instance. + */ + public Options valueShape(Shape valueShape) { + this.valueShape = valueShape; + return this; + } + + /** + * Sets the initialNumBuckets option. + * + * @param initialNumBuckets The initial number of hash table buckets. Must be a power + * to 2. + * @return this Options instance. + */ + public Options initialNumBuckets(Long initialNumBuckets) { + this.initialNumBuckets = initialNumBuckets; + return this; + } + + /** + * Sets the maxLoadFactor option. + * + * @param maxLoadFactor The maximum ratio between number of entries and number of + * buckets before growing the table. Must be between 0 and 1. + * @return this Options instance. + */ + public Options maxLoadFactor(Float maxLoadFactor) { + this.maxLoadFactor = maxLoadFactor; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTable.java index 1a551a3d77f..3d37d0a4746 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTable.java @@ -30,65 +30,42 @@ /** * Creates an empty hash table. - *

* This op creates a mutable hash table, specifying the type of its keys and * values. Each value must be a scalar. Data can be inserted into the table using * the insert operations. It does not support the initialization operation. */ @Operator public final class MutableHashTable extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.MutableHashTable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this table is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this table is shared under the given name across - * multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param useNodeNameSharing If true and shared_name is empty, the table is shared - * using the node name. - */ - public Options useNodeNameSharing(Boolean useNodeNameSharing) { - this.useNodeNameSharing = useNodeNameSharing; - return this; - } - - private String container; - private String sharedName; - private Boolean useNodeNameSharing; - - private Options() { - } + public static final String OP_NAME = "MutableHashTableV2"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + private MutableHashTable(Operation operation) { + super(operation); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MutableHashTable operation. - * + * Factory method to create a class wrapping a new MutableHashTableV2 operation. + * * @param scope current scope * @param keyDtype Type of the table keys. * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MutableHashTableV2} output and operands + * @param data type for {@code MutableHashTableV2} output and operands * @return a new instance of MutableHashTable */ - @Endpoint(describeByClass = true) - public static MutableHashTable create(Scope scope, Class keyDtype, Class valueDtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MutableHashTable create(Scope scope, + Class keyDtype, Class valueDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MutableHashTableV2", scope.makeOpName("MutableHashTable")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); @@ -108,52 +85,102 @@ public static MutableHashTable create(Scope s } return new MutableHashTable(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this table is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this table is shared under the given name across * multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Sets the useNodeNameSharing option. + * * @param useNodeNameSharing If true and shared_name is empty, the table is shared * using the node name. + * @return this Options instance. */ public static Options useNodeNameSharing(Boolean useNodeNameSharing) { return new Options().useNodeNameSharing(useNodeNameSharing); } - + /** + * Gets tableHandle. * Handle to a table. + * @return tableHandle. */ - public Output tableHandle() { + public Output tableHandle() { return tableHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) tableHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutableHashTableV2"; - - private Output tableHandle; - - private MutableHashTable(Operation operation) { - super(operation); - int outputIdx = 0; - tableHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MutableHashTable} + */ + public static class Options { + private String container; + + private String sharedName; + + private Boolean useNodeNameSharing; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this table is shared under the given name across + * multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing If true and shared_name is empty, the table is shared + * using the node name. + * @return this Options instance. + */ + public Options useNodeNameSharing(Boolean useNodeNameSharing) { + this.useNodeNameSharing = useNodeNameSharing; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTableOfTensors.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTableOfTensors.java index c054b60ad0b..60afac5f7a2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTableOfTensors.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutableHashTableOfTensors.java @@ -31,73 +31,42 @@ /** * Creates an empty hash table. - *

* This op creates a mutable hash table, specifying the type of its keys and * values. Each value must be a vector. Data can be inserted into the table using * the insert operations. It does not support the initialization operation. */ @Operator public final class MutableHashTableOfTensors extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.MutableHashTableOfTensors} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this table is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this table is shared under the given name across - * multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param useNodeNameSharing - */ - public Options useNodeNameSharing(Boolean useNodeNameSharing) { - this.useNodeNameSharing = useNodeNameSharing; - return this; - } - - /** - * @param valueShape - */ - public Options valueShape(Shape valueShape) { - this.valueShape = valueShape; - return this; - } - - private String container; - private String sharedName; - private Boolean useNodeNameSharing; - private Shape valueShape; - - private Options() { - } + public static final String OP_NAME = "MutableHashTableOfTensorsV2"; + + private Output tableHandle; + + @SuppressWarnings("unchecked") + private MutableHashTableOfTensors(Operation operation) { + super(operation); + int outputIdx = 0; + tableHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MutableHashTableOfTensors operation. - * + * Factory method to create a class wrapping a new MutableHashTableOfTensorsV2 operation. + * * @param scope current scope * @param keyDtype Type of the table keys. * @param valueDtype Type of the table values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MutableHashTableOfTensorsV2} output and operands + * @param data type for {@code MutableHashTableOfTensorsV2} output and operands * @return a new instance of MutableHashTableOfTensors */ - @Endpoint(describeByClass = true) - public static MutableHashTableOfTensors create(Scope scope, Class keyDtype, Class valueDtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MutableHashTableOfTensors create(Scope scope, + Class keyDtype, Class valueDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MutableHashTableOfTensorsV2", scope.makeOpName("MutableHashTableOfTensors")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); @@ -120,58 +89,123 @@ public static MutableHashTableOfTensors creat } return new MutableHashTableOfTensors(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this table is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this table is shared under the given name across * multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param useNodeNameSharing + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing the useNodeNameSharing option + * @return this Options instance. */ public static Options useNodeNameSharing(Boolean useNodeNameSharing) { return new Options().useNodeNameSharing(useNodeNameSharing); } - + /** - * @param valueShape + * Sets the valueShape option. + * + * @param valueShape the valueShape option + * @return this Options instance. */ public static Options valueShape(Shape valueShape) { return new Options().valueShape(valueShape); } - + /** + * Gets tableHandle. * Handle to a table. + * @return tableHandle. */ - public Output tableHandle() { + public Output tableHandle() { return tableHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) tableHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutableHashTableOfTensorsV2"; - - private Output tableHandle; - - private MutableHashTableOfTensors(Operation operation) { - super(operation); - int outputIdx = 0; - tableHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.MutableHashTableOfTensors} + */ + public static class Options { + private String container; + + private String sharedName; + + private Boolean useNodeNameSharing; + + private Shape valueShape; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this table is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this table is shared under the given name across + * multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the useNodeNameSharing option. + * + * @param useNodeNameSharing the useNodeNameSharing option + * @return this Options instance. + */ + public Options useNodeNameSharing(Boolean useNodeNameSharing) { + this.useNodeNameSharing = useNodeNameSharing; + return this; + } + + /** + * Sets the valueShape option. + * + * @param valueShape the valueShape option + * @return this Options instance. + */ + public Options valueShape(Shape valueShape) { + this.valueShape = valueShape; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Mutex.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Mutex.java index ae8f8894252..36d7656478c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Mutex.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Mutex.java @@ -28,49 +28,34 @@ import org.tensorflow.types.family.TType; /** - * Creates a Mutex resource that can be locked by `MutexLock`. + * Creates a Mutex resource that can be locked by {@code MutexLock}. */ @Operator public final class Mutex extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Mutex} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this variable is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this variable is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "MutexV2"; + + private Output resource; + + @SuppressWarnings("unchecked") + private Mutex(Operation operation) { + super(operation); + int outputIdx = 0; + resource = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Mutex operation. - * + * Factory method to create a class wrapping a new MutexV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Mutex */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Mutex create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MutexV2", scope.makeOpName("Mutex")); opBuilder = scope.apply(opBuilder); @@ -86,44 +71,77 @@ public static Mutex create(Scope scope, Options... options) { } return new Mutex(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this variable is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this variable is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets resource. * The mutex resource. + * @return resource. */ - public Output resource() { + public Output resource() { return resource; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) resource; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutexV2"; - - private Output resource; - - private Mutex(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Mutex} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this variable is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this variable is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutexLock.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutexLock.java index 1506216c8d3..d3e8ae93897 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutexLock.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MutexLock.java @@ -29,84 +29,87 @@ /** * Locks a mutex resource. The output is the lock. So long as the lock tensor - *

- * is alive, any other request to use `MutexLock` with this mutex will wait. - *

- * This is particularly useful for creating a critical section when used in - * conjunction with `MutexLockIdentity`: - *

{@code
+ * is alive, any other request to use {@code MutexLock} with this mutex will wait.
+ * 

This is particularly useful for creating a critical section when used in + * conjunction with {@code MutexLockIdentity}: + *

+ *
  * mutex = mutex_v2(
  *   shared_name=handle_name, container=container, name=name)
- * 
+ *
  * def execute_in_critical_section(fn, *args, **kwargs):
  *   lock = gen_resource_variable_ops.mutex_lock(mutex)
- * 
+ *
  *   with ops.control_dependencies([lock]):
  *     r = fn(*args, **kwargs)
- * 
+ *
  *   with ops.control_dependencies(nest.flatten(r)):
  *     with ops.colocate_with(mutex):
  *       ensure_lock_exists = mutex_lock_identity(lock)
- * 
+ *
  *     # Make sure that if any element of r is accessed, all of
  *     # them are executed together.
  *     r = nest.map_structure(tf.identity, r)
- * 
+ *
  *   with ops.control_dependencies([ensure_lock_exists]):
  *     return nest.map_structure(tf.identity, r)
- * }
- * While `fn` is running in the critical section, no other functions which wish to + *
+ *

While {@code fn} is running in the critical section, no other functions which wish to * use this critical section may run. - *

- * Often the use case is that two executions of the same graph, in parallel, - * wish to run `fn`; and we wish to ensure that only one of them executes - * at a time. This is especially important if `fn` modifies one or more + *

Often the use case is that two executions of the same graph, in parallel, + * wish to run {@code fn}; and we wish to ensure that only one of them executes + * at a time. This is especially important if {@code fn} modifies one or more * variables at a time. - *

- * It is also useful if two separate functions must share a resource, but we + *

It is also useful if two separate functions must share a resource, but we * wish to ensure the usage is exclusive. */ @Operator public final class MutexLock extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MutexLock"; + + private Output mutexLock; + + @SuppressWarnings("unchecked") + private MutexLock(Operation operation) { + super(operation); + int outputIdx = 0; + mutexLock = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MutexLock operation. - * + * * @param scope current scope * @param mutex The mutex resource to lock. * @return a new instance of MutexLock */ - @Endpoint(describeByClass = true) - public static MutexLock create(Scope scope, Operand mutex) { + @Endpoint( + describeByClass = true + ) + public static MutexLock create(Scope scope, Operand mutex) { OperationBuilder opBuilder = scope.env().opBuilder("MutexLock", scope.makeOpName("MutexLock")); opBuilder.addInput(mutex.asOutput()); opBuilder = scope.apply(opBuilder); return new MutexLock(opBuilder.build()); } - + /** + * Gets mutexLock. * A tensor that keeps a shared pointer to a lock on the mutex; * when the Tensor is destroyed, the use count on the shared pointer is decreased * by 1. When it reaches 0, the lock is released. + * @return mutexLock. */ - public Output mutexLock() { + public Output mutexLock() { return mutexLock; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) mutexLock; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MutexLock"; - - private Output mutexLock; - - private MutexLock(Operation operation) { - super(operation); - int outputIdx = 0; - mutexLock = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclAllReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclAllReduce.java index 3621d772dd2..20cdf1e184b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclAllReduce.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclAllReduce.java @@ -24,69 +24,76 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * 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 `c`, - * then `num_devices` ops will run with shared_name value `c`. Failure to do so + *

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 `num_devices` 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. * num_devices: The number of devices participating in this reduction. * shared_name: Identifier that shared between ops of the same reduction. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output + * + * @deprecated use {@link org.tensorflow.op.distribute.NcclAllReduce} instead */ +@Deprecated public final class NcclAllReduce extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NcclAllReduce"; + + private Output data; + + private NcclAllReduce(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclAllReduce operation. - * + * * @param scope current scope - * @param input - * @param reduction - * @param numDevices - * @param sharedName + * @param input the input value + * @param reduction the value of the reduction property + * @param numDevices the value of the numDevices property + * @param sharedName the value of the sharedName property + * @param data type for {@code NcclAllReduce} output and operands * @return a new instance of NcclAllReduce */ - @Endpoint(describeByClass = true) - public static NcclAllReduce create(Scope scope, Operand input, String reduction, Long numDevices, String sharedName) { + @Endpoint( + describeByClass = true + ) + public static NcclAllReduce create(Scope scope, Operand input, + String reduction, Long numDevices, String sharedName) { OperationBuilder opBuilder = scope.env().opBuilder("NcclAllReduce", scope.makeOpName("NcclAllReduce")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("reduction", reduction); opBuilder.setAttr("num_devices", numDevices); opBuilder.setAttr("shared_name", sharedName); - return new NcclAllReduce(opBuilder.build()); + return new NcclAllReduce<>(opBuilder.build()); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclAllReduce"; - - private Output data; - - private NcclAllReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclBroadcast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclBroadcast.java index 8febd22137b..7b3240b9119 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclBroadcast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclBroadcast.java @@ -25,62 +25,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * Sends `input` to all devices that are connected to the output. - *

- * Sends `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 + * 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. + *

input: The input to the broadcast. * output: The same as input. * shape: The shape of the input tensor. - * - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output + * + * @deprecated use {@link org.tensorflow.op.distribute.NcclBroadcast} instead */ +@Deprecated public final class NcclBroadcast extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NcclBroadcast"; + + private Output output; + + private NcclBroadcast(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclBroadcast operation. - * + * * @param scope current scope - * @param input - * @param shape + * @param input the input value + * @param shape the value of the shape property + * @param data type for {@code NcclBroadcast} output and operands * @return a new instance of NcclBroadcast */ - @Endpoint(describeByClass = true) - public static NcclBroadcast create(Scope scope, Operand input, Shape shape) { + @Endpoint( + describeByClass = true + ) + public static NcclBroadcast create(Scope scope, Operand input, + Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("NcclBroadcast", scope.makeOpName("NcclBroadcast")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new NcclBroadcast(opBuilder.build()); + return new NcclBroadcast<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclBroadcast"; - - private Output output; - - private NcclBroadcast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclReduce.java index eba12c24818..cda500edda0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclReduce.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NcclReduce.java @@ -25,61 +25,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * Reduces `input` from `num_devices` using `reduction` to a single device. - *

- * Reduces `input` from `num_devices` using `reduction` to a single device. - *

- * The graph should be constructed so that all inputs have a valid device + * 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 `num_devices` 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 data type for {@code data()} output + * + * @param data type for {@code data} output + * + * @deprecated use {@link org.tensorflow.op.distribute.NcclReduce} instead */ +@Deprecated public final class NcclReduce extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NcclReduce"; + + private Output data; + + private NcclReduce(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclReduce operation. - * + * * @param scope current scope - * @param input - * @param reduction + * @param input the input value + * @param reduction the value of the reduction property + * @param data type for {@code NcclReduce} output and operands * @return a new instance of NcclReduce */ - @Endpoint(describeByClass = true) - public static NcclReduce create(Scope scope, Iterable> input, String reduction) { + @Endpoint( + describeByClass = true + ) + public static NcclReduce create(Scope scope, Iterable> input, + String reduction) { OperationBuilder opBuilder = scope.env().opBuilder("NcclReduce", scope.makeOpName("NcclReduce")); opBuilder.addInputList(Operands.asOutputs(input)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("reduction", reduction); - return new NcclReduce(opBuilder.build()); + return new NcclReduce<>(opBuilder.build()); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclReduce"; - - private Output data; - - private NcclReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextIteration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextIteration.java index e5b558b23ff..1685840610b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextIteration.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextIteration.java @@ -29,47 +29,53 @@ /** * Makes its input available to the next iteration. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class NextIteration extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NextIteration"; + + private Output output; + + private NextIteration(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NextIteration operation. - * + * * @param scope current scope * @param data The tensor to be made available to the next iteration. + * @param data type for {@code NextIteration} output and operands * @return a new instance of NextIteration */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static NextIteration create(Scope scope, Operand data) { OperationBuilder opBuilder = scope.env().opBuilder("NextIteration", scope.makeOpName("NextIteration")); opBuilder.addInput(data.asOutput()); opBuilder = scope.apply(opBuilder); - return new NextIteration(opBuilder.build()); + return new NextIteration<>(opBuilder.build()); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NextIteration"; - - private Output output; - - private NextIteration(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NoOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NoOp.java index b8aa6227ce7..741e9397e69 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NoOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NoOp.java @@ -29,24 +29,27 @@ */ @Operator public final class NoOp extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NoOp"; + + private NoOp(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new NoOp operation. - * + * * @param scope current scope * @return a new instance of NoOp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static NoOp create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("NoOp", scope.makeOpName("NoOp")); opBuilder = scope.apply(opBuilder); return new NoOp(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NoOp"; - - private NoOp(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OneHot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OneHot.java index 46e82fd3b41..0cb7522274b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OneHot.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OneHot.java @@ -31,57 +31,51 @@ /** * Returns a one-hot tensor. - *

- * The locations represented by indices in `indices` take value `on_value`, - * while all other locations take value `off_value`. - *

- * If the input `indices` is rank `N`, the output will have rank `N+1`, - * The new axis is created at dimension `axis` (default: the new axis is + * The locations represented by indices in {@code indices} take value {@code on_value}, + * while all other locations take value {@code off_value}. + *

If the input {@code indices} is rank {@code N}, the output will have rank {@code N+1}, + * The new axis is created at dimension {@code axis} (default: the new axis is * appended at the end). - *

- * If `indices` is a scalar the output shape will be a vector of length `depth`. - *

- * If `indices` is a vector of length `features`, the output shape will be: - *

{@code
+ * 

If {@code indices} is a scalar the output shape will be a vector of length {@code depth}. + *

If {@code indices} is a vector of length {@code features}, the output shape will be: + *

  *   features x depth if axis == -1
  *   depth x features if axis == 0
- * }
- * If `indices` is a matrix (batch) with shape `[batch, features]`, + *
+ *

If {@code indices} is a matrix (batch) with shape {@code [batch, features]}, * the output shape will be: - *

{@code
+ * 
  *   batch x features x depth if axis == -1
  *   batch x depth x features if axis == 1
  *   depth x batch x features if axis == 0
- * }
- * Examples - * ========= - *

- * Suppose that - *

{@code
+ * 
+ * Examples
+ *

Suppose that + *

  *   indices = [0, 2, -1, 1]
  *   depth = 3
  *   on_value = 5.0
  *   off_value = 0.0
  *   axis = -1
- * }
- * Then output is `[4 x 3]`: - *
{@code
+ * 
+ *

Then output is {@code [4 x 3]}: + *

  * output =
  *   [5.0 0.0 0.0]  // one_hot(0)
  *   [0.0 0.0 5.0]  // one_hot(2)
  *   [0.0 0.0 0.0]  // one_hot(-1)
  *   [0.0 5.0 0.0]  // one_hot(1)
- * }
- * Suppose that - *
{@code
+ * 
+ *

Suppose that + *

  *   indices = [0, 2, -1, 1]
  *   depth = 3
  *   on_value = 0.0
  *   off_value = 3.0
  *   axis = 0
- * }
- * Then output is `[3 x 4]`: - *
{@code
+ * 
+ *

Then output is {@code [3 x 4]}: + *

  * output =
  *   [0.0 3.0 3.0 3.0]
  *   [3.0 3.0 3.0 0.0]
@@ -91,17 +85,17 @@
  * //      ^            one_hot(2)
  * //          ^        one_hot(-1)
  * //              ^    one_hot(1)
- * }
- * Suppose that - *
{@code
+ * 
+ *

Suppose that + *

  *   indices = [[0, 2], [1, -1]]
  *   depth = 3
  *   on_value = 1.0
  *   off_value = 0.0
  *   axis = -1
- * }
- * Then output is `[2 x 2 x 3]`: - *
{@code
+ * 
+ *

Then output is {@code [2 x 2 x 3]}: + *

  * output =
  *   [
  *     [1.0, 0.0, 0.0]  // one_hot(0)
@@ -110,46 +104,42 @@
  *     [0.0, 1.0, 0.0]  // one_hot(1)
  *     [0.0, 0.0, 0.0]  // one_hot(-1)
  *   ]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ @Operator public final class OneHot extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.OneHot} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis The axis to fill (default: -1, a new inner-most axis). - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Long axis; - - private Options() { - } + public static final String OP_NAME = "OneHot"; + + private Output output; + + private OneHot(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OneHot operation. - * + * * @param scope current scope * @param indices A tensor of indices. * @param depth A scalar defining the depth of the one hot dimension. - * @param onValue A scalar defining the value to fill in output when `indices[j] = i`. - * @param offValue A scalar defining the value to fill in output when `indices[j] != i`. - * @param options carries optional attributes values + * @param onValue A scalar defining the value to fill in output when {@code indices[j] = i}. + * @param offValue A scalar defining the value to fill in output when {@code indices[j] != i}. + * @param options carries optional attribute values + * @param data type for {@code OneHot} output and operands * @return a new instance of OneHot */ - @Endpoint(describeByClass = true) - public static OneHot create(Scope scope, Operand indices, Operand depth, Operand onValue, Operand offValue, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OneHot create(Scope scope, Operand indices, + Operand depth, Operand onValue, Operand offValue, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OneHot", scope.makeOpName("OneHot")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(depth.asOutput()); @@ -163,36 +153,51 @@ public static OneHot create(Scope scope, Operand(opBuilder.build()); + return new OneHot<>(opBuilder.build()); } - + /** + * Sets the axis option. + * * @param axis The axis to fill (default: -1, a new inner-most axis). + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. * The one-hot tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OneHot"; - - private Output output; - - private OneHot(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OneHot} + */ + public static class Options { + private Long axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis The axis to fill (default: -1, a new inner-most axis). + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OnesLike.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OnesLike.java index d314879054f..bc94f4bdd88 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OnesLike.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OnesLike.java @@ -29,47 +29,53 @@ /** * Returns a tensor of ones with the same shape and type as x. - * - * @param data type for {@code y()} output + * + * @param data type for {@code y} output */ @Operator public final class OnesLike extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OnesLike"; + + private Output y; + + private OnesLike(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OnesLike operation. - * + * * @param scope current scope * @param x a tensor of type T. + * @param data type for {@code OnesLike} output and operands * @return a new instance of OnesLike */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OnesLike create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("OnesLike", scope.makeOpName("OnesLike")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new OnesLike(opBuilder.build()); + return new OnesLike<>(opBuilder.build()); } - + /** + * Gets y. * a tensor of the same shape and type as x but filled with ones. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OnesLike"; - - private Output y; - - private OnesLike(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapClear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapClear.java index dd789bcec82..1d487caaa1f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapClear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapClear.java @@ -32,63 +32,28 @@ */ @Operator public final class OrderedMapClear extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapClear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapClear"; + + private OrderedMapClear(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new OrderedMapClear operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of OrderedMapClear */ - @Endpoint(describeByClass = true) - public static OrderedMapClear create(Scope scope, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OrderedMapClear create(Scope scope, List> dtypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapClear", scope.makeOpName("OrderedMapClear")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); @@ -110,39 +75,104 @@ public static OrderedMapClear create(Scope scope, List> d } return new OrderedMapClear(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapClear"; - - private OrderedMapClear(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapClear} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapIncompleteSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapIncompleteSize.java index 56d520b02ff..81b4b4d8e00 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapIncompleteSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapIncompleteSize.java @@ -35,63 +35,32 @@ */ @Operator public final class OrderedMapIncompleteSize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapIncompleteSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapIncompleteSize"; + + private Output output; + + private OrderedMapIncompleteSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OrderedMapIncompleteSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of OrderedMapIncompleteSize */ - @Endpoint(describeByClass = true) - public static OrderedMapIncompleteSize create(Scope scope, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OrderedMapIncompleteSize create(Scope scope, List> dtypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapIncompleteSize", scope.makeOpName("OrderedMapIncompleteSize")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); @@ -113,54 +82,118 @@ public static OrderedMapIncompleteSize create(Scope scope, List output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapIncompleteSize"; - - private Output output; - - private OrderedMapIncompleteSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapIncompleteSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapPeek.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapPeek.java index 893be796c79..3073a97acbf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapPeek.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapPeek.java @@ -35,72 +35,43 @@ /** * Op peeks at the values at the specified key. If the - *

* underlying container does not contain this key * this op will block until it does. This Op is optimized for * performance. */ @Operator public final class OrderedMapPeek extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapPeek} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapPeek"; + + private List> values; + + @SuppressWarnings("unchecked") + private OrderedMapPeek(Operation operation) { + super(operation); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new OrderedMapPeek operation. - * + * * @param scope current scope - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @param key the key value + * @param indices the indices value + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of OrderedMapPeek */ - @Endpoint(describeByClass = true) - public static OrderedMapPeek create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OrderedMapPeek create(Scope scope, Operand key, Operand indices, + List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapPeek", scope.makeOpName("OrderedMapPeek")); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -124,57 +95,119 @@ public static OrderedMapPeek create(Scope scope, Operand key, Operand> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapPeek"; - - private List> values; - - private OrderedMapPeek(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapPeek} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapSize.java index 3c561660900..97cb7da14ca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapSize.java @@ -35,63 +35,32 @@ */ @Operator public final class OrderedMapSize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapSize"; + + private Output output; + + private OrderedMapSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OrderedMapSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of OrderedMapSize */ - @Endpoint(describeByClass = true) - public static OrderedMapSize create(Scope scope, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OrderedMapSize create(Scope scope, List> dtypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapSize", scope.makeOpName("OrderedMapSize")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); @@ -113,54 +82,118 @@ public static OrderedMapSize create(Scope scope, List> dt } return new OrderedMapSize(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapSize"; - - private Output output; - - private OrderedMapSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapStage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapStage.java index a78c20a9623..b4df966b71f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapStage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapStage.java @@ -32,74 +32,36 @@ /** * Stage (key, values) in the underlying container which behaves like a ordered - *

* associative container. Elements are ordered by key. */ @Operator public final class OrderedMapStage extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapStage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts - * on the container will block when the capacity is reached. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. Otherwise, - * a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName It is necessary to match this name to the matching Unstage Op. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapStage"; + + private OrderedMapStage(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new OrderedMapStage operation. - * + * * @param scope current scope * @param key int64 - * @param indices + * @param indices the indices value * @param values a list of tensors * dtypes A list of data types that inserted values should adhere to. - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of OrderedMapStage */ - @Endpoint(describeByClass = true) - public static OrderedMapStage create(Scope scope, Operand key, Operand indices, Iterable> values, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OrderedMapStage create(Scope scope, Operand key, Operand indices, + Iterable> values, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapStage", scope.makeOpName("OrderedMapStage")); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -124,41 +86,108 @@ public static OrderedMapStage create(Scope scope, Operand key, Operand 0, inserts + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts * on the container will block when the capacity is reached. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. Otherwise, * a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapStage"; - - private OrderedMapStage(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapStage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * on the container will block when the capacity is reached. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. Otherwise, + * a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstage.java index 667f0f198fb..761f9e3c705 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstage.java @@ -35,71 +35,42 @@ /** * Op removes and returns the values associated with the key - *

* from the underlying container. If the underlying container * does not contain this key, the op will block until it does. */ @Operator public final class OrderedMapUnstage extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapUnstage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapUnstage"; + + private List> values; + + @SuppressWarnings("unchecked") + private OrderedMapUnstage(Operation operation) { + super(operation); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new OrderedMapUnstage operation. - * + * * @param scope current scope - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @param key the key value + * @param indices the indices value + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of OrderedMapUnstage */ - @Endpoint(describeByClass = true) - public static OrderedMapUnstage create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OrderedMapUnstage create(Scope scope, Operand key, Operand indices, + List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapUnstage", scope.makeOpName("OrderedMapUnstage")); opBuilder.addInput(key.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -123,57 +94,119 @@ public static OrderedMapUnstage create(Scope scope, Operand key, Operand } return new OrderedMapUnstage(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets values. + * + * @return values. */ public List> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapUnstage"; - - private List> values; - - private OrderedMapUnstage(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapUnstage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstageNoKey.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstageNoKey.java index fb0d239d6a2..952704844f8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstageNoKey.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OrderedMapUnstageNoKey.java @@ -34,70 +34,44 @@ /** * Op removes and returns the (key, value) element with the smallest - *

* key from the underlying container. If the underlying container * does not contain elements, the op will block until it does. */ @Operator public final class OrderedMapUnstageNoKey extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.OrderedMapUnstageNoKey} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "OrderedMapUnstageNoKey"; + + private Output key; + + private List> values; + + @SuppressWarnings("unchecked") + private OrderedMapUnstageNoKey(Operation operation) { + super(operation); + int outputIdx = 0; + key = operation.output(outputIdx++); + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new OrderedMapUnstageNoKey operation. - * + * * @param scope current scope - * @param indices - * @param dtypes - * @param options carries optional attributes values + * @param indices the indices value + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of OrderedMapUnstageNoKey */ - @Endpoint(describeByClass = true) - public static OrderedMapUnstageNoKey create(Scope scope, Operand indices, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OrderedMapUnstageNoKey create(Scope scope, Operand indices, + List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapUnstageNoKey", scope.makeOpName("OrderedMapUnstageNoKey")); opBuilder.addInput(indices.asOutput()); opBuilder = scope.apply(opBuilder); @@ -120,59 +94,122 @@ public static OrderedMapUnstageNoKey create(Scope scope, Operand indices } return new OrderedMapUnstageNoKey(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets key. + * + * @return key. */ public Output key() { return key; } - + /** + * Gets values. + * + * @return values. */ public List> values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OrderedMapUnstageNoKey"; - - private Output key; - private List> values; - - private OrderedMapUnstageNoKey(Operation operation) { - super(operation); - int outputIdx = 0; - key = operation.output(outputIdx++); - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.OrderedMapUnstageNoKey} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Pad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Pad.java index f455f0fc98c..7dde13cf5ee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Pad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Pad.java @@ -30,75 +30,78 @@ /** * Pads a tensor. - *

- * This operation pads `input` according to the `paddings` and `constant_values` - * you specify. `paddings` is an integer tensor with shape `[Dn, 2]`, where n is - * the rank of `input`. For each dimension D of `input`, `paddings[D, 0]` indicates - * how many padding values to add before the contents of `input` in that dimension, - * and `paddings[D, 1]` indicates how many padding values to add after the contents - * of `input` in that dimension. `constant_values` is a scalar tensor of the same - * type as `input` that indicates the value to use for padding `input`. - *

- * The padded size of each dimension D of the output is: - *

- * `paddings(D, 0) + input.dim_size(D) + paddings(D, 1)` - *

- * For example: - *

{@code
+ * This operation pads {@code input} according to the {@code paddings} and {@code constant_values}
+ * you specify. {@code paddings} is an integer tensor with shape {@code [Dn, 2]}, where n is
+ * the rank of {@code input}. For each dimension D of {@code input}, {@code paddings[D, 0]} indicates
+ * how many padding values to add before the contents of {@code input} in that dimension,
+ * and {@code paddings[D, 1]} indicates how many padding values to add after the contents
+ * of {@code input} in that dimension. {@code constant_values} is a scalar tensor of the same
+ * type as {@code input} that indicates the value to use for padding {@code input}.
+ * 

The padded size of each dimension D of the output is: + *

{@code paddings(D, 0) + input.dim_size(D) + paddings(D, 1)} + *

For example: + *

  * # 't' is [[1, 1], [2, 2]]
  * # 'paddings' is [[1, 1], [2, 2]]
  * # 'constant_values' is 0
  * # rank of 't' is 2
- * pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
+ * pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
  *                       [0, 0, 1, 1, 0, 0]
  *                       [0, 0, 2, 2, 0, 0]
  *                       [0, 0, 0, 0, 0, 0]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ @Operator public final class Pad extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Pad operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "PadV2"; + + private Output output; + + private Pad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new PadV2 operation. + * * @param scope current scope - * @param input - * @param paddings - * @param constantValues + * @param input the input value + * @param paddings the paddings value + * @param constantValues the constantValues value + * @param data type for {@code PadV2} output and operands * @return a new instance of Pad */ - @Endpoint(describeByClass = true) - public static Pad create(Scope scope, Operand input, Operand paddings, Operand constantValues) { + @Endpoint( + describeByClass = true + ) + public static Pad create(Scope scope, Operand input, + Operand paddings, Operand constantValues) { OperationBuilder opBuilder = scope.env().opBuilder("PadV2", scope.makeOpName("Pad")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); opBuilder.addInput(constantValues.asOutput()); opBuilder = scope.apply(opBuilder); - return new Pad(opBuilder.build()); + return new Pad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PadV2"; - - private Output output; - - private Pad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelConcat.java index a0f8c3d7d0b..c82ed8c6d3d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelConcat.java @@ -30,67 +30,72 @@ import org.tensorflow.types.family.TType; /** - * Concatenates a list of `N` tensors along the first dimension. - *

+ * Concatenates a list of {@code N} tensors along the first dimension. * The input tensors are all required to have size 1 in the first dimension. - *

- * For example: - *

{@code
+ * 

For example: + *

  * # 'x' is [[1, 4]]
  * # 'y' is [[2, 5]]
  * # 'z' is [[3, 6]]
- * parallel_concat([x, y, z]) => [[1, 4], [2, 5], [3, 6]]  # Pack along first dim.
- * }
- * The difference between concat and parallel_concat is that concat requires all + * parallel_concat([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim. + *
+ *

The difference between concat and parallel_concat is that concat requires all * of the inputs be computed before the operation will begin but doesn't require * that the input shapes be known during graph construction. Parallel concat * will copy pieces of the input into the output as they become available, in * some situations this can provide a performance benefit. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class ParallelConcat extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParallelConcat"; + + private Output output; + + private ParallelConcat(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ParallelConcat operation. - * + * * @param scope current scope * @param values Tensors to be concatenated. All must have size 1 in the first dimension * and same shape. * @param shape the final shape of the result; should be equal to the shapes of any input * but with the number of input values in the first dimension. + * @param data type for {@code ParallelConcat} output and operands * @return a new instance of ParallelConcat */ - @Endpoint(describeByClass = true) - public static ParallelConcat create(Scope scope, Iterable> values, Shape shape) { + @Endpoint( + describeByClass = true + ) + public static ParallelConcat create(Scope scope, Iterable> values, + Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("ParallelConcat", scope.makeOpName("ParallelConcat")); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new ParallelConcat(opBuilder.build()); + return new ParallelConcat<>(opBuilder.build()); } - + /** + * Gets output. * The concatenated tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParallelConcat"; - - private Output output; - - private ParallelConcat(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelDynamicStitch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelDynamicStitch.java index ddadd14a859..7cdaf7186dc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelDynamicStitch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ParallelDynamicStitch.java @@ -30,33 +30,31 @@ import org.tensorflow.types.family.TType; /** - * Interleave the values from the `data` tensors into a single tensor. - *

+ * Interleave the values from the {@code 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
+ * 
+ *

For example, if each {@code indices[m]} is scalar or vector, we have + *

  *     # 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 may be merged in parallel, so if an index appears in both `indices[m][i]` - * and `indices[n][j]`, the result may be invalid. This differs from the normal + *

+ *

Each {@code data[i].shape} must start with the corresponding {@code indices[i].shape}, + * and the rest of {@code data[i].shape} must be constant w.r.t. {@code i}. That is, we + * must have {@code data[i].shape = indices[i].shape + constant}. In terms of this + * {@code constant}, the output shape is + *

+ * merged.shape = [max(indices)] + constant
+ * 
+ *

Values may be merged in parallel, so if an index appears in both {@code indices[m][i]} + * and {@code indices[n][j]}, the result may be invalid. This differs from the normal * DynamicStitch operator that defines the behavior in that case. - *

- * For example: - *

{@code
+ * 

For example: + *

  *     indices[0] = 6
  *     indices[1] = [4, 1]
  *     indices[2] = [[5, 2], [0, 3]]
@@ -65,10 +63,10 @@
  *     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` + *
+ *

This method can be used to merge partitions created by {@code 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])
@@ -81,52 +79,60 @@
  *     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.
- * }
+ *
*
* *
- * - * @param data type for {@code merged()} output + * + * @param data type for {@code merged} output */ @Operator public final class ParallelDynamicStitch extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParallelDynamicStitch"; + + private Output merged; + + private ParallelDynamicStitch(Operation operation) { + super(operation); + int outputIdx = 0; + merged = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ParallelDynamicStitch operation. - * + * * @param scope current scope - * @param indices - * @param data + * @param indices the indices value + * @param data the data value + * @param data type for {@code ParallelDynamicStitch} output and operands * @return a new instance of ParallelDynamicStitch */ - @Endpoint(describeByClass = true) - public static ParallelDynamicStitch create(Scope scope, Iterable> indices, Iterable> data) { + @Endpoint( + describeByClass = true + ) + public static ParallelDynamicStitch create(Scope scope, + Iterable> indices, Iterable> data) { OperationBuilder opBuilder = scope.env().opBuilder("ParallelDynamicStitch", scope.makeOpName("ParallelDynamicStitch")); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(data)); opBuilder = scope.apply(opBuilder); - return new ParallelDynamicStitch(opBuilder.build()); + return new ParallelDynamicStitch<>(opBuilder.build()); } - + /** + * Gets merged. + * + * @return merged. */ public Output merged() { return merged; } - + @Override public Output asOutput() { return merged; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParallelDynamicStitch"; - - private Output merged; - - private ParallelDynamicStitch(Operation operation) { - super(operation); - int outputIdx = 0; - merged = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Placeholder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Placeholder.java index a510d2d5cb7..ce982c9fec3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Placeholder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Placeholder.java @@ -31,46 +31,41 @@ /** * A placeholder op for a value that will be fed into the computation. - *

* N.B. This operation will fail with an error if it is executed. It is * intended as a way to represent a value that will always be fed, and to * provide attrs that enable the fed value to be checked at runtime. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class Placeholder extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Placeholder} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shape (Optional) The shape of the tensor. If the shape has 0 dimensions, the - * shape is unconstrained. - */ - public Options shape(Shape shape) { - this.shape = shape; - return this; - } - - private Shape shape; - - private Options() { - } + public static final String OP_NAME = "Placeholder"; + + private Output output; + + private Placeholder(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Placeholder operation. - * + * * @param scope current scope * @param dtype The type of elements in the tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Placeholder} output and operands * @return a new instance of Placeholder */ - @Endpoint(describeByClass = true) - public static Placeholder create(Scope scope, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Placeholder create(Scope scope, Class dtype, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Placeholder", scope.makeOpName("Placeholder")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); @@ -81,37 +76,53 @@ public static Placeholder create(Scope scope, Class dtyp } } } - return new Placeholder(opBuilder.build()); + return new Placeholder<>(opBuilder.build()); } - + /** + * Sets the shape option. + * * @param shape (Optional) The shape of the tensor. If the shape has 0 dimensions, the * shape is unconstrained. + * @return this Options instance. */ public static Options shape(Shape shape) { return new Options().shape(shape); } - + /** + * Gets output. * A placeholder tensor that must be replaced using the feed mechanism. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Placeholder"; - - private Output output; - - private Placeholder(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Placeholder} + */ + public static class Options { + private Shape shape; + + private Options() { + } + + /** + * Sets the shape option. + * + * @param shape (Optional) The shape of the tensor. If the shape has 0 dimensions, the + * shape is unconstrained. + * @return this Options instance. + */ + public Options shape(Shape shape) { + this.shape = shape; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PlaceholderWithDefault.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PlaceholderWithDefault.java index afcf8f3b631..aaf92d4b7d1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PlaceholderWithDefault.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PlaceholderWithDefault.java @@ -29,50 +29,57 @@ import org.tensorflow.types.family.TType; /** - * A placeholder op that passes through `input` when its output is not fed. - * - * @param data type for {@code output()} output + * A placeholder op that passes through {@code input} when its output is not fed. + * + * @param data type for {@code output} output */ @Operator public final class PlaceholderWithDefault extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "PlaceholderWithDefault"; + + private Output output; + + private PlaceholderWithDefault(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new PlaceholderWithDefault operation. - * + * * @param scope current scope - * @param input The default value to produce when `output` is not fed. + * @param input The default value to produce when {@code output} is not fed. * @param shape The (possibly partial) shape of the tensor. + * @param data type for {@code PlaceholderWithDefault} output and operands * @return a new instance of PlaceholderWithDefault */ - @Endpoint(describeByClass = true) - public static PlaceholderWithDefault create(Scope scope, Operand input, Shape shape) { + @Endpoint( + describeByClass = true + ) + public static PlaceholderWithDefault create(Scope scope, Operand input, + Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("PlaceholderWithDefault", scope.makeOpName("PlaceholderWithDefault")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new PlaceholderWithDefault(opBuilder.build()); + return new PlaceholderWithDefault<>(opBuilder.build()); } - + /** - * A placeholder tensor that defaults to `input` if it is not fed. + * Gets output. + * A placeholder tensor that defaults to {@code input} if it is not fed. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PlaceholderWithDefault"; - - private Output output; - - private PlaceholderWithDefault(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Print.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Print.java index e5c1b17d5c2..e453803464a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Print.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Print.java @@ -28,49 +28,30 @@ /** * Prints a string scalar. - *

* Prints a string scalar to the desired output_stream. */ @Operator public final class Print extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.Print} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param outputStream A string specifying the output stream or logging level to print to. - */ - public Options outputStream(String outputStream) { - this.outputStream = outputStream; - return this; - } - - /** - * @param end - */ - public Options end(String end) { - this.end = end; - return this; - } - - private String outputStream; - private String end; - - private Options() { - } + public static final String OP_NAME = "PrintV2"; + + private Print(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new Print operation. - * + * Factory method to create a class wrapping a new PrintV2 operation. + * * @param scope current scope * @param input The string scalar to print. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Print */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Print create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PrintV2", scope.makeOpName("Print")); opBuilder.addInput(input.asOutput()); @@ -87,25 +68,58 @@ public static Print create(Scope scope, Operand input, Options... optio } return new Print(opBuilder.build()); } - + /** + * Sets the outputStream option. + * * @param outputStream A string specifying the output stream or logging level to print to. + * @return this Options instance. */ public static Options outputStream(String outputStream) { return new Options().outputStream(outputStream); } - + /** - * @param end + * Sets the end option. + * + * @param end the end option + * @return this Options instance. */ public static Options end(String end) { return new Options().end(end); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PrintV2"; - - private Print(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Print} + */ + public static class Options { + private String outputStream; + + private String end; + + private Options() { + } + + /** + * Sets the outputStream option. + * + * @param outputStream A string specifying the output stream or logging level to print to. + * @return this Options instance. + */ + public Options outputStream(String outputStream) { + this.outputStream = outputStream; + return this; + } + + /** + * Sets the end option. + * + * @param end the end option + * @return this Options instance. + */ + public Options end(String end) { + this.end = end; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prod.java index 3d48cb2a4d3..4644a025a92 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prod.java @@ -30,48 +30,44 @@ /** * Computes the product 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 data type for {@code output} output */ @Operator public final class Prod extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Prod} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Prod"; + + private Output output; + + private Prod(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Prod operation. - * + * * @param scope current scope * @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 Prod} output and operands * @return a new instance of Prod */ - @Endpoint(describeByClass = true) - public static Prod create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Prod create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Prod", scope.makeOpName("Prod")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +79,51 @@ public static Prod create(Scope scope, Operand input, Op } } } - return new Prod(opBuilder.build()); + return new Prod<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Prod"; - - private Output output; - - private Prod(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Prod} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedReshape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedReshape.java index 13a8a62b000..2b449817340 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedReshape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedReshape.java @@ -31,67 +31,79 @@ /** * Reshapes a quantized tensor as per the Reshape op. - *

- * ``` - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class QuantizedReshape extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedReshape"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + private QuantizedReshape(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedReshape operation. - * + * * @param scope current scope - * @param tensor + * @param tensor the tensor value * @param shape Defines the shape of the output tensor. * @param inputMin The minimum value of the input. * @param inputMax The maximum value of the input. + * @param data type for {@code QuantizedReshape} output and operands * @return a new instance of QuantizedReshape */ - @Endpoint(describeByClass = true) - public static QuantizedReshape create(Scope scope, Operand tensor, Operand shape, Operand inputMin, Operand inputMax) { + @Endpoint( + describeByClass = true + ) + public static QuantizedReshape create(Scope scope, Operand tensor, + Operand shape, Operand inputMin, Operand inputMax) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedReshape", scope.makeOpName("QuantizedReshape")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); opBuilder = scope.apply(opBuilder); - return new QuantizedReshape(opBuilder.build()); + return new QuantizedReshape<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * This value is copied from input_min. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * This value is copied from input_max. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedReshape"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private QuantizedReshape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Range.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Range.java index 7f30e607c86..ea9bafe214d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Range.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Range.java @@ -29,63 +29,67 @@ /** * Creates a sequence of numbers. - *

- * This operation creates a sequence of numbers that begins at `start` and - * extends by increments of `delta` up to but not including `limit`. - *

- * For example: - *

{@code
+ * This operation creates a sequence of numbers that begins at {@code start} and
+ * extends by increments of {@code delta} up to but not including {@code limit}.
+ * 

For example: + *

  * # 'start' is 3
  * # 'limit' is 18
  * # 'delta' is 3
- * tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15]
- * }
- * - * - * @param data type for {@code output()} output + * tf.range(start, limit, delta) ==> [3, 6, 9, 12, 15] + *
+ * + * @param data type for {@code output} output */ @Operator public final class Range extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Range"; + + private Output output; + + private Range(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Range operation. - * + * * @param scope current scope * @param start 0-D (scalar). First entry in the sequence. * @param limit 0-D (scalar). Upper limit of sequence, exclusive. - * @param delta 0-D (scalar). Optional. Default is 1. Number that increments `start`. + * @param delta 0-D (scalar). Optional. Default is 1. Number that increments {@code start}. + * @param data type for {@code Range} output and operands * @return a new instance of Range */ - @Endpoint(describeByClass = true) - public static Range create(Scope scope, Operand start, Operand limit, Operand delta) { + @Endpoint( + describeByClass = true + ) + public static Range create(Scope scope, Operand start, Operand limit, + Operand delta) { OperationBuilder opBuilder = scope.env().opBuilder("Range", scope.makeOpName("Range")); opBuilder.addInput(start.asOutput()); opBuilder.addInput(limit.asOutput()); opBuilder.addInput(delta.asOutput()); opBuilder = scope.apply(opBuilder); - return new Range(opBuilder.build()); + return new Range<>(opBuilder.build()); } - + /** + * Gets output. * 1-D. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Range"; - - private Output output; - - private Range(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rank.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rank.java index cff0df03467..c32961a10b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rank.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rank.java @@ -30,56 +30,60 @@ /** * Returns the rank of a tensor. - *

- * This operation returns an integer representing the rank of `input`. - *

- * For example: - *

{@code
+ * This operation returns an integer representing the rank of {@code input}.
+ * 

For example: + *

  * # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
  * # shape of tensor 't' is [2, 2, 3]
- * rank(t) ==> 3
- * }
- * Note: The rank of a tensor is not the same as the rank of a matrix. The rank + * rank(t) ==> 3 + *
+ *

Note: The rank of a tensor is not the same as the rank of a matrix. The rank * of a tensor is the number of indices required to uniquely select each element - * of the tensor. Rank is also known as "order", "degree", or "ndims." + * of the tensor. Rank is also known as "order", "degree", or "ndims." */ @Operator public final class Rank extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Rank"; + + private Output output; + + private Rank(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Rank operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of Rank */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Rank create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Rank", scope.makeOpName("Rank")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new Rank(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Rank"; - - private Output output; - - private Rank(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReadVariableOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReadVariableOp.java index 1e73225cc89..d7d329f37f3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReadVariableOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReadVariableOp.java @@ -30,55 +30,61 @@ /** * Reads the value of a variable. - *

* The tensor returned by this operation is immutable. - *

- * The value returned by this operation is guaranteed to be influenced by all the + *

The value returned by this operation is guaranteed to be influenced by all the * writes on which this operation depends directly or indirectly, and to not be * influenced by any of the writes which depend directly or indirectly on this * operation. - * - * @param data type for {@code value()} output + * + * @param data type for {@code value} output */ @Operator public final class ReadVariableOp extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReadVariableOp"; + + private Output value; + + private ReadVariableOp(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ReadVariableOp operation. - * + * * @param scope current scope * @param resource handle to the resource in which to store the variable. * @param dtype the dtype of the value. + * @param data type for {@code ReadVariableOp} output and operands * @return a new instance of ReadVariableOp */ - @Endpoint(describeByClass = true) - public static ReadVariableOp create(Scope scope, Operand resource, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static ReadVariableOp create(Scope scope, + Operand resource, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("ReadVariableOp", scope.makeOpName("ReadVariableOp")); opBuilder.addInput(resource.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new ReadVariableOp(opBuilder.build()); + return new ReadVariableOp<>(opBuilder.build()); } - + /** + * Gets value. + * + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReadVariableOp"; - - private Output value; - - private ReadVariableOp(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Recv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Recv.java index ccae187f1ec..dfc29a0cdc7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Recv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Recv.java @@ -25,52 +25,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Receives the named tensor from send_device on recv_device. - * - * @param data type for {@code tensor()} output + * + * @param data type for {@code tensor} output */ public final class Recv extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Recv} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param clientTerminated If set to true, this indicates that the node was added - * to the graph as a result of a client-side feed or fetch of Tensor data, - * in which case the corresponding send or recv is expected to be managed - * locally by the caller. - */ - public Options clientTerminated(Boolean clientTerminated) { - this.clientTerminated = clientTerminated; - return this; - } - - private Boolean clientTerminated; - - private Options() { - } + public static final String OP_NAME = "Recv"; + + private Output tensor; + + private Recv(Operation operation) { + super(operation); + int outputIdx = 0; + tensor = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Recv operation. - * + * * @param scope current scope - * @param tensorType + * @param tensorType the value of the tensorType property * @param tensorName The name of the tensor to receive. * @param sendDevice The name of the device sending the tensor. * @param sendDeviceIncarnation The current incarnation of send_device. * @param recvDevice The name of the device receiving the tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Recv} output and operands * @return a new instance of Recv */ - @Endpoint(describeByClass = true) - public static Recv create(Scope scope, Class tensorType, String tensorName, String sendDevice, Long sendDeviceIncarnation, String recvDevice, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Recv create(Scope scope, Class tensorType, + String tensorName, String sendDevice, Long sendDeviceIncarnation, String recvDevice, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Recv", scope.makeOpName("Recv")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("tensor_type", Operands.toDataType(tensorType)); @@ -85,39 +79,57 @@ public static Recv create(Scope scope, Class tensorType, } } } - return new Recv(opBuilder.build()); + return new Recv<>(opBuilder.build()); } - + /** + * Sets the clientTerminated option. + * * @param clientTerminated If set to true, this indicates that the node was added * to the graph as a result of a client-side feed or fetch of Tensor data, * in which case the corresponding send or recv is expected to be managed * locally by the caller. + * @return this Options instance. */ public static Options clientTerminated(Boolean clientTerminated) { return new Options().clientTerminated(clientTerminated); } - + /** + * Gets tensor. * The tensor to receive. + * @return tensor. */ public Output tensor() { return tensor; } - + @Override public Output asOutput() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Recv"; - - private Output tensor; - - private Recv(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Recv} + */ + public static class Options { + private Boolean clientTerminated; + + private Options() { + } + + /** + * Sets the clientTerminated option. + * + * @param clientTerminated If set to true, this indicates that the node was added + * to the graph as a result of a client-side feed or fetch of Tensor data, + * in which case the corresponding send or recv is expected to be managed + * locally by the caller. + * @return this Options instance. + */ + public Options clientTerminated(Boolean clientTerminated) { + this.clientTerminated = clientTerminated; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAll.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAll.java index fee74f3b81f..b684ba9d6be 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAll.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAll.java @@ -29,47 +29,42 @@ import org.tensorflow.types.family.TNumber; /** - * 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. */ @Operator public final class ReduceAll extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceAll} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "All"; + + private Output output; + + private ReduceAll(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceAll operation. - * + * Factory method to create a class wrapping a new All operation. + * * @param scope current scope * @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 ReduceAll */ - @Endpoint(describeByClass = true) - public static ReduceAll create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReduceAll create(Scope scope, Operand input, Operand axis, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("All", scope.makeOpName("ReduceAll")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,34 +78,49 @@ public static ReduceAll create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "All"; - - private Output output; - - private ReduceAll(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceAll} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAny.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAny.java index ff0b97078f9..aa446a167f3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAny.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAny.java @@ -29,47 +29,42 @@ import org.tensorflow.types.family.TNumber; /** - * 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 + * 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. */ @Operator public final class ReduceAny extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceAny} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Any"; + + private Output output; + + private ReduceAny(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceAny operation. - * + * Factory method to create a class wrapping a new Any operation. + * * @param scope current scope * @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 ReduceAny */ - @Endpoint(describeByClass = true) - public static ReduceAny create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReduceAny create(Scope scope, Operand input, Operand axis, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Any", scope.makeOpName("ReduceAny")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,34 +78,49 @@ public static ReduceAny create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Any"; - - private Output output; - - private ReduceAny(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceAny} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMax.java index 44418b844d9..5f561d2e5dd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMax.java @@ -26,52 +26,47 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; /** * Computes the maximum 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 data type for {@code output} output */ @Operator -public final class ReduceMax extends RawOp implements Operand { - +public final class ReduceMax extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Max"; + + private Output output; + + private ReduceMax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceMax operation. - * + * Factory method to create a class wrapping a new Max operation. + * * @param scope current scope * @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 Max} output and operands * @return a new instance of ReduceMax */ - @Endpoint(describeByClass = true) - public static ReduceMax create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReduceMax create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Max", scope.makeOpName("ReduceMax")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +78,51 @@ public static ReduceMax create(Scope scope, Operand inpu } } } - return new ReduceMax(opBuilder.build()); + return new ReduceMax<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Max"; - - private Output output; - - private ReduceMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceMax} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMin.java index 6a7f4361324..92ec0761a02 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceMin.java @@ -26,52 +26,47 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; /** * Computes the minimum 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 data type for {@code output} output */ @Operator -public final class ReduceMin extends RawOp implements Operand { - +public final class ReduceMin extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceMin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Min"; + + private Output output; + + private ReduceMin(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceMin operation. - * + * Factory method to create a class wrapping a new Min operation. + * * @param scope current scope * @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 Min} output and operands * @return a new instance of ReduceMin */ - @Endpoint(describeByClass = true) - public static ReduceMin create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReduceMin create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Min", scope.makeOpName("ReduceMin")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +78,51 @@ public static ReduceMin create(Scope scope, Operand inpu } } } - return new ReduceMin(opBuilder.build()); + return new ReduceMin<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Min"; - - private Output output; - - private ReduceMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceMin} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceProd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceProd.java index da78a30db62..3d7b22863b7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceProd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceProd.java @@ -30,48 +30,44 @@ /** * Computes the product 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 data type for {@code output} output */ @Operator public final class ReduceProd extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceProd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Prod"; + + private Output output; + + private ReduceProd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceProd operation. - * + * Factory method to create a class wrapping a new Prod operation. + * * @param scope current scope * @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 Prod} output and operands * @return a new instance of ReduceProd */ - @Endpoint(describeByClass = true) - public static ReduceProd create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReduceProd create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Prod", scope.makeOpName("ReduceProd")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +79,51 @@ public static ReduceProd create(Scope scope, Operand inp } } } - return new ReduceProd(opBuilder.build()); + return new ReduceProd<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Prod"; - - private Output output; - - private ReduceProd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceProd} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceSum.java index c06b2998a67..4928188d4cd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceSum.java @@ -30,48 +30,44 @@ /** * Computes the sum 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 data type for {@code output} output */ @Operator public final class ReduceSum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReduceSum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Sum"; + + private Output output; + + private ReduceSum(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReduceSum operation. - * + * Factory method to create a class wrapping a new Sum operation. + * * @param scope current scope * @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 Sum} output and operands * @return a new instance of ReduceSum */ - @Endpoint(describeByClass = true) - public static ReduceSum create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReduceSum create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Sum", scope.makeOpName("ReduceSum")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +79,51 @@ public static ReduceSum create(Scope scope, Operand inpu } } } - return new ReduceSum(opBuilder.build()); + return new ReduceSum<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sum"; - - private Output output; - - private ReduceSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReduceSum} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefEnter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefEnter.java index a31b538e594..7f399c80d94 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefEnter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefEnter.java @@ -24,60 +24,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates or finds a child frame, and makes `data` available to the child frame. - *

- * The unique `frame_name` is used by the `Executor` to identify frames. If - * `is_constant` is true, `output` is a constant in the child frame; otherwise - * it may be changed in the child frame. At most `parallel_iterations` iterations + * Creates or finds a child frame, and makes {@code data} available to the child frame. + * The unique {@code frame_name} is used by the {@code Executor} to identify frames. If + * {@code is_constant} is true, {@code output} is a constant in the child frame; otherwise + * it may be changed in the child frame. At most {@code parallel_iterations} iterations * are run in parallel in the child frame. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class RefEnter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.RefEnter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param isConstant If true, the output is constant within the child frame. - */ - public Options isConstant(Boolean isConstant) { - this.isConstant = isConstant; - return this; - } - - /** - * @param parallelIterations The number of iterations allowed to run in parallel. - */ - public Options parallelIterations(Long parallelIterations) { - this.parallelIterations = parallelIterations; - return this; - } - - private Boolean isConstant; - private Long parallelIterations; - - private Options() { - } + public static final String OP_NAME = "RefEnter"; + + private Output output; + + private RefEnter(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RefEnter operation. - * + * * @param scope current scope * @param data The tensor to be made available to the child frame. * @param frameName The name of the child frame. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RefEnter} output and operands * @return a new instance of RefEnter */ - @Endpoint(describeByClass = true) - public static RefEnter create(Scope scope, Operand data, String frameName, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RefEnter create(Scope scope, Operand data, String frameName, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RefEnter", scope.makeOpName("RefEnter")); opBuilder.addInput(data.asOutput()); opBuilder = scope.apply(opBuilder); @@ -92,43 +78,74 @@ public static RefEnter create(Scope scope, Operand data, } } } - return new RefEnter(opBuilder.build()); + return new RefEnter<>(opBuilder.build()); } - + /** + * Sets the isConstant option. + * * @param isConstant If true, the output is constant within the child frame. + * @return this Options instance. */ public static Options isConstant(Boolean isConstant) { return new Options().isConstant(isConstant); } - + /** + * Sets the parallelIterations option. + * * @param parallelIterations The number of iterations allowed to run in parallel. + * @return this Options instance. */ public static Options parallelIterations(Long parallelIterations) { return new Options().parallelIterations(parallelIterations); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefEnter"; - - private Output output; - - private RefEnter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.RefEnter} + */ + public static class Options { + private Boolean isConstant; + + private Long parallelIterations; + + private Options() { + } + + /** + * Sets the isConstant option. + * + * @param isConstant If true, the output is constant within the child frame. + * @return this Options instance. + */ + public Options isConstant(Boolean isConstant) { + this.isConstant = isConstant; + return this; + } + + /** + * Sets the parallelIterations option. + * + * @param parallelIterations The number of iterations allowed to run in parallel. + * @return this Options instance. + */ + public Options parallelIterations(Long parallelIterations) { + this.parallelIterations = parallelIterations; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefExit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefExit.java index ce2ac9a8264..82e201ae0d9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefExit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefExit.java @@ -24,53 +24,57 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Exits the current frame to its parent frame. - *

- * Exit makes its input `data` available to the parent frame. - * - * @param data type for {@code output()} output + * Exit makes its input {@code data} available to the parent frame. + * + * @param data type for {@code output} output */ public final class RefExit extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RefExit"; + + private Output output; + + private RefExit(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefExit operation. - * + * * @param scope current scope * @param data The tensor to be made available to the parent frame. + * @param data type for {@code RefExit} output and operands * @return a new instance of RefExit */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RefExit create(Scope scope, Operand data) { OperationBuilder opBuilder = scope.env().opBuilder("RefExit", scope.makeOpName("RefExit")); opBuilder.addInput(data.asOutput()); opBuilder = scope.apply(opBuilder); - return new RefExit(opBuilder.build()); + return new RefExit<>(opBuilder.build()); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefExit"; - - private Output output; - - private RefExit(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefIdentity.java index 12e896fdfb5..35360fe8d89 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefIdentity.java @@ -24,50 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Return the same ref tensor as the input ref tensor. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class RefIdentity extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RefIdentity"; + + private Output output; + + private RefIdentity(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefIdentity operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code RefIdentity} output and operands * @return a new instance of RefIdentity */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RefIdentity create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("RefIdentity", scope.makeOpName("RefIdentity")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new RefIdentity(opBuilder.build()); + return new RefIdentity<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefIdentity"; - - private Output output; - - private RefIdentity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefMerge.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefMerge.java index c19e662b607..5e671132995 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefMerge.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefMerge.java @@ -25,62 +25,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** - * Forwards the value of an available tensor from `inputs` to `output`. - *

- * `Merge` waits for at least one of the tensors in `inputs` to become available. - * It is usually combined with `Switch` to implement branching. - *

- * `Merge` forwards the first tensor for become available to `output`, and sets - * `value_index` to its index in `inputs`. - * - * @param data type for {@code output()} output + * Forwards the value of an available tensor from {@code inputs} to {@code output}. + * {@code Merge} waits for at least one of the tensors in {@code inputs} to become available. + * It is usually combined with {@code Switch} to implement branching. + *

{@code Merge} forwards the first tensor for become available to {@code output}, and sets + * {@code value_index} to its index in {@code inputs}. + * + * @param data type for {@code output} output */ public final class RefMerge extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RefMerge"; + + private Output output; + + private Output valueIndex; + + private RefMerge(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + valueIndex = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefMerge operation. - * + * * @param scope current scope * @param inputs The input tensors, exactly one of which will become available. + * @param data type for {@code RefMerge} output and operands * @return a new instance of RefMerge */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RefMerge create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("RefMerge", scope.makeOpName("RefMerge")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); - return new RefMerge(opBuilder.build()); + return new RefMerge<>(opBuilder.build()); } - + /** + * Gets output. * Will be set to the available input tensor. + * @return output. */ public Output output() { return output; } - + /** - * The index of the chosen input tensor in `inputs`. + * Gets valueIndex. + * The index of the chosen input tensor in {@code inputs}. + * @return valueIndex. */ public Output valueIndex() { return valueIndex; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefMerge"; - - private Output output; - private Output valueIndex; - - private RefMerge(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - valueIndex = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefNextIteration.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefNextIteration.java index f3f6e374590..76bb5185e08 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefNextIteration.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefNextIteration.java @@ -29,47 +29,53 @@ /** * Makes its input available to the next iteration. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class RefNextIteration extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RefNextIteration"; + + private Output output; + + private RefNextIteration(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefNextIteration operation. - * + * * @param scope current scope * @param data The tensor to be made available to the next iteration. + * @param data type for {@code RefNextIteration} output and operands * @return a new instance of RefNextIteration */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RefNextIteration create(Scope scope, Operand data) { OperationBuilder opBuilder = scope.env().opBuilder("RefNextIteration", scope.makeOpName("RefNextIteration")); opBuilder.addInput(data.asOutput()); opBuilder = scope.apply(opBuilder); - return new RefNextIteration(opBuilder.build()); + return new RefNextIteration<>(opBuilder.build()); } - + /** - * The same tensor as `data`. + * Gets output. + * The same tensor as {@code data}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefNextIteration"; - - private Output output; - - private RefNextIteration(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSelect.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSelect.java index e334412a13a..a030084acaa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSelect.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSelect.java @@ -30,50 +30,57 @@ import org.tensorflow.types.family.TType; /** - * Forwards the `index`th element of `inputs` to `output`. - * - * @param data type for {@code output()} output + * Forwards the {@code index}th element of {@code inputs} to {@code output}. + * + * @param data type for {@code output} output */ @Operator public final class RefSelect extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RefSelect"; + + private Output output; + + private RefSelect(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefSelect operation. - * + * * @param scope current scope * @param index A scalar that determines the input that gets selected. - * @param inputs A list of ref tensors, one of which will be forwarded to `output`. + * @param inputs A list of ref tensors, one of which will be forwarded to {@code output}. + * @param data type for {@code RefSelect} output and operands * @return a new instance of RefSelect */ - @Endpoint(describeByClass = true) - public static RefSelect create(Scope scope, Operand index, Iterable> inputs) { + @Endpoint( + describeByClass = true + ) + public static RefSelect create(Scope scope, Operand index, + Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("RefSelect", scope.makeOpName("RefSelect")); opBuilder.addInput(index.asOutput()); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); - return new RefSelect(opBuilder.build()); + return new RefSelect<>(opBuilder.build()); } - + /** + * Gets output. * The forwarded tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefSelect"; - - private Output output; - - private RefSelect(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSwitch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSwitch.java index 08a8f1ee53c..a94d172fdd6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSwitch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RefSwitch.java @@ -29,59 +29,67 @@ import org.tensorflow.types.family.TType; /** - * Forwards the ref tensor `data` to the output port determined by `pred`. - *

- * If `pred` is true, the `data` input is forwarded to `output_true`. Otherwise, - * the data goes to `output_false`. - *

- * See also `Switch` and `Merge`. - * - * @param data type for {@code outputFalse()} output + * Forwards the ref tensor {@code data} to the output port determined by {@code pred}. + * If {@code pred} is true, the {@code data} input is forwarded to {@code output_true}. Otherwise, + * the data goes to {@code output_false}. + *

See also {@code Switch} and {@code Merge}. + * + * @param data type for {@code output_false} output */ @Operator public final class RefSwitch extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RefSwitch"; + + private Output outputFalse; + + private Output outputTrue; + + private RefSwitch(Operation operation) { + super(operation); + int outputIdx = 0; + outputFalse = operation.output(outputIdx++); + outputTrue = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RefSwitch operation. - * + * * @param scope current scope * @param data The ref tensor to be forwarded to the appropriate output. * @param pred A scalar that specifies which output port will receive data. + * @param data type for {@code RefSwitch} output and operands * @return a new instance of RefSwitch */ - @Endpoint(describeByClass = true) - public static RefSwitch create(Scope scope, Operand data, Operand pred) { + @Endpoint( + describeByClass = true + ) + public static RefSwitch create(Scope scope, Operand data, + Operand pred) { OperationBuilder opBuilder = scope.env().opBuilder("RefSwitch", scope.makeOpName("RefSwitch")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(pred.asOutput()); opBuilder = scope.apply(opBuilder); - return new RefSwitch(opBuilder.build()); + return new RefSwitch<>(opBuilder.build()); } - + /** - * If `pred` is false, data will be forwarded to this output. + * Gets outputFalse. + * If {@code pred} is false, data will be forwarded to this output. + * @return outputFalse. */ public Output outputFalse() { return outputFalse; } - + /** - * If `pred` is true, data will be forwarded to this output. + * Gets outputTrue. + * If {@code pred} is true, data will be forwarded to this output. + * @return outputTrue. */ public Output outputTrue() { return outputTrue; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RefSwitch"; - - private Output outputFalse; - private Output outputTrue; - - private RefSwitch(Operation operation) { - super(operation); - int outputIdx = 0; - outputFalse = operation.output(outputIdx++); - outputTrue = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteFusedGraphExecute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteFusedGraphExecute.java index b0dcdfc5398..fda684ab296 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteFusedGraphExecute.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteFusedGraphExecute.java @@ -33,7 +33,6 @@ /** * Execute a sub graph on a remote processor. - *

* The graph specifications(such as graph itself, input tensors and output names) * are stored as a serialized protocol buffer of RemoteFusedGraphExecuteInfo * as serialized_remote_fused_graph_execute_info. @@ -44,19 +43,37 @@ */ @Operator public final class RemoteFusedGraphExecute extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RemoteFusedGraphExecute"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private RemoteFusedGraphExecute(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + /** * Factory method to create a class wrapping a new RemoteFusedGraphExecute operation. - * + * * @param scope current scope * @param inputs Arbitrary number of tensors with arbitrary data types - * @param Toutputs + * @param Toutputs the value of the Toutputs property * @param serializedRemoteFusedGraphExecuteInfo Serialized protocol buffer * of RemoteFusedGraphExecuteInfo which contains graph specifications. * @return a new instance of RemoteFusedGraphExecute */ - @Endpoint(describeByClass = true) - public static RemoteFusedGraphExecute create(Scope scope, Iterable> inputs, List> Toutputs, String serializedRemoteFusedGraphExecuteInfo) { + @Endpoint( + describeByClass = true + ) + public static RemoteFusedGraphExecute create(Scope scope, Iterable> inputs, + List> Toutputs, String serializedRemoteFusedGraphExecuteInfo) { OperationBuilder opBuilder = scope.env().opBuilder("RemoteFusedGraphExecute", scope.makeOpName("RemoteFusedGraphExecute")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); @@ -64,30 +81,19 @@ public static RemoteFusedGraphExecute create(Scope scope, Iterable> i opBuilder.setAttr("serialized_remote_fused_graph_execute_info", serializedRemoteFusedGraphExecuteInfo); return new RemoteFusedGraphExecute(opBuilder.build()); } - + /** + * Gets outputs. * Arbitrary number of tensors with arbitrary data types + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RemoteFusedGraphExecute"; - - private List> outputs; - - private RemoteFusedGraphExecute(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java index 1da37dd550d..f59c0efb442 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reshape.java @@ -30,35 +30,30 @@ /** * Reshapes a tensor. - *

- * Given `tensor`, this operation returns a tensor that has the same values - * as `tensor` with shape `shape`. - *

- * If one component of 1-D tensor `shape` is the special value -1, the size of that + * Given {@code tensor}, this operation returns a tensor that has the same values + * as {@code tensor} with shape {@code shape}. + *

If one component of 1-D tensor {@code shape} is the special value -1, the size of that * dimension is computed so that the total size remains constant. In particular, a - * `shape` of `[-1]` flattens into 1-D. At most one component of `shape` may be + * {@code shape} of {@code [-1]} flattens into 1-D. At most one component of {@code shape} may be * unknown. - *

- * The `shape` must be 1-D and the operation returns a tensor with shape - * `shape` filled with the values of `tensor`. In this case, the number of elements - * implied by `shape` must be the same as the number of elements in `tensor`. - *

- * It is an error if `shape` is not 1-D. - *

- * For example: - *

{@code
+ * 

The {@code shape} must be 1-D and the operation returns a tensor with shape + * {@code shape} filled with the values of {@code tensor}. In this case, the number of elements + * implied by {@code shape} must be the same as the number of elements in {@code tensor}. + *

It is an error if {@code shape} is not 1-D. + *

For example: + *

  * # tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9]
  * # tensor 't' has shape [9]
- * reshape(t, [3, 3]) ==> [[1, 2, 3],
+ * reshape(t, [3, 3]) ==> [[1, 2, 3],
  *                         [4, 5, 6],
  *                         [7, 8, 9]]
- * 
+ *
  * # tensor 't' is [[[1, 1], [2, 2]],
  * #                [[3, 3], [4, 4]]]
  * # tensor 't' has shape [2, 2, 2]
- * reshape(t, [2, 4]) ==> [[1, 1, 2, 2],
+ * reshape(t, [2, 4]) ==> [[1, 1, 2, 2],
  *                         [3, 3, 4, 4]]
- * 
+ *
  * # tensor 't' is [[[1, 1, 1],
  * #                 [2, 2, 2]],
  * #                [[3, 3, 3],
@@ -67,71 +62,78 @@
  * #                 [6, 6, 6]]]
  * # tensor 't' has shape [3, 2, 3]
  * # pass '[-1]' to flatten 't'
- * reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
- * 
+ * reshape(t, [-1]) ==> [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6]
+ *
  * # -1 can also be used to infer the shape
- * 
+ *
  * # -1 is inferred to be 9:
- * reshape(t, [2, -1]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
+ * reshape(t, [2, -1]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
  *                          [4, 4, 4, 5, 5, 5, 6, 6, 6]]
  * # -1 is inferred to be 2:
- * reshape(t, [-1, 9]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
+ * reshape(t, [-1, 9]) ==> [[1, 1, 1, 2, 2, 2, 3, 3, 3],
  *                          [4, 4, 4, 5, 5, 5, 6, 6, 6]]
  * # -1 is inferred to be 3:
- * reshape(t, [ 2, -1, 3]) ==> [[[1, 1, 1],
+ * reshape(t, [ 2, -1, 3]) ==> [[[1, 1, 1],
  *                               [2, 2, 2],
  *                               [3, 3, 3]],
  *                              [[4, 4, 4],
  *                               [5, 5, 5],
  *                               [6, 6, 6]]]
- * 
+ *
  * # tensor 't' is [7]
  * # shape `[]` reshapes to a scalar
- * reshape(t, []) ==> 7
- * }
- * - * - * @param data type for {@code output()} output + * reshape(t, []) ==> 7 + *
+ * + * @param data type for {@code output} output */ @Operator public final class Reshape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Reshape"; + + private Output output; + + private Reshape(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Reshape operation. - * + * * @param scope current scope - * @param tensor + * @param tensor the tensor value * @param shape Defines the shape of the output tensor. + * @param data type for {@code Reshape} output and operands * @return a new instance of Reshape */ - @Endpoint(describeByClass = true) - public static Reshape create(Scope scope, Operand tensor, Operand shape) { + @Endpoint( + describeByClass = true + ) + public static Reshape create(Scope scope, Operand tensor, + Operand shape) { OperationBuilder opBuilder = scope.env().opBuilder("Reshape", scope.makeOpName("Reshape")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); - return new Reshape(opBuilder.build()); + return new Reshape<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Reshape"; - - private Output output; - - private Reshape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceCountUpTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceCountUpTo.java index cbfb7ea15d2..4da07c2c8f5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceCountUpTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceCountUpTo.java @@ -27,56 +27,64 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Increments variable pointed to by 'resource' until it reaches 'limit'. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class ResourceCountUpTo extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceCountUpTo"; + + private Output output; + + private ResourceCountUpTo(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ResourceCountUpTo operation. - * + * * @param scope current scope - * @param resource Should be from a scalar `Variable` node. + * @param resource Should be from a scalar {@code Variable} node. * @param limit If incrementing ref would bring it above limit, instead generates an * 'OutOfRange' error. - * @param T + * @param T the value of the T property + * @param data type for {@code ResourceCountUpTo} output and operands * @return a new instance of ResourceCountUpTo */ - @Endpoint(describeByClass = true) - public static ResourceCountUpTo create(Scope scope, Operand resource, Long limit, Class T) { + @Endpoint( + describeByClass = true + ) + public static ResourceCountUpTo create(Scope scope, + Operand resource, Long limit, Class T) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceCountUpTo", scope.makeOpName("ResourceCountUpTo")); opBuilder.addInput(resource.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("limit", limit); opBuilder.setAttr("T", Operands.toDataType(T)); - return new ResourceCountUpTo(opBuilder.build()); + return new ResourceCountUpTo<>(opBuilder.build()); } - + /** + * Gets output. * A copy of the input before increment. If nothing else modifies the * input, the values produced will all be distinct. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceCountUpTo"; - - private Output output; - - private ResourceCountUpTo(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGather.java index c8906164dd7..274b8c0216b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGather.java @@ -30,67 +30,54 @@ import org.tensorflow.types.family.TType; /** - * Gather slices from the variable pointed to by `resource` according to `indices`. - *

- * `indices` must be an integer tensor of any dimension (usually 0-D or 1-D). - * Produces an output tensor with shape `indices.shape + params.shape[1:]` where: - *

{@code
+ * Gather slices from the variable pointed to by {@code resource} according to {@code indices}.
+ * {@code indices} must be an integer tensor of any dimension (usually 0-D or 1-D).
+ * Produces an output tensor with shape {@code indices.shape + params.shape[1:]} where:
+ * 
  *     # Scalar indices
  *     output[:, ..., :] = params[indices, :, ... :]
- * 
+ *
  *     # Vector indices
  *     output[i, :, ..., :] = params[indices[i], :, ... :]
- * 
+ *
  *     # Higher rank indices
  *     output[i, ..., j, :, ... :] = params[indices[i, ..., j], :, ..., :]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ @Operator public final class ResourceGather extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceGather} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param batchDims - */ - public Options batchDims(Long batchDims) { - this.batchDims = batchDims; - return this; - } - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Long batchDims; - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "ResourceGather"; + + private Output output; + + private ResourceGather(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResourceGather operation. - * + * * @param scope current scope - * @param resource - * @param indices - * @param dtype - * @param options carries optional attributes values + * @param resource the resource value + * @param indices the indices value + * @param dtype the value of the dtype property + * @param options carries optional attribute values + * @param data type for {@code ResourceGather} output and operands * @return a new instance of ResourceGather */ - @Endpoint(describeByClass = true) - public static ResourceGather create(Scope scope, Operand resource, Operand indices, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceGather create(Scope scope, + Operand resource, Operand indices, Class dtype, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceGather", scope.makeOpName("ResourceGather")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -106,42 +93,74 @@ public static ResourceGather create(Scope scope, Operand } } } - return new ResourceGather(opBuilder.build()); + return new ResourceGather<>(opBuilder.build()); } - + /** - * @param batchDims + * Sets the batchDims option. + * + * @param batchDims the batchDims option + * @return this Options instance. */ public static Options batchDims(Long batchDims) { return new Options().batchDims(batchDims); } - + /** - * @param validateIndices + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceGather"; - - private Output output; - - private ResourceGather(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ResourceGather} + */ + public static class Options { + private Long batchDims; + + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the batchDims option. + * + * @param batchDims the batchDims option + * @return this Options instance. + */ + public Options batchDims(Long batchDims) { + this.batchDims = batchDims; + return this; + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = validateIndices; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGatherNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGatherNd.java index 5cadc84d016..1669af384fa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGatherNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceGatherNd.java @@ -30,49 +30,59 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code output()} output + * The ResourceGatherNd operation + * + * @param data type for {@code output} output */ @Operator public final class ResourceGatherNd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceGatherNd"; + + private Output output; + + private ResourceGatherNd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ResourceGatherNd operation. - * + * * @param scope current scope - * @param resource - * @param indices - * @param dtype + * @param resource the resource value + * @param indices the indices value + * @param dtype the value of the dtype property + * @param data type for {@code ResourceGatherNd} output and operands * @return a new instance of ResourceGatherNd */ - @Endpoint(describeByClass = true) - public static ResourceGatherNd create(Scope scope, Operand resource, Operand indices, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static ResourceGatherNd create(Scope scope, + Operand resource, Operand indices, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceGatherNd", scope.makeOpName("ResourceGatherNd")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new ResourceGatherNd(opBuilder.build()); + return new ResourceGatherNd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceGatherNd"; - - private Output output; - - private ResourceGatherNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterAdd.java index 935000e7ec6..5b2c431bc55 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterAdd.java @@ -28,42 +28,50 @@ import org.tensorflow.types.family.TType; /** - * Adds sparse updates to the variable referenced by `resource`. - *

+ * Adds sparse updates to the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] += updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] += updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] += updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] += updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]
+ * 
+ *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions add. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ @Operator public final class ResourceScatterAdd extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterAdd"; + + private ResourceScatterAdd(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ResourceScatterAdd operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to add to {@code ref}. * @return a new instance of ResourceScatterAdd */ - @Endpoint(describeByClass = true) - public static ResourceScatterAdd create(Scope scope, Operand resource, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterAdd create(Scope scope, Operand resource, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterAdd", scope.makeOpName("ResourceScatterAdd")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -71,11 +79,4 @@ public static ResourceScatterAdd create(Scope scope, Operand resource, Operan opBuilder = scope.apply(opBuilder); return new ResourceScatterAdd(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterAdd"; - - private ResourceScatterAdd(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterDiv.java index 8a21a2706a3..9d6115a34d0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterDiv.java @@ -28,42 +28,50 @@ import org.tensorflow.types.family.TType; /** - * Divides sparse updates into the variable referenced by `resource`. - *

+ * Divides sparse updates into the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] /= updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] /= updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] /= updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] /= updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...]
+ * 
+ *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions multiply. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ @Operator public final class ResourceScatterDiv extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterDiv"; + + private ResourceScatterDiv(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ResourceScatterDiv operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to add to {@code ref}. * @return a new instance of ResourceScatterDiv */ - @Endpoint(describeByClass = true) - public static ResourceScatterDiv create(Scope scope, Operand resource, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterDiv create(Scope scope, Operand resource, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterDiv", scope.makeOpName("ResourceScatterDiv")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -71,11 +79,4 @@ public static ResourceScatterDiv create(Scope scope, Operand resource, Operan opBuilder = scope.apply(opBuilder); return new ResourceScatterDiv(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterDiv"; - - private ResourceScatterDiv(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMax.java index 7e6ca9e3302..8b1912ee994 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMax.java @@ -28,42 +28,50 @@ import org.tensorflow.types.family.TType; /** - * Reduces sparse updates into the variable referenced by `resource` using the `max` operation. - *

+ * Reduces sparse updates into the variable referenced by {@code resource} using the {@code max} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = max(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] = max(ref[indices, ...], updates[...])
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...])
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+ * 
+ *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions are combined. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ @Operator public final class ResourceScatterMax extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterMax"; + + private ResourceScatterMax(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ResourceScatterMax operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to add to {@code ref}. * @return a new instance of ResourceScatterMax */ - @Endpoint(describeByClass = true) - public static ResourceScatterMax create(Scope scope, Operand resource, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterMax create(Scope scope, Operand resource, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterMax", scope.makeOpName("ResourceScatterMax")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -71,11 +79,4 @@ public static ResourceScatterMax create(Scope scope, Operand resource, Operan opBuilder = scope.apply(opBuilder); return new ResourceScatterMax(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterMax"; - - private ResourceScatterMax(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMin.java index 9fa3cf76ca8..6e51c6fa2a5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMin.java @@ -28,42 +28,50 @@ import org.tensorflow.types.family.TType; /** - * Reduces sparse updates into the variable referenced by `resource` using the `min` operation. - *

+ * Reduces sparse updates into the variable referenced by {@code resource} using the {@code min} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = min(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] = min(ref[indices, ...], updates[...])
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...])
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+ * 
+ *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions are combined. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ @Operator public final class ResourceScatterMin extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterMin"; + + private ResourceScatterMin(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ResourceScatterMin operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to add to {@code ref}. * @return a new instance of ResourceScatterMin */ - @Endpoint(describeByClass = true) - public static ResourceScatterMin create(Scope scope, Operand resource, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterMin create(Scope scope, Operand resource, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterMin", scope.makeOpName("ResourceScatterMin")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -71,11 +79,4 @@ public static ResourceScatterMin create(Scope scope, Operand resource, Operan opBuilder = scope.apply(opBuilder); return new ResourceScatterMin(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterMin"; - - private ResourceScatterMin(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMul.java index 1133e6f2f82..8891aaf555a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterMul.java @@ -28,42 +28,50 @@ import org.tensorflow.types.family.TType; /** - * Multiplies sparse updates into the variable referenced by `resource`. - *

+ * Multiplies sparse updates into the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] *= updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] *= updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] *= updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] *= updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...]
+ * 
+ *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions multiply. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ @Operator public final class ResourceScatterMul extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterMul"; + + private ResourceScatterMul(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ResourceScatterMul operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to add to {@code ref}. * @return a new instance of ResourceScatterMul */ - @Endpoint(describeByClass = true) - public static ResourceScatterMul create(Scope scope, Operand resource, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterMul create(Scope scope, Operand resource, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterMul", scope.makeOpName("ResourceScatterMul")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -71,11 +79,4 @@ public static ResourceScatterMul create(Scope scope, Operand resource, Operan opBuilder = scope.apply(opBuilder); return new ResourceScatterMul(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterMul"; - - private ResourceScatterMul(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdAdd.java index 5a020f072df..f846f0105df 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdAdd.java @@ -29,75 +29,61 @@ /** * Applies sparse addition to individual values or slices in a Variable. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * {@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}.
+ * 

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
- * }
- * For example, say we want to add 4 scattered elements to a rank-1 tensor to + *
+ *

For example, say we want to add 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that addition would look like this: - *

{@code
+ * 
  * ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)
  * indices = tf.constant([[4], [3], [1], [7]])
  * updates = tf.constant([9, 10, 11, 12])
  * add = tf.scatter_nd_add(ref, indices, updates)
  * with tf.Session() as sess:
  *   print sess.run(add)
- * }
- * The resulting update to ref would look like this: - *

- * [1, 13, 3, 14, 14, 6, 7, 20] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, 13, 3, 14, 14, 6, 7, 20]
+ * 
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. */ @Operator public final class ResourceScatterNdAdd extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking An optional bool. Defaults to True. If True, the assignment will - * be protected by a lock; otherwise the behavior is undefined, - * but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceScatterNdAdd"; + + private ResourceScatterNdAdd(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceScatterNdAdd operation. - * + * * @param scope current scope * @param ref A resource handle. Must be from a VarHandleOp. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of * values to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdAdd */ - @Endpoint(describeByClass = true) - public static ResourceScatterNdAdd create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdAdd create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdAdd", scope.makeOpName("ResourceScatterNdAdd")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -112,20 +98,39 @@ public static ResourceScatterNdAdd create(Scope scope, Operand ref, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdMax create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdMax", scope.makeOpName("ResourceScatterNdMax")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -81,20 +72,39 @@ public static ResourceScatterNdMax create(Scope scope, Operand ref, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdMin create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdMin", scope.makeOpName("ResourceScatterNdMin")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -81,20 +72,39 @@ public static ResourceScatterNdMin create(Scope scope, Operand ref, Operand - * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * {@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}.
+ * 

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
- * }
- * For example, say we want to subtract 4 scattered elements from a rank-1 tensor + *
+ *

For example, say we want to subtract 4 scattered elements from a rank-1 tensor * with 8 elements. In Python, that subtraction would look like this: - *

{@code
+ * 
  * ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True)
  * indices = tf.constant([[4], [3], [1], [7]])
  * updates = tf.constant([9, 10, 11, 12])
  * sub = tf.scatter_nd_sub(ref, indices, updates)
  * with tf.Session() as sess:
  *   print sess.run(sub)
- * }
- * The resulting update to ref would look like this: - *

- * [1, -9, 3, -6, -4, 6, 7, -4] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, -9, 3, -6, -4, 6, 7, -4]
+ * 
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. */ @Operator public final class ResourceScatterNdSub extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdSub} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking An optional bool. Defaults to True. If True, the assignment will - * be protected by a lock; otherwise the behavior is undefined, - * but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceScatterNdSub"; + + private ResourceScatterNdSub(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceScatterNdSub operation. - * + * * @param scope current scope * @param ref A resource handle. Must be from a VarHandleOp. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of * values to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdSub */ - @Endpoint(describeByClass = true) - public static ResourceScatterNdSub create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdSub create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdSub", scope.makeOpName("ResourceScatterNdSub")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -112,20 +98,39 @@ public static ResourceScatterNdSub create(Scope scope, Operand ref, Operand - * variable according to `indices`. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * Applies sparse {@code updates} to individual values or slices within a given
+ * variable according to {@code indices}.
+ * 

{@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].
- * }
- * For example, say we want to update 4 scattered elements to a rank-1 tensor to + *
+ *

For example, say we want to update 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that update would look like this: - *

{@code
+ * 
  *     ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
  *     indices = tf.constant([[4], [3], [1] ,[7]])
  *     updates = tf.constant([9, 10, 11, 12])
  *     update = tf.scatter_nd_update(ref, indices, updates)
  *     with tf.Session() as sess:
  *       print sess.run(update)
- * }
- * The resulting update to ref would look like this: - *

- * [1, 11, 3, 10, 9, 6, 7, 12] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, 11, 3, 10, 9, 6, 7, 12]
+ * 
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. */ @Operator public final class ResourceScatterNdUpdate extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdUpdate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking An optional bool. Defaults to True. If True, the assignment will - * be protected by a lock; otherwise the behavior is undefined, - * but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceScatterNdUpdate"; + + private ResourceScatterNdUpdate(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceScatterNdUpdate operation. - * + * * @param scope current scope * @param ref A resource handle. Must be from a VarHandleOp. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of updated * values to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ResourceScatterNdUpdate */ - @Endpoint(describeByClass = true) - public static ResourceScatterNdUpdate create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterNdUpdate create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterNdUpdate", scope.makeOpName("ResourceScatterNdUpdate")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -114,20 +99,39 @@ public static ResourceScatterNdUpdate create(Scope scope, Operand ref, Operan } return new ResourceScatterNdUpdate(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking An optional bool. Defaults to True. If True, the assignment will * be protected by a lock; otherwise the behavior is undefined, * but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterNdUpdate"; - - private ResourceScatterNdUpdate(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ResourceScatterNdUpdate} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterSub.java index 35d94ad5a52..58bffab6d01 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterSub.java @@ -28,42 +28,50 @@ import org.tensorflow.types.family.TType; /** - * Subtracts sparse updates from the variable referenced by `resource`. - *

+ * Subtracts sparse updates from the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] -= updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] -= updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...] - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

+ * # Scalar indices
+ * ref[indices, ...] -= updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] -= updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]
+ * 
+ *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions add. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
*/ @Operator public final class ResourceScatterSub extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterSub"; + + private ResourceScatterSub(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ResourceScatterSub operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to add to {@code ref}. * @return a new instance of ResourceScatterSub */ - @Endpoint(describeByClass = true) - public static ResourceScatterSub create(Scope scope, Operand resource, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterSub create(Scope scope, Operand resource, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterSub", scope.makeOpName("ResourceScatterSub")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -71,11 +79,4 @@ public static ResourceScatterSub create(Scope scope, Operand resource, Operan opBuilder = scope.apply(opBuilder); return new ResourceScatterSub(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterSub"; - - private ResourceScatterSub(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterUpdate.java index df04dff7608..fe524c62ed3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterUpdate.java @@ -28,33 +28,44 @@ import org.tensorflow.types.family.TType; /** - * Assigns sparse updates to the variable referenced by `resource`. - *

+ * Assigns sparse updates to the variable referenced by {@code resource}. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = updates[i, ..., j, ...] + *

+ * # Scalar indices
+ * ref[indices, ...] = updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = updates[i, ..., j, ...]
+ * 
*/ @Operator public final class ResourceScatterUpdate extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceScatterUpdate"; + + private ResourceScatterUpdate(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ResourceScatterUpdate operation. - * + * * @param scope current scope - * @param resource Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. + * @param resource Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to add to {@code ref}. * @return a new instance of ResourceScatterUpdate */ - @Endpoint(describeByClass = true) - public static ResourceScatterUpdate create(Scope scope, Operand resource, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static ResourceScatterUpdate create(Scope scope, Operand resource, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceScatterUpdate", scope.makeOpName("ResourceScatterUpdate")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -62,11 +73,4 @@ public static ResourceScatterUpdate create(Scope scope, Operand resource, Ope opBuilder = scope.apply(opBuilder); return new ResourceScatterUpdate(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceScatterUpdate"; - - private ResourceScatterUpdate(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceStridedSliceAssign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceStridedSliceAssign.java index d0e6fc06b2f..3751916d6e3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceStridedSliceAssign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceStridedSliceAssign.java @@ -28,87 +28,43 @@ import org.tensorflow.types.family.TType; /** - * Assign `value` to the sliced l-value reference of `ref`. - *

- * The values of `value` are assigned to the positions in the variable - * `ref` that are selected by the slice parameters. The slice parameters - * `begin, `end`, `strides`, etc. work exactly as in `StridedSlice`. - *

- * NOTE this op currently does not support broadcasting and so `value`'s - * shape must be exactly the shape produced by the slice of `ref`. + * Assign {@code value} to the sliced l-value reference of {@code ref}. + * The values of {@code value} are assigned to the positions in the variable + * {@code ref} that are selected by the slice parameters. The slice parameters + * {@code begin, }end{@code , }strides{@code , etc. work exactly as in }StridedSlice`. + *

NOTE this op currently does not support broadcasting and so {@code value}'s + * shape must be exactly the shape produced by the slice of {@code ref}. */ @Operator public final class ResourceStridedSliceAssign extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.ResourceStridedSliceAssign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "ResourceStridedSliceAssign"; + + private ResourceStridedSliceAssign(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceStridedSliceAssign operation. - * + * * @param scope current scope - * @param ref - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values + * @param ref the ref value + * @param begin the begin value + * @param end the end value + * @param strides the strides value + * @param value the value value + * @param options carries optional attribute values + * @param data type for {@code ResourceStridedSliceAssign} output and operands * @return a new instance of ResourceStridedSliceAssign */ - @Endpoint(describeByClass = true) - public static ResourceStridedSliceAssign create(Scope scope, Operand ref, Operand begin, Operand end, Operand strides, Operand value, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceStridedSliceAssign create(Scope scope, + Operand ref, Operand begin, Operand end, Operand strides, + Operand value, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceStridedSliceAssign", scope.makeOpName("ResourceStridedSliceAssign")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(begin.asOutput()); @@ -137,46 +93,127 @@ public static ResourceStridedSliceAssign create(Scope scope, } return new ResourceStridedSliceAssign(opBuilder.build()); } - + /** - * @param beginMask + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceStridedSliceAssign"; - - private ResourceStridedSliceAssign(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ResourceStridedSliceAssign} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = shrinkAxisMask; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reverse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reverse.java index 95cc701bae3..c5227f60573 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reverse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Reverse.java @@ -30,20 +30,16 @@ /** * Reverses specific dimensions of a tensor. - *

- * NOTE `tf.reverse` has now changed behavior in preparation for 1.0. - * `tf.reverse_v2` is currently an alias that will be deprecated before TF 1.0. - *

- * Given a `tensor`, and a `int32` tensor `axis` representing the set of - * dimensions of `tensor` to reverse. This operation reverses each dimension - * `i` for which there exists `j` s.t. `axis[j] == i`. - *

- * `tensor` can have up to 8 dimensions. The number of dimensions specified - * in `axis` may be 0 or more entries. If an index is specified more than + * NOTE {@code tf.reverse} has now changed behavior in preparation for 1.0. + * {@code tf.reverse_v2} is currently an alias that will be deprecated before TF 1.0. + *

Given a {@code tensor}, and a {@code int32} tensor {@code axis} representing the set of + * dimensions of {@code tensor} to reverse. This operation reverses each dimension + * {@code i} for which there exists {@code j} s.t. {@code axis[j] == i}. + *

{@code tensor} can have up to 8 dimensions. The number of dimensions specified + * in {@code axis} may be 0 or more entries. If an index is specified more than * once, a InvalidArgument error is raised. - *

- * For example: - *

{@code
+ * 

For example: + *

  * # tensor 't' is [[[[ 0,  1,  2,  3],
  * #                  [ 4,  5,  6,  7],
  * #                  [ 8,  9, 10, 11]],
@@ -51,76 +47,82 @@
  * #                  [16, 17, 18, 19],
  * #                  [20, 21, 22, 23]]]]
  * # tensor 't' shape is [1, 2, 3, 4]
- * 
+ *
  * # 'dims' is [3] or 'dims' is [-1]
- * reverse(t, dims) ==> [[[[ 3,  2,  1,  0],
+ * reverse(t, dims) ==> [[[[ 3,  2,  1,  0],
  *                         [ 7,  6,  5,  4],
  *                         [ 11, 10, 9, 8]],
  *                        [[15, 14, 13, 12],
  *                         [19, 18, 17, 16],
  *                         [23, 22, 21, 20]]]]
- * 
+ *
  * # 'dims' is '[1]' (or 'dims' is '[-3]')
- * reverse(t, dims) ==> [[[[12, 13, 14, 15],
+ * reverse(t, dims) ==> [[[[12, 13, 14, 15],
  *                         [16, 17, 18, 19],
  *                         [20, 21, 22, 23]
  *                        [[ 0,  1,  2,  3],
  *                         [ 4,  5,  6,  7],
  *                         [ 8,  9, 10, 11]]]]
- * 
+ *
  * # 'dims' is '[2]' (or 'dims' is '[-2]')
- * reverse(t, dims) ==> [[[[8, 9, 10, 11],
+ * reverse(t, dims) ==> [[[[8, 9, 10, 11],
  *                         [4, 5, 6, 7],
  *                         [0, 1, 2, 3]]
  *                        [[20, 21, 22, 23],
  *                         [16, 17, 18, 19],
  *                         [12, 13, 14, 15]]]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ @Operator public final class Reverse extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Reverse operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReverseV2"; + + private Output output; + + private Reverse(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReverseV2 operation. + * * @param scope current scope * @param tensor Up to 8-D. * @param axis 1-D. The indices of the dimensions to reverse. Must be in the range - * `[-rank(tensor), rank(tensor))`. + * {@code [-rank(tensor), rank(tensor))}. + * @param data type for {@code ReverseV2} output and operands * @return a new instance of Reverse */ - @Endpoint(describeByClass = true) - public static Reverse create(Scope scope, Operand tensor, Operand axis) { + @Endpoint( + describeByClass = true + ) + public static Reverse create(Scope scope, Operand tensor, + Operand axis) { OperationBuilder opBuilder = scope.env().opBuilder("ReverseV2", scope.makeOpName("Reverse")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(axis.asOutput()); opBuilder = scope.apply(opBuilder); - return new Reverse(opBuilder.build()); + return new Reverse<>(opBuilder.build()); } - + /** - * The same shape as `tensor`. + * Gets output. + * The same shape as {@code tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReverseV2"; - - private Output output; - - private Reverse(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReverseSequence.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReverseSequence.java index 6793713f659..f90bce00b11 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReverseSequence.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReverseSequence.java @@ -30,97 +30,89 @@ /** * Reverses variable length slices. - *

- * This op first slices `input` along the dimension `batch_dim`, and for each - * slice `i`, reverses the first `seq_lengths[i]` elements along - * the dimension `seq_dim`. - *

- * The elements of `seq_lengths` must obey `seq_lengths[i] <= input.dims[seq_dim]`, - * and `seq_lengths` must be a vector of length `input.dims[batch_dim]`. - *

- * The output slice `i` along dimension `batch_dim` is then given by input - * slice `i`, with the first `seq_lengths[i]` slices along dimension - * `seq_dim` reversed. - *

- * For example: - *

{@code
+ * This op first slices {@code input} along the dimension {@code batch_dim}, and for each
+ * slice {@code i}, reverses the first {@code seq_lengths[i]} elements along
+ * the dimension {@code seq_dim}.
+ * 

The elements of {@code seq_lengths} must obey {@code seq_lengths[i] <= input.dims[seq_dim]}, + * and {@code seq_lengths} must be a vector of length {@code input.dims[batch_dim]}. + *

The output slice {@code i} along dimension {@code batch_dim} is then given by input + * slice {@code i}, with the first {@code seq_lengths[i]} slices along dimension + * {@code seq_dim} reversed. + *

For example: + *

  * # Given this:
  * batch_dim = 0
  * seq_dim = 1
  * input.dims = (4, 8, ...)
  * seq_lengths = [7, 2, 3, 5]
- * 
+ *
  * # then slices of input are reversed on seq_dim, but only up to seq_lengths:
  * output[0, 0:7, :, ...] = input[0, 7:0:-1, :, ...]
  * output[1, 0:2, :, ...] = input[1, 2:0:-1, :, ...]
  * output[2, 0:3, :, ...] = input[2, 3:0:-1, :, ...]
  * output[3, 0:5, :, ...] = input[3, 5:0:-1, :, ...]
- * 
+ *
  * # while entries past seq_lens are copied through:
  * output[0, 7:, :, ...] = input[0, 7:, :, ...]
  * output[1, 2:, :, ...] = input[1, 2:, :, ...]
  * output[2, 3:, :, ...] = input[2, 3:, :, ...]
  * output[3, 2:, :, ...] = input[3, 2:, :, ...]
- * }
- * In contrast, if: - *
{@code
+ * 
+ *

In contrast, if: + *

  * # Given this:
  * batch_dim = 2
  * seq_dim = 0
  * input.dims = (8, ?, 4, ...)
  * seq_lengths = [7, 2, 3, 5]
- * 
+ *
  * # then slices of input are reversed on seq_dim, but only up to seq_lengths:
  * output[0:7, :, 0, :, ...] = input[7:0:-1, :, 0, :, ...]
  * output[0:2, :, 1, :, ...] = input[2:0:-1, :, 1, :, ...]
  * output[0:3, :, 2, :, ...] = input[3:0:-1, :, 2, :, ...]
  * output[0:5, :, 3, :, ...] = input[5:0:-1, :, 3, :, ...]
- * 
+ *
  * # while entries past seq_lens are copied through:
  * output[7:, :, 0, :, ...] = input[7:, :, 0, :, ...]
  * output[2:, :, 1, :, ...] = input[2:, :, 1, :, ...]
  * output[3:, :, 2, :, ...] = input[3:, :, 2, :, ...]
  * output[2:, :, 3, :, ...] = input[2:, :, 3, :, ...]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ @Operator public final class ReverseSequence extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ReverseSequence} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param batchDim The dimension along which reversal is performed. - */ - public Options batchDim(Long batchDim) { - this.batchDim = batchDim; - return this; - } - - private Long batchDim; - - private Options() { - } + public static final String OP_NAME = "ReverseSequence"; + + private Output output; + + private ReverseSequence(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ReverseSequence operation. - * + * * @param scope current scope * @param input The input to reverse. - * @param seqLengths 1-D with length `input.dims(batch_dim)` and - * `max(seq_lengths) <= input.dims(seq_dim)` + * @param seqLengths 1-D with length {@code input.dims(batch_dim)} and + * {@code max(seq_lengths) <= input.dims(seq_dim)} * @param seqDim The dimension which is partially reversed. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ReverseSequence} output and operands * @return a new instance of ReverseSequence */ - @Endpoint(describeByClass = true) - public static ReverseSequence create(Scope scope, Operand input, Operand seqLengths, Long seqDim, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReverseSequence create(Scope scope, Operand input, + Operand seqLengths, Long seqDim, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ReverseSequence", scope.makeOpName("ReverseSequence")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(seqLengths.asOutput()); @@ -133,36 +125,51 @@ public static ReverseSequence create(Scope scope, Operand(opBuilder.build()); + return new ReverseSequence<>(opBuilder.build()); } - + /** + * Sets the batchDim option. + * * @param batchDim The dimension along which reversal is performed. + * @return this Options instance. */ public static Options batchDim(Long batchDim) { return new Options().batchDim(batchDim); } - + /** - * The partially reversed input. It has the same shape as `input`. + * Gets output. + * The partially reversed input. It has the same shape as {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReverseSequence"; - - private Output output; - - private ReverseSequence(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ReverseSequence} + */ + public static class Options { + private Long batchDim; + + private Options() { + } + + /** + * Sets the batchDim option. + * + * @param batchDim The dimension along which reversal is performed. + * @return this Options instance. + */ + public Options batchDim(Long batchDim) { + this.batchDim = batchDim; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Roll.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Roll.java index 4151cb41a3e..46c1105525b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Roll.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Roll.java @@ -30,80 +30,84 @@ /** * Rolls the elements of a tensor along an axis. - *

* The elements are shifted positively (towards larger indices) by the offset of - * `shift` along the dimension of `axis`. Negative `shift` values will shift + * {@code shift} along the dimension of {@code axis}. Negative {@code shift} values will shift * elements in the opposite direction. Elements that roll passed the last position * will wrap around to the first and vice versa. Multiple shifts along multiple * axes may be specified. - *

- * For example: - *

{@code
+ * 

For example: + *

  * # 't' is [0, 1, 2, 3, 4]
- * roll(t, shift=2, axis=0) ==> [3, 4, 0, 1, 2]
- * 
+ * roll(t, shift=2, axis=0) ==> [3, 4, 0, 1, 2]
+ *
  * # shifting along multiple dimensions
  * # 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]
- * roll(t, shift=[1, -2], axis=[0, 1]) ==> [[7, 8, 9, 5, 6], [2, 3, 4, 0, 1]]
- * 
+ * roll(t, shift=[1, -2], axis=[0, 1]) ==> [[7, 8, 9, 5, 6], [2, 3, 4, 0, 1]]
+ *
  * # shifting along the same axis multiple times
  * # 't' is [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]
- * roll(t, shift=[2, -3], axis=[1, 1]) ==> [[1, 2, 3, 4, 0], [6, 7, 8, 9, 5]]
- * }
- * - * - * @param data type for {@code output()} output + * roll(t, shift=[2, -3], axis=[1, 1]) ==> [[1, 2, 3, 4, 0], [6, 7, 8, 9, 5]] + *
+ * + * @param data type for {@code output} output */ @Operator public final class Roll extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Roll"; + + private Output output; + + private Roll(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Roll operation. - * + * * @param scope current scope - * @param input - * @param shift Dimension must be 0-D or 1-D. `shift[i]` specifies the number of places by which + * @param input the input value + * @param shift Dimension must be 0-D or 1-D. {@code shift[i]} specifies the number of places by which * elements are shifted positively (towards larger indices) along the dimension - * specified by `axis[i]`. Negative shifts will roll the elements in the opposite + * specified by {@code axis[i]}. Negative shifts will roll the elements in the opposite * direction. - * @param axis Dimension must be 0-D or 1-D. `axis[i]` specifies the dimension that the shift - * `shift[i]` should occur. If the same axis is referenced more than once, the + * @param axis Dimension must be 0-D or 1-D. {@code axis[i]} specifies the dimension that the shift + * {@code shift[i]} should occur. If the same axis is referenced more than once, the * total shift for that axis will be the sum of all the shifts that belong to that * axis. + * @param data type for {@code Roll} output and operands * @return a new instance of Roll */ - @Endpoint(describeByClass = true) - public static Roll create(Scope scope, Operand input, Operand shift, Operand axis) { + @Endpoint( + describeByClass = true + ) + public static Roll create(Scope scope, Operand input, + Operand shift, Operand axis) { OperationBuilder opBuilder = scope.env().opBuilder("Roll", scope.makeOpName("Roll")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(shift.asOutput()); opBuilder.addInput(axis.asOutput()); opBuilder = scope.apply(opBuilder); - return new Roll(opBuilder.build()); + return new Roll<>(opBuilder.build()); } - + /** + * Gets output. * Has the same shape and size as the input. The elements are shifted - * positively (towards larger indices) by the offsets of `shift` along the - * dimensions of `axis`. + * positively (towards larger indices) by the offsets of {@code shift} along the + * dimensions of {@code axis}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Roll"; - - private Output output; - - private Roll(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rpc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rpc.java index e11643041c7..248a76e6104 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rpc.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Rpc.java @@ -29,114 +29,81 @@ /** * Perform batches of RPC requests. - *

* This op asynchronously performs either a single RPC request, or a batch * of requests. RPC requests are defined by three main parameters: - *

- * - `address` (the host+port or BNS address of the request) - * - `method` (the RPC method name for the request) - * - `request` (the serialized proto string, or vector of strings, - * of the RPC request argument). - *

- * For example, if you have an RPC service running on port localhost:2345, + *

    + *
  • {@code address} (the host+port or BNS address of the request)
  • + *
  • {@code method} (the RPC method name for the request)
  • + *
  • {@code request} (the serialized proto string, or vector of strings, + * of the RPC request argument).
  • + *
+ *

For example, if you have an RPC service running on port localhost:2345, * and its interface is configured with the following proto declaration: - *

{@code
+ * 
  * service MyService {
  *   rpc MyMethod(MyRequestProto) returns (MyResponseProto) {
  *   }
  * };
- * }
- * then call this op with arguments: - *
{@code
- * address = "localhost:2345"
- * method = "MyService/MyMethod"
- * }
- * The `request` tensor is a string tensor representing serialized `MyRequestProto` - * strings; and the output string tensor `response` will have the same shape + *
+ *

then call this op with arguments: + *

+ * address = "localhost:2345"
+ * method = "MyService/MyMethod"
+ * 
+ *

The {@code request} tensor is a string tensor representing serialized {@code MyRequestProto} + * strings; and the output string tensor {@code response} will have the same shape * and contain (upon successful completion) corresponding serialized - * `MyResponseProto` strings. - *

- * For example, to send a single, empty, `MyRequestProto`, call - * this op with `request = ""`. To send 5 parallel empty requests, - * call this op with `request = ["", "", "", "", ""]`. - *

- * More generally, one can create a batch of `MyRequestProto` serialized protos - * from regular batched tensors using the `encode_proto` op, and convert - * the response `MyResponseProto` serialized protos to batched tensors - * using the `decode_proto` op. - *

- * NOTE Working with serialized proto strings is faster than instantiating + * {@code MyResponseProto} strings. + *

For example, to send a single, empty, {@code MyRequestProto}, call + * this op with {@code request = ""}. To send 5 parallel empty requests, + * call this op with {@code request = ["", "", "", "", ""]}. + *

More generally, one can create a batch of {@code MyRequestProto} serialized protos + * from regular batched tensors using the {@code encode_proto} op, and convert + * the response {@code MyResponseProto} serialized protos to batched tensors + * using the {@code decode_proto} op. + *

NOTE Working with serialized proto strings is faster than instantiating * actual proto objects in memory, so no performance degradation is expected * compared to writing custom kernels for this workflow. - *

- * If the connection fails or the remote worker returns an error + *

If the connection fails or the remote worker returns an error * status, the op reraises this exception locally. - *

- * See the `TryRpc` op if you prefer to handle RPC failures manually in the graph. + *

See the {@code TryRpc} op if you prefer to handle RPC failures manually in the graph. */ @Operator public final class Rpc extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Rpc} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param protocol RPC protocol to use. Empty string means use the default protocol. - * Options include 'grpc'. - */ - public Options protocol(String protocol) { - this.protocol = protocol; - return this; - } - - /** - * @param failFast `boolean`. If `true` (default), then failures to connect - * (i.e., the server does not immediately respond) cause an RPC failure. - */ - public Options failFast(Boolean failFast) { - this.failFast = failFast; - return this; - } - - /** - * @param timeoutInMs `int`. If `0` (default), then the kernel will run the RPC - * request and only time out if the RPC deadline passes or the session times out. - * If this value is greater than `0`, then the op will raise an exception if - * the RPC takes longer than `timeout_in_ms`. - */ - public Options timeoutInMs(Long timeoutInMs) { - this.timeoutInMs = timeoutInMs; - return this; - } - - private String protocol; - private Boolean failFast; - private Long timeoutInMs; - - private Options() { - } + public static final String OP_NAME = "Rpc"; + + private Output response; + + private Rpc(Operation operation) { + super(operation); + int outputIdx = 0; + response = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Rpc operation. - * + * * @param scope current scope - * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. + * @param address {@code 0-D} or {@code 1-D}. The address (i.e. host_name:port) of the RPC server. * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `method` and `request`. - * @param method `0-D` or `1-D`. The method address on the RPC server. + * are sent. This argument broadcasts with {@code method} and {@code request}. + * @param method {@code 0-D} or {@code 1-D}. The method address on the RPC server. * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `request`. - * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. + * are sent. This argument broadcasts with {@code address} and {@code request}. + * @param request {@code 0-D} or {@code 1-D}. Serialized proto strings: the rpc request argument. * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `method`. - * @param options carries optional attributes values + * are sent. This argument broadcasts with {@code address} and {@code method}. + * @param options carries optional attribute values * @return a new instance of Rpc */ - @Endpoint(describeByClass = true) - public static Rpc create(Scope scope, Operand address, Operand method, Operand request, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Rpc create(Scope scope, Operand address, Operand method, + Operand request, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Rpc", scope.makeOpName("Rpc")); opBuilder.addInput(address.asOutput()); opBuilder.addInput(method.asOutput()); @@ -157,53 +124,105 @@ public static Rpc create(Scope scope, Operand address, Operand } return new Rpc(opBuilder.build()); } - + /** + * Sets the protocol option. + * * @param protocol RPC protocol to use. Empty string means use the default protocol. * Options include 'grpc'. + * @return this Options instance. */ public static Options protocol(String protocol) { return new Options().protocol(protocol); } - + /** - * @param failFast `boolean`. If `true` (default), then failures to connect + * Sets the failFast option. + * + * @param failFast {@code boolean}. If {@code true} (default), then failures to connect * (i.e., the server does not immediately respond) cause an RPC failure. + * @return this Options instance. */ public static Options failFast(Boolean failFast) { return new Options().failFast(failFast); } - + /** - * @param timeoutInMs `int`. If `0` (default), then the kernel will run the RPC + * Sets the timeoutInMs option. + * + * @param timeoutInMs {@code int}. If {@code 0} (default), then the kernel will run the RPC * request and only time out if the RPC deadline passes or the session times out. - * If this value is greater than `0`, then the op will raise an exception if - * the RPC takes longer than `timeout_in_ms`. + * If this value is greater than {@code 0}, then the op will raise an exception if + * the RPC takes longer than {@code timeout_in_ms}. + * @return this Options instance. */ public static Options timeoutInMs(Long timeoutInMs) { return new Options().timeoutInMs(timeoutInMs); } - + /** - * Same shape as `request`. Serialized proto strings: the rpc responses. + * Gets response. + * Same shape as {@code request}. Serialized proto strings: the rpc responses. + * @return response. */ public Output response() { return response; } - + @Override public Output asOutput() { return response; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Rpc"; - - private Output response; - - private Rpc(Operation operation) { - super(operation); - int outputIdx = 0; - response = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Rpc} + */ + public static class Options { + private String protocol; + + private Boolean failFast; + + private Long timeoutInMs; + + private Options() { + } + + /** + * Sets the protocol option. + * + * @param protocol RPC protocol to use. Empty string means use the default protocol. + * Options include 'grpc'. + * @return this Options instance. + */ + public Options protocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Sets the failFast option. + * + * @param failFast {@code boolean}. If {@code true} (default), then failures to connect + * (i.e., the server does not immediately respond) cause an RPC failure. + * @return this Options instance. + */ + public Options failFast(Boolean failFast) { + this.failFast = failFast; + return this; + } + + /** + * Sets the timeoutInMs option. + * + * @param timeoutInMs {@code int}. If {@code 0} (default), then the kernel will run the RPC + * request and only time out if the RPC deadline passes or the session times out. + * If this value is greater than {@code 0}, then the op will raise an exception if + * the RPC takes longer than {@code timeout_in_ms}. + * @return this Options instance. + */ + public Options timeoutInMs(Long timeoutInMs) { + this.timeoutInMs = timeoutInMs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterAdd.java index 61b7f0e29c6..fb99ba72e15 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterAdd.java @@ -30,67 +30,59 @@ /** * Adds sparse updates to a variable reference. - *

* This operation computes - *

- * # Scalar indices - * ref[indices, ...] += updates[...] - *

- * # Vector indices (for each i) - * ref[indices[i], ...] += updates[i, ...] - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...] - *

- * This operation outputs `ref` after the update is done. + *

+ * # Scalar indices
+ * ref[indices, ...] += updates[...]
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] += updates[i, ...]
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] += updates[i, ..., j, ...]
+ * 
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions add. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- * - * @param data type for {@code outputRef()} output + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterAdd extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the addition will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterAdd"; + + private Output outputRef; + + private ScatterAdd(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterAdd operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to add to `ref`. - * @param options carries optional attributes values + * @param ref Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to add to {@code ref}. + * @param options carries optional attribute values + * @param data type for {@code ScatterAdd} output and operands * @return a new instance of ScatterAdd */ - @Endpoint(describeByClass = true) - public static ScatterAdd create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterAdd create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterAdd", scope.makeOpName("ScatterAdd")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -103,38 +95,54 @@ public static ScatterAdd create(Scope scope, Operand ref } } } - return new ScatterAdd(opBuilder.build()); + return new ScatterAdd<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the addition will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterAdd"; - - private Output outputRef; - - private ScatterAdd(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterAdd} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the addition will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterDiv.java index d7de6fb959d..e4a2aee18e3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterDiv.java @@ -30,63 +30,56 @@ /** * Divides a variable reference by sparse updates. - *

* This operation computes - *

{@code
+ * 
  *     # Scalar indices
  *     ref[indices, ...] /= updates[...]
- * 
+ *
  *     # Vector indices (for each i)
  *     ref[indices[i], ...] /= updates[i, ...]
- * 
+ *
  *     # High rank indices (for each i, ..., j)
  *     ref[indices[i, ..., j], ...] /= updates[i, ..., j, ...]
- * }
- * This operation outputs `ref` after the update is done. + *
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions divide. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - * - * @param data type for {@code outputRef()} output + *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterDiv extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterDiv} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the operation will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterDiv"; + + private Output outputRef; + + private ScatterDiv(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterDiv operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of values that `ref` is divided by. - * @param options carries optional attributes values + * @param ref Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of values that {@code ref} is divided by. + * @param options carries optional attribute values + * @param data type for {@code ScatterDiv} output and operands * @return a new instance of ScatterDiv */ - @Endpoint(describeByClass = true) - public static ScatterDiv create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterDiv create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterDiv", scope.makeOpName("ScatterDiv")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -99,38 +92,54 @@ public static ScatterDiv create(Scope scope, Operand ref } } } - return new ScatterDiv(opBuilder.build()); + return new ScatterDiv<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the operation will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterDiv"; - - private Output outputRef; - - private ScatterDiv(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterDiv} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the operation will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMax.java index b76c71f3aad..0151d58d5e4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMax.java @@ -28,68 +28,60 @@ import org.tensorflow.types.family.TNumber; /** - * Reduces sparse updates into a variable reference using the `max` operation. - *

+ * Reduces sparse updates into a variable reference using the {@code max} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = max(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * This operation outputs `ref` after the update is done. + *

+ * # Scalar indices
+ * ref[indices, ...] = max(ref[indices, ...], updates[...])
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = max(ref[indices[i], ...], updates[i, ...])
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = max(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+ * 
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions combine. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- * - * @param data type for {@code outputRef()} output + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterMax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the update will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterMax"; + + private Output outputRef; + + private ScatterMax(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterMax operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to reduce into `ref`. - * @param options carries optional attributes values + * @param ref Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to reduce into {@code ref}. + * @param options carries optional attribute values + * @param data type for {@code ScatterMax} output and operands * @return a new instance of ScatterMax */ - @Endpoint(describeByClass = true) - public static ScatterMax create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterMax create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterMax", scope.makeOpName("ScatterMax")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -102,38 +94,54 @@ public static ScatterMax create(Scope scope, Operand r } } } - return new ScatterMax(opBuilder.build()); + return new ScatterMax<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the update will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterMax"; - - private Output outputRef; - - private ScatterMax(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterMax} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the update will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMin.java index 20c4393ce79..f8de1ab981f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMin.java @@ -28,68 +28,60 @@ import org.tensorflow.types.family.TNumber; /** - * Reduces sparse updates into a variable reference using the `min` operation. - *

+ * Reduces sparse updates into a variable reference using the {@code min} operation. * This operation computes - *

- * # Scalar indices - * ref[indices, ...] = min(ref[indices, ...], updates[...]) - *

- * # Vector indices (for each i) - * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...]) - *

- * # High rank indices (for each i, ..., j) - * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...]) - *

- * This operation outputs `ref` after the update is done. + *

+ * # Scalar indices
+ * ref[indices, ...] = min(ref[indices, ...], updates[...])
+ *
+ * # Vector indices (for each i)
+ * ref[indices[i], ...] = min(ref[indices[i], ...], updates[i, ...])
+ *
+ * # High rank indices (for each i, ..., j)
+ * ref[indices[i, ..., j], ...] = min(ref[indices[i, ..., j], ...], updates[i, ..., j, ...])
+ * 
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions combine. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- * - * @param data type for {@code outputRef()} output + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterMin extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterMin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the update will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterMin"; + + private Output outputRef; + + private ScatterMin(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterMin operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to reduce into `ref`. - * @param options carries optional attributes values + * @param ref Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to reduce into {@code ref}. + * @param options carries optional attribute values + * @param data type for {@code ScatterMin} output and operands * @return a new instance of ScatterMin */ - @Endpoint(describeByClass = true) - public static ScatterMin create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterMin create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterMin", scope.makeOpName("ScatterMin")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -102,38 +94,54 @@ public static ScatterMin create(Scope scope, Operand r } } } - return new ScatterMin(opBuilder.build()); + return new ScatterMin<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the update will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterMin"; - - private Output outputRef; - - private ScatterMin(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterMin} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the update will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMul.java index 7b155dd8fd5..e3c60debba5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterMul.java @@ -30,63 +30,56 @@ /** * Multiplies sparse updates into a variable reference. - *

* This operation computes - *

{@code
+ * 
  *     # Scalar indices
  *     ref[indices, ...] *= updates[...]
- * 
+ *
  *     # Vector indices (for each i)
  *     ref[indices[i], ...] *= updates[i, ...]
- * 
+ *
  *     # High rank indices (for each i, ..., j)
  *     ref[indices[i, ..., j], ...] *= updates[i, ..., j, ...]
- * }
- * This operation outputs `ref` after the update is done. + *
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their contributions multiply. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - * - * @param data type for {@code outputRef()} output + *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the operation will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterMul"; + + private Output outputRef; + + private ScatterMul(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterMul operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to multiply to `ref`. - * @param options carries optional attributes values + * @param ref Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to multiply to {@code ref}. + * @param options carries optional attribute values + * @param data type for {@code ScatterMul} output and operands * @return a new instance of ScatterMul */ - @Endpoint(describeByClass = true) - public static ScatterMul create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterMul create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterMul", scope.makeOpName("ScatterMul")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -99,38 +92,54 @@ public static ScatterMul create(Scope scope, Operand ref } } } - return new ScatterMul(opBuilder.build()); + return new ScatterMul<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the operation will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterMul"; - - private Output outputRef; - - private ScatterMul(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterMul} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the operation will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNd.java index 63dd5fa5cef..0590363853f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNd.java @@ -29,66 +29,57 @@ import org.tensorflow.types.family.TType; /** - * Scatter `updates` into a new tensor according to `indices`. - *

- * Creates a new tensor by applying sparse `updates` to individual values or + * Scatter {@code updates} into a new tensor according to {@code indices}. + * Creates a new tensor by applying sparse {@code updates} to individual values or * slices within a tensor (initially zero for numeric, empty for string) of - * the given `shape` according to indices. This operator is the inverse of the - * `tf.gather_nd` operator which extracts values or slices from a given tensor. - *

- * This operation is similar to tensor_scatter_add, except that the tensor is - * zero-initialized. Calling `tf.scatter_nd(indices, values, shape)` is identical - * to `tensor_scatter_add(tf.zeros(shape, values.dtype), indices, values)` - *

- * If `indices` contains duplicates, then their updates are accumulated (summed). - *

- * WARNING: The order in which updates are applied is nondeterministic, so the - * output will be nondeterministic if `indices` contains duplicates -- because + * the given {@code shape} according to indices. This operator is the inverse of the + * {@code tf.gather_nd} operator which extracts values or slices from a given tensor. + *

This operation is similar to tensor_scatter_add, except that the tensor is + * zero-initialized. Calling {@code tf.scatter_nd(indices, values, shape)} is identical + * to {@code tensor_scatter_add(tf.zeros(shape, values.dtype), indices, values)} + *

If {@code indices} contains duplicates, then their updates are accumulated (summed). + *

WARNING: The order in which updates are applied is nondeterministic, so the + * output will be nondeterministic if {@code indices} contains duplicates -- because * of some numerical approximation issues, numbers summed in different order * may yield different results. - *

- * `indices` is an integer tensor containing indices into a new tensor of shape - * `shape`. The last dimension of `indices` can be at most the rank of `shape`: - *

- * indices.shape[-1] <= shape.rank - *

- * The last dimension of `indices` corresponds to indices into elements - * (if `indices.shape[-1] = shape.rank`) or slices - * (if `indices.shape[-1] < shape.rank`) along dimension `indices.shape[-1]` of - * `shape`. `updates` is a tensor with shape - *

- * indices.shape[:-1] + shape[indices.shape[-1]:] - *

- * The simplest form of scatter is to insert individual elements in a tensor by + *

{@code indices} is an integer tensor containing indices into a new tensor of shape + * {@code shape}. The last dimension of {@code indices} can be at most the rank of {@code shape}: + *

+ * indices.shape[-1] <= shape.rank
+ * 
+ *

The last dimension of {@code indices} corresponds to indices into elements + * (if {@code indices.shape[-1] = shape.rank}) or slices + * (if {@code indices.shape[-1] < shape.rank}) along dimension {@code indices.shape[-1]} of + * {@code shape}. {@code updates} is a tensor with shape + *

+ * indices.shape[:-1] + shape[indices.shape[-1]:]
+ * 
+ *

The simplest form of scatter is to insert individual elements in a tensor by * index. For example, say we want to insert 4 scattered elements in a rank-1 * tensor with 8 elements. - *

*

* *
- *

- * In Python, this scatter operation would look like this: - *

{@code
+ * 

In Python, this scatter operation would look like this: + *

  *     indices = tf.constant([[4], [3], [1], [7]])
  *     updates = tf.constant([9, 10, 11, 12])
  *     shape = tf.constant([8])
  *     scatter = tf.scatter_nd(indices, updates, shape)
  *     print(scatter)
- * }
- * The resulting tensor would look like this: - *

- * [0, 11, 0, 10, 9, 0, 0, 12] - *

- * We can also, insert entire slices of a higher rank tensor all at once. For + *

+ *

The resulting tensor would look like this: + *

+ * [0, 11, 0, 10, 9, 0, 0, 12]
+ * 
+ *

We can also, insert entire slices of a higher rank tensor all at once. For * example, if we wanted to insert two slices in the first dimension of a * rank-3 tensor with two matrices of new values. - *

*

* *
- *

- * In Python, this scatter operation would look like this: - *

{@code
+ * 

In Python, this scatter operation would look like this: + *

  *     indices = tf.constant([[0], [2]])
  *     updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6],
  *                             [7, 7, 7, 7], [8, 8, 8, 8]],
@@ -97,62 +88,70 @@
  *     shape = tf.constant([4, 4, 4])
  *     scatter = tf.scatter_nd(indices, updates, shape)
  *     print(scatter)
- * }
- * The resulting tensor would look like this: - *

- * [[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]], - * [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], - * [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]], - * [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]] - *

- * Note that on CPU, if an out of bound index is found, an error is returned. + *

+ *

The resulting tensor would look like this: + *

+ * [[[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
+ *  [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]],
+ *  [[5, 5, 5, 5], [6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8]],
+ *  [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]]
+ * 
+ *

Note that on CPU, if an out of bound index is found, an error is returned. * On GPU, if an out of bound index is found, the index is ignored. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class ScatterNd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ScatterNd"; + + private Output output; + + private ScatterNd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ScatterNd operation. - * + * * @param scope current scope * @param indices Index tensor. * @param updates Updates to scatter into output. * @param shape 1-D. The shape of the resulting tensor. + * @param data type for {@code ScatterNd} output and operands + * @param data type for {@code ScatterNd} output and operands * @return a new instance of ScatterNd */ - @Endpoint(describeByClass = true) - public static ScatterNd create(Scope scope, Operand indices, Operand updates, Operand shape) { + @Endpoint( + describeByClass = true + ) + public static ScatterNd create(Scope scope, + Operand indices, Operand updates, Operand shape) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterNd", scope.makeOpName("ScatterNd")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); - return new ScatterNd(opBuilder.build()); + return new ScatterNd<>(opBuilder.build()); } - + /** + * Gets output. * A new tensor with the given shape and updates applied according * to the indices. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNd"; - - private Output output; - - private ScatterNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdAdd.java index 3ccd389abcb..c84b4db7ed3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdAdd.java @@ -30,77 +30,68 @@ /** * Applies sparse addition to individual values or slices in a Variable. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * {@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}.
+ * 

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
- * }
- * For example, say we want to add 4 scattered elements to a rank-1 tensor to + *
+ *

For example, say we want to add 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that addition would look like this: - *

{@code
+ * 
  * ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
  * indices = tf.constant([[4], [3], [1], [7]])
  * updates = tf.constant([9, 10, 11, 12])
  * add = tf.scatter_nd_add(ref, indices, updates)
  * with tf.Session() as sess:
  *   print sess.run(add)
- * }
- * The resulting update to ref would look like this: - *

- * [1, 13, 3, 14, 14, 6, 7, 20] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, 13, 3, 14, 14, 6, 7, 20]
+ * 
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. - * - * @param data type for {@code outputRef()} output + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterNdAdd extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking An optional bool. Defaults to True. If True, the assignment will - * be protected by a lock; otherwise the behavior is undefined, - * but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdAdd"; + + private Output outputRef; + + private ScatterNdAdd(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdAdd operation. - * + * * @param scope current scope * @param ref A mutable Tensor. Should be from a Variable node. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of updated values * to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdAdd} output and operands * @return a new instance of ScatterNdAdd */ - @Endpoint(describeByClass = true) - public static ScatterNdAdd create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterNdAdd create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdAdd", scope.makeOpName("ScatterNdAdd")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -113,39 +104,56 @@ public static ScatterNdAdd create(Scope scope, Operand r } } } - return new ScatterNdAdd(opBuilder.build()); + return new ScatterNdAdd<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking An optional bool. Defaults to True. If True, the assignment will * be protected by a lock; otherwise the behavior is undefined, * but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** + * Gets outputRef. * Same as ref. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdAdd"; - - private Output outputRef; - - private ScatterNdAdd(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdAdd} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMax.java index 8c77ecad143..bfe7e8470db 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMax.java @@ -24,52 +24,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Computes element-wise maximum. - * - * @param data type for {@code outputRef()} output + * + * @param data type for {@code output_ref} output */ public final class ScatterNdMax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking An optional bool. Defaults to True. If True, the assignment will - * be protected by a lock; otherwise the behavior is undefined, - * but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdMax"; + + private Output outputRef; + + private ScatterNdMax(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdMax operation. - * + * * @param scope current scope * @param ref A mutable Tensor. Should be from a Variable node. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of updated values * to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdMax} output and operands * @return a new instance of ScatterNdMax */ - @Endpoint(describeByClass = true) - public static ScatterNdMax create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterNdMax create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdMax", scope.makeOpName("ScatterNdMax")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -82,39 +76,56 @@ public static ScatterNdMax create(Scope scope, Operand r } } } - return new ScatterNdMax(opBuilder.build()); + return new ScatterNdMax<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking An optional bool. Defaults to True. If True, the assignment will * be protected by a lock; otherwise the behavior is undefined, * but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** + * Gets outputRef. * Same as ref. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdMax"; - - private Output outputRef; - - private ScatterNdMax(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdMax} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMin.java index 19fbd9eac1e..98663edd311 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdMin.java @@ -24,52 +24,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Computes element-wise minimum. - * - * @param data type for {@code outputRef()} output + * + * @param data type for {@code output_ref} output */ public final class ScatterNdMin extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdMin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking An optional bool. Defaults to True. If True, the assignment will - * be protected by a lock; otherwise the behavior is undefined, - * but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdMin"; + + private Output outputRef; + + private ScatterNdMin(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdMin operation. - * + * * @param scope current scope * @param ref A mutable Tensor. Should be from a Variable node. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of updated values * to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdMin} output and operands * @return a new instance of ScatterNdMin */ - @Endpoint(describeByClass = true) - public static ScatterNdMin create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterNdMin create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdMin", scope.makeOpName("ScatterNdMin")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -82,39 +76,56 @@ public static ScatterNdMin create(Scope scope, Operand r } } } - return new ScatterNdMin(opBuilder.build()); + return new ScatterNdMin<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking An optional bool. Defaults to True. If True, the assignment will * be protected by a lock; otherwise the behavior is undefined, * but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** + * Gets outputRef. * Same as ref. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdMin"; - - private Output outputRef; - - private ScatterNdMin(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdMin} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdNonAliasingAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdNonAliasingAdd.java index 09396a80e86..e9d2f0586e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdNonAliasingAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdNonAliasingAdd.java @@ -29,89 +29,89 @@ import org.tensorflow.types.family.TType; /** - * Applies sparse addition to `input` using individual values or slices - *

- * from `updates` according to indices `indices`. The updates are non-aliasing: - * `input` is only modified in-place if no other operations will use it. - * Otherwise, a copy of `input` is made. This operation has a gradient with - * respect to both `input` and `updates`. - *

- * `input` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `input`. - * It must be shape \\([d_0, ..., d_{Q-2}, K]\\) where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or `(P-K)`-dimensional slices - * (if `K < P`) along the `K`th dimension of `input`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

- * $$[d_0, ..., d_{Q-2}, input.shape[K], ..., input.shape[P-1]].$$ - *

- * For example, say we want to add 4 scattered elements to a rank-1 tensor to 8 + * Applies sparse addition to {@code input} using individual values or slices + * from {@code updates} according to indices {@code indices}. The updates are non-aliasing: + * {@code input} is only modified in-place if no other operations will use it. + * Otherwise, a copy of {@code input} is made. This operation has a gradient with + * respect to both {@code input} and {@code updates}. + *

{@code input} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code input}. + * It must be shape \([d_0, ..., d_{Q-2}, K]\) where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or {@code (P-K)}-dimensional slices + * (if {@code K < P}) along the {@code K}th dimension of {@code input}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

$$[d_0, ..., d_{Q-2}, input.shape[K], ..., input.shape[P-1]].$$ + *

For example, say we want to add 4 scattered elements to a rank-1 tensor to 8 * elements. In Python, that addition would look like this: - *

- * input = tf.constant([1, 2, 3, 4, 5, 6, 7, 8]) - * indices = tf.constant([[4], [3], [1], [7]]) - * updates = tf.constant([9, 10, 11, 12]) - * output = tf.scatter_nd_non_aliasing_add(input, indices, updates) - * with tf.Session() as sess: - * print(sess.run(output)) - *

- * The resulting value `output` would look like this: - *

- * [1, 13, 3, 14, 14, 6, 7, 20] - *

- * See `tf.scatter_nd` for more details about how to make updates to slices. - * - * @param data type for {@code output()} output + *

+ * input = tf.constant([1, 2, 3, 4, 5, 6, 7, 8])
+ * indices = tf.constant([[4], [3], [1], [7]])
+ * updates = tf.constant([9, 10, 11, 12])
+ * output = tf.scatter_nd_non_aliasing_add(input, indices, updates)
+ * with tf.Session() as sess:
+ *   print(sess.run(output))
+ * 
+ *

The resulting value {@code output} would look like this: + *

+ * [1, 13, 3, 14, 14, 6, 7, 20]
+ * 
+ *

See {@code tf.scatter_nd} for more details about how to make updates to slices. + * + * @param data type for {@code output} output */ @Operator public final class ScatterNdNonAliasingAdd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ScatterNdNonAliasingAdd"; + + private Output output; + + private ScatterNdNonAliasingAdd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ScatterNdNonAliasingAdd operation. - * + * * @param scope current scope * @param input A Tensor. - * @param indices A Tensor. Must be one of the following types: `int32`, `int64`. - * A tensor of indices into `input`. + * @param indices A Tensor. Must be one of the following types: {@code int32}, {@code int64}. + * A tensor of indices into {@code input}. * @param updates A Tensor. Must have the same type as ref. A tensor of updated values - * to add to `input`. + * to add to {@code input}. + * @param data type for {@code ScatterNdNonAliasingAdd} output and operands * @return a new instance of ScatterNdNonAliasingAdd */ - @Endpoint(describeByClass = true) - public static ScatterNdNonAliasingAdd create(Scope scope, Operand input, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static ScatterNdNonAliasingAdd create(Scope scope, Operand input, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdNonAliasingAdd", scope.makeOpName("ScatterNdNonAliasingAdd")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); opBuilder = scope.apply(opBuilder); - return new ScatterNdNonAliasingAdd(opBuilder.build()); + return new ScatterNdNonAliasingAdd<>(opBuilder.build()); } - + /** - * A `Tensor` with the same shape as `input`, containing values of `input` - * updated with `updates`. + * Gets output. + * A {@code Tensor} with the same shape as {@code input}, containing values of {@code input} + * updated with {@code updates}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdNonAliasingAdd"; - - private Output output; - - private ScatterNdNonAliasingAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdSub.java index e391a05ff82..23e1d53e85d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdSub.java @@ -30,79 +30,69 @@ /** * Applies sparse subtraction to individual values or slices in a Variable. - *

- * within a given variable according to `indices`. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape `[d_0, ..., d_{Q-2}, K]` where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

{@code
+ * within a given variable according to {@code indices}.
+ * 

{@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape {@code [d_0, ..., d_{Q-2}, K]} where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

  * [d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
- * }
- * For example, say we want to subtract 4 scattered elements from a rank-1 tensor + *
+ *

For example, say we want to subtract 4 scattered elements from a rank-1 tensor * with 8 elements. In Python, that subtraction would look like this: - *

{@code
+ * 
  * ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
  * indices = tf.constant([[4], [3], [1], [7]])
  * updates = tf.constant([9, 10, 11, 12])
  * sub = tf.scatter_nd_sub(ref, indices, updates)
  * with tf.Session() as sess:
  *   print sess.run(sub)
- * }
- * The resulting update to ref would look like this: - *

- * [1, -9, 3, -6, -4, 6, 7, -4] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, -9, 3, -6, -4, 6, 7, -4]
+ * 
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. - * - * @param data type for {@code outputRef()} output + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterNdSub extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdSub} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking An optional bool. Defaults to True. If True, the assignment will - * be protected by a lock; otherwise the behavior is undefined, - * but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdSub"; + + private Output outputRef; + + private ScatterNdSub(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdSub operation. - * + * * @param scope current scope * @param ref A mutable Tensor. Should be from a Variable node. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of updated values * to subtract from ref. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdSub} output and operands * @return a new instance of ScatterNdSub */ - @Endpoint(describeByClass = true) - public static ScatterNdSub create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterNdSub create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdSub", scope.makeOpName("ScatterNdSub")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -115,39 +105,56 @@ public static ScatterNdSub create(Scope scope, Operand r } } } - return new ScatterNdSub(opBuilder.build()); + return new ScatterNdSub<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking An optional bool. Defaults to True. If True, the assignment will * be protected by a lock; otherwise the behavior is undefined, * but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** + * Gets outputRef. * Same as ref. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdSub"; - - private Output outputRef; - - private ScatterNdSub(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdSub} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdUpdate.java index 13eb21a735c..1d93219a76d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterNdUpdate.java @@ -29,82 +29,69 @@ import org.tensorflow.types.family.TType; /** - * Applies sparse `updates` to individual values or slices within a given - *

- * variable according to `indices`. - *

- * `ref` is a `Tensor` with rank `P` and `indices` is a `Tensor` of rank `Q`. - *

- * `indices` must be integer tensor, containing indices into `ref`. - * It must be shape \\([d_0, ..., d_{Q-2}, K]\\) where `0 < K <= P`. - *

- * The innermost dimension of `indices` (with length `K`) corresponds to - * indices into elements (if `K = P`) or slices (if `K < P`) along the `K`th - * dimension of `ref`. - *

- * `updates` is `Tensor` of rank `Q-1+P-K` with shape: - *

- * $$[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].$$ - *

- * For example, say we want to update 4 scattered elements to a rank-1 tensor to + * Applies sparse {@code updates} to individual values or slices within a given + * variable according to {@code indices}. + *

{@code ref} is a {@code Tensor} with rank {@code P} and {@code indices} is a {@code Tensor} of rank {@code Q}. + *

{@code indices} must be integer tensor, containing indices into {@code ref}. + * It must be shape \([d_0, ..., d_{Q-2}, K]\) where {@code 0 < K <= P}. + *

The innermost dimension of {@code indices} (with length {@code K}) corresponds to + * indices into elements (if {@code K = P}) or slices (if {@code K < P}) along the {@code K}th + * dimension of {@code ref}. + *

{@code updates} is {@code Tensor} of rank {@code Q-1+P-K} with shape: + *

$$[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]].$$ + *

For example, say we want to update 4 scattered elements to a rank-1 tensor to * 8 elements. In Python, that update would look like this: - *

{@code
+ * 
  *     ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8])
  *     indices = tf.constant([[4], [3], [1] ,[7]])
  *     updates = tf.constant([9, 10, 11, 12])
  *     update = tf.scatter_nd_update(ref, indices, updates)
  *     with tf.Session() as sess:
  *       print sess.run(update)
- * }
- * The resulting update to ref would look like this: - *

- * [1, 11, 3, 10, 9, 6, 7, 12] - *

- * See `tf.scatter_nd` for more details about how to make updates to + *

+ *

The resulting update to ref would look like this: + *

+ * [1, 11, 3, 10, 9, 6, 7, 12]
+ * 
+ *

See {@code tf.scatter_nd} for more details about how to make updates to * slices. - *

- * See also `tf.scatter_update` and `tf.batch_scatter_update`. - * - * @param data type for {@code outputRef()} output + *

See also {@code tf.scatter_update} and {@code tf.batch_scatter_update}. + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterNdUpdate extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterNdUpdate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking An optional bool. Defaults to True. If True, the assignment will - * be protected by a lock; otherwise the behavior is undefined, - * but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterNdUpdate"; + + private Output outputRef; + + private ScatterNdUpdate(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterNdUpdate operation. - * + * * @param scope current scope * @param ref A mutable Tensor. Should be from a Variable node. * @param indices A Tensor. Must be one of the following types: int32, int64. * A tensor of indices into ref. * @param updates A Tensor. Must have the same type as ref. A tensor of updated * values to add to ref. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ScatterNdUpdate} output and operands * @return a new instance of ScatterNdUpdate */ - @Endpoint(describeByClass = true) - public static ScatterNdUpdate create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterNdUpdate create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterNdUpdate", scope.makeOpName("ScatterNdUpdate")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -117,39 +104,56 @@ public static ScatterNdUpdate create(Scope scope, Operand(opBuilder.build()); + return new ScatterNdUpdate<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking An optional bool. Defaults to True. If True, the assignment will * be protected by a lock; otherwise the behavior is undefined, * but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** + * Gets outputRef. * Same as ref. Returned as a convenience for operations that want to * use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterNdUpdate"; - - private Output outputRef; - - private ScatterNdUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterNdUpdate} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking An optional bool. Defaults to True. If True, the assignment will + * be protected by a lock; otherwise the behavior is undefined, + * but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterSub.java index 0d53ef622fe..8dcec648560 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterSub.java @@ -30,66 +30,58 @@ /** * Subtracts sparse updates to a variable reference. - *

- *

{@code
+ * 
  *     # Scalar indices
  *     ref[indices, ...] -= updates[...]
- * 
+ *
  *     # Vector indices (for each i)
  *     ref[indices[i], ...] -= updates[i, ...]
- * 
+ *
  *     # High rank indices (for each i, ..., j)
  *     ref[indices[i, ..., j], ...] -= updates[i, ..., j, ...]
- * }
- * This operation outputs `ref` after the update is done. + *
+ * This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * Duplicate entries are handled correctly: if multiple `indices` reference + *

Duplicate entries are handled correctly: if multiple {@code indices} reference * the same location, their (negated) contributions add. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- * - * @param data type for {@code outputRef()} output + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterSub extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterSub} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterSub"; + + private Output outputRef; + + private ScatterSub(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterSub operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to subtract from `ref`. - * @param options carries optional attributes values + * @param ref Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to subtract from {@code ref}. + * @param options carries optional attribute values + * @param data type for {@code ScatterSub} output and operands * @return a new instance of ScatterSub */ - @Endpoint(describeByClass = true) - public static ScatterSub create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterSub create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterSub", scope.makeOpName("ScatterSub")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -102,38 +94,54 @@ public static ScatterSub create(Scope scope, Operand ref } } } - return new ScatterSub(opBuilder.build()); + return new ScatterSub<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterSub"; - - private Output outputRef; - - private ScatterSub(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterSub} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterUpdate.java index 37efa7194e8..9e6e6fa106b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScatterUpdate.java @@ -30,70 +30,61 @@ /** * Applies sparse updates to a variable reference. - *

* This operation computes - *

{@code
+ * 
  *     # Scalar indices
  *     ref[indices, ...] = updates[...]
- * 
+ *
  *     # Vector indices (for each i)
  *     ref[indices[i], ...] = updates[i, ...]
- * 
+ *
  *     # High rank indices (for each i, ..., j)
  *     ref[indices[i, ..., j], ...] = updates[i, ..., j, ...]
- * }
- * This operation outputs `ref` after the update is done. + *
+ *

This operation outputs {@code ref} after the update is done. * This makes it easier to chain operations that need to use the reset value. - *

- * If values in `ref` is to be updated more than once, because there are - * duplicate entries in `indices`, the order at which the updates happen + *

If values in {@code ref} is to be updated more than once, because there are + * duplicate entries in {@code indices}, the order at which the updates happen * for each value is undefined. - *

- * Requires `updates.shape = indices.shape + ref.shape[1:]` or `updates.shape = []`. - *

+ *

Requires {@code updates.shape = indices.shape + ref.shape[1:]} or {@code updates.shape = []}. *

* *
- *

- * See also `tf.batch_scatter_update` and `tf.scatter_nd_update`. - * - * @param data type for {@code outputRef()} output + *

See also {@code tf.batch_scatter_update} and {@code tf.scatter_nd_update}. + * + * @param data type for {@code output_ref} output */ @Operator public final class ScatterUpdate extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.ScatterUpdate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the assignment will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ScatterUpdate"; + + private Output outputRef; + + private ScatterUpdate(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScatterUpdate operation. - * + * * @param scope current scope - * @param ref Should be from a `Variable` node. - * @param indices A tensor of indices into the first dimension of `ref`. - * @param updates A tensor of updated values to store in `ref`. - * @param options carries optional attributes values + * @param ref Should be from a {@code Variable} node. + * @param indices A tensor of indices into the first dimension of {@code ref}. + * @param updates A tensor of updated values to store in {@code ref}. + * @param options carries optional attribute values + * @param data type for {@code ScatterUpdate} output and operands * @return a new instance of ScatterUpdate */ - @Endpoint(describeByClass = true) - public static ScatterUpdate create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScatterUpdate create(Scope scope, Operand ref, + Operand indices, Operand updates, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScatterUpdate", scope.makeOpName("ScatterUpdate")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -106,38 +97,54 @@ public static ScatterUpdate create(Scope scope, Operand } } } - return new ScatterUpdate(opBuilder.build()); + return new ScatterUpdate<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the assignment will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * = Same as `ref`. Returned as a convenience for operations that want + * Gets outputRef. + * = Same as {@code ref}. Returned as a convenience for operations that want * to use the updated values after the update is done. + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScatterUpdate"; - - private Output outputRef; - - private ScatterUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.ScatterUpdate} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the assignment will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Select.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Select.java index 4bea1d6de91..20e13a1131b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Select.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Select.java @@ -29,49 +29,59 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code output()} output + * The SelectV2 operation + * + * @param data type for {@code output} output */ @Operator public final class Select extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Select operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SelectV2"; + + private Output output; + + private Select(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SelectV2 operation. + * * @param scope current scope - * @param condition - * @param t - * @param e + * @param condition the condition value + * @param t the t value + * @param e the e value + * @param data type for {@code SelectV2} output and operands * @return a new instance of Select */ - @Endpoint(describeByClass = true) - public static Select create(Scope scope, Operand condition, Operand t, Operand e) { + @Endpoint( + describeByClass = true + ) + public static Select create(Scope scope, Operand condition, + Operand t, Operand e) { OperationBuilder opBuilder = scope.env().opBuilder("SelectV2", scope.makeOpName("Select")); opBuilder.addInput(condition.asOutput()); opBuilder.addInput(t.asOutput()); opBuilder.addInput(e.asOutput()); opBuilder = scope.apply(opBuilder); - return new Select(opBuilder.build()); + return new Select<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SelectV2"; - - private Output output; - - private Select(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Send.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Send.java index 480cd265f1a..2a666ce3f1c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Send.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Send.java @@ -23,50 +23,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Sends the named tensor from send_device to recv_device. */ public final class Send extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.Send} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param clientTerminated If set to true, this indicates that the node was added - * to the graph as a result of a client-side feed or fetch of Tensor data, - * in which case the corresponding send or recv is expected to be managed - * locally by the caller. - */ - public Options clientTerminated(Boolean clientTerminated) { - this.clientTerminated = clientTerminated; - return this; - } - - private Boolean clientTerminated; - - private Options() { - } + public static final String OP_NAME = "Send"; + + private Send(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new Send operation. - * + * * @param scope current scope * @param tensor The tensor to send. * @param tensorName The name of the tensor to send. * @param sendDevice The name of the device sending the tensor. * @param sendDeviceIncarnation The current incarnation of send_device. * @param recvDevice The name of the device receiving the tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Send */ - @Endpoint(describeByClass = true) - public static Send create(Scope scope, Operand tensor, String tensorName, String sendDevice, Long sendDeviceIncarnation, String recvDevice, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Send create(Scope scope, Operand tensor, String tensorName, + String sendDevice, Long sendDeviceIncarnation, String recvDevice, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Send", scope.makeOpName("Send")); opBuilder.addInput(tensor.asOutput()); opBuilder = scope.apply(opBuilder); @@ -83,21 +71,41 @@ public static Send create(Scope scope, Operand tensor, String t } return new Send(opBuilder.build()); } - + /** + * Sets the clientTerminated option. + * * @param clientTerminated If set to true, this indicates that the node was added * to the graph as a result of a client-side feed or fetch of Tensor data, * in which case the corresponding send or recv is expected to be managed * locally by the caller. + * @return this Options instance. */ public static Options clientTerminated(Boolean clientTerminated) { return new Options().clientTerminated(clientTerminated); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Send"; - - private Send(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Send} + */ + public static class Options { + private Boolean clientTerminated; + + private Options() { + } + + /** + * Sets the clientTerminated option. + * + * @param clientTerminated If set to true, this indicates that the node was added + * to the graph as a result of a client-side feed or fetch of Tensor data, + * in which case the corresponding send or recv is expected to be managed + * locally by the caller. + * @return this Options instance. + */ + public Options clientTerminated(Boolean clientTerminated) { + this.clientTerminated = clientTerminated; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetDiff1d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetDiff1d.java index 515f413fca9..cfd64e9f8f5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetDiff1d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetDiff1d.java @@ -32,89 +32,101 @@ /** * Computes the difference between two lists of numbers or strings. - *

- * Given a list `x` and a list `y`, this operation returns a list `out` that - * represents all values that are in `x` but not in `y`. The returned list `out` - * is sorted in the same order that the numbers appear in `x` (duplicates are - * preserved). This operation also returns a list `idx` that represents the - * position of each `out` element in `x`. In other words: - *

- * `out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]` - *

- * For example, given this input: - *

{@code
+ * Given a list {@code x} and a list {@code y}, this operation returns a list {@code out} that
+ * represents all values that are in {@code x} but not in {@code y}. The returned list {@code out}
+ * is sorted in the same order that the numbers appear in {@code x} (duplicates are
+ * preserved). This operation also returns a list {@code idx} that represents the
+ * position of each {@code out} element in {@code x}. In other words:
+ * 

{@code out[i] = x[idx[i]] for i in [0, 1, ..., len(out) - 1]} + *

For example, given this input: + *

  * x = [1, 2, 3, 4, 5, 6]
  * y = [1, 3, 5]
- * }
- * This operation would return: - *
{@code
- * out ==> [2, 4, 6]
- * idx ==> [1, 3, 5]
- * }
- * - * - * @param data type for {@code out()} output - * @param data type for {@code idx()} output + *
+ *

This operation would return: + *

+ * out ==> [2, 4, 6]
+ * idx ==> [1, 3, 5]
+ * 
+ * + * @param data type for {@code out} output + * + * @param data type for {@code idx} output */ @Operator public final class SetDiff1d extends RawOp { - /** - * Factory method to create a class wrapping a new SetDiff1d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ListDiff"; + + private Output out; + + private Output idx; + + private SetDiff1d(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); + idx = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ListDiff operation. + * * @param scope current scope * @param x 1-D. Values to keep. * @param y 1-D. Values to remove. - * @param outIdx + * @param outIdx the value of the outIdx property + * @param data type for {@code ListDiff} output and operands + * @param data type for {@code ListDiff} output and operands * @return a new instance of SetDiff1d */ - @Endpoint(describeByClass = true) - public static SetDiff1d create(Scope scope, Operand x, Operand y, Class outIdx) { + @Endpoint( + describeByClass = true + ) + public static SetDiff1d create(Scope scope, + Operand x, Operand y, Class outIdx) { OperationBuilder opBuilder = scope.env().opBuilder("ListDiff", scope.makeOpName("SetDiff1d")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_idx", Operands.toDataType(outIdx)); - return new SetDiff1d(opBuilder.build()); + return new SetDiff1d<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new SetDiff1d operation using default output types. - * + * Factory method to create a class wrapping a new ListDiff operation, with the default output types. + * * @param scope current scope * @param x 1-D. Values to keep. * @param y 1-D. Values to remove. - * @return a new instance of SetDiff1d + * @param data type for {@code ListDiff} output and operands + * @return a new instance of SetDiff1d, with default output types */ - @Endpoint(describeByClass = true) - public static SetDiff1d create(Scope scope, Operand x, Operand y) { + @Endpoint( + describeByClass = true + ) + public static SetDiff1d create(Scope scope, Operand x, + Operand y) { return create(scope, x, y, TInt32.class); } - + /** - * 1-D. Values present in `x` but not in `y`. + * Gets out. + * 1-D. Values present in {@code x} but not in {@code y}. + * @return out. */ public Output out() { return out; } - + /** - * 1-D. Positions of `x` values preserved in `out`. + * Gets idx. + * 1-D. Positions of {@code x} values preserved in {@code out}. + * @return idx. */ public Output idx() { return idx; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ListDiff"; - - private Output out; - private Output idx; - - private SetDiff1d(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - idx = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetSize.java index bfa86868a72..26a705b8d1f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SetSize.java @@ -30,49 +30,43 @@ import org.tensorflow.types.family.TType; /** - * Number of unique elements along last dimension of input `set`. - *

- * Input `set` is a `SparseTensor` represented by `set_indices`, `set_values`, - * and `set_shape`. The last dimension contains values in a set, duplicates are + * Number of unique elements along last dimension of input {@code set}. + * Input {@code set} is a {@code SparseTensor} represented by {@code set_indices}, {@code set_values}, + * and {@code set_shape}. The last dimension contains values in a set, duplicates are * allowed but ignored. - *

- * If `validate_indices` is `True`, this op validates the order and range of `set` + *

If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set} * indices. */ @Operator public final class SetSize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.SetSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "SetSize"; + + private Output output; + + private SetSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SetSize operation. - * + * * @param scope current scope - * @param setIndices 2D `Tensor`, indices of a `SparseTensor`. - * @param setValues 1D `Tensor`, values of a `SparseTensor`. - * @param setShape 1D `Tensor`, shape of a `SparseTensor`. - * @param options carries optional attributes values + * @param setIndices 2D {@code Tensor}, indices of a {@code SparseTensor}. + * @param setValues 1D {@code Tensor}, values of a {@code SparseTensor}. + * @param setShape 1D {@code Tensor}, shape of a {@code SparseTensor}. + * @param options carries optional attribute values * @return a new instance of SetSize */ - @Endpoint(describeByClass = true) - public static SetSize create(Scope scope, Operand setIndices, Operand setValues, Operand setShape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SetSize create(Scope scope, Operand setIndices, + Operand setValues, Operand setShape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SetSize", scope.makeOpName("SetSize")); opBuilder.addInput(setIndices.asOutput()); opBuilder.addInput(setValues.asOutput()); @@ -87,36 +81,51 @@ public static SetSize create(Scope scope, Operand setIndices, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SetSize"; - - private Output output; - - private SetSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.SetSize} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = validateIndices; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Shape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Shape.java index dbb34980213..1b111b8643e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Shape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Shape.java @@ -32,69 +32,76 @@ /** * Returns the shape of a tensor. - *

- * This operation returns a 1-D integer tensor representing the shape of `input`. - *

- * For example: - *

{@code
+ * This operation returns a 1-D integer tensor representing the shape of {@code input}.
+ * 

For example: + *

  * # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
- * shape(t) ==> [2, 2, 3]
- * }
- * - * - * @param data type for {@code output()} output + * shape(t) ==> [2, 2, 3] + *
+ * + * @param data type for {@code output} output */ @Operator public final class Shape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Shape"; + + private Output output; + + private Shape(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Shape operation. - * + * * @param scope current scope - * @param input - * @param outType + * @param input the input value + * @param outType the value of the outType property + * @param data type for {@code Shape} output and operands * @return a new instance of Shape */ - @Endpoint(describeByClass = true) - public static Shape create(Scope scope, Operand input, Class outType) { + @Endpoint( + describeByClass = true + ) + public static Shape create(Scope scope, Operand input, + Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("Shape", scope.makeOpName("Shape")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new Shape(opBuilder.build()); + return new Shape<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Shape operation using default output types. - * + * Factory method to create a class wrapping a new Shape operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Shape + * @param input the input value + * @return a new instance of Shape, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Shape create(Scope scope, Operand input) { return create(scope, input, TInt32.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Shape"; - - private Output output; - - private Shape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShapeN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShapeN.java index b196e321962..ac06776f9fa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShapeN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShapeN.java @@ -35,66 +35,75 @@ /** * Returns shape of tensors. - *

- * This operation returns N 1-D integer tensors representing shape of `input[i]s`. - * - * @param data type for {@code output()} output + * This operation returns N 1-D integer tensors representing shape of {@code input[i]s}. + * + * @param data type for {@code output} output */ @Operator public final class ShapeN extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ShapeN"; + + private List> output; + + @SuppressWarnings("unchecked") + private ShapeN(Operation operation) { + super(operation); + int outputIdx = 0; + int outputLength = operation.outputListLength("output"); + output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); + outputIdx += outputLength; + } + /** * Factory method to create a class wrapping a new ShapeN operation. - * + * * @param scope current scope - * @param input - * @param outType + * @param input the input value + * @param outType the value of the outType property + * @param data type for {@code ShapeN} output and operands * @return a new instance of ShapeN */ - @Endpoint(describeByClass = true) - public static ShapeN create(Scope scope, Iterable> input, Class outType) { + @Endpoint( + describeByClass = true + ) + public static ShapeN create(Scope scope, + Iterable> input, Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("ShapeN", scope.makeOpName("ShapeN")); opBuilder.addInputList(Operands.asOutputs(input)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new ShapeN(opBuilder.build()); + return new ShapeN<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ShapeN operation using default output types. - * + * Factory method to create a class wrapping a new ShapeN operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of ShapeN + * @param input the input value + * @return a new instance of ShapeN, with default output types */ - @Endpoint(describeByClass = true) - public static ShapeN create(Scope scope, Iterable> input) { + @Endpoint( + describeByClass = true + ) + public static ShapeN create(Scope scope, Iterable> input) { return create(scope, input, TInt32.class); } - + /** + * Gets output. + * + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShapeN"; - - private List> output; - - @SuppressWarnings("unchecked") - private ShapeN(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Size.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Size.java index 07ab596ea23..d8c5d3fcc88 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Size.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Size.java @@ -32,70 +32,77 @@ /** * Returns the size of a tensor. - *

* This operation returns an integer representing the number of elements in - * `input`. - *

- * For example: - *

{@code
+ * {@code input}.
+ * 

For example: + *

  * # 't' is [[[1, 1,, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]
- * size(t) ==> 12
- * }
- * - * - * @param data type for {@code output()} output + * size(t) ==> 12 + *
+ * + * @param data type for {@code output} output */ @Operator public final class Size extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Size"; + + private Output output; + + private Size(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Size operation. - * + * * @param scope current scope - * @param input - * @param outType + * @param input the input value + * @param outType the value of the outType property + * @param data type for {@code Size} output and operands * @return a new instance of Size */ - @Endpoint(describeByClass = true) - public static Size create(Scope scope, Operand input, Class outType) { + @Endpoint( + describeByClass = true + ) + public static Size create(Scope scope, Operand input, + Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("Size", scope.makeOpName("Size")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new Size(opBuilder.build()); + return new Size<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Size operation using default output types. - * + * Factory method to create a class wrapping a new Size operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Size + * @param input the input value + * @return a new instance of Size, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Size create(Scope scope, Operand input) { return create(scope, input, TInt32.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Size"; - - private Output output; - - private Size(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Skipgram.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Skipgram.java index d55a47e4c48..51127563a5b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Skipgram.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Skipgram.java @@ -33,56 +33,49 @@ */ @Operator public final class Skipgram extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.Skipgram} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param windowSize The number of words to predict to the left and right of the target. - */ - public Options windowSize(Long windowSize) { - this.windowSize = windowSize; - return this; - } - - /** - * @param minCount The minimum number of word occurrences for it to be included in the - * vocabulary. - */ - public Options minCount(Long minCount) { - this.minCount = minCount; - return this; - } - - /** - * @param subsample Threshold for word occurrence. Words that appear with higher - * frequency will be randomly down-sampled. Set to 0 to disable. - */ - public Options subsample(Float subsample) { - this.subsample = subsample; - return this; - } - - private Long windowSize; - private Long minCount; - private Float subsample; - - private Options() { - } + public static final String OP_NAME = "Skipgram"; + + private Output vocabWord; + + private Output vocabFreq; + + private Output wordsPerEpoch; + + private Output currentEpoch; + + private Output totalWordsProcessed; + + private Output examples; + + private Output labels; + + private Skipgram(Operation operation) { + super(operation); + int outputIdx = 0; + vocabWord = operation.output(outputIdx++); + vocabFreq = operation.output(outputIdx++); + wordsPerEpoch = operation.output(outputIdx++); + currentEpoch = operation.output(outputIdx++); + totalWordsProcessed = operation.output(outputIdx++); + examples = operation.output(outputIdx++); + labels = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Skipgram operation. - * + * * @param scope current scope * @param filename The corpus's text file name. * @param batchSize The size of produced batch. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Skipgram */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Skipgram create(Scope scope, String filename, Long batchSize, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Skipgram", scope.makeOpName("Skipgram")); opBuilder = scope.apply(opBuilder); @@ -103,99 +96,148 @@ public static Skipgram create(Scope scope, String filename, Long batchSize, Opti } return new Skipgram(opBuilder.build()); } - + /** + * Sets the windowSize option. + * * @param windowSize The number of words to predict to the left and right of the target. + * @return this Options instance. */ public static Options windowSize(Long windowSize) { return new Options().windowSize(windowSize); } - + /** + * Sets the minCount option. + * * @param minCount The minimum number of word occurrences for it to be included in the * vocabulary. + * @return this Options instance. */ public static Options minCount(Long minCount) { return new Options().minCount(minCount); } - + /** + * Sets the subsample option. + * * @param subsample Threshold for word occurrence. Words that appear with higher * frequency will be randomly down-sampled. Set to 0 to disable. + * @return this Options instance. */ public static Options subsample(Float subsample) { return new Options().subsample(subsample); } - + /** + * Gets vocabWord. * A vector of words in the corpus. + * @return vocabWord. */ public Output vocabWord() { return vocabWord; } - + /** + * Gets vocabFreq. * Frequencies of words. Sorted in the non-ascending order. + * @return vocabFreq. */ public Output vocabFreq() { return vocabFreq; } - + /** + * Gets wordsPerEpoch. * Number of words per epoch in the data file. + * @return wordsPerEpoch. */ public Output wordsPerEpoch() { return wordsPerEpoch; } - + /** + * Gets currentEpoch. * The current epoch number. + * @return currentEpoch. */ public Output currentEpoch() { return currentEpoch; } - + /** + * Gets totalWordsProcessed. * The total number of words processed so far. + * @return totalWordsProcessed. */ public Output totalWordsProcessed() { return totalWordsProcessed; } - + /** + * Gets examples. * A vector of word ids. + * @return examples. */ public Output examples() { return examples; } - + /** + * Gets labels. * A vector of word ids. + * @return labels. */ public Output labels() { return labels; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Skipgram"; - - private Output vocabWord; - private Output vocabFreq; - private Output wordsPerEpoch; - private Output currentEpoch; - private Output totalWordsProcessed; - private Output examples; - private Output labels; - - private Skipgram(Operation operation) { - super(operation); - int outputIdx = 0; - vocabWord = operation.output(outputIdx++); - vocabFreq = operation.output(outputIdx++); - wordsPerEpoch = operation.output(outputIdx++); - currentEpoch = operation.output(outputIdx++); - totalWordsProcessed = operation.output(outputIdx++); - examples = operation.output(outputIdx++); - labels = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Skipgram} + */ + public static class Options { + private Long windowSize; + + private Long minCount; + + private Float subsample; + + private Options() { + } + + /** + * Sets the windowSize option. + * + * @param windowSize The number of words to predict to the left and right of the target. + * @return this Options instance. + */ + public Options windowSize(Long windowSize) { + this.windowSize = windowSize; + return this; + } + + /** + * Sets the minCount option. + * + * @param minCount The minimum number of word occurrences for it to be included in the + * vocabulary. + * @return this Options instance. + */ + public Options minCount(Long minCount) { + this.minCount = minCount; + return this; + } + + /** + * Sets the subsample option. + * + * @param subsample Threshold for word occurrence. Words that appear with higher + * frequency will be randomly down-sampled. Set to 0 to disable. + * @return this Options instance. + */ + public Options subsample(Float subsample) { + this.subsample = subsample; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Slice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Slice.java index 22447d96bcd..ec2adda3e4b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Slice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Slice.java @@ -30,61 +30,68 @@ /** * Return a slice from 'input'. - *

* The output tensor is a tensor with dimensions described by 'size' * whose values are extracted from 'input' starting at the offsets in * 'begin'. - *

- * Requirements: - * 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n) - * - * @param data type for {@code output()} output + *

Requirements: + * 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n) + * + * @param data type for {@code output} output */ @Operator public final class Slice extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Slice"; + + private Output output; + + private Slice(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Slice operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @param begin begin[i] specifies the offset into the 'i'th dimension of * 'input' to slice from. - * @param size size[i] specifies the number of elements of the 'i'th dimension + * @param sizeOutput size[i] specifies the number of elements of the 'i'th dimension * of 'input' to slice. If size[i] is -1, all remaining elements in dimension * i are included in the slice (i.e. this is equivalent to setting * size[i] = input.dim_size(i) - begin[i]). + * @param data type for {@code Slice} output and operands + * @param data type for {@code Slice} output and operands * @return a new instance of Slice */ - @Endpoint(describeByClass = true) - public static Slice create(Scope scope, Operand input, Operand begin, Operand size) { + @Endpoint( + describeByClass = true + ) + public static Slice create(Scope scope, Operand input, + Operand begin, Operand sizeOutput) { OperationBuilder opBuilder = scope.env().opBuilder("Slice", scope.makeOpName("Slice")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(begin.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); - return new Slice(opBuilder.build()); + return new Slice<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Slice"; - - private Output output; - - private Slice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Snapshot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Snapshot.java index eb782cf90d8..25c8106b0ac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Snapshot.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Snapshot.java @@ -29,46 +29,53 @@ /** * Returns a copy of the input tensor. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class Snapshot extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Snapshot"; + + private Output output; + + private Snapshot(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Snapshot operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code Snapshot} output and operands * @return a new instance of Snapshot */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Snapshot create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Snapshot", scope.makeOpName("Snapshot")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Snapshot(opBuilder.build()); + return new Snapshot<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Snapshot"; - - private Output output; - - private Snapshot(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SpaceToBatchNd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SpaceToBatchNd.java index df34fd91afd..cc66b8943ee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SpaceToBatchNd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SpaceToBatchNd.java @@ -30,151 +30,158 @@ /** * SpaceToBatch for N-D tensors of type T. - *

- * This operation divides "spatial" dimensions `[1, ..., M]` of the input into a - * grid of blocks of shape `block_shape`, and interleaves these blocks with the - * "batch" dimension (0) such that in the output, the spatial dimensions - * `[1, ..., M]` correspond to the position within the grid, and the batch + * This operation divides "spatial" dimensions {@code [1, ..., M]} of the input into a + * grid of blocks of shape {@code block_shape}, and interleaves these blocks with the + * "batch" dimension (0) such that in the output, the spatial dimensions + * {@code [1, ..., M]} correspond to the position within the grid, and the batch * dimension combines both the position within a spatial block and the original * batch position. Prior to division into blocks, the spatial dimensions of the - * input are optionally zero padded according to `paddings`. See below for a + * input are optionally zero padded according to {@code paddings}. See below for a * precise description. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class SpaceToBatchNd extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SpaceToBatchNd operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SpaceToBatchND"; + + private Output output; + + private SpaceToBatchNd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SpaceToBatchND operation. + * * @param scope current scope - * @param input N-D with shape `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 paddings 2-D with shape `[M, 2]`, all values must be >= 0. - * `paddings[i] = [pad_start, pad_end]` specifies the padding for input dimension - * `i + 1`, which corresponds to spatial dimension `i`. It is required that - * `block_shape[i]` divides `input_shape[i + 1] + pad_start + pad_end`. - *

- * This operation is equivalent to the following steps: - *

- * 1. Zero-pad the start and end of dimensions `[1, ..., M]` of the - * input according to `paddings` to produce `padded` of shape `padded_shape`. - *

- * 2. Reshape `padded` to `reshaped_padded` of shape: - *

- * [batch] + - * [padded_shape[1] / block_shape[0], - * block_shape[0], - * ..., - * padded_shape[M] / block_shape[M-1], - * block_shape[M-1]] + - * remaining_shape - *

- * 3. Permute dimensions of `reshaped_padded` to produce - * `permuted_reshaped_padded` of shape: - *

- * block_shape + - * [batch] + - * [padded_shape[1] / block_shape[0], - * ..., - * padded_shape[M] / block_shape[M-1]] + - * remaining_shape - *

- * 4. Reshape `permuted_reshaped_padded` to flatten `block_shape` into the batch - * dimension, producing an output tensor of shape: - *

- * [batch * prod(block_shape)] + - * [padded_shape[1] / block_shape[0], - * ..., - * padded_shape[M] / block_shape[M-1]] + - * remaining_shape - *

- * Some examples: - *

- * (1) For the following input of shape `[1, 2, 2, 1]`, `block_shape = [2, 2]`, and - * `paddings = [[0, 0], [0, 0]]`: - *

{@code
+   * @param input N-D with shape {@code input_shape = [batch] + spatial_shape + remaining_shape},
+   * where spatial_shape has {@code M} dimensions.
+   * @param blockShape 1-D with shape {@code [M]}, all values must be >= 1.
+   * @param paddings 2-D with shape {@code [M, 2]}, all values must be >= 0.
+   * {@code paddings[i] = [pad_start, pad_end]} specifies the padding for input dimension
+   * {@code i + 1}, which corresponds to spatial dimension {@code i}.  It is required that
+   * {@code block_shape[i]} divides {@code input_shape[i + 1] + pad_start + pad_end}.
+   * 

This operation is equivalent to the following steps: + *

    + *
  1. + *

    Zero-pad the start and end of dimensions {@code [1, ..., M]} of the + * input according to {@code paddings} to produce {@code padded} of shape {@code padded_shape}. + *

  2. + *
  3. + *

    Reshape {@code padded} to {@code reshaped_padded} of shape: + *

    [batch] + + * [padded_shape[1] / block_shape[0], + * block_shape[0], + * ..., + * padded_shape[M] / block_shape[M-1], + * block_shape[M-1]] + + * remaining_shape + *

  4. + *
  5. + *

    Permute dimensions of {@code reshaped_padded} to produce + * {@code permuted_reshaped_padded} of shape: + *

    block_shape + + * [batch] + + * [padded_shape[1] / block_shape[0], + * ..., + * padded_shape[M] / block_shape[M-1]] + + * remaining_shape + *

  6. + *
  7. + *

    Reshape {@code permuted_reshaped_padded} to flatten {@code block_shape} into the batch + * dimension, producing an output tensor of shape: + *

    [batch * prod(block_shape)] + + * [padded_shape[1] / block_shape[0], + * ..., + * padded_shape[M] / block_shape[M-1]] + + * remaining_shape + *

  8. + *
+ *

Some examples: + *

(1) For the following input of shape {@code [1, 2, 2, 1]}, {@code block_shape = [2, 2]}, and + * {@code paddings = [[0, 0], [0, 0]]}: + *

    * 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]`, `block_shape = [2, 2]`, and - * `paddings = [[0, 0], [0, 0]]`: - *
{@code
+   * 
+ *

(2) For the following input of shape {@code [1, 2, 2, 3]}, {@code block_shape = [2, 2]}, and + * {@code paddings = [[0, 0], [0, 0]]}: + *

    * 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]`, `block_shape = [2, 2]`, and - * `paddings = [[0, 0], [0, 0]]`: - *
{@code
+   * 
+ *

(3) For the following input of shape {@code [1, 4, 4, 1]}, {@code block_shape = [2, 2]}, and + * {@code paddings = [[0, 0], [0, 0]]}: + *

    * 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]`, block_shape = `[2, 2]`, and - * paddings = `[[0, 0], [2, 0]]`: - *
{@code
+   * 
+ *

(4) For the following input of shape {@code [2, 2, 4, 1]}, block_shape = {@code [2, 2]}, and + * paddings = {@code [[0, 0], [2, 0]]}: + *

    * x = [[[[1],   [2],  [3],  [4]],
    *       [[5],   [6],  [7],  [8]]],
    *      [[[9],  [10], [11],  [12]],
    *       [[13], [14], [15],  [16]]]]
-   * }
- * The output tensor has shape `[8, 1, 3, 1]` and value: - *
{@code
+   * 
+ *

The output tensor has shape {@code [8, 1, 3, 1]} and value: + *

    * 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]]]]
-   * }
- * 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 data type for {@code SpaceToBatchND} output and operands * @return a new instance of SpaceToBatchNd */ - @Endpoint(describeByClass = true) - public static SpaceToBatchNd create(Scope scope, Operand input, Operand blockShape, Operand paddings) { + @Endpoint( + describeByClass = true + ) + public static SpaceToBatchNd create(Scope scope, Operand input, + Operand blockShape, Operand paddings) { OperationBuilder opBuilder = scope.env().opBuilder("SpaceToBatchND", scope.makeOpName("SpaceToBatchNd")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(blockShape.asOutput()); opBuilder.addInput(paddings.asOutput()); opBuilder = scope.apply(opBuilder); - return new SpaceToBatchNd(opBuilder.build()); + return new SpaceToBatchNd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SpaceToBatchND"; - - private Output output; - - private SpaceToBatchNd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Split.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Split.java index d56a31b93e4..98476c4a960 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Split.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Split.java @@ -32,60 +32,67 @@ import org.tensorflow.types.family.TType; /** - * Splits a tensor into `num_split` tensors along one dimension. - * - * @param data type for {@code output()} output + * Splits a tensor into {@code num_split} tensors along one dimension. + * + * @param data type for {@code output} output */ @Operator public final class Split extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Split"; + + private List> output; + + @SuppressWarnings("unchecked") + private Split(Operation operation) { + super(operation); + int outputIdx = 0; + int outputLength = operation.outputListLength("output"); + output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); + outputIdx += outputLength; + } + /** * Factory method to create a class wrapping a new Split operation. - * + * * @param scope current scope * @param axis 0-D. The dimension along which to split. Must be in the range - * `[-rank(value), rank(value))`. + * {@code [-rank(value), rank(value))}. * @param value The tensor to split. * @param numSplit The number of ways to split. Must evenly divide - * `value.shape[split_dim]`. + * {@code value.shape[split_dim]}. + * @param data type for {@code Split} output and operands * @return a new instance of Split */ - @Endpoint(describeByClass = true) - public static Split create(Scope scope, Operand axis, Operand value, Long numSplit) { + @Endpoint( + describeByClass = true + ) + public static Split create(Scope scope, Operand axis, + Operand value, Long numSplit) { OperationBuilder opBuilder = scope.env().opBuilder("Split", scope.makeOpName("Split")); opBuilder.addInput(axis.asOutput()); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_split", numSplit); - return new Split(opBuilder.build()); + return new Split<>(opBuilder.build()); } - + /** - * They are identically shaped tensors, whose shape matches that of `value` - * except along `axis`, where their sizes are - * `values.shape[split_dim] / num_split`. + * Gets output. + * They are identically shaped tensors, whose shape matches that of {@code value} + * except along {@code axis}, where their sizes are + * {@code values.shape[split_dim] / num_split}. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Split"; - - private List> output; - - @SuppressWarnings("unchecked") - private Split(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SplitV.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SplitV.java index ee7dced8ee8..b62cb587fa7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SplitV.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SplitV.java @@ -33,63 +33,70 @@ import org.tensorflow.types.family.TType; /** - * Splits a tensor into `num_split` tensors along one dimension. - * - * @param data type for {@code output()} output + * Splits a tensor into {@code num_split} tensors along one dimension. + * + * @param data type for {@code output} output */ @Operator public final class SplitV extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SplitV"; + + private List> output; + + @SuppressWarnings("unchecked") + private SplitV(Operation operation) { + super(operation); + int outputIdx = 0; + int outputLength = operation.outputListLength("output"); + output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); + outputIdx += outputLength; + } + /** * Factory method to create a class wrapping a new SplitV operation. - * + * * @param scope current scope * @param value The tensor to split. * @param sizeSplits list containing the sizes of each output tensor along the split * dimension. Must sum to the dimension of value along split_dim. * Can contain one -1 indicating that dimension is to be inferred. * @param axis 0-D. The dimension along which to split. Must be in the range - * `[-rank(value), rank(value))`. - * @param numSplit + * {@code [-rank(value), rank(value))}. + * @param numSplit the value of the numSplit property + * @param data type for {@code SplitV} output and operands * @return a new instance of SplitV */ - @Endpoint(describeByClass = true) - public static SplitV create(Scope scope, Operand value, Operand sizeSplits, Operand axis, Long numSplit) { + @Endpoint( + describeByClass = true + ) + public static SplitV create(Scope scope, Operand value, + Operand sizeSplits, Operand axis, Long numSplit) { OperationBuilder opBuilder = scope.env().opBuilder("SplitV", scope.makeOpName("SplitV")); opBuilder.addInput(value.asOutput()); opBuilder.addInput(sizeSplits.asOutput()); opBuilder.addInput(axis.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_split", numSplit); - return new SplitV(opBuilder.build()); + return new SplitV<>(opBuilder.build()); } - + /** - * Tensors whose shape matches that of `value` - * except along `axis`, where their sizes are - * `size_splits[i]`. + * Gets output. + * Tensors whose shape matches that of {@code value} + * except along {@code axis}, where their sizes are + * {@code size_splits[i]}. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SplitV"; - - private List> output; - - @SuppressWarnings("unchecked") - private SplitV(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Squeeze.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Squeeze.java index bce8dad363e..49fe614adec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Squeeze.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Squeeze.java @@ -17,6 +17,7 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -30,107 +31,141 @@ /** * Removes dimensions of size 1 from the shape of a tensor. - *

- * Given a tensor `input`, this operation returns a tensor of the same type with + * Given a tensor {@code input}, this operation returns a tensor of the same type with * all dimensions of size 1 removed. If you don't want to remove all size 1 * dimensions, you can remove specific size 1 dimensions by specifying - * `axis`. - *

- * For example: - *

{@code
+ * {@code axis}.
+ * 

For example: + *

  * # 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
- * shape(squeeze(t)) ==> [2, 3]
- * }
- * Or, to remove specific size 1 dimensions: - *
{@code
+ * shape(squeeze(t)) ==> [2, 3]
+ * 
+ *

Or, to remove specific size 1 dimensions: + *

  * # 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
- * shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]
- * }
- * - * - * @param data type for {@code output()} output + * shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1] + *
+ * + * @param data type for {@code output} output */ @Operator public final class Squeeze extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Squeeze} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis If specified, only squeezes the dimensions listed. The dimension - * index starts at 0. It is an error to squeeze a dimension that is not 1. Must - * be in the range `[-rank(input), rank(input))`. - */ - public Options axis(List axis) { - this.axis = axis; - return this; - } - - private List axis; - - private Options() { - } + public static final String OP_NAME = "Squeeze"; + + private Output output; + + private Squeeze(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Squeeze operation. - * + * * @param scope current scope - * @param input The `input` to squeeze. - * @param options carries optional attributes values + * @param input The {@code input} to squeeze. + * @param options carries optional attribute values + * @param data type for {@code Squeeze} output and operands * @return a new instance of Squeeze */ - @Endpoint(describeByClass = true) - public static Squeeze create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Squeeze create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Squeeze", scope.makeOpName("Squeeze")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { if (opts.axis != null) { - long[] axisArray = new long[opts.axis.size()]; - for (int i = 0; i < axisArray.length; ++i) { - axisArray[i] = opts.axis.get(i); + long[] squeezeDimsArray = new long[opts.axis.size()]; + for (int i = 0 ; i < squeezeDimsArray.length ; i++) { + squeezeDimsArray[i] = opts.axis.get(i); } - opBuilder.setAttr("squeeze_dims", axisArray); + opBuilder.setAttr("squeeze_dims", squeezeDimsArray); } } } - return new Squeeze(opBuilder.build()); + return new Squeeze<>(opBuilder.build()); } - + /** + * Sets the axis option. + * * @param axis If specified, only squeezes the dimensions listed. The dimension * index starts at 0. It is an error to squeeze a dimension that is not 1. Must - * be in the range `[-rank(input), rank(input))`. + * be in the range {@code [-rank(input), rank(input))}. + * @return this Options instance. */ public static Options axis(List axis) { return new Options().axis(axis); } - + + /** + * Sets the axis option. + * + * @param axis If specified, only squeezes the dimensions listed. The dimension + * index starts at 0. It is an error to squeeze a dimension that is not 1. Must + * be in the range {@code [-rank(input), rank(input))}. + * @return this Options instance. + */ + public static Options axis(Long[] axis) { + return new Options().axis(axis); + } + /** - * Contains the same data as `input`, but has one or more dimensions of + * Gets output. + * Contains the same data as {@code input}, but has one or more dimensions of * size 1 removed. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Squeeze"; - - private Output output; - - private Squeeze(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Squeeze} + */ + public static class Options { + private List axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis If specified, only squeezes the dimensions listed. The dimension + * index starts at 0. It is an error to squeeze a dimension that is not 1. Must + * be in the range {@code [-rank(input), rank(input))}. + * @return this Options instance. + */ + public Options axis(List axis) { + this.axis = axis; + return this; + } + + /** + * Sets the axis option. + * + * @param axis If specified, only squeezes the dimensions listed. The dimension + * index starts at 0. It is an error to squeeze a dimension that is not 1. Must + * be in the range {@code [-rank(input), rank(input))}. + * @return this Options instance. + */ + public Options axis(Long... axis) { + this.axis = Arrays.asList(axis); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stack.java index 3586ca71251..31ff857d014 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stack.java @@ -29,61 +29,54 @@ import org.tensorflow.types.family.TType; /** - * Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor. - *

- * Packs the `N` tensors in `values` into a tensor with rank one higher than each - * tensor in `values`, by packing them along the `axis` dimension. - * Given a list of tensors of shape `(A, B, C)`; - *

- * if `axis == 0` then the `output` tensor will have the shape `(N, A, B, C)`. - * if `axis == 1` then the `output` tensor will have the shape `(A, N, B, C)`. + * Packs a list of {@code N} rank-{@code R} tensors into one rank-{@code (R+1)} tensor. + * Packs the {@code N} tensors in {@code values} into a tensor with rank one higher than each + * tensor in {@code values}, by packing them along the {@code axis} dimension. + * Given a list of tensors of shape {@code (A, B, C)}; + *

if {@code axis == 0} then the {@code output} tensor will have the shape {@code (N, A, B, C)}. + * if {@code axis == 1} then the {@code output} tensor will have the shape {@code (A, N, B, C)}. * Etc. - *

- * For example: - *

{@code
+ * 

For example: + *

  * # 'x' is [1, 4]
  * # 'y' is [2, 5]
  * # 'z' is [3, 6]
- * pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]]  # Pack along first dim.
- * pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]
- * }
- * This is the opposite of `unpack`. - * - * @param data type for {@code output()} output + * pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim. + * pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]] + *
+ *

This is the opposite of {@code unpack}. + * + * @param data type for {@code output} output */ @Operator public final class Stack extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Stack} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis Dimension along which to pack. Negative values wrap around, so the - * valid range is `[-(R+1), R+1)`. - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Long axis; - - private Options() { - } + public static final String OP_NAME = "Pack"; + + private Output output; + + private Stack(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Stack operation. - * + * Factory method to create a class wrapping a new Pack operation. + * * @param scope current scope * @param values Must be of same shape and type. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Pack} output and operands * @return a new instance of Stack */ - @Endpoint(describeByClass = true) - public static Stack create(Scope scope, Iterable> values, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Stack create(Scope scope, Iterable> values, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Pack", scope.makeOpName("Stack")); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder = scope.apply(opBuilder); @@ -94,37 +87,53 @@ public static Stack create(Scope scope, Iterable } } } - return new Stack(opBuilder.build()); + return new Stack<>(opBuilder.build()); } - + /** + * Sets the axis option. + * * @param axis Dimension along which to pack. Negative values wrap around, so the - * valid range is `[-(R+1), R+1)`. + * valid range is {@code [-(R+1), R+1)}. + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. * The packed tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Pack"; - - private Output output; - - private Stack(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Stack} + */ + public static class Options { + private Long axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis Dimension along which to pack. Negative values wrap around, so the + * valid range is {@code [-(R+1), R+1)}. + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stage.java index 3925ec6313b..527fd5f3c53 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Stage.java @@ -28,72 +28,32 @@ /** * Stage values similar to a lightweight Enqueue. - *

* The basic functionality of this Op is similar to a queue with many * fewer capabilities and options. This Op is optimized for performance. */ @Operator public final class Stage extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.Stage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts - * on the container will block when the capacity is reached. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit The maximum number of bytes allowed for Tensors in the Staging Area. - * If > 0, inserts will block until sufficient space is available. - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. Otherwise, - * a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName It is necessary to match this name to the matching Unstage Op. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "Stage"; + + private Stage(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new Stage operation. - * + * * @param scope current scope * @param values a list of tensors * dtypes A list of data types that inserted values should adhere to. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Stage */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Stage create(Scope scope, Iterable> values, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Stage", scope.makeOpName("Stage")); opBuilder.addInputList(Operands.asOutputs(values)); @@ -116,42 +76,110 @@ public static Stage create(Scope scope, Iterable> values, Options... } return new Stage(opBuilder.build()); } - + /** - * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts * on the container will block when the capacity is reached. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the memoryLimit option. + * * @param memoryLimit The maximum number of bytes allowed for Tensors in the Staging Area. - * If > 0, inserts will block until sufficient space is available. + * If > 0, inserts will block until sufficient space is available. + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. Otherwise, * a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Stage"; - - private Stage(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Stage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity Maximum number of elements in the Staging Area. If > 0, inserts + * on the container will block when the capacity is reached. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit The maximum number of bytes allowed for Tensors in the Staging Area. + * If > 0, inserts will block until sufficient space is available. + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. Otherwise, + * a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName It is necessary to match this name to the matching Unstage Op. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageClear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageClear.java index 7be90432f6b..ba08b758785 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageClear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageClear.java @@ -32,63 +32,28 @@ */ @Operator public final class StageClear extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.StageClear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "StageClear"; + + private StageClear(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new StageClear operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of StageClear */ - @Endpoint(describeByClass = true) - public static StageClear create(Scope scope, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static StageClear create(Scope scope, List> dtypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StageClear", scope.makeOpName("StageClear")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); @@ -110,39 +75,104 @@ public static StageClear create(Scope scope, List> dtypes } return new StageClear(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StageClear"; - - private StageClear(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StageClear} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StagePeek.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StagePeek.java index eb6e6dde91c..b431723eb47 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StagePeek.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StagePeek.java @@ -34,71 +34,42 @@ /** * Op peeks at the values at the specified index. If the - *

* underlying container does not contain sufficient elements * this op will block until it does. This Op is optimized for * performance. */ @Operator public final class StagePeek extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.core.StagePeek} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "StagePeek"; + + private List> values; + + @SuppressWarnings("unchecked") + private StagePeek(Operation operation) { + super(operation); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new StagePeek operation. - * + * * @param scope current scope - * @param index - * @param dtypes - * @param options carries optional attributes values + * @param index the index value + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of StagePeek */ - @Endpoint(describeByClass = true) - public static StagePeek create(Scope scope, Operand index, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static StagePeek create(Scope scope, Operand index, + List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StagePeek", scope.makeOpName("StagePeek")); opBuilder.addInput(index.asOutput()); opBuilder = scope.apply(opBuilder); @@ -121,57 +92,119 @@ public static StagePeek create(Scope scope, Operand index, List> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StagePeek"; - - private List> values; - - private StagePeek(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.StagePeek} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageSize.java index c70660c2071..15c77f0f49b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StageSize.java @@ -35,63 +35,32 @@ */ @Operator public final class StageSize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.StageSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "StageSize"; + + private Output output; + + private StageSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StageSize operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of StageSize */ - @Endpoint(describeByClass = true) - public static StageSize create(Scope scope, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static StageSize create(Scope scope, List> dtypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StageSize", scope.makeOpName("StageSize")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); @@ -113,54 +82,118 @@ public static StageSize create(Scope scope, List> dtypes, } return new StageSize(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StageSize"; - - private Output output; - - private StageSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StageSize} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StopGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StopGradient.java index e4e8ac9bd46..521be5199ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StopGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StopGradient.java @@ -29,71 +29,71 @@ /** * Stops gradient computation. - *

* When executed in a graph, this op outputs its input tensor as-is. - *

- * When building ops to compute gradients, this op prevents the contribution of + *

When building ops to compute gradients, this op prevents the contribution of * its inputs to be taken into account. Normally, the gradient generator adds ops * to a graph to compute the derivatives of a specified 'loss' by recursively * finding out inputs that contributed to its computation. If you insert this op * in the graph it inputs are masked from the gradient generator. They are not * taken into account for computing gradients. - *

- * This is useful any time you want to compute a value with TensorFlow but need + *

This is useful any time you want to compute a value with TensorFlow but need * to pretend that the value was a constant. Some examples include: *

    - *
  • - * The EM algorithm where the M-step should not involve backpropagation - * through the output of the E-step. - *
  • - *
  • - * Contrastive divergence training of Boltzmann machines where, when - * differentiating the energy function, the training must not backpropagate - * through the graph that generated the samples from the model. - *
  • - *
  • - * Adversarial training, where no backprop should happen through the adversarial - * example generation process. - * - * @param data type for {@code output()} output + *
  • The EM algorithm where the M-step should not involve backpropagation + * through the output of the E-step.
  • + *
  • Contrastive divergence training of Boltzmann machines where, when + * differentiating the energy function, the training must not backpropagate + * through the graph that generated the samples from the model.
  • + *
  • Adversarial training, where no backprop should happen through the adversarial + * example generation process.
  • + *
+ * + * @param data type for {@code output} output */ @Operator public final class StopGradient extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StopGradient"; + + private Output output; + + private StopGradient(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StopGradient operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code StopGradient} output and operands * @return a new instance of StopGradient */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StopGradient create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("StopGradient", scope.makeOpName("StopGradient")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new StopGradient(opBuilder.build()); + return new StopGradient<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StopGradient"; - - private Output output; - - private StopGradient(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSlice.java index 2e1cc56828b..ea85e807597 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSlice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSlice.java @@ -29,192 +29,149 @@ import org.tensorflow.types.family.TType; /** - * Return a strided slice from `input`. - *

- * Note, most python users will want to use the Python `Tensor.__getitem__` - * or `Variable.__getitem__` rather than this op directly. - *

- * The goal of this op is to produce a new tensor with a subset of - * the elements from the `n` dimensional `input` tensor. The subset is chosen using - * a sequence of `m` sparse range specifications encoded into the arguments + * Return a strided slice from {@code input}. + * Note, most python users will want to use the Python {@code Tensor.__getitem__} + * or {@code Variable.__getitem__} rather than this op directly. + *

The goal of this op is to produce a new tensor with a subset of + * the elements from the {@code n} dimensional {@code input} tensor. The subset is chosen using + * a sequence of {@code m} sparse range specifications encoded into the arguments * of this function. Note, in some cases - * `m` could be equal to `n`, but this need not be the case. Each + * {@code m} could be equal to {@code n}, but this need not be the case. Each * range specification entry can be one of the following: - *

- * - An ellipsis (...). Ellipses are used to imply zero or more - * dimensions of full-dimension selection and are produced using - * `ellipsis_mask`. For example, `foo[...]` is the identity slice. - *

- * - A new axis. This is used to insert a new shape=1 dimension and is - * produced using `new_axis_mask`. For example, `foo[:, ...]` where - * `foo` is shape `(3, 4)` produces a `(1, 3, 4)` tensor. - *

- * - A range `begin:end:stride`. This is used to specify how much to choose from - * a given dimension. `stride` can be any integer but 0. `begin` is an integer - * which represents the index of the first value to select while `end` represents - * the index of the last value to select. The number of values selected in each - * dimension is `end - begin` if `stride > 0` and `begin - end` if `stride < 0`. - * `begin` and `end` can be negative where `-1` is the last element, `-2` is - * the second to last. `begin_mask` controls whether to replace the explicitly - * given `begin` with an implicit effective value of `0` if `stride > 0` and - * `-1` if `stride < 0`. `end_mask` is analogous but produces the number - * required to create the largest open interval. For example, given a shape - * `(3,)` tensor `foo[:]`, the effective `begin` and `end` are `0` and `3`. Do - * not assume this is equivalent to `foo[0:-1]` which has an effective `begin` - * and `end` of `0` and `2`. Another example is `foo[-2::-1]` which reverses the - * first dimension of a tensor while dropping the last two (in the original - * order elements). For example `foo = [1,2,3,4]; foo[-2::-1]` is `[4,3]`. - *

- * - A single index. This is used to keep only elements that have a given - * index. For example (`foo[2, :]` on a shape `(5,6)` tensor produces a - * shape `(6,)` tensor. This is encoded in `begin` and `end` and - * `shrink_axis_mask`. - *

- * Each conceptual range specification is encoded in the op's argument. This + *

    + *
  • + *

    An ellipsis (...). Ellipses are used to imply zero or more + * dimensions of full-dimension selection and are produced using + * {@code ellipsis_mask}. For example, {@code foo[...]} is the identity slice. + *

  • + *
  • + *

    A new axis. This is used to insert a new shape=1 dimension and is + * produced using {@code new_axis_mask}. For example, {@code foo[:, ...]} where + * {@code foo} is shape {@code (3, 4)} produces a {@code (1, 3, 4)} tensor. + *

  • + *
  • + *

    A range {@code begin:end:stride}. This is used to specify how much to choose from + * a given dimension. {@code stride} can be any integer but 0. {@code begin} is an integer + * which represents the index of the first value to select while {@code end} represents + * the index of the last value to select. The number of values selected in each + * dimension is {@code end - begin} if {@code stride > 0} and {@code begin - end} if {@code stride < 0}. + * {@code begin} and {@code end} can be negative where {@code -1} is the last element, {@code -2} is + * the second to last. {@code begin_mask} controls whether to replace the explicitly + * given {@code begin} with an implicit effective value of {@code 0} if {@code stride > 0} and + * {@code -1} if {@code stride < 0}. {@code end_mask} is analogous but produces the number + * required to create the largest open interval. For example, given a shape + * {@code (3,)} tensor {@code foo[:]}, the effective {@code begin} and {@code end} are {@code 0} and {@code 3}. Do + * not assume this is equivalent to {@code foo[0:-1]} which has an effective {@code begin} + * and {@code end} of {@code 0} and {@code 2}. Another example is {@code foo[-2::-1]} which reverses the + * first dimension of a tensor while dropping the last two (in the original + * order elements). For example {@code foo = [1,2,3,4]; foo[-2::-1]} is {@code [4,3]}. + *

  • + *
  • + *

    A single index. This is used to keep only elements that have a given + * index. For example ({@code foo[2, :]} on a shape {@code (5,6)} tensor produces a + * shape {@code (6,)} tensor. This is encoded in {@code begin} and {@code end} and + * {@code shrink_axis_mask}. + *

  • + *
+ *

Each conceptual range specification is encoded in the op's argument. This * encoding is best understand by considering a non-trivial example. In * particular, - * `foo[1, 2:4, None, ..., :-3:-1, :]` will be encoded as - *

{@code
+ * {@code foo[1, 2:4, None, ..., :-3:-1, :]} will be encoded as
+ * 
  * begin = [1, 2, x, x, 0, x] # x denotes don't care (usually 0)
  * end = [2, 4, x, x, -3, x]
  * strides = [1, 1, x, x, -1, 1]
- * begin_mask = 1<<4 | 1<<5 = 48
- * end_mask = 1<<5 = 32
- * ellipsis_mask = 1<<3 = 8
- * new_axis_mask = 1<<2 = 4
- * shrink_axis_mask = 1<<0 = 1
- * }
- * In this case if `foo.shape` is (5, 5, 5, 5, 5, 5) the final shape of + * begin_mask = 1<<4 | 1<<5 = 48 + * end_mask = 1<<5 = 32 + * ellipsis_mask = 1<<3 = 8 + * new_axis_mask = 1<<2 = 4 + * shrink_axis_mask = 1<<0 = 1 + *
+ *

In this case if {@code foo.shape} is (5, 5, 5, 5, 5, 5) the final shape of * the slice becomes (2, 1, 5, 5, 2, 5). * Let us walk step by step through each argument specification. - *

- * 1. The first argument in the example slice is turned into `begin = 1` and - * `end = begin + 1 = 2`. To disambiguate from the original spec `2:4` we - * also set the appropriate bit in `shrink_axis_mask`. - *

- * 2. `2:4` is contributes 2, 4, 1 to begin, end, and stride. All masks have + *

    + *
  1. + *

    The first argument in the example slice is turned into {@code begin = 1} and + * {@code end = begin + 1 = 2}. To disambiguate from the original spec {@code 2:4} we + * also set the appropriate bit in {@code shrink_axis_mask}. + *

  2. + *
  3. + *

    {@code 2:4} is contributes 2, 4, 1 to begin, end, and stride. All masks have * zero bits contributed. - *

    - * 3. None is a synonym for `tf.newaxis`. This means insert a dimension of size 1 + *

  4. + *
  5. + *

    None is a synonym for {@code tf.newaxis}. This means insert a dimension of size 1 * dimension in the final shape. Dummy values are contributed to begin, * end and stride, while the new_axis_mask bit is set. - *

    - * 4. `...` grab the full ranges from as many dimensions as needed to + *

  6. + *
  7. + *

    {@code ...} grab the full ranges from as many dimensions as needed to * fully specify a slice for every dimension of the input shape. - *

    - * 5. `:-3:-1` shows the use of negative indices. A negative index `i` associated - * with a dimension that has shape `s` is converted to a positive index - * `s + i`. So `-1` becomes `s-1` (i.e. the last element). This conversion + *

  8. + *
  9. + *

    {@code :-3:-1} shows the use of negative indices. A negative index {@code i} associated + * with a dimension that has shape {@code s} is converted to a positive index + * {@code s + i}. So {@code -1} becomes {@code s-1} (i.e. the last element). This conversion * is done internally so begin, end and strides receive x, -3, and -1. * The appropriate begin_mask bit is set to indicate the start range is the * full range (ignoring the x). - *

    - * 6. `:` indicates that the entire contents of the corresponding dimension - * is selected. This is equivalent to `::` or `0::1`. begin, end, and strides - * receive 0, 0, and 1, respectively. The appropriate bits in `begin_mask` and - * `end_mask` are also set. - *

    - * Requirements: - * `0 != strides[i] for i in [0, m)` - * `ellipsis_mask must be a power of two (only one ellipsis)` - * - * @param data type for {@code output()} output + *

  10. + *
  11. + *

    {@code :} indicates that the entire contents of the corresponding dimension + * is selected. This is equivalent to {@code ::} or {@code 0::1}. begin, end, and strides + * receive 0, 0, and 1, respectively. The appropriate bits in {@code begin_mask} and + * {@code end_mask} are also set. + *

  12. + *
+ *

Requirements: + * {@code 0 != strides[i] for i in [0, m)} + * {@code ellipsis_mask must be a power of two (only one ellipsis)} + * + * @param data type for {@code output} output */ @Operator public final class StridedSlice extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.StridedSlice} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask a bitmask where a bit i being 1 means to ignore the begin - * value and instead use the largest interval possible. At runtime - * begin[i] will be replaced with `[0, n-1)` if `stride[i] > 0` or - * `[-1, n-1]` if `stride[i] < 0` - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask analogous to `begin_mask` - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask a bitmask where bit `i` being 1 means the `i`th - * position is actually an ellipsis. One bit at most can be 1. - * If `ellipsis_mask == 0`, then an implicit ellipsis mask of `1 << (m+1)` - * is provided. This means that `foo[3:5] == foo[3:5, ...]`. An ellipsis - * implicitly creates as many range specifications as necessary to fully - * specify the sliced range for every dimension. For example for a 4-dimensional - * tensor `foo` the slice `foo[2, ..., 5:8]` implies `foo[2, :, :, 5:8]`. - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask a bitmask where bit `i` being 1 means the `i`th - * specification creates a new shape 1 dimension. For example - * `foo[:4, tf.newaxis, :2]` would produce a shape `(4, 1, 2)` tensor. - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask a bitmask where bit `i` implies that the `i`th - * specification should shrink the dimensionality. begin and end - * must imply a slice of size 1 in the dimension. For example in - * python one might do `foo[:, 3, :]` which would result in - * `shrink_axis_mask` being 2. - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "StridedSlice"; + + private Output output; + + private StridedSlice(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StridedSlice operation. - * + * * @param scope current scope - * @param input - * @param begin `begin[k]` specifies the offset into the `k`th range specification. + * @param input the input value + * @param begin {@code begin[k]} specifies the offset into the {@code k}th range specification. * The exact dimension this corresponds to will be determined by context. - * Out-of-bounds values will be silently clamped. If the `k`th bit of - * `begin_mask` then `begin[k]` is ignored and the full range of the + * Out-of-bounds values will be silently clamped. If the {@code k}th bit of + * {@code begin_mask} then {@code begin[k]} is ignored and the full range of the * appropriate dimension is used instead. Negative values causes indexing - * to start from the highest element e.g. If `foo==[1,2,3]` then `foo[-1]==3`. - * @param end `end[i]` is like `begin` with the exception that `end_mask` is + * to start from the highest element e.g. If {@code foo==[1,2,3]} then {@code foo[-1]==3}. + * @param end {@code end[i]} is like {@code begin} with the exception that {@code end_mask} is * used to determine full ranges. - * @param strides `strides[i]` specifies the increment in the `i`th specification + * @param strides {@code strides[i]} specifies the increment in the {@code i}th specification * after extracting a given element. Negative indices will reverse * the original order. Out or range values are - * clamped to `[0,dim[i]) if slice[i]>0` or `[-1,dim[i]-1] if slice[i] < 0` - * @param options carries optional attributes values + * clamped to {@code [0,dim[i]) if slice[i]>0} or {@code [-1,dim[i]-1] if slice[i] < 0} + * @param options carries optional attribute values + * @param data type for {@code StridedSlice} output and operands + * @param data type for {@code StridedSlice} output and operands * @return a new instance of StridedSlice */ - @Endpoint(describeByClass = true) - public static StridedSlice create(Scope scope, Operand input, Operand begin, Operand end, Operand strides, Options... options) { + @Endpoint( + describeByClass = true + ) + public static StridedSlice create(Scope scope, + Operand input, Operand begin, Operand end, Operand strides, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StridedSlice", scope.makeOpName("StridedSlice")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(begin.asOutput()); @@ -240,78 +197,173 @@ public static StridedSlice create(Scope } } } - return new StridedSlice(opBuilder.build()); + return new StridedSlice<>(opBuilder.build()); } - + /** + * Sets the beginMask option. + * * @param beginMask a bitmask where a bit i being 1 means to ignore the begin * value and instead use the largest interval possible. At runtime - * begin[i] will be replaced with `[0, n-1)` if `stride[i] > 0` or - * `[-1, n-1]` if `stride[i] < 0` + * begin[i] will be replaced with {@code [0, n-1)} if {@code stride[i] > 0} or + * {@code [-1, n-1]} if {@code stride[i] < 0} + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask analogous to `begin_mask` + * Sets the endMask option. + * + * @param endMask analogous to {@code begin_mask} + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask a bitmask where bit `i` being 1 means the `i`th + * Sets the ellipsisMask option. + * + * @param ellipsisMask a bitmask where bit {@code i} being 1 means the {@code i}th * position is actually an ellipsis. One bit at most can be 1. - * If `ellipsis_mask == 0`, then an implicit ellipsis mask of `1 << (m+1)` - * is provided. This means that `foo[3:5] == foo[3:5, ...]`. An ellipsis + * If {@code ellipsis_mask == 0}, then an implicit ellipsis mask of {@code 1 << (m+1)} + * is provided. This means that {@code foo[3:5] == foo[3:5, ...]}. An ellipsis * implicitly creates as many range specifications as necessary to fully * specify the sliced range for every dimension. For example for a 4-dimensional - * tensor `foo` the slice `foo[2, ..., 5:8]` implies `foo[2, :, :, 5:8]`. + * tensor {@code foo} the slice {@code foo[2, ..., 5:8]} implies {@code foo[2, :, :, 5:8]}. + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask a bitmask where bit `i` being 1 means the `i`th + * Sets the newAxisMask option. + * + * @param newAxisMask a bitmask where bit {@code i} being 1 means the {@code i}th * specification creates a new shape 1 dimension. For example - * `foo[:4, tf.newaxis, :2]` would produce a shape `(4, 1, 2)` tensor. + * {@code foo[:4, tf.newaxis, :2]} would produce a shape {@code (4, 1, 2)} tensor. + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask a bitmask where bit `i` implies that the `i`th + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask a bitmask where bit {@code i} implies that the {@code i}th * specification should shrink the dimensionality. begin and end * must imply a slice of size 1 in the dimension. For example in - * python one might do `foo[:, 3, :]` which would result in - * `shrink_axis_mask` being 2. + * python one might do {@code foo[:, 3, :]} which would result in + * {@code shrink_axis_mask} being 2. + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StridedSlice"; - - private Output output; - - private StridedSlice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StridedSlice} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask a bitmask where a bit i being 1 means to ignore the begin + * value and instead use the largest interval possible. At runtime + * begin[i] will be replaced with {@code [0, n-1)} if {@code stride[i] > 0} or + * {@code [-1, n-1]} if {@code stride[i] < 0} + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask analogous to {@code begin_mask} + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask a bitmask where bit {@code i} being 1 means the {@code i}th + * position is actually an ellipsis. One bit at most can be 1. + * If {@code ellipsis_mask == 0}, then an implicit ellipsis mask of {@code 1 << (m+1)} + * is provided. This means that {@code foo[3:5] == foo[3:5, ...]}. An ellipsis + * implicitly creates as many range specifications as necessary to fully + * specify the sliced range for every dimension. For example for a 4-dimensional + * tensor {@code foo} the slice {@code foo[2, ..., 5:8]} implies {@code foo[2, :, :, 5:8]}. + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask a bitmask where bit {@code i} being 1 means the {@code i}th + * specification creates a new shape 1 dimension. For example + * {@code foo[:4, tf.newaxis, :2]} would produce a shape {@code (4, 1, 2)} tensor. + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask a bitmask where bit {@code i} implies that the {@code i}th + * specification should shrink the dimensionality. begin and end + * must imply a slice of size 1 in the dimension. For example in + * python one might do {@code foo[:, 3, :]} which would result in + * {@code shrink_axis_mask} being 2. + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = shrinkAxisMask; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceAssign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceAssign.java index f3662beb353..b53f429f456 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceAssign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceAssign.java @@ -29,89 +29,50 @@ import org.tensorflow.types.family.TType; /** - * Assign `value` to the sliced l-value reference of `ref`. - *

- * The values of `value` are assigned to the positions in the variable - * `ref` that are selected by the slice parameters. The slice parameters - * `begin`, `end`, `strides`, etc. work exactly as in `StridedSlice`. - *

- * NOTE this op currently does not support broadcasting and so `value`'s - * shape must be exactly the shape produced by the slice of `ref`. - * - * @param data type for {@code outputRef()} output + * Assign {@code value} to the sliced l-value reference of {@code ref}. + * The values of {@code value} are assigned to the positions in the variable + * {@code ref} that are selected by the slice parameters. The slice parameters + * {@code begin}, {@code end}, {@code strides}, etc. work exactly as in {@code StridedSlice}. + *

NOTE this op currently does not support broadcasting and so {@code value}'s + * shape must be exactly the shape produced by the slice of {@code ref}. + * + * @param data type for {@code output_ref} output */ @Operator public final class StridedSliceAssign extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.StridedSliceAssign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "StridedSliceAssign"; + + private Output outputRef; + + private StridedSliceAssign(Operation operation) { + super(operation); + int outputIdx = 0; + outputRef = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StridedSliceAssign operation. - * + * * @param scope current scope - * @param ref - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values + * @param ref the ref value + * @param begin the begin value + * @param end the end value + * @param strides the strides value + * @param value the value value + * @param options carries optional attribute values + * @param data type for {@code StridedSliceAssign} output and operands + * @param data type for {@code StridedSliceAssign} output and operands * @return a new instance of StridedSliceAssign */ - @Endpoint(describeByClass = true) - public static StridedSliceAssign create(Scope scope, Operand ref, Operand begin, Operand end, Operand strides, Operand value, Options... options) { + @Endpoint( + describeByClass = true + ) + public static StridedSliceAssign create(Scope scope, + Operand ref, Operand begin, Operand end, Operand strides, Operand value, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StridedSliceAssign", scope.makeOpName("StridedSliceAssign")); opBuilder.addInput(ref.asOutput()); opBuilder.addInput(begin.asOutput()); @@ -138,63 +99,143 @@ public static StridedSliceAssign create( } } } - return new StridedSliceAssign(opBuilder.build()); + return new StridedSliceAssign<>(opBuilder.build()); } - + /** - * @param beginMask + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - + /** + * Gets outputRef. + * + * @return outputRef. */ public Output outputRef() { return outputRef; } - + @Override public Output asOutput() { return outputRef; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StridedSliceAssign"; - - private Output outputRef; - - private StridedSliceAssign(Operation operation) { - super(operation); - int outputIdx = 0; - outputRef = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StridedSliceAssign} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = shrinkAxisMask; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceGrad.java index d9559f48eb1..125b88fb75e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StridedSliceGrad.java @@ -29,91 +29,52 @@ import org.tensorflow.types.family.TType; /** - * Returns the gradient of `StridedSlice`. - *

- * Since `StridedSlice` cuts out pieces of its `input` which is size - * `shape`, its gradient will have the same shape (which is passed here - * as `shape`). The gradient will be zero in any element that the slice + * Returns the gradient of {@code StridedSlice}. + * Since {@code StridedSlice} cuts out pieces of its {@code input} which is size + * {@code shape}, its gradient will have the same shape (which is passed here + * as {@code shape}). The gradient will be zero in any element that the slice * does not select. - *

- * Arguments are the same as StridedSliceGrad with the exception that - * `dy` is the input gradient to be propagated and `shape` is the - * shape of `StridedSlice`'s `input`. - * - * @param data type for {@code output()} output + *

Arguments are the same as StridedSliceGrad with the exception that + * {@code dy} is the input gradient to be propagated and {@code shape} is the + * shape of {@code StridedSlice}'s {@code input}. + * + * @param data type for {@code output} output */ @Operator public final class StridedSliceGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.StridedSliceGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "StridedSliceGrad"; + + private Output output; + + private StridedSliceGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StridedSliceGrad operation. - * + * * @param scope current scope - * @param shape - * @param begin - * @param end - * @param strides - * @param dy - * @param options carries optional attributes values + * @param shape the shape value + * @param begin the begin value + * @param end the end value + * @param strides the strides value + * @param dy the dy value + * @param options carries optional attribute values + * @param data type for {@code StridedSliceGrad} output and operands + * @param data type for {@code StridedSliceGrad} output and operands * @return a new instance of StridedSliceGrad */ - @Endpoint(describeByClass = true) - public static StridedSliceGrad create(Scope scope, Operand shape, Operand begin, Operand end, Operand strides, Operand dy, Options... options) { + @Endpoint( + describeByClass = true + ) + public static StridedSliceGrad create(Scope scope, + Operand shape, Operand begin, Operand end, Operand strides, Operand dy, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StridedSliceGrad", scope.makeOpName("StridedSliceGrad")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(begin.asOutput()); @@ -140,63 +101,143 @@ public static StridedSliceGrad create(Sc } } } - return new StridedSliceGrad(opBuilder.build()); + return new StridedSliceGrad<>(opBuilder.build()); } - + /** - * @param beginMask + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StridedSliceGrad"; - - private Output output; - - private StridedSliceGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.StridedSliceGrad} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = shrinkAxisMask; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Sum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Sum.java index 0eedfb90a82..a0b4d10e4c3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Sum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Sum.java @@ -30,48 +30,44 @@ /** * Computes the sum 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 data type for {@code output} output */ @Operator public final class Sum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Sum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Sum"; + + private Output output; + + private Sum(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Sum operation. - * + * * @param scope current scope * @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 Sum} output and operands * @return a new instance of Sum */ - @Endpoint(describeByClass = true) - public static Sum create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Sum create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Sum", scope.makeOpName("Sum")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +79,51 @@ public static Sum create(Scope scope, Operand input, Ope } } } - return new Sum(opBuilder.build()); + return new Sum<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sum"; - - private Output output; - - private Sum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Sum} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SwitchCond.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SwitchCond.java index 5662f5b9509..38a7ed866d0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SwitchCond.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SwitchCond.java @@ -29,59 +29,67 @@ import org.tensorflow.types.family.TType; /** - * Forwards `data` to the output port determined by `pred`. - *

- * If `pred` is true, the `data` input is forwarded to `output_true`. Otherwise, - * the data goes to `output_false`. - *

- * See also `RefSwitch` and `Merge`. - * - * @param data type for {@code outputFalse()} output + * Forwards {@code data} to the output port determined by {@code pred}. + * If {@code pred} is true, the {@code data} input is forwarded to {@code output_true}. Otherwise, + * the data goes to {@code output_false}. + *

See also {@code RefSwitch} and {@code Merge}. + * + * @param data type for {@code output_false} output */ @Operator public final class SwitchCond extends RawOp { - /** - * Factory method to create a class wrapping a new SwitchCond operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Switch"; + + private Output outputFalse; + + private Output outputTrue; + + private SwitchCond(Operation operation) { + super(operation); + int outputIdx = 0; + outputFalse = operation.output(outputIdx++); + outputTrue = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Switch operation. + * * @param scope current scope * @param data The tensor to be forwarded to the appropriate output. * @param pred A scalar that specifies which output port will receive data. + * @param data type for {@code Switch} output and operands * @return a new instance of SwitchCond */ - @Endpoint(describeByClass = true) - public static SwitchCond create(Scope scope, Operand data, Operand pred) { + @Endpoint( + describeByClass = true + ) + public static SwitchCond create(Scope scope, Operand data, + Operand pred) { OperationBuilder opBuilder = scope.env().opBuilder("Switch", scope.makeOpName("SwitchCond")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(pred.asOutput()); opBuilder = scope.apply(opBuilder); - return new SwitchCond(opBuilder.build()); + return new SwitchCond<>(opBuilder.build()); } - + /** - * If `pred` is false, data will be forwarded to this output. + * Gets outputFalse. + * If {@code pred} is false, data will be forwarded to this output. + * @return outputFalse. */ public Output outputFalse() { return outputFalse; } - + /** - * If `pred` is true, data will be forwarded to this output. + * Gets outputTrue. + * If {@code pred} is true, data will be forwarded to this output. + * @return outputTrue. */ public Output outputTrue() { return outputTrue; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Switch"; - - private Output outputFalse; - private Output outputTrue; - - private SwitchCond(Operation operation) { - super(operation); - int outputIdx = 0; - outputFalse = operation.output(outputIdx++); - outputTrue = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TemporaryVariable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TemporaryVariable.java index 15f54863824..3b87b135172 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TemporaryVariable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TemporaryVariable.java @@ -31,58 +31,50 @@ /** * Returns a tensor that may be mutated, but only persists within a single step. - *

* This is an experimental op for internal use only and it is possible to use this * op in unsafe ways. DO NOT USE unless you fully understand the risks. - *

- * It is the caller's responsibility to ensure that 'ref' is eventually passed to a + *

It is the caller's responsibility to ensure that 'ref' is eventually passed to a * matching 'DestroyTemporaryVariable' op after all other uses have completed. - *

- * Outputs a ref to the tensor state so it may be read or modified. - *

- * E.g. - * var = state_ops._temporary_variable([1, 2], types.float_) - * var_name = var.op.name - * var = state_ops.assign(var, [[4.0, 5.0]]) - * var = state_ops.assign_add(var, [[6.0, 7.0]]) - * final = state_ops._destroy_temporary_variable(var, var_name=var_name) - * - * @param data type for {@code ref()} output + *

Outputs a ref to the tensor state so it may be read or modified. + *

E.g. + * var = state_ops.temporary_variable([1, 2], types.float) + * var_name = var.op.name + * var = state_ops.assign(var, [[4.0, 5.0]]) + * var = state_ops.assign_add(var, [[6.0, 7.0]]) + * final = state_ops._destroy_temporary_variable(var, var_name=var_name) + * + * @param data type for {@code ref} output */ @Operator public final class TemporaryVariable extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TemporaryVariable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param varName Overrides the name used for the temporary variable resource. Default - * value is the name of the 'TemporaryVariable' op (which is guaranteed unique). - */ - public Options varName(String varName) { - this.varName = varName; - return this; - } - - private String varName; - - private Options() { - } + public static final String OP_NAME = "TemporaryVariable"; + + private Output ref; + + private TemporaryVariable(Operation operation) { + super(operation); + int outputIdx = 0; + ref = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TemporaryVariable operation. - * + * * @param scope current scope * @param shape The shape of the variable tensor. * @param dtype The type of elements in the variable tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TemporaryVariable} output and operands * @return a new instance of TemporaryVariable */ - @Endpoint(describeByClass = true) - public static TemporaryVariable create(Scope scope, Shape shape, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TemporaryVariable create(Scope scope, Shape shape, + Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TemporaryVariable", scope.makeOpName("TemporaryVariable")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); @@ -94,37 +86,53 @@ public static TemporaryVariable create(Scope scope, Shape s } } } - return new TemporaryVariable(opBuilder.build()); + return new TemporaryVariable<>(opBuilder.build()); } - + /** + * Sets the varName option. + * * @param varName Overrides the name used for the temporary variable resource. Default * value is the name of the 'TemporaryVariable' op (which is guaranteed unique). + * @return this Options instance. */ public static Options varName(String varName) { return new Options().varName(varName); } - + /** + * Gets ref. * A reference to the variable tensor. + * @return ref. */ public Output ref() { return ref; } - + @Override public Output asOutput() { return ref; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TemporaryVariable"; - - private Output ref; - - private TemporaryVariable(Operation operation) { - super(operation); - int outputIdx = 0; - ref = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TemporaryVariable} + */ + public static class Options { + private String varName; + + private Options() { + } + + /** + * Sets the varName option. + * + * @param varName Overrides the name used for the temporary variable resource. Default + * value is the name of the 'TemporaryVariable' op (which is guaranteed unique). + * @return this Options instance. + */ + public Options varName(String varName) { + this.varName = varName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArray.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArray.java index c162f3110f6..1dab0aa5619 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArray.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArray.java @@ -33,92 +33,44 @@ /** * An array of Tensors of given size. - *

* Write data via Write and read via Read or Pack. */ @Operator public final class TensorArray extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorArray} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param elementShape The expected shape of an element, if known. Used to - * validate the shapes of TensorArray elements. If this shape is not - * fully specified, gathering zero-size TensorArrays is an error. - */ - public Options elementShape(Shape elementShape) { - this.elementShape = elementShape; - return this; - } - - /** - * @param dynamicSize A boolean that determines whether writes to the TensorArray - * are allowed to grow the size. By default, this is not allowed. - */ - public Options dynamicSize(Boolean dynamicSize) { - this.dynamicSize = dynamicSize; - return this; - } - - /** - * @param clearAfterRead If true (default), Tensors in the TensorArray are cleared - * after being read. This disables multiple read semantics but allows early - * release of memory. - */ - public Options clearAfterRead(Boolean clearAfterRead) { - this.clearAfterRead = clearAfterRead; - return this; - } - - /** - * @param identicalElementShapes If true (default is false), then all - * elements in the TensorArray will be expected to have have identical shapes. - * This allows certain behaviors, like dynamically checking for - * consistent shapes on write, and being able to fill in properly - * shaped zero tensors on stack -- even if the element_shape attribute - * is not fully defined. - */ - public Options identicalElementShapes(Boolean identicalElementShapes) { - this.identicalElementShapes = identicalElementShapes; - return this; - } - - /** - * @param tensorArrayName Overrides the name used for the temporary tensor_array - * resource. Default value is the name of the 'TensorArray' op (which - * is guaranteed unique). - */ - public Options tensorArrayName(String tensorArrayName) { - this.tensorArrayName = tensorArrayName; - return this; - } - - private Shape elementShape; - private Boolean dynamicSize; - private Boolean clearAfterRead; - private Boolean identicalElementShapes; - private String tensorArrayName; - - private Options() { - } + public static final String OP_NAME = "TensorArrayV3"; + + private Output handle; + + private Output flow; + + @SuppressWarnings("unchecked") + private TensorArray(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + flow = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TensorArray operation. - * + * Factory method to create a class wrapping a new TensorArrayV3 operation. + * * @param scope current scope - * @param size The size of the array. + * @param sizeOutput The size of the array. * @param dtype The type of the elements on the tensor_array. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TensorArrayV3} output and operands * @return a new instance of TensorArray */ - @Endpoint(describeByClass = true) - public static TensorArray create(Scope scope, Operand size, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TensorArray create(Scope scope, Operand sizeOutput, + Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayV3", scope.makeOpName("TensorArray")); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); if (options != null) { @@ -142,78 +94,169 @@ public static TensorArray create(Scope scope, Operand } return new TensorArray(opBuilder.build()); } - + /** + * Sets the elementShape option. + * * @param elementShape The expected shape of an element, if known. Used to * validate the shapes of TensorArray elements. If this shape is not * fully specified, gathering zero-size TensorArrays is an error. + * @return this Options instance. */ public static Options elementShape(Shape elementShape) { return new Options().elementShape(elementShape); } - + /** + * Sets the dynamicSize option. + * * @param dynamicSize A boolean that determines whether writes to the TensorArray * are allowed to grow the size. By default, this is not allowed. + * @return this Options instance. */ public static Options dynamicSize(Boolean dynamicSize) { return new Options().dynamicSize(dynamicSize); } - + /** + * Sets the clearAfterRead option. + * * @param clearAfterRead If true (default), Tensors in the TensorArray are cleared * after being read. This disables multiple read semantics but allows early * release of memory. + * @return this Options instance. */ public static Options clearAfterRead(Boolean clearAfterRead) { return new Options().clearAfterRead(clearAfterRead); } - + /** + * Sets the identicalElementShapes option. + * * @param identicalElementShapes If true (default is false), then all * elements in the TensorArray will be expected to have have identical shapes. * This allows certain behaviors, like dynamically checking for * consistent shapes on write, and being able to fill in properly * shaped zero tensors on stack -- even if the element_shape attribute * is not fully defined. + * @return this Options instance. */ public static Options identicalElementShapes(Boolean identicalElementShapes) { return new Options().identicalElementShapes(identicalElementShapes); } - + /** + * Sets the tensorArrayName option. + * * @param tensorArrayName Overrides the name used for the temporary tensor_array * resource. Default value is the name of the 'TensorArray' op (which * is guaranteed unique). + * @return this Options instance. */ public static Options tensorArrayName(String tensorArrayName) { return new Options().tensorArrayName(tensorArrayName); } - + /** + * Gets handle. * The handle to the TensorArray. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets flow. * A scalar used to control gradient flow. + * @return flow. */ public Output flow() { return flow; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayV3"; - - private Output handle; - private Output flow; - - private TensorArray(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - flow = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorArray} + */ + public static class Options { + private Shape elementShape; + + private Boolean dynamicSize; + + private Boolean clearAfterRead; + + private Boolean identicalElementShapes; + + private String tensorArrayName; + + private Options() { + } + + /** + * Sets the elementShape option. + * + * @param elementShape The expected shape of an element, if known. Used to + * validate the shapes of TensorArray elements. If this shape is not + * fully specified, gathering zero-size TensorArrays is an error. + * @return this Options instance. + */ + public Options elementShape(Shape elementShape) { + this.elementShape = elementShape; + return this; + } + + /** + * Sets the dynamicSize option. + * + * @param dynamicSize A boolean that determines whether writes to the TensorArray + * are allowed to grow the size. By default, this is not allowed. + * @return this Options instance. + */ + public Options dynamicSize(Boolean dynamicSize) { + this.dynamicSize = dynamicSize; + return this; + } + + /** + * Sets the clearAfterRead option. + * + * @param clearAfterRead If true (default), Tensors in the TensorArray are cleared + * after being read. This disables multiple read semantics but allows early + * release of memory. + * @return this Options instance. + */ + public Options clearAfterRead(Boolean clearAfterRead) { + this.clearAfterRead = clearAfterRead; + return this; + } + + /** + * Sets the identicalElementShapes option. + * + * @param identicalElementShapes If true (default is false), then all + * elements in the TensorArray will be expected to have have identical shapes. + * This allows certain behaviors, like dynamically checking for + * consistent shapes on write, and being able to fill in properly + * shaped zero tensors on stack -- even if the element_shape attribute + * is not fully defined. + * @return this Options instance. + */ + public Options identicalElementShapes(Boolean identicalElementShapes) { + this.identicalElementShapes = identicalElementShapes; + return this; + } + + /** + * Sets the tensorArrayName option. + * + * @param tensorArrayName Overrides the name used for the temporary tensor_array + * resource. Default value is the name of the 'TensorArray' op (which + * is guaranteed unique). + * @return this Options instance. + */ + public Options tensorArrayName(String tensorArrayName) { + this.tensorArrayName = tensorArrayName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayClose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayClose.java index 7a195cd579e..73d7e827b1a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayClose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayClose.java @@ -24,35 +24,38 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Delete the TensorArray from its resource container. - *

* This enables the user to close and release the resource in the middle * of a step/run. */ @Operator public final class TensorArrayClose extends RawOp { - /** - * Factory method to create a class wrapping a new TensorArrayClose operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayCloseV3"; + + private TensorArrayClose(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new TensorArrayCloseV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray (output of TensorArray or TensorArrayGrad). * @return a new instance of TensorArrayClose */ - @Endpoint(describeByClass = true) - public static TensorArrayClose create(Scope scope, Operand handle) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayClose create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayCloseV3", scope.makeOpName("TensorArrayClose")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorArrayClose(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayCloseV3"; - - private TensorArrayClose(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayConcat.java index a861b19400e..e280753d74a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayConcat.java @@ -32,58 +32,52 @@ import org.tensorflow.types.family.TType; /** - * Concat the elements from the TensorArray into value `value`. - *

- * Takes `T` elements of shapes - *

- *

{@code
- *   (n0 x d0 x d1 x ...), (n1 x d0 x d1 x ...), ..., (n(T-1) x d0 x d1 x ...)
- *   }
- * and concatenates them into a Tensor of shape: - *

- *

{@code
- * (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)}
- * All elements must have the same shape (excepting the first dimension). - * - * @param data type for {@code value()} output + * Concat the elements from the TensorArray into value {@code value}. + * Takes {@code T} elements of shapes + *
+ * (n0 x d0 x d1 x ...), (n1 x d0 x d1 x ...), ..., (n(T-1) x d0 x d1 x ...)
+ * 
+ *

and concatenates them into a Tensor of shape: + *

{@code (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)} + *

All elements must have the same shape (excepting the first dimension). + * + * @param data type for {@code value} output */ @Operator public final class TensorArrayConcat extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorArrayConcat} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param elementShapeExcept0 The expected shape of an element, if known, - * excluding the first dimension. Used to validate the shapes of - * TensorArray elements. If this shape is not fully specified, concatenating - * zero-size TensorArrays is an error. - */ - public Options elementShapeExcept0(Shape elementShapeExcept0) { - this.elementShapeExcept0 = elementShapeExcept0; - return this; - } - - private Shape elementShapeExcept0; - - private Options() { - } + public static final String OP_NAME = "TensorArrayConcatV3"; + + private Output value; + + private Output lengths; + + private TensorArrayConcat(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); + lengths = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TensorArrayConcat operation. - * + * Factory method to create a class wrapping a new TensorArrayConcatV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. * @param flowIn A float scalar that enforces proper chaining of operations. * @param dtype The type of the elem that is returned. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TensorArrayConcatV3} output and operands * @return a new instance of TensorArrayConcat */ - @Endpoint(describeByClass = true) - public static TensorArrayConcat create(Scope scope, Operand handle, Operand flowIn, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayConcat create(Scope scope, + Operand handle, Operand flowIn, Class dtype, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayConcatV3", scope.makeOpName("TensorArrayConcat")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); @@ -96,46 +90,64 @@ public static TensorArrayConcat create(Scope scope, Operand } } } - return new TensorArrayConcat(opBuilder.build()); + return new TensorArrayConcat<>(opBuilder.build()); } - + /** + * Sets the elementShapeExcept0 option. + * * @param elementShapeExcept0 The expected shape of an element, if known, * excluding the first dimension. Used to validate the shapes of * TensorArray elements. If this shape is not fully specified, concatenating * zero-size TensorArrays is an error. + * @return this Options instance. */ public static Options elementShapeExcept0(Shape elementShapeExcept0) { return new Options().elementShapeExcept0(elementShapeExcept0); } - + /** + * Gets value. * All of the elements in the TensorArray, concatenated along the first * axis. + * @return value. */ public Output value() { return value; } - + /** + * Gets lengths. * A vector of the row sizes of the original T elements in the * value output. In the example above, this would be the values: - * `(n1, n2, ..., n(T-1))`. + * {@code (n1, n2, ..., n(T-1))}. + * @return lengths. */ public Output lengths() { return lengths; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayConcatV3"; - - private Output value; - private Output lengths; - - private TensorArrayConcat(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); - lengths = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorArrayConcat} + */ + public static class Options { + private Shape elementShapeExcept0; + + private Options() { + } + + /** + * Sets the elementShapeExcept0 option. + * + * @param elementShapeExcept0 The expected shape of an element, if known, + * excluding the first dimension. Used to validate the shapes of + * TensorArray elements. If this shape is not fully specified, concatenating + * zero-size TensorArrays is an error. + * @return this Options instance. + */ + public Options elementShapeExcept0(Shape elementShapeExcept0) { + this.elementShapeExcept0 = elementShapeExcept0; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGather.java index 8f4bcea319e..31a93247809 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGather.java @@ -32,49 +32,44 @@ import org.tensorflow.types.family.TType; /** - * Gather specific elements from the TensorArray into output `value`. - *

- * All elements selected by `indices` must have the same shape. - * - * @param data type for {@code value()} output + * Gather specific elements from the TensorArray into output {@code value}. + * All elements selected by {@code indices} must have the same shape. + * + * @param data type for {@code value} output */ @Operator public final class TensorArrayGather extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorArrayGather} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param elementShape The expected shape of an element, if known. Used to - * validate the shapes of TensorArray elements. If this shape is not - * fully specified, gathering zero-size TensorArrays is an error. - */ - public Options elementShape(Shape elementShape) { - this.elementShape = elementShape; - return this; - } - - private Shape elementShape; - - private Options() { - } + public static final String OP_NAME = "TensorArrayGatherV3"; + + private Output value; + + private TensorArrayGather(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TensorArrayGather operation. - * + * Factory method to create a class wrapping a new TensorArrayGatherV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. * @param indices The locations in the TensorArray from which to read tensor elements. * @param flowIn A float scalar that enforces proper chaining of operations. * @param dtype The type of the elem that is returned. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TensorArrayGatherV3} output and operands * @return a new instance of TensorArrayGather */ - @Endpoint(describeByClass = true) - public static TensorArrayGather create(Scope scope, Operand handle, Operand indices, Operand flowIn, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayGather create(Scope scope, + Operand handle, Operand indices, Operand flowIn, + Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayGatherV3", scope.makeOpName("TensorArrayGather")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -88,39 +83,56 @@ public static TensorArrayGather create(Scope scope, Operand } } } - return new TensorArrayGather(opBuilder.build()); + return new TensorArrayGather<>(opBuilder.build()); } - + /** + * Sets the elementShape option. + * * @param elementShape The expected shape of an element, if known. Used to * validate the shapes of TensorArray elements. If this shape is not * fully specified, gathering zero-size TensorArrays is an error. + * @return this Options instance. */ public static Options elementShape(Shape elementShape) { return new Options().elementShape(elementShape); } - + /** + * Gets value. * All of the elements in the TensorArray, concatenated along a new * axis (the new dimension 0). + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayGatherV3"; - - private Output value; - - private TensorArrayGather(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorArrayGather} + */ + public static class Options { + private Shape elementShape; + + private Options() { + } + + /** + * Sets the elementShape option. + * + * @param elementShape The expected shape of an element, if known. Used to + * validate the shapes of TensorArray elements. If this shape is not + * fully specified, gathering zero-size TensorArrays is an error. + * @return this Options instance. + */ + public Options elementShape(Shape elementShape) { + this.elementShape = elementShape; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGrad.java index 2c9c73e8b90..5b6984b2ebe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGrad.java @@ -26,17 +26,14 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TType; /** * Creates a TensorArray for storing the gradients of values in the given handle. - *

* If the given TensorArray gradient already exists, returns a reference to it. - *

- * Locks the size of the original TensorArray by disabling its dynamic size flag. - *

- * **A note about the input flow_in:** - *

- * The handle flow_in forces the execution of the gradient lookup to occur + *

Locks the size of the original TensorArray by disabling its dynamic size flag. + *

A note about the input flow_in: + *

The handle flow_in forces the execution of the gradient lookup to occur * only after certain other operations have occurred. For example, when * the forward TensorArray is dynamically sized, writes to this TensorArray * may resize the object. The gradient TensorArray is statically sized based @@ -44,35 +41,46 @@ * Furthermore, the size of the forward TensorArray is frozen by this call. * As a result, the flow is used to ensure that the call to generate the gradient * TensorArray only happens after all writes are executed. - *

- * In the case of dynamically sized TensorArrays, gradient computation should + *

In the case of dynamically sized TensorArrays, gradient computation should * only be performed on read operations that have themselves been chained via * flow to occur only after all writes have executed. That way the final size * of the forward TensorArray is known when this operation is called. - *

- * **A note about the source attribute:** - *

- * TensorArray gradient calls use an accumulator TensorArray object. If + *

A note about the source attribute: + *

TensorArray gradient calls use an accumulator TensorArray object. If * multiple gradients are calculated and run in the same session, the multiple * gradient nodes may accidentally flow through the same accumulator TensorArray. * This double counts and generally breaks the TensorArray gradient flow. - *

- * The solution is to identify which gradient call this particular + *

The solution is to identify which gradient call this particular * TensorArray gradient is being called in. This is performed by identifying - * a unique string (e.g. "gradients", "gradients_1", ...) from the input + * a unique string (e.g. "gradients", "gradients_1", ...) from the input * gradient Tensor's name. This string is used as a suffix when creating - * the TensorArray gradient object here (the attribute `source`). - *

- * The attribute `source` is added as a suffix to the forward TensorArray's + * the TensorArray gradient object here (the attribute {@code source}). + *

The attribute {@code source} is added as a suffix to the forward TensorArray's * name when performing the creation / lookup, so that each separate gradient * calculation gets its own TensorArray accumulator. */ @Operator public final class TensorArrayGrad extends RawOp { - /** - * Factory method to create a class wrapping a new TensorArrayGrad operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayGradV3"; + + private Output gradHandle; + + private Output flowOut; + + @SuppressWarnings("unchecked") + private TensorArrayGrad(Operation operation) { + super(operation); + int outputIdx = 0; + gradHandle = operation.output(outputIdx++); + flowOut = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArrayGradV3 operation. + * * @param scope current scope * @param handle The handle to the forward TensorArray. * @param flowIn A float scalar that enforces proper chaining of operations. @@ -80,8 +88,11 @@ public final class TensorArrayGrad extends RawOp { * to return. * @return a new instance of TensorArrayGrad */ - @Endpoint(describeByClass = true) - public static TensorArrayGrad create(Scope scope, Operand handle, Operand flowIn, String source) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayGrad create(Scope scope, Operand handle, + Operand flowIn, String source) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayGradV3", scope.makeOpName("TensorArrayGrad")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); @@ -89,29 +100,22 @@ public static TensorArrayGrad create(Scope scope, Operand handle, Operand gradHandle() { + public Output gradHandle() { return gradHandle; } - + /** + * Gets flowOut. + * + * @return flowOut. */ public Output flowOut() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayGradV3"; - - private Output gradHandle; - private Output flowOut; - - private TensorArrayGrad(Operation operation) { - super(operation); - int outputIdx = 0; - gradHandle = operation.output(outputIdx++); - flowOut = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGradWithShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGradWithShape.java index 76479b938cd..4c685c48f45 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGradWithShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayGradWithShape.java @@ -27,10 +27,10 @@ import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Creates a TensorArray for storing multiple gradients of values in the given handle. - *

* Similar to TensorArrayGradV3. However it creates an accumulator with an * expanded shape compared to the input TensorArray whose gradient is being * computed. This enables multiple gradients for the same TensorArray to be @@ -38,10 +38,26 @@ */ @Operator public final class TensorArrayGradWithShape extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayGradWithShape"; + + private Output gradHandle; + + private Output flowOut; + + @SuppressWarnings("unchecked") + private TensorArrayGradWithShape(Operation operation) { + super(operation); + int outputIdx = 0; + gradHandle = operation.output(outputIdx++); + flowOut = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorArrayGradWithShape operation. - * + * * @param scope current scope * @param handle The handle to the forward TensorArray. * @param flowIn A float scalar that enforces proper chaining of operations. @@ -52,8 +68,11 @@ public final class TensorArrayGradWithShape extends RawOp { * to return. * @return a new instance of TensorArrayGradWithShape */ - @Endpoint(describeByClass = true) - public static TensorArrayGradWithShape create(Scope scope, Operand handle, Operand flowIn, Operand shapeToPrepend, String source) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayGradWithShape create(Scope scope, Operand handle, + Operand flowIn, Operand shapeToPrepend, String source) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayGradWithShape", scope.makeOpName("TensorArrayGradWithShape")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); @@ -62,29 +81,22 @@ public static TensorArrayGradWithShape create(Scope scope, Operand handle, Op opBuilder.setAttr("source", source); return new TensorArrayGradWithShape(opBuilder.build()); } - + /** + * Gets gradHandle. + * + * @return gradHandle. */ - public Output gradHandle() { + public Output gradHandle() { return gradHandle; } - + /** + * Gets flowOut. + * + * @return flowOut. */ public Output flowOut() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayGradWithShape"; - - private Output gradHandle; - private Output flowOut; - - private TensorArrayGradWithShape(Operation operation) { - super(operation); - int outputIdx = 0; - gradHandle = operation.output(outputIdx++); - flowOut = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayPack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayPack.java index aa45df4b937..ee1f21e1d26 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayPack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayPack.java @@ -32,42 +32,41 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code value()} output + * The TensorArrayPack operation + * + * @param data type for {@code value} output */ @Operator public final class TensorArrayPack extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorArrayPack} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param elementShape - */ - public Options elementShape(Shape elementShape) { - this.elementShape = elementShape; - return this; - } - - private Shape elementShape; - - private Options() { - } + public static final String OP_NAME = "TensorArrayPack"; + + private Output value; + + private TensorArrayPack(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TensorArrayPack operation. - * + * * @param scope current scope - * @param handle - * @param flowIn - * @param dtype - * @param options carries optional attributes values + * @param handle the handle value + * @param flowIn the flowIn value + * @param dtype the value of the dtype property + * @param options carries optional attribute values + * @param data type for {@code TensorArrayPack} output and operands * @return a new instance of TensorArrayPack */ - @Endpoint(describeByClass = true) - public static TensorArrayPack create(Scope scope, Operand handle, Operand flowIn, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayPack create(Scope scope, Operand handle, + Operand flowIn, Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayPack", scope.makeOpName("TensorArrayPack")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); @@ -80,35 +79,51 @@ public static TensorArrayPack create(Scope scope, Operand(opBuilder.build()); + return new TensorArrayPack<>(opBuilder.build()); } - + /** - * @param elementShape + * Sets the elementShape option. + * + * @param elementShape the elementShape option + * @return this Options instance. */ public static Options elementShape(Shape elementShape) { return new Options().elementShape(elementShape); } - + /** + * Gets value. + * + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayPack"; - - private Output value; - - private TensorArrayPack(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorArrayPack} + */ + public static class Options { + private Shape elementShape; + + private Options() { + } + + /** + * Sets the elementShape option. + * + * @param elementShape the elementShape option + * @return this Options instance. + */ + public Options elementShape(Shape elementShape) { + this.elementShape = elementShape; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayRead.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayRead.java index c076510e393..60b34119d6b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayRead.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayRead.java @@ -31,54 +31,62 @@ import org.tensorflow.types.family.TType; /** - * Read an element from the TensorArray into output `value`. - * - * @param data type for {@code value()} output + * Read an element from the TensorArray into output {@code value}. + * + * @param data type for {@code value} output */ @Operator public final class TensorArrayRead extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorArrayRead operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayReadV3"; + + private Output value; + + private TensorArrayRead(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArrayReadV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. - * @param index + * @param index the index value * @param flowIn A float scalar that enforces proper chaining of operations. * @param dtype The type of the elem that is returned. + * @param data type for {@code TensorArrayReadV3} output and operands * @return a new instance of TensorArrayRead */ - @Endpoint(describeByClass = true) - public static TensorArrayRead create(Scope scope, Operand handle, Operand index, Operand flowIn, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayRead create(Scope scope, + Operand handle, Operand index, Operand flowIn, + Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayReadV3", scope.makeOpName("TensorArrayRead")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(index.asOutput()); opBuilder.addInput(flowIn.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new TensorArrayRead(opBuilder.build()); + return new TensorArrayRead<>(opBuilder.build()); } - + /** + * Gets value. * The tensor that is read from the TensorArray. + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayReadV3"; - - private Output value; - - private TensorArrayRead(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayScatter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayScatter.java index f00c1477b05..be7ed94d09c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayScatter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayScatter.java @@ -31,15 +31,26 @@ /** * Scatter the data from the input value into specific TensorArray elements. - *

- * `indices` must be a vector, its length must match the first dim of `value`. + * {@code indices} must be a vector, its length must match the first dim of {@code value}. */ @Operator public final class TensorArrayScatter extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorArrayScatter operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayScatterV3"; + + private Output flowOut; + + private TensorArrayScatter(Operation operation) { + super(operation); + int outputIdx = 0; + flowOut = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArrayScatterV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. * @param indices The locations at which to write the tensor elements. @@ -47,8 +58,11 @@ public final class TensorArrayScatter extends RawOp implements Operand * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArrayScatter */ - @Endpoint(describeByClass = true) - public static TensorArrayScatter create(Scope scope, Operand handle, Operand indices, Operand value, Operand flowIn) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayScatter create(Scope scope, Operand handle, + Operand indices, Operand value, Operand flowIn) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayScatterV3", scope.makeOpName("TensorArrayScatter")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -57,27 +71,18 @@ public static TensorArrayScatter create(Scope scope, Operand handle, Operand< opBuilder = scope.apply(opBuilder); return new TensorArrayScatter(opBuilder.build()); } - + /** + * Gets flowOut. * A float scalar that enforces proper chaining of operations. + * @return flowOut. */ public Output flowOut() { return flowOut; } - + @Override public Output asOutput() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayScatterV3"; - - private Output flowOut; - - private TensorArrayScatter(Operation operation) { - super(operation); - int outputIdx = 0; - flowOut = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySize.java index 7a7e0ce8867..45a377703a5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySize.java @@ -27,50 +27,57 @@ import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Get the current size of the TensorArray. */ @Operator public final class TensorArraySize extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorArraySize operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArraySizeV3"; + + private Output output; + + private TensorArraySize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArraySizeV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray (output of TensorArray or TensorArrayGrad). * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArraySize */ - @Endpoint(describeByClass = true) - public static TensorArraySize create(Scope scope, Operand handle, Operand flowIn) { + @Endpoint( + describeByClass = true + ) + public static TensorArraySize create(Scope scope, Operand handle, + Operand flowIn) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArraySizeV3", scope.makeOpName("TensorArraySize")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorArraySize(opBuilder.build()); } - + /** + * Gets output. * The current size of the TensorArray. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArraySizeV3"; - - private Output output; - - private TensorArraySize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySplit.java index eaab6d412fd..c23f1a1ee13 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArraySplit.java @@ -31,35 +31,34 @@ /** * Split the data from the input value into TensorArray elements. - *

- * Assuming that `lengths` takes on values - *

- *

{@code
- * (n0, n1, ..., n(T-1))}
- * and that `value` has shape - *

- *

{@code
- * (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)}
- * , - *

- * this splits values into a TensorArray with T tensors. - *

- * TensorArray index t will be the subtensor of values with starting position - *

- *

{@code
- * (n0 + n1 + ... + n(t-1), 0, 0, ...)}
- * and having size - *

- *

{@code
- * nt x d0 x d1 x ...}
- * + * Assuming that {@code lengths} takes on values + *

{@code (n0, n1, ..., n(T-1))} + *

and that {@code value} has shape + *

{@code (n0 + n1 + ... + n(T-1) x d0 x d1 x ...)}, + *

this splits values into a TensorArray with T tensors. + *

TensorArray index t will be the subtensor of values with starting position + *

{@code (n0 + n1 + ... + n(t-1), 0, 0, ...)} + *

and having size + *

{@code nt x d0 x d1 x ...} */ @Operator public final class TensorArraySplit extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorArraySplit operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArraySplitV3"; + + private Output flowOut; + + private TensorArraySplit(Operation operation) { + super(operation); + int outputIdx = 0; + flowOut = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArraySplitV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. * @param value The concatenated tensor to write to the TensorArray. @@ -68,8 +67,11 @@ public final class TensorArraySplit extends RawOp implements Operand { * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArraySplit */ - @Endpoint(describeByClass = true) - public static TensorArraySplit create(Scope scope, Operand handle, Operand value, Operand lengths, Operand flowIn) { + @Endpoint( + describeByClass = true + ) + public static TensorArraySplit create(Scope scope, Operand handle, + Operand value, Operand lengths, Operand flowIn) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArraySplitV3", scope.makeOpName("TensorArraySplit")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(value.asOutput()); @@ -78,27 +80,18 @@ public static TensorArraySplit create(Scope scope, Operand handle, Operand flowOut() { return flowOut; } - + @Override public Output asOutput() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArraySplitV3"; - - private Output flowOut; - - private TensorArraySplit(Operation operation) { - super(operation); - int outputIdx = 0; - flowOut = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayUnpack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayUnpack.java index 82f62c98658..8dc2dc2e0f9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayUnpack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayUnpack.java @@ -30,21 +30,37 @@ import org.tensorflow.types.family.TType; /** + * The TensorArrayUnpack operation */ @Operator public final class TensorArrayUnpack extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayUnpack"; + + private Output flowOut; + + private TensorArrayUnpack(Operation operation) { + super(operation); + int outputIdx = 0; + flowOut = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorArrayUnpack operation. - * + * * @param scope current scope - * @param handle - * @param value - * @param flowIn + * @param handle the handle value + * @param value the value value + * @param flowIn the flowIn value * @return a new instance of TensorArrayUnpack */ - @Endpoint(describeByClass = true) - public static TensorArrayUnpack create(Scope scope, Operand handle, Operand value, Operand flowIn) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayUnpack create(Scope scope, Operand handle, + Operand value, Operand flowIn) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayUnpack", scope.makeOpName("TensorArrayUnpack")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(value.asOutput()); @@ -52,26 +68,18 @@ public static TensorArrayUnpack create(Scope scope, Operand handle, Ope opBuilder = scope.apply(opBuilder); return new TensorArrayUnpack(opBuilder.build()); } - + /** + * Gets flowOut. + * + * @return flowOut. */ public Output flowOut() { return flowOut; } - + @Override public Output asOutput() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayUnpack"; - - private Output flowOut; - - private TensorArrayUnpack(Operation operation) { - super(operation); - int outputIdx = 0; - flowOut = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayWrite.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayWrite.java index 0d2fde02369..df16154064f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayWrite.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorArrayWrite.java @@ -34,10 +34,22 @@ */ @Operator public final class TensorArrayWrite extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorArrayWrite operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorArrayWriteV3"; + + private Output flowOut; + + private TensorArrayWrite(Operation operation) { + super(operation); + int outputIdx = 0; + flowOut = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorArrayWriteV3 operation. + * * @param scope current scope * @param handle The handle to a TensorArray. * @param index The position to write to inside the TensorArray. @@ -45,8 +57,11 @@ public final class TensorArrayWrite extends RawOp implements Operand { * @param flowIn A float scalar that enforces proper chaining of operations. * @return a new instance of TensorArrayWrite */ - @Endpoint(describeByClass = true) - public static TensorArrayWrite create(Scope scope, Operand handle, Operand index, Operand value, Operand flowIn) { + @Endpoint( + describeByClass = true + ) + public static TensorArrayWrite create(Scope scope, Operand handle, + Operand index, Operand value, Operand flowIn) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayWriteV3", scope.makeOpName("TensorArrayWrite")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(index.asOutput()); @@ -55,27 +70,18 @@ public static TensorArrayWrite create(Scope scope, Operand handle, Operand flowOut() { return flowOut; } - + @Override public Output asOutput() { return flowOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorArrayWriteV3"; - - private Output flowOut; - - private TensorArrayWrite(Operation operation) { - super(operation); - int outputIdx = 0; - flowOut = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestCreateTreeVariable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestCreateTreeVariable.java index e494af78e5b..def3e63a22f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestCreateTreeVariable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestCreateTreeVariable.java @@ -23,35 +23,39 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Creates a tree resource and returns a handle to it. */ public final class TensorForestCreateTreeVariable extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorForestCreateTreeVariable"; + + private TensorForestCreateTreeVariable(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new TensorForestCreateTreeVariable operation. - * + * * @param scope current scope * @param treeHandle Handle to the tree resource to be created. * @param treeConfig Serialized proto string of the boosted_trees.Tree. * @return a new instance of TensorForestCreateTreeVariable */ - @Endpoint(describeByClass = true) - public static TensorForestCreateTreeVariable create(Scope scope, Operand treeHandle, Operand treeConfig) { + @Endpoint( + describeByClass = true + ) + public static TensorForestCreateTreeVariable create(Scope scope, + Operand treeHandle, Operand treeConfig) { OperationBuilder opBuilder = scope.env().opBuilder("TensorForestCreateTreeVariable", scope.makeOpName("TensorForestCreateTreeVariable")); opBuilder.addInput(treeHandle.asOutput()); opBuilder.addInput(treeConfig.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorForestCreateTreeVariable(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestCreateTreeVariable"; - - private TensorForestCreateTreeVariable(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeDeserialize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeDeserialize.java index 74794de4ecb..690cd0fba7b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeDeserialize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeDeserialize.java @@ -23,35 +23,39 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Deserializes a proto into the tree handle */ public final class TensorForestTreeDeserialize extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorForestTreeDeserialize"; + + private TensorForestTreeDeserialize(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new TensorForestTreeDeserialize operation. - * + * * @param scope current scope * @param treeHandle Handle to the tree resource to be restored. * @param treeConfig Serialied proto string of the boosted_trees.Tree proto. * @return a new instance of TensorForestTreeDeserialize */ - @Endpoint(describeByClass = true) - public static TensorForestTreeDeserialize create(Scope scope, Operand treeHandle, Operand treeConfig) { + @Endpoint( + describeByClass = true + ) + public static TensorForestTreeDeserialize create(Scope scope, Operand treeHandle, + Operand treeConfig) { OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeDeserialize", scope.makeOpName("TensorForestTreeDeserialize")); opBuilder.addInput(treeHandle.asOutput()); opBuilder.addInput(treeConfig.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorForestTreeDeserialize(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeDeserialize"; - - private TensorForestTreeDeserialize(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeIsInitializedOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeIsInitializedOp.java index 55cd0bc8cf1..42a8b748515 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeIsInitializedOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeIsInitializedOp.java @@ -24,49 +24,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Checks whether a tree has been initialized. */ public final class TensorForestTreeIsInitializedOp extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorForestTreeIsInitializedOp"; + + private Output isInitialized; + + private TensorForestTreeIsInitializedOp(Operation operation) { + super(operation); + int outputIdx = 0; + isInitialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorForestTreeIsInitializedOp operation. - * + * * @param scope current scope * @param treeHandle Handle to the tree. * @return a new instance of TensorForestTreeIsInitializedOp */ - @Endpoint(describeByClass = true) - public static TensorForestTreeIsInitializedOp create(Scope scope, Operand treeHandle) { + @Endpoint( + describeByClass = true + ) + public static TensorForestTreeIsInitializedOp create(Scope scope, + Operand treeHandle) { OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeIsInitializedOp", scope.makeOpName("TensorForestTreeIsInitializedOp")); opBuilder.addInput(treeHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorForestTreeIsInitializedOp(opBuilder.build()); } - + /** + * Gets isInitialized. * Whether the tree is initialized. + * @return isInitialized. */ public Output isInitialized() { return isInitialized; } - + @Override public Output asOutput() { return isInitialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeIsInitializedOp"; - - private Output isInitialized; - - private TensorForestTreeIsInitializedOp(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreePredict.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreePredict.java index 2f0988d0e88..da8cf52fc05 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreePredict.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreePredict.java @@ -24,25 +24,40 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TType; /** * Output the logits for the given input data */ public final class TensorForestTreePredict extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorForestTreePredict"; + + private Output logits; + + private TensorForestTreePredict(Operation operation) { + super(operation); + int outputIdx = 0; + logits = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorForestTreePredict operation. - * + * * @param scope current scope * @param treeHandle Handle to the tree resource. * @param denseFeatures Rank 2 dense features tensor. * @param logitsDimension Scalar, dimension of the logits. * @return a new instance of TensorForestTreePredict */ - @Endpoint(describeByClass = true) - public static TensorForestTreePredict create(Scope scope, Operand treeHandle, Operand denseFeatures, Long logitsDimension) { + @Endpoint( + describeByClass = true + ) + public static TensorForestTreePredict create(Scope scope, Operand treeHandle, + Operand denseFeatures, Long logitsDimension) { OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreePredict", scope.makeOpName("TensorForestTreePredict")); opBuilder.addInput(treeHandle.asOutput()); opBuilder.addInput(denseFeatures.asOutput()); @@ -50,27 +65,18 @@ public static TensorForestTreePredict create(Scope scope, Operand treeHandle, opBuilder.setAttr("logits_dimension", logitsDimension); return new TensorForestTreePredict(opBuilder.build()); } - + /** + * Gets logits. * The logits predictions from the tree for each instance in the batch. + * @return logits. */ public Output logits() { return logits; } - + @Override public Output asOutput() { return logits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreePredict"; - - private Output logits; - - private TensorForestTreePredict(Operation operation) { - super(operation); - int outputIdx = 0; - logits = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeResourceHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeResourceHandleOp.java index dd6d50ccaf7..645b79e00c1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeResourceHandleOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeResourceHandleOp.java @@ -24,50 +24,36 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates a handle to a TensorForestTreeResource */ public final class TensorForestTreeResourceHandleOp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorForestTreeResourceHandleOp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "TensorForestTreeResourceHandleOp"; + + private Output resource; + + @SuppressWarnings("unchecked") + private TensorForestTreeResourceHandleOp(Operation operation) { + super(operation); + int outputIdx = 0; + resource = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TensorForestTreeResourceHandleOp operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of TensorForestTreeResourceHandleOp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TensorForestTreeResourceHandleOp create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeResourceHandleOp", scope.makeOpName("TensorForestTreeResourceHandleOp")); opBuilder = scope.apply(opBuilder); @@ -83,41 +69,73 @@ public static TensorForestTreeResourceHandleOp create(Scope scope, Options... op } return new TensorForestTreeResourceHandleOp(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets resource. + * + * @return resource. */ - public Output resource() { + public Output resource() { return resource; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) resource; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeResourceHandleOp"; - - private Output resource; - - private TensorForestTreeResourceHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorForestTreeResourceHandleOp} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSerialize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSerialize.java index 3ac7ead2a7d..81e0658f425 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSerialize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSerialize.java @@ -24,49 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Serializes the tree handle to a proto */ public final class TensorForestTreeSerialize extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorForestTreeSerialize"; + + private Output treeConfig; + + private TensorForestTreeSerialize(Operation operation) { + super(operation); + int outputIdx = 0; + treeConfig = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorForestTreeSerialize operation. - * + * * @param scope current scope * @param treeHandle Handle to the tree resource to be serialized. * @return a new instance of TensorForestTreeSerialize */ - @Endpoint(describeByClass = true) - public static TensorForestTreeSerialize create(Scope scope, Operand treeHandle) { + @Endpoint( + describeByClass = true + ) + public static TensorForestTreeSerialize create(Scope scope, Operand treeHandle) { OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeSerialize", scope.makeOpName("TensorForestTreeSerialize")); opBuilder.addInput(treeHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorForestTreeSerialize(opBuilder.build()); } - + /** + * Gets treeConfig. * Serialied proto string of the tree resource. + * @return treeConfig. */ public Output treeConfig() { return treeConfig; } - + @Override public Output asOutput() { return treeConfig; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeSerialize"; - - private Output treeConfig; - - private TensorForestTreeSerialize(Operation operation) { - super(operation); - int outputIdx = 0; - treeConfig = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSize.java index d0de55fd4c8..d6082e3be89 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorForestTreeSize.java @@ -24,49 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Get the number of nodes in a tree */ public final class TensorForestTreeSize extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorForestTreeSize"; + + private Output treeSize; + + private TensorForestTreeSize(Operation operation) { + super(operation); + int outputIdx = 0; + treeSize = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorForestTreeSize operation. - * + * * @param scope current scope * @param treeHandle Handle to the tree resource. * @return a new instance of TensorForestTreeSize */ - @Endpoint(describeByClass = true) - public static TensorForestTreeSize create(Scope scope, Operand treeHandle) { + @Endpoint( + describeByClass = true + ) + public static TensorForestTreeSize create(Scope scope, Operand treeHandle) { OperationBuilder opBuilder = scope.env().opBuilder("TensorForestTreeSize", scope.makeOpName("TensorForestTreeSize")); opBuilder.addInput(treeHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorForestTreeSize(opBuilder.build()); } - + /** + * Gets treeSize. * The size of the tree. + * @return treeSize. */ public Output treeSize() { return treeSize; } - + @Override public Output asOutput() { return treeSize; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorForestTreeSize"; - - private Output treeSize; - - private TensorForestTreeSize(Operation operation) { - super(operation); - int outputIdx = 0; - treeSize = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcat.java index e419a43b504..146c951c0df 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcat.java @@ -32,68 +32,78 @@ /** * Concats all tensors in the list along the 0th dimension. - *

* Requires that all tensors have the same shape except the first dimension. - *

- * input_handle: The input list. + *

input_handle: The input list. * element_shape: The shape of the uninitialized elements in the list. If the first - * dimension is not -1, it is assumed that all list elements have the same - * leading dim. + * dimension is not -1, it is assumed that all list elements have the same + * leading dim. * leading_dims: The list of leading dims of uninitialized list elements. Used if - * the leading dim of input_handle.element_shape or the element_shape input arg - * is not already set. + * the leading dim of input_handle.element_shape or the element_shape input arg + * is not already set. * tensor: The concated result. * lengths: Output tensor containing sizes of the 0th dimension of tensors in the list, used for computing the gradient. - * - * - * @param data type for {@code tensor()} output + * + * @param data type for {@code tensor} output */ @Operator public final class TensorListConcat extends RawOp { - /** - * Factory method to create a class wrapping a new TensorListConcat operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListConcatV2"; + + private Output tensor; + + private Output lengths; + + private TensorListConcat(Operation operation) { + super(operation); + int outputIdx = 0; + tensor = operation.output(outputIdx++); + lengths = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorListConcatV2 operation. + * * @param scope current scope - * @param inputHandle - * @param elementShape - * @param leadingDims - * @param elementDtype + * @param inputHandle the inputHandle value + * @param elementShape the elementShape value + * @param leadingDims the leadingDims value + * @param elementDtype the value of the elementDtype property + * @param data type for {@code TensorListConcatV2} output and operands * @return a new instance of TensorListConcat */ - @Endpoint(describeByClass = true) - public static TensorListConcat create(Scope scope, Operand inputHandle, Operand elementShape, Operand leadingDims, Class elementDtype) { + @Endpoint( + describeByClass = true + ) + public static TensorListConcat create(Scope scope, + Operand inputHandle, Operand elementShape, + Operand leadingDims, Class elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListConcatV2", scope.makeOpName("TensorListConcat")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(leadingDims.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); - return new TensorListConcat(opBuilder.build()); + return new TensorListConcat<>(opBuilder.build()); } - + /** + * Gets tensor. + * + * @return tensor. */ public Output tensor() { return tensor; } - + /** + * Gets lengths. + * + * @return lengths. */ public Output lengths() { return lengths; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListConcatV2"; - - private Output tensor; - private Output lengths; - - private TensorListConcat(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); - lengths = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatLists.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatLists.java index 25b2e06df84..e574d05f613 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatLists.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatLists.java @@ -29,21 +29,39 @@ import org.tensorflow.types.family.TType; /** + * The TensorListConcatLists operation */ @Operator public final class TensorListConcatLists extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListConcatLists"; + + private Output output; + + @SuppressWarnings("unchecked") + private TensorListConcatLists(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListConcatLists operation. - * + * * @param scope current scope - * @param inputA - * @param inputB - * @param elementDtype + * @param inputA the inputA value + * @param inputB the inputB value + * @param elementDtype the value of the elementDtype property + * @param data type for {@code TensorListConcatLists} output and operands * @return a new instance of TensorListConcatLists */ - @Endpoint(describeByClass = true) - public static TensorListConcatLists create(Scope scope, Operand inputA, Operand inputB, Class elementDtype) { + @Endpoint( + describeByClass = true + ) + public static TensorListConcatLists create(Scope scope, + Operand inputA, Operand inputB, Class elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListConcatLists", scope.makeOpName("TensorListConcatLists")); opBuilder.addInput(inputA.asOutput()); opBuilder.addInput(inputB.asOutput()); @@ -51,27 +69,19 @@ public static TensorListConcatLists create(Scope scope, Operan opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); return new TensorListConcatLists(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListConcatLists"; - - private Output output; - - private TensorListConcatLists(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListElementShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListElementShape.java index a985213de4e..dd5910d8d2e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListElementShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListElementShape.java @@ -27,54 +27,62 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * The shape of the elements of the given list, as a tensor. - *

- * input_handle: the list - * element_shape: the shape of elements of the list - * - * @param data type for {@code elementShape()} output + * input_handle: the list + * element_shape: the shape of elements of the list + * + * @param data type for {@code element_shape} output */ @Operator public final class TensorListElementShape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListElementShape"; + + private Output elementShape; + + private TensorListElementShape(Operation operation) { + super(operation); + int outputIdx = 0; + elementShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListElementShape operation. - * + * * @param scope current scope - * @param inputHandle - * @param shapeType + * @param inputHandle the inputHandle value + * @param shapeType the value of the shapeType property + * @param data type for {@code TensorListElementShape} output and operands * @return a new instance of TensorListElementShape */ - @Endpoint(describeByClass = true) - public static TensorListElementShape create(Scope scope, Operand inputHandle, Class shapeType) { + @Endpoint( + describeByClass = true + ) + public static TensorListElementShape create(Scope scope, + Operand inputHandle, Class shapeType) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListElementShape", scope.makeOpName("TensorListElementShape")); opBuilder.addInput(inputHandle.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape_type", Operands.toDataType(shapeType)); - return new TensorListElementShape(opBuilder.build()); + return new TensorListElementShape<>(opBuilder.build()); } - + /** + * Gets elementShape. + * + * @return elementShape. */ public Output elementShape() { return elementShape; } - + @Override public Output asOutput() { return elementShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListElementShape"; - - private Output elementShape; - - private TensorListElementShape(Operation operation) { - super(operation); - int outputIdx = 0; - elementShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListFromTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListFromTensor.java index 128c23f0947..12ae7a9ed70 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListFromTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListFromTensor.java @@ -29,53 +29,59 @@ import org.tensorflow.types.family.TType; /** - * Creates a TensorList which, when stacked, has the value of `tensor`. - *

+ * Creates a TensorList which, when stacked, has the value of {@code tensor}. * Each tensor in the result list corresponds to one row of the input tensor. - *

- * tensor: The input tensor. + *

tensor: The input tensor. * output_handle: The list. */ @Operator public final class TensorListFromTensor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListFromTensor"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private TensorListFromTensor(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListFromTensor operation. - * + * * @param scope current scope - * @param tensor - * @param elementShape + * @param tensor the tensor value + * @param elementShape the elementShape value * @return a new instance of TensorListFromTensor */ - @Endpoint(describeByClass = true) - public static TensorListFromTensor create(Scope scope, Operand tensor, Operand elementShape) { + @Endpoint( + describeByClass = true + ) + public static TensorListFromTensor create(Scope scope, Operand tensor, + Operand elementShape) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListFromTensor", scope.makeOpName("TensorListFromTensor")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorListFromTensor(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListFromTensor"; - - private Output outputHandle; - - private TensorListFromTensor(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGather.java index 90cacdd0435..bae8f1b33da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGather.java @@ -31,59 +31,66 @@ /** * Creates a Tensor by indexing into the TensorList. - *

* Each row in the produced Tensor corresponds to the element in the TensorList - * specified by the given index (see `tf.gather`). - *

- * input_handle: The input tensor list. + * specified by the given index (see {@code tf.gather}). + *

input_handle: The input tensor list. * indices: The indices used to index into the list. * values: The tensor. - * - * @param data type for {@code values()} output + * + * @param data type for {@code values} output */ @Operator public final class TensorListGather extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListGather"; + + private Output values; + + private TensorListGather(Operation operation) { + super(operation); + int outputIdx = 0; + values = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListGather operation. - * + * * @param scope current scope - * @param inputHandle - * @param indices - * @param elementShape - * @param elementDtype + * @param inputHandle the inputHandle value + * @param indices the indices value + * @param elementShape the elementShape value + * @param elementDtype the value of the elementDtype property + * @param data type for {@code TensorListGather} output and operands * @return a new instance of TensorListGather */ - @Endpoint(describeByClass = true) - public static TensorListGather create(Scope scope, Operand inputHandle, Operand indices, Operand elementShape, Class elementDtype) { + @Endpoint( + describeByClass = true + ) + public static TensorListGather create(Scope scope, + Operand inputHandle, Operand indices, Operand elementShape, + Class elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListGather", scope.makeOpName("TensorListGather")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); - return new TensorListGather(opBuilder.build()); + return new TensorListGather<>(opBuilder.build()); } - + /** + * Gets values. + * + * @return values. */ public Output values() { return values; } - + @Override public Output asOutput() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListGather"; - - private Output values; - - private TensorListGather(Operation operation) { - super(operation); - int outputIdx = 0; - values = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGetItem.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGetItem.java index 7f96f897242..4d7eba7bbfa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGetItem.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListGetItem.java @@ -30,51 +30,62 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code item()} output + * The TensorListGetItem operation + * + * @param data type for {@code item} output */ @Operator public final class TensorListGetItem extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListGetItem"; + + private Output item; + + private TensorListGetItem(Operation operation) { + super(operation); + int outputIdx = 0; + item = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListGetItem operation. - * + * * @param scope current scope - * @param inputHandle - * @param index - * @param elementShape - * @param elementDtype + * @param inputHandle the inputHandle value + * @param index the index value + * @param elementShape the elementShape value + * @param elementDtype the value of the elementDtype property + * @param data type for {@code TensorListGetItem} output and operands * @return a new instance of TensorListGetItem */ - @Endpoint(describeByClass = true) - public static TensorListGetItem create(Scope scope, Operand inputHandle, Operand index, Operand elementShape, Class elementDtype) { + @Endpoint( + describeByClass = true + ) + public static TensorListGetItem create(Scope scope, + Operand inputHandle, Operand index, Operand elementShape, + Class elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListGetItem", scope.makeOpName("TensorListGetItem")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(index.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); - return new TensorListGetItem(opBuilder.build()); + return new TensorListGetItem<>(opBuilder.build()); } - + /** + * Gets item. + * + * @return item. */ public Output item() { return item; } - + @Override public Output asOutput() { return item; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListGetItem"; - - private Output item; - - private TensorListGetItem(Operation operation) { - super(operation); - int outputIdx = 0; - item = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListLength.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListLength.java index b583a498ea5..5614497942b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListLength.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListLength.java @@ -26,50 +26,56 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Returns the number of tensors in the input tensor list. - *

* input_handle: the input list * length: the number of tensors in the list */ @Operator public final class TensorListLength extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListLength"; + + private Output length; + + private TensorListLength(Operation operation) { + super(operation); + int outputIdx = 0; + length = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListLength operation. - * + * * @param scope current scope - * @param inputHandle + * @param inputHandle the inputHandle value * @return a new instance of TensorListLength */ - @Endpoint(describeByClass = true) - public static TensorListLength create(Scope scope, Operand inputHandle) { + @Endpoint( + describeByClass = true + ) + public static TensorListLength create(Scope scope, Operand inputHandle) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListLength", scope.makeOpName("TensorListLength")); opBuilder.addInput(inputHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorListLength(opBuilder.build()); } - + /** + * Gets length. + * + * @return length. */ public Output length() { return length; } - + @Override public Output asOutput() { return length; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListLength"; - - private Output length; - - private TensorListLength(Operation operation) { - super(operation); - int outputIdx = 0; - length = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPopBack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPopBack.java index 5600bf69778..6926cbf92da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPopBack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPopBack.java @@ -31,60 +31,71 @@ /** * Returns the last element of the input list as well as a list with all but that element. - *

* Fails if the list is empty. - *

- * input_handle: the input list + *

input_handle: the input list * tensor: the withdrawn last element of the list * element_dtype: the type of elements in the list * element_shape: the shape of the output tensor - * - * @param data type for {@code tensor()} output + * + * @param data type for {@code tensor} output */ @Operator public final class TensorListPopBack extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListPopBack"; + + private Output outputHandle; + + private Output tensor; + + @SuppressWarnings("unchecked") + private TensorListPopBack(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + tensor = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListPopBack operation. - * + * * @param scope current scope - * @param inputHandle - * @param elementShape - * @param elementDtype + * @param inputHandle the inputHandle value + * @param elementShape the elementShape value + * @param elementDtype the value of the elementDtype property + * @param data type for {@code TensorListPopBack} output and operands * @return a new instance of TensorListPopBack */ - @Endpoint(describeByClass = true) - public static TensorListPopBack create(Scope scope, Operand inputHandle, Operand elementShape, Class elementDtype) { + @Endpoint( + describeByClass = true + ) + public static TensorListPopBack create(Scope scope, + Operand inputHandle, Operand elementShape, Class elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListPopBack", scope.makeOpName("TensorListPopBack")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("element_dtype", Operands.toDataType(elementDtype)); - return new TensorListPopBack(opBuilder.build()); + return new TensorListPopBack<>(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + /** + * Gets tensor. + * + * @return tensor. */ public Output tensor() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListPopBack"; - - private Output outputHandle; - private Output tensor; - - private TensorListPopBack(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - tensor = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBack.java index 8f831c0ba7c..6df4b4e1ff4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBack.java @@ -28,8 +28,7 @@ import org.tensorflow.types.family.TType; /** - * Returns a list which has the passed-in `Tensor` as last element and the other elements of the given list in `input_handle`. - *

+ * Returns a list which has the passed-in {@code Tensor} as last element and the other elements of the given list in {@code input_handle}. * tensor: The tensor to put on the list. * input_handle: The old list. * output_handle: A list with the elements of the old list followed by tensor. @@ -38,44 +37,52 @@ */ @Operator public final class TensorListPushBack extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListPushBack"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private TensorListPushBack(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListPushBack operation. - * + * * @param scope current scope - * @param inputHandle - * @param tensor + * @param inputHandle the inputHandle value + * @param tensor the tensor value * @return a new instance of TensorListPushBack */ - @Endpoint(describeByClass = true) - public static TensorListPushBack create(Scope scope, Operand inputHandle, Operand tensor) { + @Endpoint( + describeByClass = true + ) + public static TensorListPushBack create(Scope scope, Operand inputHandle, + Operand tensor) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListPushBack", scope.makeOpName("TensorListPushBack")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(tensor.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorListPushBack(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListPushBack"; - - private Output outputHandle; - - private TensorListPushBack(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBackBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBackBatch.java index b39bb5027fd..4191773ce8f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBackBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListPushBackBatch.java @@ -28,47 +28,56 @@ import org.tensorflow.types.family.TType; /** + * The TensorListPushBackBatch operation */ @Operator public final class TensorListPushBackBatch extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListPushBackBatch"; + + private Output outputHandles; + + @SuppressWarnings("unchecked") + private TensorListPushBackBatch(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandles = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListPushBackBatch operation. - * + * * @param scope current scope - * @param inputHandles - * @param tensor + * @param inputHandles the inputHandles value + * @param tensor the tensor value * @return a new instance of TensorListPushBackBatch */ - @Endpoint(describeByClass = true) - public static TensorListPushBackBatch create(Scope scope, Operand inputHandles, Operand tensor) { + @Endpoint( + describeByClass = true + ) + public static TensorListPushBackBatch create(Scope scope, Operand inputHandles, + Operand tensor) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListPushBackBatch", scope.makeOpName("TensorListPushBackBatch")); opBuilder.addInput(inputHandles.asOutput()); opBuilder.addInput(tensor.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorListPushBackBatch(opBuilder.build()); } - + /** + * Gets outputHandles. + * + * @return outputHandles. */ - public Output outputHandles() { + public Output outputHandles() { return outputHandles; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandles; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListPushBackBatch"; - - private Output outputHandles; - - private TensorListPushBackBatch(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandles = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListReserve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListReserve.java index 19bf60b1ce2..9ab261d5b39 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListReserve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListReserve.java @@ -32,7 +32,6 @@ /** * List of the given size with empty elements. - *

* element_shape: the shape of the future elements of the list * num_elements: the number of elements to reserve * handle: the output list @@ -40,18 +39,35 @@ */ @Operator public final class TensorListReserve extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListReserve"; + + private Output handle; + + @SuppressWarnings("unchecked") + private TensorListReserve(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListReserve operation. - * + * * @param scope current scope - * @param elementShape - * @param numElements - * @param elementDtype + * @param elementShape the elementShape value + * @param numElements the numElements value + * @param elementDtype the value of the elementDtype property + * @param data type for {@code TensorListReserve} output and operands * @return a new instance of TensorListReserve */ - @Endpoint(describeByClass = true) - public static TensorListReserve create(Scope scope, Operand elementShape, Operand numElements, Class elementDtype) { + @Endpoint( + describeByClass = true + ) + public static TensorListReserve create(Scope scope, + Operand elementShape, Operand numElements, Class elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListReserve", scope.makeOpName("TensorListReserve")); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(numElements.asOutput()); @@ -59,27 +75,19 @@ public static TensorListReserve create(Scope scope, Operand handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListReserve"; - - private Output handle; - - private TensorListReserve(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListResize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListResize.java index e9fc0516c16..ba395731c15 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListResize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListResize.java @@ -30,52 +30,57 @@ /** * Resizes the list. - *

- * * input_handle: the input list * size: size of the output list - * */ @Operator public final class TensorListResize extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListResize"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private TensorListResize(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListResize operation. - * + * * @param scope current scope - * @param inputHandle - * @param size + * @param inputHandle the inputHandle value + * @param sizeOutput the sizeOutput value * @return a new instance of TensorListResize */ - @Endpoint(describeByClass = true) - public static TensorListResize create(Scope scope, Operand inputHandle, Operand size) { + @Endpoint( + describeByClass = true + ) + public static TensorListResize create(Scope scope, Operand inputHandle, + Operand sizeOutput) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListResize", scope.makeOpName("TensorListResize")); opBuilder.addInput(inputHandle.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorListResize(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListResize"; - - private Output outputHandle; - - private TensorListResize(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatter.java index 98aaadd7a7c..8bd16951d66 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatter.java @@ -31,34 +31,49 @@ /** * Creates a TensorList by indexing into a Tensor. - *

* Each member of the TensorList corresponds to one row of the input tensor, - * specified by the given index (see `tf.gather`). - *

- * tensor: The input tensor. + * specified by the given index (see {@code tf.gather}). + *

tensor: The input tensor. * indices: The indices used to index into the list. * element_shape: The shape of the elements in the list (can be less specified than - * the shape of the tensor). + * the shape of the tensor). * num_elements: The size of the output list. Must be large enough to accommodate - * the largest index in indices. If -1, the list is just large enough to include - * the largest index in indices. + * the largest index in indices. If -1, the list is just large enough to include + * the largest index in indices. * output_handle: The TensorList. */ @Operator public final class TensorListScatter extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorListScatter operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListScatterV2"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private TensorListScatter(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorListScatterV2 operation. + * * @param scope current scope - * @param tensor - * @param indices - * @param elementShape - * @param numElements + * @param tensor the tensor value + * @param indices the indices value + * @param elementShape the elementShape value + * @param numElements the numElements value * @return a new instance of TensorListScatter */ - @Endpoint(describeByClass = true) - public static TensorListScatter create(Scope scope, Operand tensor, Operand indices, Operand elementShape, Operand numElements) { + @Endpoint( + describeByClass = true + ) + public static TensorListScatter create(Scope scope, Operand tensor, + Operand indices, Operand elementShape, + Operand numElements) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListScatterV2", scope.makeOpName("TensorListScatter")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -67,27 +82,19 @@ public static TensorListScatter create(Scope scope, Operand ten opBuilder = scope.apply(opBuilder); return new TensorListScatter(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListScatterV2"; - - private Output outputHandle; - - private TensorListScatter(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterIntoExistingList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterIntoExistingList.java index da49a9d672f..68dba6e4b53 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterIntoExistingList.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterIntoExistingList.java @@ -30,29 +30,44 @@ /** * Scatters tensor at indices in an input list. - *

* Each member of the TensorList corresponds to one row of the input tensor, - * specified by the given index (see `tf.gather`). - *

- * input_handle: The list to scatter into. + * specified by the given index (see {@code tf.gather}). + *

input_handle: The list to scatter into. * tensor: The input tensor. * indices: The indices used to index into the list. * output_handle: The TensorList. */ @Operator public final class TensorListScatterIntoExistingList extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListScatterIntoExistingList"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private TensorListScatterIntoExistingList(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListScatterIntoExistingList operation. - * + * * @param scope current scope - * @param inputHandle - * @param tensor - * @param indices + * @param inputHandle the inputHandle value + * @param tensor the tensor value + * @param indices the indices value * @return a new instance of TensorListScatterIntoExistingList */ - @Endpoint(describeByClass = true) - public static TensorListScatterIntoExistingList create(Scope scope, Operand inputHandle, Operand tensor, Operand indices) { + @Endpoint( + describeByClass = true + ) + public static TensorListScatterIntoExistingList create(Scope scope, + Operand inputHandle, Operand tensor, + Operand indices) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListScatterIntoExistingList", scope.makeOpName("TensorListScatterIntoExistingList")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(tensor.asOutput()); @@ -60,27 +75,19 @@ public static TensorListScatterIntoExistingList create(Scope scope, Operand i opBuilder = scope.apply(opBuilder); return new TensorListScatterIntoExistingList(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListScatterIntoExistingList"; - - private Output outputHandle; - - private TensorListScatterIntoExistingList(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSetItem.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSetItem.java index 3f8df2fd889..ba7ef3ae22a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSetItem.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSetItem.java @@ -29,21 +29,38 @@ import org.tensorflow.types.family.TType; /** + * The TensorListSetItem operation */ @Operator public final class TensorListSetItem extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListSetItem"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private TensorListSetItem(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListSetItem operation. - * + * * @param scope current scope - * @param inputHandle - * @param index - * @param item + * @param inputHandle the inputHandle value + * @param index the index value + * @param item the item value * @return a new instance of TensorListSetItem */ - @Endpoint(describeByClass = true) - public static TensorListSetItem create(Scope scope, Operand inputHandle, Operand index, Operand item) { + @Endpoint( + describeByClass = true + ) + public static TensorListSetItem create(Scope scope, Operand inputHandle, + Operand index, Operand item) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListSetItem", scope.makeOpName("TensorListSetItem")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(index.asOutput()); @@ -51,27 +68,19 @@ public static TensorListSetItem create(Scope scope, Operand inputHandle, Oper opBuilder = scope.apply(opBuilder); return new TensorListSetItem(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListSetItem"; - - private Output outputHandle; - - private TensorListSetItem(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSplit.java index 2dc7bf979b5..2ca49751954 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListSplit.java @@ -31,29 +31,43 @@ /** * Splits a tensor into a list. - *

* list[i] corresponds to lengths[i] tensors from the input tensor. * The tensor must have rank at least 1 and contain exactly sum(lengths) elements. - *

- * tensor: The input tensor. + *

tensor: The input tensor. * element_shape: A shape compatible with that of elements in the tensor. * lengths: Vector of sizes of the 0th dimension of tensors in the list. * output_handle: The list. */ @Operator public final class TensorListSplit extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorListSplit"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private TensorListSplit(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorListSplit operation. - * + * * @param scope current scope - * @param tensor - * @param elementShape - * @param lengths + * @param tensor the tensor value + * @param elementShape the elementShape value + * @param lengths the lengths value * @return a new instance of TensorListSplit */ - @Endpoint(describeByClass = true) - public static TensorListSplit create(Scope scope, Operand tensor, Operand elementShape, Operand lengths) { + @Endpoint( + describeByClass = true + ) + public static TensorListSplit create(Scope scope, Operand tensor, + Operand elementShape, Operand lengths) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListSplit", scope.makeOpName("TensorListSplit")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(elementShape.asOutput()); @@ -61,27 +75,19 @@ public static TensorListSplit create(Scope scope, Operand tenso opBuilder = scope.apply(opBuilder); return new TensorListSplit(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListSplit"; - - private Output outputHandle; - - private TensorListSplit(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListStack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListStack.java index 20284f1e76e..9d6b475d625 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListStack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListStack.java @@ -31,50 +31,45 @@ /** * Stacks all tensors in the list. - *

* Requires that all tensors have the same shape. - *

- * input_handle: the input list + *

input_handle: the input list * tensor: the gathered result * num_elements: optional. If not -1, the number of elements in the list. - * - * - * @param data type for {@code tensor()} output + * + * @param data type for {@code tensor} output */ @Operator public final class TensorListStack extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorListStack} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numElements - */ - public Options numElements(Long numElements) { - this.numElements = numElements; - return this; - } - - private Long numElements; - - private Options() { - } + public static final String OP_NAME = "TensorListStack"; + + private Output tensor; + + private TensorListStack(Operation operation) { + super(operation); + int outputIdx = 0; + tensor = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TensorListStack operation. - * + * * @param scope current scope - * @param inputHandle - * @param elementShape - * @param elementDtype - * @param options carries optional attributes values + * @param inputHandle the inputHandle value + * @param elementShape the elementShape value + * @param elementDtype the value of the elementDtype property + * @param options carries optional attribute values + * @param data type for {@code TensorListStack} output and operands * @return a new instance of TensorListStack */ - @Endpoint(describeByClass = true) - public static TensorListStack create(Scope scope, Operand inputHandle, Operand elementShape, Class elementDtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TensorListStack create(Scope scope, + Operand inputHandle, Operand elementShape, Class elementDtype, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListStack", scope.makeOpName("TensorListStack")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(elementShape.asOutput()); @@ -87,35 +82,51 @@ public static TensorListStack create(Scope scope, Operand(opBuilder.build()); + return new TensorListStack<>(opBuilder.build()); } - + /** - * @param numElements + * Sets the numElements option. + * + * @param numElements the numElements option + * @return this Options instance. */ public static Options numElements(Long numElements) { return new Options().numElements(numElements); } - + /** + * Gets tensor. + * + * @return tensor. */ public Output tensor() { return tensor; } - + @Override public Output asOutput() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorListStack"; - - private Output tensor; - - private TensorListStack(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorListStack} + */ + public static class Options { + private Long numElements; + + private Options() { + } + + /** + * Sets the numElements option. + * + * @param numElements the numElements option + * @return this Options instance. + */ + public Options numElements(Long numElements) { + this.numElements = numElements; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapErase.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapErase.java index cd3fd969829..6a5eac721ef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapErase.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapErase.java @@ -30,25 +30,41 @@ /** * Returns a tensor map with item from given key erased. - *

* input_handle: the original map * output_handle: the map with value from given key removed * key: the key of the value to be erased */ @Operator public final class TensorMapErase extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapErase"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private TensorMapErase(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapErase operation. - * + * * @param scope current scope - * @param inputHandle - * @param key - * @param valueDtype + * @param inputHandle the inputHandle value + * @param key the key value + * @param valueDtype the value of the valueDtype property + * @param data type for {@code TensorMapErase} output and operands * @return a new instance of TensorMapErase */ - @Endpoint(describeByClass = true) - public static TensorMapErase create(Scope scope, Operand inputHandle, Operand key, Class valueDtype) { + @Endpoint( + describeByClass = true + ) + public static TensorMapErase create(Scope scope, + Operand inputHandle, Operand key, Class valueDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorMapErase", scope.makeOpName("TensorMapErase")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(key.asOutput()); @@ -56,27 +72,19 @@ public static TensorMapErase create(Scope scope, Operand in opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); return new TensorMapErase(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapErase"; - - private Output outputHandle; - - private TensorMapErase(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapHasKey.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapHasKey.java index 75a432c34b1..c02b3f84543 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapHasKey.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapHasKey.java @@ -30,50 +30,56 @@ /** * Returns whether the given key exists in the map. - *

* input_handle: the input map * key: the key to check * has_key: whether the key is already in the map or not */ @Operator public final class TensorMapHasKey extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapHasKey"; + + private Output hasKey; + + private TensorMapHasKey(Operation operation) { + super(operation); + int outputIdx = 0; + hasKey = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapHasKey operation. - * + * * @param scope current scope - * @param inputHandle - * @param key + * @param inputHandle the inputHandle value + * @param key the key value * @return a new instance of TensorMapHasKey */ - @Endpoint(describeByClass = true) - public static TensorMapHasKey create(Scope scope, Operand inputHandle, Operand key) { + @Endpoint( + describeByClass = true + ) + public static TensorMapHasKey create(Scope scope, Operand inputHandle, + Operand key) { OperationBuilder opBuilder = scope.env().opBuilder("TensorMapHasKey", scope.makeOpName("TensorMapHasKey")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(key.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorMapHasKey(opBuilder.build()); } - + /** + * Gets hasKey. + * + * @return hasKey. */ public Output hasKey() { return hasKey; } - + @Override public Output asOutput() { return hasKey; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapHasKey"; - - private Output hasKey; - - private TensorMapHasKey(Operation operation) { - super(operation); - int outputIdx = 0; - hasKey = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapInsert.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapInsert.java index 2a1ea4eb399..5b08049cf5f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapInsert.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapInsert.java @@ -29,7 +29,6 @@ /** * Returns a map that is the 'input_handle' with the given key-value pair inserted. - *

* input_handle: the original map * output_handle: the map with key and value inserted * key: the key to be inserted @@ -37,18 +36,34 @@ */ @Operator public final class TensorMapInsert extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapInsert"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private TensorMapInsert(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapInsert operation. - * + * * @param scope current scope - * @param inputHandle - * @param key - * @param value + * @param inputHandle the inputHandle value + * @param key the key value + * @param value the value value * @return a new instance of TensorMapInsert */ - @Endpoint(describeByClass = true) - public static TensorMapInsert create(Scope scope, Operand inputHandle, Operand key, Operand value) { + @Endpoint( + describeByClass = true + ) + public static TensorMapInsert create(Scope scope, Operand inputHandle, + Operand key, Operand value) { OperationBuilder opBuilder = scope.env().opBuilder("TensorMapInsert", scope.makeOpName("TensorMapInsert")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(key.asOutput()); @@ -56,27 +71,19 @@ public static TensorMapInsert create(Scope scope, Operand inputHandle, Operan opBuilder = scope.apply(opBuilder); return new TensorMapInsert(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapInsert"; - - private Output outputHandle; - - private TensorMapInsert(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapLookup.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapLookup.java index a8b17f51ee1..69ebb676047 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapLookup.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapLookup.java @@ -30,54 +30,61 @@ /** * Returns the value from a given key in a tensor map. - *

* input_handle: the input map * key: the key to be looked up * value: the value found from the given key - * - * @param data type for {@code value()} output + * + * @param data type for {@code value} output */ @Operator public final class TensorMapLookup extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapLookup"; + + private Output value; + + private TensorMapLookup(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapLookup operation. - * + * * @param scope current scope - * @param inputHandle - * @param key - * @param valueDtype + * @param inputHandle the inputHandle value + * @param key the key value + * @param valueDtype the value of the valueDtype property + * @param data type for {@code TensorMapLookup} output and operands * @return a new instance of TensorMapLookup */ - @Endpoint(describeByClass = true) - public static TensorMapLookup create(Scope scope, Operand inputHandle, Operand key, Class valueDtype) { + @Endpoint( + describeByClass = true + ) + public static TensorMapLookup create(Scope scope, + Operand inputHandle, Operand key, Class valueDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorMapLookup", scope.makeOpName("TensorMapLookup")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(key.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("value_dtype", Operands.toDataType(valueDtype)); - return new TensorMapLookup(opBuilder.build()); + return new TensorMapLookup<>(opBuilder.build()); } - + /** + * Gets value. + * + * @return value. */ public Output value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapLookup"; - - private Output value; - - private TensorMapLookup(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapSize.java index 8e3ea33c75b..6aa230ce27c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapSize.java @@ -26,50 +26,56 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Returns the number of tensors in the input tensor map. - *

* input_handle: the input map * size: the number of tensors in the map */ @Operator public final class TensorMapSize extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapSize"; + + private Output output; + + private TensorMapSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapSize operation. - * + * * @param scope current scope - * @param inputHandle + * @param inputHandle the inputHandle value * @return a new instance of TensorMapSize */ - @Endpoint(describeByClass = true) - public static TensorMapSize create(Scope scope, Operand inputHandle) { + @Endpoint( + describeByClass = true + ) + public static TensorMapSize create(Scope scope, Operand inputHandle) { OperationBuilder opBuilder = scope.env().opBuilder("TensorMapSize", scope.makeOpName("TensorMapSize")); opBuilder.addInput(inputHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new TensorMapSize(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapSize"; - - private Output output; - - private TensorMapSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapStackKeys.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapStackKeys.java index 6166ddb357f..5d7ca8458f1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapStackKeys.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorMapStackKeys.java @@ -30,51 +30,58 @@ /** * Returns a Tensor stack of all keys in a tensor map. - *

* input_handle: the input map * keys: the returned Tensor of all keys in the map - * - * @param data type for {@code keys()} output + * + * @param data type for {@code keys} output */ @Operator public final class TensorMapStackKeys extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorMapStackKeys"; + + private Output keys; + + private TensorMapStackKeys(Operation operation) { + super(operation); + int outputIdx = 0; + keys = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorMapStackKeys operation. - * + * * @param scope current scope - * @param inputHandle - * @param keyDtype + * @param inputHandle the inputHandle value + * @param keyDtype the value of the keyDtype property + * @param data type for {@code TensorMapStackKeys} output and operands * @return a new instance of TensorMapStackKeys */ - @Endpoint(describeByClass = true) - public static TensorMapStackKeys create(Scope scope, Operand inputHandle, Class keyDtype) { + @Endpoint( + describeByClass = true + ) + public static TensorMapStackKeys create(Scope scope, + Operand inputHandle, Class keyDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorMapStackKeys", scope.makeOpName("TensorMapStackKeys")); opBuilder.addInput(inputHandle.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("key_dtype", Operands.toDataType(keyDtype)); - return new TensorMapStackKeys(opBuilder.build()); + return new TensorMapStackKeys<>(opBuilder.build()); } - + /** + * Gets keys. + * + * @return keys. */ public Output keys() { return keys; } - + @Override public Output asOutput() { return keys; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorMapStackKeys"; - - private Output keys; - - private TensorMapStackKeys(Operation operation) { - super(operation); - int outputIdx = 0; - keys = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdAdd.java index 52954e4e323..7059f28795a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdAdd.java @@ -29,49 +29,45 @@ import org.tensorflow.types.family.TType; /** - * Adds sparse `updates` to an existing tensor according to `indices`. - *

- * This operation creates a new tensor by adding sparse `updates` to the passed - * in `tensor`. - * This operation is very similar to `tf.scatter_nd_add`, except that the updates + * Adds sparse {@code updates} to an existing tensor according to {@code indices}. + * This operation creates a new tensor by adding sparse {@code updates} to the passed + * in {@code tensor}. + * This operation is very similar to {@code tf.scatter_nd_add}, except that the updates * are added onto an existing tensor (as opposed to a variable). If the memory * for the existing tensor cannot be re-used, a copy is made and updated. - *

- * `indices` is an integer tensor containing indices into a new tensor of shape - * `tensor.shape`. The last dimension of `indices` can be at most the rank of - * `tensor.shape`: - *

- * indices.shape[-1] <= tensor.shape.rank - *

- * The last dimension of `indices` corresponds to indices into elements - * (if `indices.shape[-1] = tensor.shape.rank`) or slices - * (if `indices.shape[-1] < tensor.shape.rank`) along dimension - * `indices.shape[-1]` of `tensor.shape`. `updates` is a tensor with shape - *

- * indices.shape[:-1] + tensor.shape[indices.shape[-1]:] - *

- * The simplest form of tensor_scatter_add is to add individual elements to a + *

{@code indices} is an integer tensor containing indices into a new tensor of shape + * {@code tensor.shape}. The last dimension of {@code indices} can be at most the rank of + * {@code tensor.shape}: + *

+ * indices.shape[-1] <= tensor.shape.rank
+ * 
+ *

The last dimension of {@code indices} corresponds to indices into elements + * (if {@code indices.shape[-1] = tensor.shape.rank}) or slices + * (if {@code indices.shape[-1] < tensor.shape.rank}) along dimension + * {@code indices.shape[-1]} of {@code tensor.shape}. {@code updates} is a tensor with shape + *

+ * indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
+ * 
+ *

The simplest form of tensor_scatter_add is to add individual elements to a * tensor by index. For example, say we want to add 4 elements in a rank-1 * tensor with 8 elements. - *

- * In Python, this scatter add operation would look like this: - *

{@code
+ * 

In Python, this scatter add operation would look like this: + *

  *     indices = tf.constant([[4], [3], [1], [7]])
  *     updates = tf.constant([9, 10, 11, 12])
  *     tensor = tf.ones([8], dtype=tf.int32)
  *     updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
  *     print(updated)
- * }
- * The resulting tensor would look like this: - *

- * [1, 12, 1, 11, 10, 1, 1, 13] - *

- * We can also, insert entire slices of a higher rank tensor all at once. For + *

+ *

The resulting tensor would look like this: + *

+ * [1, 12, 1, 11, 10, 1, 1, 13]
+ * 
+ *

We can also, insert entire slices of a higher rank tensor all at once. For * example, if we wanted to insert two slices in the first dimension of a * rank-3 tensor with two matrices of new values. - *

- * In Python, this scatter add operation would look like this: - *

{@code
+ * 

In Python, this scatter add operation would look like this: + *

  *     indices = tf.constant([[0], [2]])
  *     updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6],
  *                             [7, 7, 7, 7], [8, 8, 8, 8]],
@@ -80,61 +76,68 @@
  *     tensor = tf.ones([4, 4, 4],dtype=tf.int32)
  *     updated = tf.tensor_scatter_nd_add(tensor, indices, updates)
  *     print(updated)
- * }
- * The resulting tensor would look like this: - *

- * [[[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]], - * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], - * [[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]], - * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]] - *

- * Note that on CPU, if an out of bound index is found, an error is returned. + *

+ *

The resulting tensor would look like this: + *

+ * [[[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]],
+ *  [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
+ *  [[6, 6, 6, 6], [7, 7, 7, 7], [8, 8, 8, 8], [9, 9, 9, 9]],
+ *  [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]]
+ * 
+ *

Note that on CPU, if an out of bound index is found, an error is returned. * On GPU, if an out of bound index is found, the index is ignored. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class TensorScatterNdAdd extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorScatterNdAdd operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterAdd"; + + private Output output; + + private TensorScatterNdAdd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterAdd operation. + * * @param scope current scope * @param tensor Tensor to copy/update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param data type for {@code TensorScatterAdd} output and operands * @return a new instance of TensorScatterNdAdd */ - @Endpoint(describeByClass = true) - public static TensorScatterNdAdd create(Scope scope, Operand tensor, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdAdd create(Scope scope, Operand tensor, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterAdd", scope.makeOpName("TensorScatterNdAdd")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); opBuilder = scope.apply(opBuilder); - return new TensorScatterNdAdd(opBuilder.build()); + return new TensorScatterNdAdd<>(opBuilder.build()); } - + /** + * Gets output. * A new tensor copied from tensor and updates added according to the indices. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterAdd"; - - private Output output; - - private TensorScatterNdAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMax.java index bd6d0be53e1..5c0b720df48 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMax.java @@ -29,50 +29,59 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code output()} output + * The TensorScatterMax operation + * + * @param data type for {@code output} output */ @Operator public final class TensorScatterNdMax extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorScatterNdMax operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterMax"; + + private Output output; + + private TensorScatterNdMax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterMax operation. + * * @param scope current scope * @param tensor Tensor to update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param data type for {@code TensorScatterMax} output and operands * @return a new instance of TensorScatterNdMax */ - @Endpoint(describeByClass = true) - public static TensorScatterNdMax create(Scope scope, Operand tensor, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdMax create(Scope scope, Operand tensor, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterMax", scope.makeOpName("TensorScatterNdMax")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); opBuilder = scope.apply(opBuilder); - return new TensorScatterNdMax(opBuilder.build()); + return new TensorScatterNdMax<>(opBuilder.build()); } - + /** + * Gets output. * A new tensor copied from tensor whose values are element-wise maximum between tensor and updates according to the indices. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterMax"; - - private Output output; - - private TensorScatterNdMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMin.java index b823931fef8..68ca6569d4a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdMin.java @@ -29,50 +29,59 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code output()} output + * The TensorScatterMin operation + * + * @param data type for {@code output} output */ @Operator public final class TensorScatterNdMin extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorScatterNdMin operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterMin"; + + private Output output; + + private TensorScatterNdMin(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterMin operation. + * * @param scope current scope * @param tensor Tensor to update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param data type for {@code TensorScatterMin} output and operands * @return a new instance of TensorScatterNdMin */ - @Endpoint(describeByClass = true) - public static TensorScatterNdMin create(Scope scope, Operand tensor, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdMin create(Scope scope, Operand tensor, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterMin", scope.makeOpName("TensorScatterNdMin")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); opBuilder = scope.apply(opBuilder); - return new TensorScatterNdMin(opBuilder.build()); + return new TensorScatterNdMin<>(opBuilder.build()); } - + /** + * Gets output. * A new tensor copied from tensor whose values are element-wise minimum between tensor and updates according to the indices. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterMin"; - - private Output output; - - private TensorScatterNdMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdSub.java index a29743da711..b5748556821 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdSub.java @@ -29,48 +29,44 @@ import org.tensorflow.types.family.TType; /** - * Subtracts sparse `updates` from an existing tensor according to `indices`. - *

- * This operation creates a new tensor by subtracting sparse `updates` from the - * passed in `tensor`. - * This operation is very similar to `tf.scatter_nd_sub`, except that the updates + * Subtracts sparse {@code updates} from an existing tensor according to {@code indices}. + * This operation creates a new tensor by subtracting sparse {@code updates} from the + * passed in {@code tensor}. + * This operation is very similar to {@code tf.scatter_nd_sub}, except that the updates * are subtracted from an existing tensor (as opposed to a variable). If the memory * for the existing tensor cannot be re-used, a copy is made and updated. - *

- * `indices` is an integer tensor containing indices into a new tensor of shape - * `shape`. The last dimension of `indices` can be at most the rank of `shape`: - *

- * indices.shape[-1] <= shape.rank - *

- * The last dimension of `indices` corresponds to indices into elements - * (if `indices.shape[-1] = shape.rank`) or slices - * (if `indices.shape[-1] < shape.rank`) along dimension `indices.shape[-1]` of - * `shape`. `updates` is a tensor with shape - *

- * indices.shape[:-1] + shape[indices.shape[-1]:] - *

- * The simplest form of tensor_scatter_sub is to subtract individual elements + *

{@code indices} is an integer tensor containing indices into a new tensor of shape + * {@code shape}. The last dimension of {@code indices} can be at most the rank of {@code shape}: + *

+ * indices.shape[-1] <= shape.rank
+ * 
+ *

The last dimension of {@code indices} corresponds to indices into elements + * (if {@code indices.shape[-1] = shape.rank}) or slices + * (if {@code indices.shape[-1] < shape.rank}) along dimension {@code indices.shape[-1]} of + * {@code shape}. {@code updates} is a tensor with shape + *

+ * indices.shape[:-1] + shape[indices.shape[-1]:]
+ * 
+ *

The simplest form of tensor_scatter_sub is to subtract individual elements * from a tensor by index. For example, say we want to insert 4 scattered elements * in a rank-1 tensor with 8 elements. - *

- * In Python, this scatter subtract operation would look like this: - *

{@code
+ * 

In Python, this scatter subtract operation would look like this: + *

  *     indices = tf.constant([[4], [3], [1], [7]])
  *     updates = tf.constant([9, 10, 11, 12])
  *     tensor = tf.ones([8], dtype=tf.int32)
  *     updated = tf.tensor_scatter_nd_sub(tensor, indices, updates)
  *     print(updated)
- * }
- * The resulting tensor would look like this: - *

- * [1, -10, 1, -9, -8, 1, 1, -11] - *

- * We can also, insert entire slices of a higher rank tensor all at once. For + *

+ *

The resulting tensor would look like this: + *

+ * [1, -10, 1, -9, -8, 1, 1, -11]
+ * 
+ *

We can also, insert entire slices of a higher rank tensor all at once. For * example, if we wanted to insert two slices in the first dimension of a * rank-3 tensor with two matrices of new values. - *

- * In Python, this scatter add operation would look like this: - *

{@code
+ * 

In Python, this scatter add operation would look like this: + *

  *     indices = tf.constant([[0], [2]])
  *     updates = tf.constant([[[5, 5, 5, 5], [6, 6, 6, 6],
  *                             [7, 7, 7, 7], [8, 8, 8, 8]],
@@ -79,61 +75,68 @@
  *     tensor = tf.ones([4, 4, 4],dtype=tf.int32)
  *     updated = tf.tensor_scatter_nd_sub(tensor, indices, updates)
  *     print(updated)
- * }
- * The resulting tensor would look like this: - *

- * [[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]], - * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], - * [[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]], - * [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]] - *

- * Note that on CPU, if an out of bound index is found, an error is returned. + *

+ *

The resulting tensor would look like this: + *

+ * [[[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
+ *  [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]],
+ *  [[-4, -4, -4, -4], [-5, -5, -5, -5], [-6, -6, -6, -6], [-7, -7, -7, -7]],
+ *  [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]]
+ * 
+ *

Note that on CPU, if an out of bound index is found, an error is returned. * On GPU, if an out of bound index is found, the index is ignored. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class TensorScatterNdSub extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorScatterNdSub operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterSub"; + + private Output output; + + private TensorScatterNdSub(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterSub operation. + * * @param scope current scope * @param tensor Tensor to copy/update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param data type for {@code TensorScatterSub} output and operands * @return a new instance of TensorScatterNdSub */ - @Endpoint(describeByClass = true) - public static TensorScatterNdSub create(Scope scope, Operand tensor, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdSub create(Scope scope, Operand tensor, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterSub", scope.makeOpName("TensorScatterNdSub")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); opBuilder = scope.apply(opBuilder); - return new TensorScatterNdSub(opBuilder.build()); + return new TensorScatterNdSub<>(opBuilder.build()); } - + /** + * Gets output. * A new tensor copied from tensor and updates subtracted according to the indices. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterSub"; - - private Output output; - - private TensorScatterNdSub(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdUpdate.java index 6cb02e0a8a0..dd6a9c5b775 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterNdUpdate.java @@ -29,92 +29,89 @@ import org.tensorflow.types.family.TType; /** - * Scatter `updates` into an existing tensor according to `indices`. - *

- * This operation creates a new tensor by applying sparse `updates` to the passed - * in `tensor`. - * This operation is very similar to `tf.scatter_nd`, except that the updates are + * Scatter {@code updates} into an existing tensor according to {@code indices}. + * This operation creates a new tensor by applying sparse {@code updates} to the passed + * in {@code tensor}. + * This operation is very similar to {@code tf.scatter_nd}, except that the updates are * scattered onto an existing tensor (as opposed to a zero-tensor). If the memory * for the existing tensor cannot be re-used, a copy is made and updated. - *

- * If `indices` contains duplicates, then we pick the last update for the index. - *

- * If an out of bound index is found on CPU, an error is returned. - *

- * WARNING: There are some GPU specific semantics for this operation. - * - If an out of bound index is found, the index is ignored. - * - The order in which updates are applied is nondeterministic, so the output - * will be nondeterministic if `indices` contains duplicates. - *

- * `indices` is an integer tensor containing indices into a new tensor of shape - * `shape`. + *

If {@code indices} contains duplicates, then we pick the last update for the index. + *

If an out of bound index is found on CPU, an error is returned. + *

WARNING: There are some GPU specific semantics for this operation. *

    - *
  • - * `indices` must have at least 2 axes: `(num_updates, index_depth)`. - *
  • - *
  • - * The last axis of `indices` is how deep to index into `tensor` so this index - * depth must be less than the rank of `tensor`: `indices.shape[-1] <= tensor.ndim` - *
  • + *
  • If an out of bound index is found, the index is ignored.
  • + *
  • The order in which updates are applied is nondeterministic, so the output + * will be nondeterministic if {@code indices} contains duplicates.
  • *
- * if `indices.shape[-1] = tensor.rank` this Op indexes and updates scalar elements. - * if `indices.shape[-1] < tensor.rank` it indexes and updates slices of the input - * `tensor`. - *

- * Each `update` has a rank of `tensor.rank - indices.shape[-1]`. - * The overall shape of `updates` is: - *

{@code
+ * 

{@code indices} is an integer tensor containing indices into a new tensor of shape + * {@code shape}. + *

    + *
  • {@code indices} must have at least 2 axes: {@code (num_updates, index_depth)}.
  • + *
  • The last axis of {@code indices} is how deep to index into {@code tensor} so this index + * depth must be less than the rank of {@code tensor}: {@code indices.shape[-1] <= tensor.ndim}
  • + *
+ *

if {@code indices.shape[-1] = tensor.rank} this Op indexes and updates scalar elements. + * if {@code indices.shape[-1] < tensor.rank} it indexes and updates slices of the input + * {@code tensor}. + *

Each {@code update} has a rank of {@code tensor.rank - indices.shape[-1]}. + * The overall shape of {@code updates} is: + *

  * indices.shape[:-1] + tensor.shape[indices.shape[-1]:]
- * }
- * For usage examples see the python [tf.tensor_scatter_nd_update]( - * https://www.tensorflow.org/api_docs/python/tf/tensor_scatter_nd_update) function - * - * - * @param data type for {@code output()} output + *
+ *

For usage examples see the python tf.tensor_scatter_nd_update {@link org.tensorflow.op.Ops#tensorScatterNdUpdate} function + * + * @param data type for {@code output} output */ @Operator public final class TensorScatterNdUpdate extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorScatterNdUpdate operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorScatterUpdate"; + + private Output output; + + private TensorScatterNdUpdate(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorScatterUpdate operation. + * * @param scope current scope * @param tensor Tensor to copy/update. * @param indices Index tensor. * @param updates Updates to scatter into output. + * @param data type for {@code TensorScatterUpdate} output and operands * @return a new instance of TensorScatterNdUpdate */ - @Endpoint(describeByClass = true) - public static TensorScatterNdUpdate create(Scope scope, Operand tensor, Operand indices, Operand updates) { + @Endpoint( + describeByClass = true + ) + public static TensorScatterNdUpdate create(Scope scope, Operand tensor, + Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterUpdate", scope.makeOpName("TensorScatterNdUpdate")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(updates.asOutput()); opBuilder = scope.apply(opBuilder); - return new TensorScatterNdUpdate(opBuilder.build()); + return new TensorScatterNdUpdate<>(opBuilder.build()); } - + /** + * Gets output. * A new tensor with the given shape and updates applied according * to the indices. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorScatterUpdate"; - - private Output output; - - private TensorScatterNdUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorStridedSliceUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorStridedSliceUpdate.java index d7ad46b5362..00fcc69e613 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorStridedSliceUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorStridedSliceUpdate.java @@ -29,89 +29,50 @@ import org.tensorflow.types.family.TType; /** - * Assign `value` to the sliced l-value reference of `input`. - *

- * The values of `value` are assigned to the positions in the tensor `input` that - * are selected by the slice parameters. The slice parameters `begin` `end` - * `strides` etc. work exactly as in `StridedSlice`. - *

- * NOTE this op currently does not support broadcasting and so `value`'s shape - * must be exactly the shape produced by the slice of `input`. - * - * @param data type for {@code output()} output + * Assign {@code value} to the sliced l-value reference of {@code input}. + * The values of {@code value} are assigned to the positions in the tensor {@code input} that + * are selected by the slice parameters. The slice parameters {@code begin} {@code end} + * {@code strides} etc. work exactly as in {@code StridedSlice}. + *

NOTE this op currently does not support broadcasting and so {@code value}'s shape + * must be exactly the shape produced by the slice of {@code input}. + * + * @param data type for {@code output} output */ @Operator public final class TensorStridedSliceUpdate extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.TensorStridedSliceUpdate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param beginMask - */ - public Options beginMask(Long beginMask) { - this.beginMask = beginMask; - return this; - } - - /** - * @param endMask - */ - public Options endMask(Long endMask) { - this.endMask = endMask; - return this; - } - - /** - * @param ellipsisMask - */ - public Options ellipsisMask(Long ellipsisMask) { - this.ellipsisMask = ellipsisMask; - return this; - } - - /** - * @param newAxisMask - */ - public Options newAxisMask(Long newAxisMask) { - this.newAxisMask = newAxisMask; - return this; - } - - /** - * @param shrinkAxisMask - */ - public Options shrinkAxisMask(Long shrinkAxisMask) { - this.shrinkAxisMask = shrinkAxisMask; - return this; - } - - private Long beginMask; - private Long endMask; - private Long ellipsisMask; - private Long newAxisMask; - private Long shrinkAxisMask; - - private Options() { - } + public static final String OP_NAME = "TensorStridedSliceUpdate"; + + private Output output; + + private TensorStridedSliceUpdate(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TensorStridedSliceUpdate operation. - * + * * @param scope current scope - * @param input - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values + * @param input the input value + * @param begin the begin value + * @param end the end value + * @param strides the strides value + * @param value the value value + * @param options carries optional attribute values + * @param data type for {@code TensorStridedSliceUpdate} output and operands + * @param data type for {@code TensorStridedSliceUpdate} output and operands * @return a new instance of TensorStridedSliceUpdate */ - @Endpoint(describeByClass = true) - public static TensorStridedSliceUpdate create(Scope scope, Operand input, Operand begin, Operand end, Operand strides, Operand value, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TensorStridedSliceUpdate create(Scope scope, + Operand input, Operand begin, Operand end, Operand strides, Operand value, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorStridedSliceUpdate", scope.makeOpName("TensorStridedSliceUpdate")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(begin.asOutput()); @@ -138,63 +99,143 @@ public static TensorStridedSliceUpdate c } } } - return new TensorStridedSliceUpdate(opBuilder.build()); + return new TensorStridedSliceUpdate<>(opBuilder.build()); } - + /** - * @param beginMask + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. */ public static Options beginMask(Long beginMask) { return new Options().beginMask(beginMask); } - + /** - * @param endMask + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. */ public static Options endMask(Long endMask) { return new Options().endMask(endMask); } - + /** - * @param ellipsisMask + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. */ public static Options ellipsisMask(Long ellipsisMask) { return new Options().ellipsisMask(ellipsisMask); } - + /** - * @param newAxisMask + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. */ public static Options newAxisMask(Long newAxisMask) { return new Options().newAxisMask(newAxisMask); } - + /** - * @param shrinkAxisMask + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. */ public static Options shrinkAxisMask(Long shrinkAxisMask) { return new Options().shrinkAxisMask(shrinkAxisMask); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorStridedSliceUpdate"; - - private Output output; - - private TensorStridedSliceUpdate(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TensorStridedSliceUpdate} + */ + public static class Options { + private Long beginMask; + + private Long endMask; + + private Long ellipsisMask; + + private Long newAxisMask; + + private Long shrinkAxisMask; + + private Options() { + } + + /** + * Sets the beginMask option. + * + * @param beginMask the beginMask option + * @return this Options instance. + */ + public Options beginMask(Long beginMask) { + this.beginMask = beginMask; + return this; + } + + /** + * Sets the endMask option. + * + * @param endMask the endMask option + * @return this Options instance. + */ + public Options endMask(Long endMask) { + this.endMask = endMask; + return this; + } + + /** + * Sets the ellipsisMask option. + * + * @param ellipsisMask the ellipsisMask option + * @return this Options instance. + */ + public Options ellipsisMask(Long ellipsisMask) { + this.ellipsisMask = ellipsisMask; + return this; + } + + /** + * Sets the newAxisMask option. + * + * @param newAxisMask the newAxisMask option + * @return this Options instance. + */ + public Options newAxisMask(Long newAxisMask) { + this.newAxisMask = newAxisMask; + return this; + } + + /** + * Sets the shrinkAxisMask option. + * + * @param shrinkAxisMask the shrinkAxisMask option + * @return this Options instance. + */ + public Options shrinkAxisMask(Long shrinkAxisMask) { + this.shrinkAxisMask = shrinkAxisMask; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Tile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Tile.java index c7ee253114c..c2c290787a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Tile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Tile.java @@ -30,75 +30,87 @@ /** * Constructs a tensor by tiling a given tensor. - *

- * This operation creates a new tensor by replicating `input` `multiples` times. - * The output tensor's i'th dimension has `input.dims(i) * multiples[i]` elements, - * and the values of `input` are replicated `multiples[i]` times along the 'i'th - * dimension. For example, tiling `[a b c d]` by `[2]` produces - * `[a b c d a b c d]`. - *

- * >>> a = tf.constant([[1,2,3],[4,5,6]], tf.int32) - * >>> b = tf.constant([1,2], tf.int32) - * >>> tf.tile(a, b) - * + *

+ *
+ *

a = tf.constant([[1,2,3],[4,5,6]], tf.int32) + * b = tf.constant([1,2], tf.int32) + * tf.tile(a, b) + * <tf.Tensor: shape=(2, 6), dtype=int32, numpy= * array([[1, 2, 3, 1, 2, 3], - * [4, 5, 6, 4, 5, 6]], dtype=int32)> - * >>> c = tf.constant([2,1], tf.int32) - * >>> tf.tile(a, c) - * - * >>> d = tf.constant([2,2], tf.int32) - * >>> tf.tile(a, d) - * - * - * @param data type for {@code output()} output + * [4, 5, 6, 4, 5, 6], + * [1, 2, 3, 1, 2, 3], + * [4, 5, 6, 4, 5, 6]], dtype=int32)> + *

+ *
+ * + * + * @param data type for {@code output} output */ @Operator public final class Tile extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Tile"; + + private Output output; + + private Tile(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Tile operation. - * + * * @param scope current scope * @param input 1-D or higher. - * @param multiples 1-D. Length must be the same as the number of dimensions in `input` + * @param multiples 1-D. Length must be the same as the number of dimensions in {@code input} + * @param data type for {@code Tile} output and operands * @return a new instance of Tile */ - @Endpoint(describeByClass = true) - public static Tile create(Scope scope, Operand input, Operand multiples) { + @Endpoint( + describeByClass = true + ) + public static Tile create(Scope scope, Operand input, + Operand multiples) { OperationBuilder opBuilder = scope.env().opBuilder("Tile", scope.makeOpName("Tile")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(multiples.asOutput()); opBuilder = scope.apply(opBuilder); - return new Tile(opBuilder.build()); + return new Tile<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Tile"; - - private Output output; - - private Tile(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Timestamp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Timestamp.java index 30a7d13d4a5..200a3627235 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Timestamp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Timestamp.java @@ -29,47 +29,51 @@ /** * Provides the time since epoch in seconds. - *

- * Returns the timestamp as a `float64` for seconds since the Unix epoch. - *

- * Note: the timestamp is computed when the op is executed, not when it is added + * Returns the timestamp as a {@code float64} for seconds since the Unix epoch. + *

Note: the timestamp is computed when the op is executed, not when it is added * to the graph. */ @Operator public final class Timestamp extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Timestamp"; + + private Output ts; + + private Timestamp(Operation operation) { + super(operation); + int outputIdx = 0; + ts = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Timestamp operation. - * + * * @param scope current scope * @return a new instance of Timestamp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Timestamp create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("Timestamp", scope.makeOpName("Timestamp")); opBuilder = scope.apply(opBuilder); return new Timestamp(opBuilder.build()); } - + /** + * Gets ts. + * + * @return ts. */ public Output ts() { return ts; } - + @Override public Output asOutput() { return ts; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Timestamp"; - - private Output ts; - - private Timestamp(Operation operation) { - super(operation); - int outputIdx = 0; - ts = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKUnique.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKUnique.java index 1904a513a5a..8627f1eab1b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKUnique.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKUnique.java @@ -30,7 +30,6 @@ /** * Returns the TopK unique values in the array in sorted order. The - *

* running time is proportional to the product of K and the input * size. Sorting the whole array is more efficient for sufficiently large * values of K. The median-of-medians algorithm is probably faster, but @@ -46,16 +45,33 @@ */ @Operator public final class TopKUnique extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TopKUnique"; + + private Output topk; + + private Output topkIndices; + + private TopKUnique(Operation operation) { + super(operation); + int outputIdx = 0; + topk = operation.output(outputIdx++); + topkIndices = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TopKUnique operation. - * + * * @param scope current scope - * @param input - * @param k + * @param input the input value + * @param k the value of the k property * @return a new instance of TopKUnique */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TopKUnique create(Scope scope, Operand input, Long k) { OperationBuilder opBuilder = scope.env().opBuilder("TopKUnique", scope.makeOpName("TopKUnique")); opBuilder.addInput(input.asOutput()); @@ -63,29 +79,22 @@ public static TopKUnique create(Scope scope, Operand input, Long k) { opBuilder.setAttr("k", k); return new TopKUnique(opBuilder.build()); } - + /** + * Gets topk. + * + * @return topk. */ public Output topk() { return topk; } - + /** + * Gets topkIndices. + * + * @return topkIndices. */ public Output topkIndices() { return topkIndices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TopKUnique"; - - private Output topk; - private Output topkIndices; - - private TopKUnique(Operation operation) { - super(operation); - int outputIdx = 0; - topk = operation.output(outputIdx++); - topkIndices = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKWithUnique.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKWithUnique.java index a2cc2c2adf5..b984e2741f7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKWithUnique.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TopKWithUnique.java @@ -30,7 +30,6 @@ /** * Returns the TopK values in the array in sorted order. This is a combination - *

* of MakeUnique and TopKUnique. The returned top-K will have its lower bits * replaced by iota, thus it will be close to the original value but not exactly * the same. The running time is proportional to the product of K and the input @@ -38,16 +37,33 @@ */ @Operator public final class TopKWithUnique extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TopKWithUnique"; + + private Output topk; + + private Output topkIndices; + + private TopKWithUnique(Operation operation) { + super(operation); + int outputIdx = 0; + topk = operation.output(outputIdx++); + topkIndices = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TopKWithUnique operation. - * + * * @param scope current scope - * @param input - * @param k + * @param input the input value + * @param k the value of the k property * @return a new instance of TopKWithUnique */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TopKWithUnique create(Scope scope, Operand input, Long k) { OperationBuilder opBuilder = scope.env().opBuilder("TopKWithUnique", scope.makeOpName("TopKWithUnique")); opBuilder.addInput(input.asOutput()); @@ -55,29 +71,22 @@ public static TopKWithUnique create(Scope scope, Operand input, Long k opBuilder.setAttr("k", k); return new TopKWithUnique(opBuilder.build()); } - + /** + * Gets topk. + * + * @return topk. */ public Output topk() { return topk; } - + /** + * Gets topkIndices. + * + * @return topkIndices. */ public Output topkIndices() { return topkIndices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TopKWithUnique"; - - private Output topk; - private Output topkIndices; - - private TopKWithUnique(Operation operation) { - super(operation); - int outputIdx = 0; - topk = operation.output(outputIdx++); - topkIndices = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TryRpc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TryRpc.java index eaf5f97335b..b41e0204f36 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TryRpc.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TryRpc.java @@ -30,116 +30,90 @@ /** * Perform batches of RPC requests. - *

* This op asynchronously performs either a single RPC request, or a batch * of requests. RPC requests are defined by three main parameters: - *

- * - `address` (the host+port or BNS address of the request) - * - `method` (the method name for the request) - * - `request` (the serialized proto string, or vector of strings, - * of the RPC request argument). - *

- * For example, if you have an RPC service running on port localhost:2345, + *

    + *
  • {@code address} (the host+port or BNS address of the request)
  • + *
  • {@code method} (the method name for the request)
  • + *
  • {@code request} (the serialized proto string, or vector of strings, + * of the RPC request argument).
  • + *
+ *

For example, if you have an RPC service running on port localhost:2345, * and its interface is configured with the following proto declaration: - *

{@code
+ * 
  * service MyService {
  *   rpc MyMethod(MyRequestProto) returns (MyResponseProto) {
  *   }
  * };
- * }
- * then call this op with arguments: - *
{@code
- * address = "localhost:2345"
- * method = "MyService/MyMethod"
- * }
- * The `request` tensor is a string tensor representing serialized `MyRequestProto` - * strings; and the output string tensor `response` will have the same shape + *
+ *

then call this op with arguments: + *

+ * address = "localhost:2345"
+ * method = "MyService/MyMethod"
+ * 
+ *

The {@code request} tensor is a string tensor representing serialized {@code MyRequestProto} + * strings; and the output string tensor {@code response} will have the same shape * and contain (upon successful completion) corresponding serialized - * `MyResponseProto` strings. - *

- * For example, to send a single, empty, `MyRequestProto`, call - * this op with `request = ""`. To send 5 parallel empty requests, - * call this op with `request = ["", "", "", "", ""]`. - *

- * More generally, one can create a batch of `MyRequestProto` serialized protos - * from regular batched tensors using the `encode_proto` op, and convert - * the response `MyResponseProto` serialized protos to batched tensors - * using the `decode_proto` op. - *

- * NOTE Working with serialized proto strings is faster than instantiating + * {@code MyResponseProto} strings. + *

For example, to send a single, empty, {@code MyRequestProto}, call + * this op with {@code request = ""}. To send 5 parallel empty requests, + * call this op with {@code request = ["", "", "", "", ""]}. + *

More generally, one can create a batch of {@code MyRequestProto} serialized protos + * from regular batched tensors using the {@code encode_proto} op, and convert + * the response {@code MyResponseProto} serialized protos to batched tensors + * using the {@code decode_proto} op. + *

NOTE Working with serialized proto strings is faster than instantiating * actual proto objects in memory, so no performance degradation is expected * compared to writing custom kernels for this workflow. - *

- * Unlike the standard `Rpc` op, if the connection fails or the remote worker - * returns an error status, this op does not reraise the exception. - * Instead, the `status_code` and `status_message` entry for the corresponding RPC - * call is set with the error returned from the RPC call. The `response` tensor + *

Unlike the standard {@code Rpc} op, if the connection fails or the remote worker + * returns an error status, this op does not reraise the exception. + * Instead, the {@code status_code} and {@code status_message} entry for the corresponding RPC + * call is set with the error returned from the RPC call. The {@code response} tensor * will contain valid response values for those minibatch entries whose RPCs did * not fail; the rest of the entries will have empty strings. */ @Operator public final class TryRpc extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.core.TryRpc} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param protocol RPC protocol to use. Empty string means use the default protocol. - * Options include 'grpc'. - */ - public Options protocol(String protocol) { - this.protocol = protocol; - return this; - } - - /** - * @param failFast `boolean`. If `true` (default), then failures to connect - * (i.e., the server does not immediately respond) cause an RPC failure. - */ - public Options failFast(Boolean failFast) { - this.failFast = failFast; - return this; - } - - /** - * @param timeoutInMs `int`. If `0` (default), then the kernel will run the RPC - * request and only time out if the RPC deadline passes or the session times out. - * If this value is greater than `0`, then the op will raise an exception if - * the RPC takes longer than `timeout_in_ms`. - */ - public Options timeoutInMs(Long timeoutInMs) { - this.timeoutInMs = timeoutInMs; - return this; - } - - private String protocol; - private Boolean failFast; - private Long timeoutInMs; - - private Options() { - } + public static final String OP_NAME = "TryRpc"; + + private Output response; + + private Output statusCode; + + private Output statusMessage; + + private TryRpc(Operation operation) { + super(operation); + int outputIdx = 0; + response = operation.output(outputIdx++); + statusCode = operation.output(outputIdx++); + statusMessage = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TryRpc operation. - * + * * @param scope current scope - * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. + * @param address {@code 0-D} or {@code 1-D}. The address (i.e. host_name:port) of the RPC server. * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `method` and `request`. - * @param method `0-D` or `1-D`. The method address on the RPC server. + * are sent. This argument broadcasts with {@code method} and {@code request}. + * @param method {@code 0-D} or {@code 1-D}. The method address on the RPC server. * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `request`. - * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. + * are sent. This argument broadcasts with {@code address} and {@code request}. + * @param request {@code 0-D} or {@code 1-D}. Serialized proto strings: the rpc request argument. * If this tensor has more than 1 element, then multiple parallel rpc requests - * are sent. This argument broadcasts with `address` and `method`. - * @param options carries optional attributes values + * are sent. This argument broadcasts with {@code address} and {@code method}. + * @param options carries optional attribute values * @return a new instance of TryRpc */ - @Endpoint(describeByClass = true) - public static TryRpc create(Scope scope, Operand address, Operand method, Operand request, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TryRpc create(Scope scope, Operand address, Operand method, + Operand request, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TryRpc", scope.makeOpName("TryRpc")); opBuilder.addInput(address.asOutput()); opBuilder.addInput(method.asOutput()); @@ -160,67 +134,119 @@ public static TryRpc create(Scope scope, Operand address, Operand response() { return response; } - + /** - * Same shape as `request`. Values correspond to tensorflow Status enum codes. + * Gets statusCode. + * Same shape as {@code request}. Values correspond to tensorflow Status enum codes. + * @return statusCode. */ public Output statusCode() { return statusCode; } - + /** - * Same shape as `request`. Values correspond to Status messages + * Gets statusMessage. + * Same shape as {@code request}. Values correspond to Status messages * returned from the RPC calls. + * @return statusMessage. */ public Output statusMessage() { return statusMessage; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TryRpc"; - - private Output response; - private Output statusCode; - private Output statusMessage; - - private TryRpc(Operation operation) { - super(operation); - int outputIdx = 0; - response = operation.output(outputIdx++); - statusCode = operation.output(outputIdx++); - statusMessage = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.TryRpc} + */ + public static class Options { + private String protocol; + + private Boolean failFast; + + private Long timeoutInMs; + + private Options() { + } + + /** + * Sets the protocol option. + * + * @param protocol RPC protocol to use. Empty string means use the default protocol. + * Options include 'grpc'. + * @return this Options instance. + */ + public Options protocol(String protocol) { + this.protocol = protocol; + return this; + } + + /** + * Sets the failFast option. + * + * @param failFast {@code boolean}. If {@code true} (default), then failures to connect + * (i.e., the server does not immediately respond) cause an RPC failure. + * @return this Options instance. + */ + public Options failFast(Boolean failFast) { + this.failFast = failFast; + return this; + } + + /** + * Sets the timeoutInMs option. + * + * @param timeoutInMs {@code int}. If {@code 0} (default), then the kernel will run the RPC + * request and only time out if the RPC deadline passes or the session times out. + * If this value is greater than {@code 0}, then the op will raise an exception if + * the RPC takes longer than {@code timeout_in_ms}. + * @return this Options instance. + */ + public Options timeoutInMs(Long timeoutInMs) { + this.timeoutInMs = timeoutInMs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unbatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unbatch.java index 4d2ccd8e552..cc4c9cbcfba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unbatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unbatch.java @@ -30,72 +30,58 @@ /** * Reverses the operation of Batch for a single output Tensor. - *

* An instance of Unbatch either receives an empty batched_tensor, in which case it * asynchronously waits until the values become available from a concurrently * running instance of Unbatch with the same container and shared_name, or receives * a non-empty batched_tensor in which case it finalizes all other concurrently * running instances and outputs its own element from the batch. - *

- * batched_tensor: The possibly transformed output of Batch. The size of the first - * dimension should remain unchanged by the transformations for the operation to - * work. + *

batched_tensor: The possibly transformed output of Batch. The size of the first + * dimension should remain unchanged by the transformations for the operation to + * work. * batch_index: The matching batch_index obtained from Batch. * id: The id scalar emitted by Batch. * unbatched_tensor: The Tensor corresponding to this execution. * timeout_micros: Maximum amount of time (in microseconds) to wait to receive the - * batched input tensor associated with a given invocation of the op. + * batched input tensor associated with a given invocation of the op. * container: Container to control resource sharing. * shared_name: Instances of Unbatch with the same container and shared_name are - * assumed to possibly belong to the same batch. If left empty, the op name will - * be used as the shared name. - * - * @param data type for {@code unbatchedTensor()} output + * assumed to possibly belong to the same batch. If left empty, the op name will + * be used as the shared name. + * + * @param data type for {@code unbatched_tensor} output */ @Operator public final class Unbatch extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Unbatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "Unbatch"; + + private Output unbatchedTensor; + + private Unbatch(Operation operation) { + super(operation); + int outputIdx = 0; + unbatchedTensor = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Unbatch operation. - * + * * @param scope current scope - * @param batchedTensor - * @param batchIndex - * @param id - * @param timeoutMicros - * @param options carries optional attributes values + * @param batchedTensor the batchedTensor value + * @param batchIndex the batchIndex value + * @param id the id value + * @param timeoutMicros the value of the timeoutMicros property + * @param options carries optional attribute values + * @param data type for {@code Unbatch} output and operands * @return a new instance of Unbatch */ - @Endpoint(describeByClass = true) - public static Unbatch create(Scope scope, Operand batchedTensor, Operand batchIndex, Operand id, Long timeoutMicros, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Unbatch create(Scope scope, Operand batchedTensor, + Operand batchIndex, Operand id, Long timeoutMicros, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Unbatch", scope.makeOpName("Unbatch")); opBuilder.addInput(batchedTensor.asOutput()); opBuilder.addInput(batchIndex.asOutput()); @@ -112,42 +98,74 @@ public static Unbatch create(Scope scope, Operand batche } } } - return new Unbatch(opBuilder.build()); + return new Unbatch<>(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets unbatchedTensor. + * + * @return unbatchedTensor. */ public Output unbatchedTensor() { return unbatchedTensor; } - + @Override public Output asOutput() { return unbatchedTensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Unbatch"; - - private Output unbatchedTensor; - - private Unbatch(Operation operation) { - super(operation); - int outputIdx = 0; - unbatchedTensor = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Unbatch} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnbatchGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnbatchGrad.java index 91bb7c52cf4..910bc87c3fc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnbatchGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnbatchGrad.java @@ -30,12 +30,10 @@ /** * Gradient of Unbatch. - *

* Acts like Batch but using the given batch_index index of batching things as they * become available. This ensures that the gradients are propagated back in the * same session which did the forward pass. - *

- * original_input: The input to the Unbatch operation this is the gradient of. + *

original_input: The input to the Unbatch operation this is the gradient of. * batch_index: The batch_index given to the Unbatch operation this is the gradient * of. * grad: The downstream gradient. @@ -43,55 +41,43 @@ * batched_grad: The return value, either an empty tensor or the batched gradient. * container: Container to control resource sharing. * shared_name: Instances of UnbatchGrad with the same container and shared_name - * are assumed to possibly belong to the same batch. If left empty, the op name - * will be used as the shared name. - * - * @param data type for {@code batchedGrad()} output + * are assumed to possibly belong to the same batch. If left empty, the op name + * will be used as the shared name. + * + * @param data type for {@code batched_grad} output */ @Operator public final class UnbatchGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.UnbatchGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "UnbatchGrad"; + + private Output batchedGrad; + + private UnbatchGrad(Operation operation) { + super(operation); + int outputIdx = 0; + batchedGrad = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnbatchGrad operation. - * + * * @param scope current scope - * @param originalInput - * @param batchIndex - * @param grad - * @param id - * @param options carries optional attributes values + * @param originalInput the originalInput value + * @param batchIndex the batchIndex value + * @param grad the grad value + * @param id the id value + * @param options carries optional attribute values + * @param data type for {@code UnbatchGrad} output and operands * @return a new instance of UnbatchGrad */ - @Endpoint(describeByClass = true) - public static UnbatchGrad create(Scope scope, Operand originalInput, Operand batchIndex, Operand grad, Operand id, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnbatchGrad create(Scope scope, Operand originalInput, + Operand batchIndex, Operand grad, Operand id, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("UnbatchGrad", scope.makeOpName("UnbatchGrad")); opBuilder.addInput(originalInput.asOutput()); opBuilder.addInput(batchIndex.asOutput()); @@ -108,42 +94,74 @@ public static UnbatchGrad create(Scope scope, Operand or } } } - return new UnbatchGrad(opBuilder.build()); + return new UnbatchGrad<>(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets batchedGrad. + * + * @return batchedGrad. */ public Output batchedGrad() { return batchedGrad; } - + @Override public Output asOutput() { return batchedGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnbatchGrad"; - - private Output batchedGrad; - - private UnbatchGrad(Operation operation) { - super(operation); - int outputIdx = 0; - batchedGrad = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.UnbatchGrad} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unique.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unique.java index acbbbbc14cb..59bce512c2a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unique.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unique.java @@ -32,112 +32,124 @@ /** * Finds unique elements along an axis of a tensor. - *

- * This operation either returns a tensor `y` containing unique elements - * along the `axis` of a tensor. The returned unique elements is sorted - * in the same order as they occur along `axis` in `x`. - * This operation also returns a tensor `idx` that is the same size as - * the number of the elements in `x` along the `axis` dimension. It - * contains the index in the unique output `y`. - * In other words, for an `1-D` tensor `x` with `axis = None: - *

- * `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` - *

- * For example: - *

{@code
+ * This operation either returns a tensor {@code y} containing unique elements
+ * along the {@code axis} of a tensor. The returned unique elements is sorted
+ * in the same order as they occur along {@code axis} in {@code x}.
+ * This operation also returns a tensor {@code idx} that is the same size as
+ * the number of the elements in {@code x} along the {@code axis} dimension. It
+ * contains the index in the unique output {@code y}.
+ * In other words, for an {@code 1-D} tensor {@code x} with `axis = None:
+ * 

{@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]} + *

For example: + *

  * # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
  * y, idx = unique(x)
- * y ==> [1, 2, 4, 7, 8]
- * idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
- * }
- * For an `2-D` tensor `x` with `axis = 0`: - *
{@code
+ * y ==> [1, 2, 4, 7, 8]
+ * idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
+ * 
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 0}: + *

  * # tensor 'x' is [[1, 0, 0],
  * #                [1, 0, 0],
  * #                [2, 0, 0]]
  * y, idx = unique(x, axis=0)
- * y ==> [[1, 0, 0],
+ * y ==> [[1, 0, 0],
  *        [2, 0, 0]]
- * idx ==> [0, 0, 1]
- * }
- * For an `2-D` tensor `x` with `axis = 1`: - *
{@code
+ * idx ==> [0, 0, 1]
+ * 
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 1}: + *

  * # tensor 'x' is [[1, 0, 0],
  * #                [1, 0, 0],
  * #                [2, 0, 0]]
  * y, idx = unique(x, axis=1)
- * y ==> [[1, 0],
+ * y ==> [[1, 0],
  *        [1, 0],
  *        [2, 0]]
- * idx ==> [0, 1, 1]
- * }
- * - * - * @param data type for {@code y()} output - * @param data type for {@code idx()} output + * idx ==> [0, 1, 1] + *
+ * + * @param data type for {@code y} output + * + * @param data type for {@code idx} output */ @Operator public final class Unique extends RawOp { - /** - * Factory method to create a class wrapping a new Unique operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniqueV2"; + + private Output y; + + private Output idx; + + private Unique(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + idx = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniqueV2 operation. + * * @param scope current scope - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @param x A {@code Tensor}. + * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. - * @param outIdx + * @param outIdx the value of the outIdx property + * @param data type for {@code UniqueV2} output and operands + * @param data type for {@code UniqueV2} output and operands * @return a new instance of Unique */ - @Endpoint(describeByClass = true) - public static Unique create(Scope scope, Operand x, Operand axis, Class outIdx) { + @Endpoint( + describeByClass = true + ) + public static Unique create(Scope scope, Operand x, + Operand axis, Class outIdx) { OperationBuilder opBuilder = scope.env().opBuilder("UniqueV2", scope.makeOpName("Unique")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_idx", Operands.toDataType(outIdx)); - return new Unique(opBuilder.build()); + return new Unique<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Unique operation using default output types. - * + * Factory method to create a class wrapping a new UniqueV2 operation, with the default output types. + * * @param scope current scope - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @param x A {@code Tensor}. + * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. - * @return a new instance of Unique + * @param data type for {@code UniqueV2} output and operands + * @return a new instance of Unique, with default output types */ - @Endpoint(describeByClass = true) - public static Unique create(Scope scope, Operand x, Operand axis) { + @Endpoint( + describeByClass = true + ) + public static Unique create(Scope scope, Operand x, + Operand axis) { return create(scope, x, axis, TInt32.class); } - + /** - * A `Tensor`. Unique elements along the `axis` of `Tensor` x. + * Gets y. + * A {@code Tensor}. Unique elements along the {@code axis} of {@code Tensor} x. + * @return y. */ public Output y() { return y; } - + /** + * Gets idx. * A 1-D Tensor. Has the same type as x that contains the index of each * value of x in the output y. + * @return idx. */ public Output idx() { return idx; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UniqueV2"; - - private Output y; - private Output idx; - - private Unique(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - idx = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueWithCounts.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueWithCounts.java index b2a9a5c2193..95de8a7d015 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueWithCounts.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueWithCounts.java @@ -32,125 +32,140 @@ /** * Finds unique elements along an axis of a tensor. - *

- * This operation either returns a tensor `y` containing unique elements - * along the `axis` of a tensor. The returned unique elements is sorted - * in the same order as they occur along `axis` in `x`. - * This operation also returns a tensor `idx` and a tensor `count` - * that are the same size as the number of the elements in `x` along the - * `axis` dimension. The `idx` contains the index in the unique output `y` - * and the `count` contains the count in the unique output `y`. - * In other words, for an `1-D` tensor `x` with `axis = None: - *

- * `y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]` - *

- * For example: - *

{@code
+ * This operation either returns a tensor {@code y} containing unique elements
+ * along the {@code axis} of a tensor. The returned unique elements is sorted
+ * in the same order as they occur along {@code axis} in {@code x}.
+ * This operation also returns a tensor {@code idx} and a tensor {@code count}
+ * that are the same size as the number of the elements in {@code x} along the
+ * {@code axis} dimension. The {@code idx} contains the index in the unique output {@code y}
+ * and the {@code count} contains the count in the unique output {@code y}.
+ * In other words, for an {@code 1-D} tensor {@code x} with `axis = None:
+ * 

{@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]} + *

For example: + *

  * # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
  * y, idx, count = unique_with_counts(x)
- * y ==> [1, 2, 4, 7, 8]
- * idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
- * count ==> [2, 1, 3, 1, 2]
- * }
- * For an `2-D` tensor `x` with `axis = 0`: - *
{@code
+ * y ==> [1, 2, 4, 7, 8]
+ * idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
+ * count ==> [2, 1, 3, 1, 2]
+ * 
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 0}: + *

  * # tensor 'x' is [[1, 0, 0],
  * #                [1, 0, 0],
  * #                [2, 0, 0]]
  * y, idx, count = unique_with_counts(x, axis=0)
- * y ==> [[1, 0, 0],
+ * y ==> [[1, 0, 0],
  *        [2, 0, 0]]
- * idx ==> [0, 0, 1]
- * count ==> [2, 1]
- * }
- * For an `2-D` tensor `x` with `axis = 1`: - *
{@code
+ * idx ==> [0, 0, 1]
+ * count ==> [2, 1]
+ * 
+ *

For an {@code 2-D} tensor {@code x} with {@code axis = 1}: + *

  * # tensor 'x' is [[1, 0, 0],
  * #                [1, 0, 0],
  * #                [2, 0, 0]]
  * y, idx, count = unique_with_counts(x, axis=1)
- * y ==> [[1, 0],
+ * y ==> [[1, 0],
  *        [1, 0],
  *        [2, 0]]
- * idx ==> [0, 1, 1]
- * count ==> [1, 2]
- * }
- * - * - * @param data type for {@code y()} output - * @param data type for {@code idx()} output + * idx ==> [0, 1, 1] + * count ==> [1, 2] + *
+ * + * @param data type for {@code y} output + * + * @param data type for {@code idx} output */ @Operator public final class UniqueWithCounts extends RawOp { - /** - * Factory method to create a class wrapping a new UniqueWithCounts operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniqueWithCountsV2"; + + private Output y; + + private Output idx; + + private Output count; + + private UniqueWithCounts(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + idx = operation.output(outputIdx++); + count = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new UniqueWithCountsV2 operation. + * * @param scope current scope - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @param x A {@code Tensor}. + * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. - * @param outIdx + * @param outIdx the value of the outIdx property + * @param data type for {@code UniqueWithCountsV2} output and operands + * @param data type for {@code UniqueWithCountsV2} output and operands * @return a new instance of UniqueWithCounts */ - @Endpoint(describeByClass = true) - public static UniqueWithCounts create(Scope scope, Operand x, Operand axis, Class outIdx) { + @Endpoint( + describeByClass = true + ) + public static UniqueWithCounts create(Scope scope, + Operand x, Operand axis, Class outIdx) { OperationBuilder opBuilder = scope.env().opBuilder("UniqueWithCountsV2", scope.makeOpName("UniqueWithCounts")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_idx", Operands.toDataType(outIdx)); - return new UniqueWithCounts(opBuilder.build()); + return new UniqueWithCounts<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new UniqueWithCounts operation using default output types. - * + * Factory method to create a class wrapping a new UniqueWithCountsV2 operation, with the default output types. + * * @param scope current scope - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @param x A {@code Tensor}. + * @param axis A {@code Tensor} of type {@code int32} (default: None). The axis of the Tensor to * find the unique elements. - * @return a new instance of UniqueWithCounts + * @param data type for {@code UniqueWithCountsV2} output and operands + * @return a new instance of UniqueWithCounts, with default output types */ - @Endpoint(describeByClass = true) - public static UniqueWithCounts create(Scope scope, Operand x, Operand axis) { + @Endpoint( + describeByClass = true + ) + public static UniqueWithCounts create(Scope scope, Operand x, + Operand axis) { return create(scope, x, axis, TInt32.class); } - + /** - * A `Tensor`. Unique elements along the `axis` of `Tensor` x. + * Gets y. + * A {@code Tensor}. Unique elements along the {@code axis} of {@code Tensor} x. + * @return y. */ public Output y() { return y; } - + /** + * Gets idx. * A 1-D Tensor. Has the same type as x that contains the index of each * value of x in the output y. + * @return idx. */ public Output idx() { return idx; } - + /** + * Gets count. * A 1-D Tensor. The count of each value of x in the output y. + * @return count. */ public Output count() { return count; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UniqueWithCountsV2"; - - private Output y; - private Output idx; - private Output count; - - private UniqueWithCounts(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - idx = operation.output(outputIdx++); - count = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnravelIndex.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnravelIndex.java index 0ce98a63884..23a2f0b3f5f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnravelIndex.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnravelIndex.java @@ -29,10 +29,8 @@ /** * Converts an array of flat indices into a tuple of coordinate arrays. - *

- * * Example: - *

{@code
+ * 
  * y = tf.unravel_index(indices=[2, 5, 7], dims=[3, 3])
  * # 'dims' represent a hypothetical (3, 3) tensor of indices:
  * # [[0, 1, *2*],
@@ -40,60 +38,67 @@
  * #  [6, *7*, 8]]
  * # For each entry from 'indices', this operation returns
  * # its coordinates (marked with '*'), such as
- * # 2 ==> (0, 2)
- * # 5 ==> (1, 2)
- * # 7 ==> (2, 1)
- * y ==> [[0, 1, 2], [2, 2, 1]]
- * }
- * @compatibility(numpy) + * # 2 ==> (0, 2) + * # 5 ==> (1, 2) + * # 7 ==> (2, 1) + * y ==> [[0, 1, 2], [2, 2, 1]] + *
+ *

{@literal @}compatibility(numpy)
* Equivalent to np.unravel_index - * @end_compatibility - * - * @param data type for {@code output()} output + *
{@literal @}end_compatibility + * + * @param data type for {@code output} output */ @Operator public final class UnravelIndex extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnravelIndex"; + + private Output output; + + private UnravelIndex(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnravelIndex operation. - * + * * @param scope current scope - * @param indices An 0-D or 1-D `int` Tensor whose elements are indices into the + * @param indices An 0-D or 1-D {@code int} Tensor whose elements are indices into the * flattened version of an array of dimensions dims. - * @param dims An 1-D `int` Tensor. The shape of the array to use for unraveling + * @param dims An 1-D {@code int} Tensor. The shape of the array to use for unraveling * indices. + * @param data type for {@code UnravelIndex} output and operands * @return a new instance of UnravelIndex */ - @Endpoint(describeByClass = true) - public static UnravelIndex create(Scope scope, Operand indices, Operand dims) { + @Endpoint( + describeByClass = true + ) + public static UnravelIndex create(Scope scope, Operand indices, + Operand dims) { OperationBuilder opBuilder = scope.env().opBuilder("UnravelIndex", scope.makeOpName("UnravelIndex")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(dims.asOutput()); opBuilder = scope.apply(opBuilder); - return new UnravelIndex(opBuilder.build()); + return new UnravelIndex<>(opBuilder.build()); } - + /** + * Gets output. * An 2-D (or 1-D if indices is 0-D) tensor where each row has the * same shape as the indices array. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnravelIndex"; - - private Output output; - - private UnravelIndex(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstack.java index f1c46f3fa39..64940b36cee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstack.java @@ -31,57 +31,52 @@ import org.tensorflow.types.family.TType; /** - * Unpacks a given dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors. - *

- * Unpacks `num` tensors from `value` by chipping it along the `axis` dimension. - * For example, given a tensor of shape `(A, B, C, D)`; - *

- * If `axis == 0` then the i'th tensor in `output` is the slice `value[i, :, :, :]` - * and each tensor in `output` will have shape `(B, C, D)`. (Note that the - * dimension unpacked along is gone, unlike `split`). - *

- * If `axis == 1` then the i'th tensor in `output` is the slice `value[:, i, :, :]` - * and each tensor in `output` will have shape `(A, C, D)`. + * Unpacks a given dimension of a rank-{@code R} tensor into {@code num} rank-{@code (R-1)} tensors. + * Unpacks {@code num} tensors from {@code value} by chipping it along the {@code axis} dimension. + * For example, given a tensor of shape {@code (A, B, C, D)}; + *

If {@code axis == 0} then the i'th tensor in {@code output} is the slice {@code value[i, :, :, :]} + * and each tensor in {@code output} will have shape {@code (B, C, D)}. (Note that the + * dimension unpacked along is gone, unlike {@code split}). + *

If {@code axis == 1} then the i'th tensor in {@code output} is the slice {@code value[:, i, :, :]} + * and each tensor in {@code output} will have shape {@code (A, C, D)}. * Etc. - *

- * This is the opposite of `pack`. - * - * @param data type for {@code output()} output + *

This is the opposite of {@code pack}. + * + * @param data type for {@code output} output */ @Operator public final class Unstack extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.core.Unstack} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis Dimension along which to unpack. Negative values wrap around, so the - * valid range is `[-R, R)`. - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Long axis; - - private Options() { - } + public static final String OP_NAME = "Unpack"; + + private List> output; + + @SuppressWarnings("unchecked") + private Unstack(Operation operation) { + super(operation); + int outputIdx = 0; + int outputLength = operation.outputListLength("output"); + output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); + outputIdx += outputLength; } - + /** - * Factory method to create a class wrapping a new Unstack operation. - * + * Factory method to create a class wrapping a new Unpack operation. + * * @param scope current scope - * @param value 1-D or higher, with `axis` dimension size equal to `num`. - * @param num - * @param options carries optional attributes values + * @param value 1-D or higher, with {@code axis} dimension size equal to {@code num}. + * @param num the value of the num property + * @param options carries optional attribute values + * @param data type for {@code Unpack} output and operands * @return a new instance of Unstack */ - @Endpoint(describeByClass = true) - public static Unstack create(Scope scope, Operand value, Long num, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Unstack create(Scope scope, Operand value, Long num, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Unpack", scope.makeOpName("Unstack")); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); @@ -93,41 +88,54 @@ public static Unstack create(Scope scope, Operand value, } } } - return new Unstack(opBuilder.build()); + return new Unstack<>(opBuilder.build()); } - + /** + * Sets the axis option. + * * @param axis Dimension along which to unpack. Negative values wrap around, so the - * valid range is `[-R, R)`. + * valid range is {@code [-R, R)}. + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** - * The list of tensors unpacked from `value`. + * Gets output. + * The list of tensors unpacked from {@code value}. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Unpack"; - - private List> output; - - @SuppressWarnings("unchecked") - private Unstack(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.Unstack} + */ + public static class Options { + private Long axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis Dimension along which to unpack. Negative values wrap around, so the + * valid range is {@code [-R, R)}. + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstage.java index 2997b5eaa57..6daf9ee8b21 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Unstage.java @@ -33,69 +33,40 @@ /** * Op is similar to a lightweight Dequeue. - *

* The basic functionality is similar to dequeue with many fewer * capabilities and options. This Op is optimized for performance. */ @Operator public final class Unstage extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.core.Unstage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param memoryLimit - */ - public Options memoryLimit(Long memoryLimit) { - this.memoryLimit = memoryLimit; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private Long memoryLimit; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "Unstage"; + + private List> values; + + @SuppressWarnings("unchecked") + private Unstage(Operation operation) { + super(operation); + int outputIdx = 0; + int valuesLength = operation.outputListLength("values"); + values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); + outputIdx += valuesLength; } - + /** * Factory method to create a class wrapping a new Unstage operation. - * + * * @param scope current scope - * @param dtypes - * @param options carries optional attributes values + * @param dtypes the value of the dtypes property + * @param options carries optional attribute values * @return a new instance of Unstage */ - @Endpoint(describeByClass = true) - public static Unstage create(Scope scope, List> dtypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Unstage create(Scope scope, List> dtypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Unstage", scope.makeOpName("Unstage")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); @@ -117,57 +88,119 @@ public static Unstage create(Scope scope, List> dtypes, O } return new Unstage(opBuilder.build()); } - + /** - * @param capacity + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** - * @param memoryLimit + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. */ public static Options memoryLimit(Long memoryLimit) { return new Options().memoryLimit(memoryLimit); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets values. + * + * @return values. */ public List> values() { return values; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) values.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Unstage"; - - private List> values; - - private Unstage(Operation operation) { - super(operation); - int outputIdx = 0; - int valuesLength = operation.outputListLength("values"); - values = Arrays.asList(operation.outputList(outputIdx, valuesLength)); - outputIdx += valuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.core.Unstage} + */ + public static class Options { + private Long capacity; + + private Long memoryLimit; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity the capacity option + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the memoryLimit option. + * + * @param memoryLimit the memoryLimit option + * @return this Options instance. + */ + public Options memoryLimit(Long memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UpperBound.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UpperBound.java index 6bc9d8034fd..7764cc2220b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UpperBound.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UpperBound.java @@ -25,92 +25,98 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Applies upper_bound(sorted_search_values, values) along each row. - *

* Each set of rows with the same index in (sorted_inputs, values) is treated * independently. The resulting row is the equivalent of calling - * `np.searchsorted(sorted_inputs, values, side='right')`. - *

- * The result is not a global index to the entire - * `Tensor`, but rather just the index in the last dimension. - *

- * A 2-D example: - * sorted_sequence = [[0, 3, 9, 9, 10], - * [1, 2, 3, 4, 5]] - * values = [[2, 4, 9], - * [0, 2, 6]] - *

- * result = UpperBound(sorted_sequence, values) - *

- * result == [[1, 2, 4], - * [0, 2, 5]] - * - * @param data type for {@code output()} output + * {@code np.searchsorted(sorted_inputs, values, side='right')}. + *

The result is not a global index to the entire + * {@code Tensor}, but rather just the index in the last dimension. + *

A 2-D example: + * sorted_sequence = [[0, 3, 9, 9, 10], + * [1, 2, 3, 4, 5]] + * values = [[2, 4, 9], + * [0, 2, 6]] + *

result = UpperBound(sorted_sequence, values) + *

result == [[1, 2, 4], + * [0, 2, 5]] + * + * @param data type for {@code output} output */ public final class UpperBound extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UpperBound"; + + private Output output; + + private UpperBound(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UpperBound operation. - * + * * @param scope current scope * @param sortedInputs 2-D Tensor where each row is ordered. - * @param values 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains - * the values that will be searched for in `sorted_search_values`. - * @param outType + * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + * @param outType the value of the outType property + * @param data type for {@code UpperBound} output and operands + * @param data type for {@code UpperBound} output and operands * @return a new instance of UpperBound */ - @Endpoint(describeByClass = true) - public static UpperBound create(Scope scope, Operand sortedInputs, Operand values, Class outType) { + @Endpoint( + describeByClass = true + ) + public static UpperBound create(Scope scope, + Operand sortedInputs, Operand values, Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("UpperBound", scope.makeOpName("UpperBound")); opBuilder.addInput(sortedInputs.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new UpperBound(opBuilder.build()); + return new UpperBound<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new UpperBound operation using default output types. - * + * Factory method to create a class wrapping a new UpperBound operation, with the default output types. + * * @param scope current scope * @param sortedInputs 2-D Tensor where each row is ordered. - * @param values 2-D Tensor with the same numbers of rows as `sorted_search_values`. Contains - * the values that will be searched for in `sorted_search_values`. - * @return a new instance of UpperBound + * @param values 2-D Tensor with the same numbers of rows as {@code sorted_search_values}. Contains + * the values that will be searched for in {@code sorted_search_values}. + * @param data type for {@code UpperBound} output and operands + * @return a new instance of UpperBound, with default output types */ - @Endpoint(describeByClass = true) - public static UpperBound create(Scope scope, Operand sortedInputs, Operand values) { + @Endpoint( + describeByClass = true + ) + public static UpperBound create(Scope scope, Operand sortedInputs, + Operand values) { return create(scope, sortedInputs, values, TInt32.class); } - + /** - * A `Tensor` with the same shape as `values`. It contains the last scalar index + * Gets output. + * A {@code Tensor} with the same shape as {@code values}. It contains the last scalar index * into the last dimension where values can be inserted without changing the * ordered property. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UpperBound"; - - private Output output; - - private UpperBound(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarHandleOp.java index 41d962d4381..a5bef8a017d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarHandleOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarHandleOp.java @@ -17,6 +17,7 @@ package org.tensorflow.op.core; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -35,57 +36,36 @@ */ @Operator public final class VarHandleOp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.VarHandleOp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container the container this variable is placed in. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName the name by which this variable is referred to. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the - * output ResourceHandle represents a per-replica/partitioned resource variable. - */ - public Options allowedDevices(List allowedDevices) { - this.allowedDevices = allowedDevices; - return this; - } - - private String container; - private String sharedName; - private List allowedDevices; - - private Options() { - } + public static final String OP_NAME = "VarHandleOp"; + + private Output resource; + + @SuppressWarnings("unchecked") + private VarHandleOp(Operation operation) { + super(operation); + int outputIdx = 0; + resource = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new VarHandleOp operation. - * + * * @param scope current scope * @param dtype the type of this variable. Must agree with the dtypes * of all ops using this variable. * @param shape The (possibly partially specified) shape of this variable. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code VarHandleOp} output and operands * @return a new instance of VarHandleOp */ - @Endpoint(describeByClass = true) - public static VarHandleOp create(Scope scope, Class dtype, Shape shape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static VarHandleOp create(Scope scope, Class dtype, Shape shape, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("VarHandleOp", scope.makeOpName("VarHandleOp")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); @@ -100,7 +80,7 @@ public static VarHandleOp create(Scope scope, Class dtype, } if (opts.allowedDevices != null) { String[] allowedDevicesArray = new String[opts.allowedDevices.size()]; - for (int i = 0; i < allowedDevicesArray.length; ++i) { + for (int i = 0 ; i < allowedDevicesArray.length ; i++) { allowedDevicesArray[i] = opts.allowedDevices.get(i); } opBuilder.setAttr("allowed_devices", allowedDevicesArray); @@ -109,49 +89,121 @@ public static VarHandleOp create(Scope scope, Class dtype, } return new VarHandleOp(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container the container this variable is placed in. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName the name by which this variable is referred to. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Sets the allowedDevices option. + * * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the * output ResourceHandle represents a per-replica/partitioned resource variable. + * @return this Options instance. */ public static Options allowedDevices(List allowedDevices) { return new Options().allowedDevices(allowedDevices); } - + + /** + * Sets the allowedDevices option. + * + * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the + * output ResourceHandle represents a per-replica/partitioned resource variable. + * @return this Options instance. + */ + public static Options allowedDevices(String[] allowedDevices) { + return new Options().allowedDevices(allowedDevices); + } + /** + * Gets resource. + * + * @return resource. */ - public Output resource() { + public Output resource() { return resource; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) resource; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "VarHandleOp"; - - private Output resource; - - private VarHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.VarHandleOp} + */ + public static class Options { + private String container; + + private String sharedName; + + private List allowedDevices; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container the container this variable is placed in. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the name by which this variable is referred to. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the allowedDevices option. + * + * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the + * output ResourceHandle represents a per-replica/partitioned resource variable. + * @return this Options instance. + */ + public Options allowedDevices(List allowedDevices) { + this.allowedDevices = allowedDevices; + return this; + } + + /** + * Sets the allowedDevices option. + * + * @param allowedDevices DEPRECATED. The allowed devices containing the resource variable. Set when the + * output ResourceHandle represents a per-replica/partitioned resource variable. + * @return this Options instance. + */ + public Options allowedDevices(String... allowedDevices) { + this.allowedDevices = Arrays.asList(allowedDevices); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarIsInitializedOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarIsInitializedOp.java index 16ee42372b3..708a550be11 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarIsInitializedOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VarIsInitializedOp.java @@ -26,49 +26,55 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Checks whether a resource handle-based variable has been initialized. */ @Operator public final class VarIsInitializedOp extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "VarIsInitializedOp"; + + private Output isInitialized; + + private VarIsInitializedOp(Operation operation) { + super(operation); + int outputIdx = 0; + isInitialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new VarIsInitializedOp operation. - * + * * @param scope current scope * @param resource the input resource handle. * @return a new instance of VarIsInitializedOp */ - @Endpoint(describeByClass = true) - public static VarIsInitializedOp create(Scope scope, Operand resource) { + @Endpoint( + describeByClass = true + ) + public static VarIsInitializedOp create(Scope scope, Operand resource) { OperationBuilder opBuilder = scope.env().opBuilder("VarIsInitializedOp", scope.makeOpName("VarIsInitializedOp")); opBuilder.addInput(resource.asOutput()); opBuilder = scope.apply(opBuilder); return new VarIsInitializedOp(opBuilder.build()); } - + /** + * Gets isInitialized. * a scalar boolean which is true if the variable has been * initialized. + * @return isInitialized. */ public Output isInitialized() { return isInitialized; } - + @Override public Output asOutput() { return isInitialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "VarIsInitializedOp"; - - private Output isInitialized; - - private VarIsInitializedOp(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Variable.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Variable.java index 98e545d7b76..8fd5c10363e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Variable.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Variable.java @@ -31,57 +31,42 @@ /** * Holds state in the form of a tensor that persists across steps. - *

* Outputs a ref to the tensor state so it may be read or modified. * TODO(zhifengc/mrry): Adds a pointer to a more detail document * about sharing states in tensorflow. - * - * @param data type for {@code ref()} output + * + * @param data type for {@code ref} output */ @Operator public final class Variable extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.core.Variable} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this variable is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this variable is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "VariableV2"; + + private Output ref; + + private Variable(Operation operation) { + super(operation); + int outputIdx = 0; + ref = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Variable operation. - * + * Factory method to create a class wrapping a new VariableV2 operation. + * * @param scope current scope * @param shape The shape of the variable tensor. * @param dtype The type of elements in the variable tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code VariableV2} output and operands * @return a new instance of Variable */ - @Endpoint(describeByClass = true) - public static Variable create(Scope scope, Shape shape, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Variable create(Scope scope, Shape shape, Class dtype, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("VariableV2", scope.makeOpName("Variable")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); @@ -96,45 +81,78 @@ public static Variable create(Scope scope, Shape shape, Cla } } } - return new Variable(opBuilder.build()); + return new Variable<>(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this variable is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this variable is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets ref. * A reference to the variable tensor. + * @return ref. */ public Output ref() { return ref; } - + @Override public Output asOutput() { return ref; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "VariableV2"; - - private Output ref; - - private Variable(Operation operation) { - super(operation); - int outputIdx = 0; - ref = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.core.Variable} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this variable is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this variable is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VariableShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VariableShape.java index ab37a6c4d08..57d31b78299 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VariableShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/VariableShape.java @@ -28,72 +28,80 @@ import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** - * Returns the shape of the variable pointed to by `resource`. - *

- * This operation returns a 1-D integer tensor representing the shape of `input`. - *

- * For example: - *

{@code
+ * Returns the shape of the variable pointed to by {@code resource}.
+ * This operation returns a 1-D integer tensor representing the shape of {@code input}.
+ * 

For example: + *

  * # 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
- * shape(t) ==> [2, 2, 3]
- * }
- * - * - * @param data type for {@code output()} output + * shape(t) ==> [2, 2, 3] + *
+ * + * @param data type for {@code output} output */ @Operator public final class VariableShape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "VariableShape"; + + private Output output; + + private VariableShape(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new VariableShape operation. - * + * * @param scope current scope - * @param input - * @param outType + * @param input the input value + * @param outType the value of the outType property + * @param data type for {@code VariableShape} output and operands * @return a new instance of VariableShape */ - @Endpoint(describeByClass = true) - public static VariableShape create(Scope scope, Operand input, Class outType) { + @Endpoint( + describeByClass = true + ) + public static VariableShape create(Scope scope, + Operand input, Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("VariableShape", scope.makeOpName("VariableShape")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new VariableShape(opBuilder.build()); + return new VariableShape<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new VariableShape operation using default output types. - * + * Factory method to create a class wrapping a new VariableShape operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of VariableShape + * @param input the input value + * @return a new instance of VariableShape, with default output types */ - @Endpoint(describeByClass = true) - public static VariableShape create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static VariableShape create(Scope scope, Operand input) { return create(scope, input, TInt32.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "VariableShape"; - - private Output output; - - private VariableShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where.java index 558da8d85ac..0a7dd998332 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where.java @@ -30,23 +30,21 @@ /** * Returns locations of nonzero / true values in a tensor. - *

- * This operation returns the coordinates of true elements in `condition`. The + * This operation returns the coordinates of true elements in {@code condition}. The * coordinates are returned in a 2-D tensor where the first dimension (rows) * represents the number of true elements, and the second dimension (columns) * represents the coordinates of the true elements. Keep in mind, the shape of * the output tensor can vary depending on how many true values there are in - * `condition`. Indices are output in row-major order. - *

- * For example: - *

{@code
+ * {@code condition}. Indices are output in row-major order.
+ * 

For example: + *

  * # 'input' tensor is [[True, False]
  * #                    [True, False]]
  * # 'input' has two true values, so output has two coordinates.
  * # 'input' has rank of 2, so coordinates have two indices.
- * where(input) ==> [[0, 0],
+ * where(input) ==> [[0, 0],
  *                   [1, 0]]
- * 
+ *
  * # `condition` tensor is [[[True, False]
  * #                     [True, False]]
  * #                    [[False, True]
@@ -55,12 +53,12 @@
  * #                     [False, True]]]
  * # 'input' has 5 true values, so output has 5 coordinates.
  * # 'input' has rank of 3, so coordinates have three indices.
- * where(input) ==> [[0, 0, 0],
+ * where(input) ==> [[0, 0, 0],
  *                   [0, 1, 0],
  *                   [1, 0, 1],
  *                   [1, 1, 1],
  *                   [2, 1, 1]]
- * 
+ *
  * # `condition` tensor is [[[1.5,  0.0]
  * #                     [-0.5, 0.0]]
  * #                    [[0.0,  0.25]
@@ -69,12 +67,12 @@
  * #                     [0.0,  0.01]]]
  * # 'input' has 5 nonzero values, so output has 5 coordinates.
  * # 'input' has rank of 3, so coordinates have three indices.
- * where(input) ==> [[0, 0, 0],
+ * where(input) ==> [[0, 0, 0],
  *                   [0, 1, 0],
  *                   [1, 0, 1],
  *                   [1, 1, 1],
  *                   [2, 1, 1]]
- * 
+ *
  * # `condition` tensor is [[[1.5 + 0.0j, 0.0  + 0.0j]
  * #                     [0.0 + 0.5j, 0.0  + 0.0j]]
  * #                    [[0.0 + 0.0j, 0.25 + 1.5j]
@@ -83,51 +81,56 @@
  * #                     [0.0 + 0.0j, 0.01 + 0.0j]]]
  * # 'input' has 5 nonzero magnitude values, so output has 5 coordinates.
  * # 'input' has rank of 3, so coordinates have three indices.
- * where(input) ==> [[0, 0, 0],
+ * where(input) ==> [[0, 0, 0],
  *                   [0, 1, 0],
  *                   [1, 0, 1],
  *                   [1, 1, 1],
  *                   [2, 1, 1]]
- * }
- * + *
*/ @Operator public final class Where extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Where"; + + private Output index; + + private Where(Operation operation) { + super(operation); + int outputIdx = 0; + index = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Where operation. - * + * * @param scope current scope - * @param condition + * @param condition the condition value * @return a new instance of Where */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Where create(Scope scope, Operand condition) { OperationBuilder opBuilder = scope.env().opBuilder("Where", scope.makeOpName("Where")); opBuilder.addInput(condition.asOutput()); opBuilder = scope.apply(opBuilder); return new Where(opBuilder.build()); } - + /** + * Gets index. + * + * @return index. */ public Output index() { return index; } - + @Override public Output asOutput() { return index; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Where"; - - private Output index; - - private Where(Operation operation) { - super(operation); - int outputIdx = 0; - index = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdFullToShardShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdFullToShardShape.java index e1a89b8b3a3..cbb7a734ee0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdFullToShardShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdFullToShardShape.java @@ -29,53 +29,60 @@ /** * An op used by XLA SPMD partitioner to switch from automatic partitioning to - *

* manual partitioning. It annotates the input (full-shape, to be automatically * partitioned) with the same sharding used by manual partitioning, and outputs a * shard-shaped tensor to be consumed by later manually-partitioned ops. If the * shape is not evenly partitionable, the padding region will be masked with 0s. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class XlaSpmdFullToShardShape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSpmdFullToShardShape"; + + private Output output; + + private XlaSpmdFullToShardShape(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new XlaSpmdFullToShardShape operation. - * + * * @param scope current scope - * @param input - * @param manualSharding + * @param input the input value + * @param manualSharding the value of the manualSharding property + * @param data type for {@code XlaSpmdFullToShardShape} output and operands * @return a new instance of XlaSpmdFullToShardShape */ - @Endpoint(describeByClass = true) - public static XlaSpmdFullToShardShape create(Scope scope, Operand input, String manualSharding) { + @Endpoint( + describeByClass = true + ) + public static XlaSpmdFullToShardShape create(Scope scope, Operand input, + String manualSharding) { OperationBuilder opBuilder = scope.env().opBuilder("XlaSpmdFullToShardShape", scope.makeOpName("XlaSpmdFullToShardShape")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("manual_sharding", manualSharding); - return new XlaSpmdFullToShardShape(opBuilder.build()); + return new XlaSpmdFullToShardShape<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSpmdFullToShardShape"; - - private Output output; - - private XlaSpmdFullToShardShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdShardToFullShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdShardToFullShape.java index 1014c328351..d2c177cb22e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdShardToFullShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/XlaSpmdShardToFullShape.java @@ -30,54 +30,61 @@ /** * An op used by XLA SPMD partitioner to switch from manual partitioning to - *

* automatic partitioning. It converts the shard-shaped, manually partitioned input * into full-shaped tensor to be partitioned automatically with the same sharding * used by manual partitioning. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ @Operator public final class XlaSpmdShardToFullShape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSpmdShardToFullShape"; + + private Output output; + + private XlaSpmdShardToFullShape(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new XlaSpmdShardToFullShape operation. - * + * * @param scope current scope - * @param input - * @param manualSharding - * @param fullShape + * @param input the input value + * @param manualSharding the value of the manualSharding property + * @param fullShape the value of the fullShape property + * @param data type for {@code XlaSpmdShardToFullShape} output and operands * @return a new instance of XlaSpmdShardToFullShape */ - @Endpoint(describeByClass = true) - public static XlaSpmdShardToFullShape create(Scope scope, Operand input, String manualSharding, Shape fullShape) { + @Endpoint( + describeByClass = true + ) + public static XlaSpmdShardToFullShape create(Scope scope, Operand input, + String manualSharding, Shape fullShape) { OperationBuilder opBuilder = scope.env().opBuilder("XlaSpmdShardToFullShape", scope.makeOpName("XlaSpmdShardToFullShape")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("manual_sharding", manualSharding); opBuilder.setAttr("full_shape", fullShape); - return new XlaSpmdShardToFullShape(opBuilder.build()); + return new XlaSpmdShardToFullShape<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSpmdShardToFullShape"; - - private Output output; - - private XlaSpmdShardToFullShape(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java index f3353d53023..2b95580be17 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ZerosLike.java @@ -29,47 +29,53 @@ /** * Returns a tensor of zeros with the same shape and type as x. - * - * @param data type for {@code y()} output + * + * @param data type for {@code y} output */ @Operator public final class ZerosLike extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ZerosLike"; + + private Output y; + + private ZerosLike(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ZerosLike operation. - * + * * @param scope current scope * @param x a tensor of type T. + * @param data type for {@code ZerosLike} output and operands * @return a new instance of ZerosLike */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ZerosLike create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("ZerosLike", scope.makeOpName("ZerosLike")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new ZerosLike(opBuilder.build()); + return new ZerosLike<>(opBuilder.build()); } - + /** + * Gets y. * a tensor of the same shape and type as x but filled with zeros. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ZerosLike"; - - private Output y; - - private ZerosLike(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousIterator.java index 3be3e0be3eb..d9ea90b5f0a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousIterator.java @@ -32,57 +32,69 @@ /** * A container for an iterator resource. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class AnonymousIterator extends RawOp { - /** - * Factory method to create a class wrapping a new AnonymousIterator operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousIteratorV2"; + + private Output handle; + + private Output deleter; + + @SuppressWarnings("unchecked") + private AnonymousIterator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + deleter = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AnonymousIteratorV2 operation. + * * @param scope current scope - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of AnonymousIterator */ - @Endpoint(describeByClass = true) - public static AnonymousIterator create(Scope scope, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static AnonymousIterator create(Scope scope, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("AnonymousIteratorV2", scope.makeOpName("AnonymousIterator")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new AnonymousIterator(opBuilder.build()); } - + /** - * A handle to the iterator that can be passed to a "MakeIterator" or - * "IteratorGetNext" op. In contrast to Iterator, AnonymousIterator prevents + * Gets handle. + * A handle to the iterator that can be passed to a "MakeIterator" or + * "IteratorGetNext" op. In contrast to Iterator, AnonymousIterator prevents * resource sharing by name, and does not keep a reference to the resource * container. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets deleter. * A variant deleter that should be passed into the op that deletes the iterator. + * @return deleter. */ - public Output deleter() { + public Output deleter() { return deleter; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousIteratorV2"; - - private Output handle; - private Output deleter; - - private AnonymousIterator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMemoryCache.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMemoryCache.java index e75f88d40d2..6f1bf3d4e27 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMemoryCache.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMemoryCache.java @@ -23,47 +23,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** + * The AnonymousMemoryCache operation */ public final class AnonymousMemoryCache extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousMemoryCache"; + + private Output handle; + + private Output deleter; + + @SuppressWarnings("unchecked") + private AnonymousMemoryCache(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + deleter = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AnonymousMemoryCache operation. - * + * * @param scope current scope * @return a new instance of AnonymousMemoryCache */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static AnonymousMemoryCache create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("AnonymousMemoryCache", scope.makeOpName("AnonymousMemoryCache")); opBuilder = scope.apply(opBuilder); return new AnonymousMemoryCache(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets deleter. + * + * @return deleter. */ - public Output deleter() { + public Output deleter() { return deleter; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousMemoryCache"; - - private Output handle; - private Output deleter; - - private AnonymousMemoryCache(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMultiDeviceIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMultiDeviceIterator.java index d02a1f37cf3..b398bba3165 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMultiDeviceIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AnonymousMultiDeviceIterator.java @@ -26,68 +26,77 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A container for a multi device iterator resource. */ public final class AnonymousMultiDeviceIterator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousMultiDeviceIterator"; + + private Output handle; + + private Output deleter; + + @SuppressWarnings("unchecked") + private AnonymousMultiDeviceIterator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + deleter = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AnonymousMultiDeviceIterator operation. - * + * * @param scope current scope - * @param devices - * @param outputTypes - * @param outputShapes + * @param devices the value of the devices property + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of AnonymousMultiDeviceIterator */ - @Endpoint(describeByClass = true) - public static AnonymousMultiDeviceIterator create(Scope scope, List devices, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static AnonymousMultiDeviceIterator create(Scope scope, List devices, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("AnonymousMultiDeviceIterator", scope.makeOpName("AnonymousMultiDeviceIterator")); opBuilder = scope.apply(opBuilder); String[] devicesArray = new String[devices.size()]; - for (int i = 0; i < devicesArray.length; ++i) { + for (int i = 0 ; i < devicesArray.length ; i++) { devicesArray[i] = devices.get(i); } opBuilder.setAttr("devices", devicesArray); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new AnonymousMultiDeviceIterator(opBuilder.build()); } - + /** + * Gets handle. * A handle to a multi device iterator that can be passed to a - * "MultiDeviceIteratorGetNextFromShard" op. In contrast to MultiDeviceIterator, + * "MultiDeviceIteratorGetNextFromShard" op. In contrast to MultiDeviceIterator, * AnonymousIterator prevents resource sharing by name, and does not keep a * reference to the resource container. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets deleter. * A variant deleter that should be passed into the op that deletes the iterator. + * @return deleter. */ - public Output deleter() { + public Output deleter() { return deleter; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousMultiDeviceIterator"; - - private Output handle; - private Output deleter; - - private AnonymousMultiDeviceIterator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertNextDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertNextDataset.java index ee9da65be4d..683782d9c29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertNextDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AssertNextDataset.java @@ -27,71 +27,77 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * 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 `transformations` argument. If there is a mismatch, the + * 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 + *

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. */ public final class AssertNextDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssertNextDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private AssertNextDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AssertNextDataset operation. - * + * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. - * `data.AssertNextDataset` passes through the outputs of its input dataset. - * @param transformations A `tf.string` vector `tf.Tensor` identifying the transformations that are + * {@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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of AssertNextDataset */ - @Endpoint(describeByClass = true) - public static AssertNextDataset create(Scope scope, Operand inputDataset, Operand transformations, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static AssertNextDataset create(Scope scope, Operand inputDataset, + Operand transformations, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("AssertNextDataset", scope.makeOpName("AssertNextDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(transformations.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new AssertNextDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssertNextDataset"; - - private Output handle; - - private AssertNextDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AutoShardDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AutoShardDataset.java index d16064aa7f3..a635d219ea0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AutoShardDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/AutoShardDataset.java @@ -27,65 +27,51 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * 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 + *

This dataset will throw a NotFound error if we cannot shard the dataset * automatically. */ public final class AutoShardDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.AutoShardDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param autoShardPolicy - */ - public Options autoShardPolicy(Long autoShardPolicy) { - this.autoShardPolicy = autoShardPolicy; - return this; - } - - /** - * @param numReplicas - */ - public Options numReplicas(Long numReplicas) { - this.numReplicas = numReplicas; - return this; - } - - private Long autoShardPolicy; - private Long numReplicas; - - private Options() { - } + public static final String OP_NAME = "AutoShardDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private AutoShardDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AutoShardDataset operation. - * + * * @param scope current scope * @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 - * @param outputShapes - * @param options carries optional attributes values + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of AutoShardDataset */ - @Endpoint(describeByClass = true) - public static AutoShardDataset create(Scope scope, Operand inputDataset, Operand numWorkers, Operand index, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AutoShardDataset create(Scope scope, Operand inputDataset, + Operand numWorkers, Operand index, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AutoShardDataset", scope.makeOpName("AutoShardDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numWorkers.asOutput()); @@ -93,7 +79,7 @@ public static AutoShardDataset create(Scope scope, Operand inputDataset, Oper opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -109,41 +95,73 @@ public static AutoShardDataset create(Scope scope, Operand inputDataset, Oper } return new AutoShardDataset(opBuilder.build()); } - + /** - * @param autoShardPolicy + * Sets the autoShardPolicy option. + * + * @param autoShardPolicy the autoShardPolicy option + * @return this Options instance. */ public static Options autoShardPolicy(Long autoShardPolicy) { return new Options().autoShardPolicy(autoShardPolicy); } - + /** - * @param numReplicas + * Sets the numReplicas option. + * + * @param numReplicas the numReplicas option + * @return this Options instance. */ public static Options numReplicas(Long numReplicas) { return new Options().numReplicas(numReplicas); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AutoShardDataset"; - - private Output handle; - - private AutoShardDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.AutoShardDataset} + */ + public static class Options { + private Long autoShardPolicy; + + private Long numReplicas; + + private Options() { + } + + /** + * Sets the autoShardPolicy option. + * + * @param autoShardPolicy the autoShardPolicy option + * @return this Options instance. + */ + public Options autoShardPolicy(Long autoShardPolicy) { + this.autoShardPolicy = autoShardPolicy; + return this; + } + + /** + * Sets the numReplicas option. + * + * @param numReplicas the numReplicas option + * @return this Options instance. + */ + public Options numReplicas(Long numReplicas) { + this.numReplicas = numReplicas; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BatchDataset.java index ee03bac2b95..5e04312b18c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BatchDataset.java @@ -33,45 +33,45 @@ import org.tensorflow.types.family.TType; /** - * Creates a dataset that batches `batch_size` elements from `input_dataset`. + * Creates a dataset that batches {@code batch_size} elements from {@code input_dataset}. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class BatchDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.BatchDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param parallelCopy - */ - public Options parallelCopy(Boolean parallelCopy) { - this.parallelCopy = parallelCopy; - return this; - } - - private Boolean parallelCopy; - - private Options() { - } + public static final String OP_NAME = "BatchDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private BatchDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BatchDataset operation. - * + * Factory method to create a class wrapping a new BatchDatasetV2 operation. + * * @param scope current scope - * @param inputDataset + * @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 - * @param outputShapes - * @param options carries optional attributes values + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of BatchDataset */ - @Endpoint(describeByClass = true) - public static BatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand dropRemainder, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BatchDataset create(Scope scope, Operand inputDataset, + Operand batchSize, Operand dropRemainder, + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchDatasetV2", scope.makeOpName("BatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSize.asOutput()); @@ -79,7 +79,7 @@ public static BatchDataset create(Scope scope, Operand inputDataset, Operand< opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -92,34 +92,50 @@ public static BatchDataset create(Scope scope, Operand inputDataset, Operand< } return new BatchDataset(opBuilder.build()); } - + /** - * @param parallelCopy + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. */ public static Options parallelCopy(Boolean parallelCopy) { return new Options().parallelCopy(parallelCopy); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchDatasetV2"; - - private Output handle; - - private BatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.BatchDataset} + */ + public static class Options { + private Boolean parallelCopy; + + private Options() { + } + + /** + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. + */ + public Options parallelCopy(Boolean parallelCopy) { + this.parallelCopy = parallelCopy; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BytesProducedStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BytesProducedStatsDataset.java index b9cea475727..8bf3d9de786 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BytesProducedStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/BytesProducedStatsDataset.java @@ -27,60 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** - * Records the bytes size of each element of `input_dataset` in a StatsAggregator. + * Records the bytes size of each element of {@code input_dataset} in a StatsAggregator. */ public final class BytesProducedStatsDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BytesProducedStatsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private BytesProducedStatsDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BytesProducedStatsDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param tag - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param tag the tag value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of BytesProducedStatsDataset */ - @Endpoint(describeByClass = true) - public static BytesProducedStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static BytesProducedStatsDataset create(Scope scope, Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("BytesProducedStatsDataset", scope.makeOpName("BytesProducedStatsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new BytesProducedStatsDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BytesProducedStatsDataset"; - - private Output handle; - - private BytesProducedStatsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDataset.java index d2df9f2f263..2a04eeb6acd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDataset.java @@ -27,34 +27,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The CSVDataset operation */ public final class CSVDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CSVDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private CSVDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CSVDataset operation. - * + * * @param scope current scope - * @param filenames - * @param compressionType - * @param bufferSize - * @param header - * @param fieldDelim - * @param useQuoteDelim - * @param naValue - * @param selectCols - * @param recordDefaults - * @param outputShapes + * @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 property * @return a new instance of CSVDataset */ - @Endpoint(describeByClass = true) - public static CSVDataset create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize, Operand header, Operand fieldDelim, Operand useQuoteDelim, Operand naValue, Operand selectCols, Iterable> recordDefaults, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static CSVDataset create(Scope scope, Operand filenames, + Operand compressionType, Operand bufferSize, Operand header, + Operand fieldDelim, Operand useQuoteDelim, Operand naValue, + Operand selectCols, Iterable> recordDefaults, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("CSVDataset", scope.makeOpName("CSVDataset")); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); @@ -67,33 +85,25 @@ public static CSVDataset create(Scope scope, Operand filenames, Operand opBuilder.addInputList(Operands.asOutputs(recordDefaults)); opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new CSVDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSVDataset"; - - private Output handle; - - private CSVDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDatasetV2.java index f724dca8e93..871994f4416 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDatasetV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CSVDatasetV2.java @@ -27,35 +27,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The CSVDatasetV2 operation */ public final class CSVDatasetV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CSVDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private CSVDatasetV2(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CSVDatasetV2 operation. - * + * * @param scope current scope - * @param filenames - * @param compressionType - * @param bufferSize - * @param header - * @param fieldDelim - * @param useQuoteDelim - * @param naValue - * @param selectCols - * @param recordDefaults - * @param excludeCols - * @param outputShapes + * @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 property * @return a new instance of CSVDatasetV2 */ - @Endpoint(describeByClass = true) - public static CSVDatasetV2 create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize, Operand header, Operand fieldDelim, Operand useQuoteDelim, Operand naValue, Operand selectCols, Iterable> recordDefaults, Operand excludeCols, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static CSVDatasetV2 create(Scope scope, Operand filenames, + Operand compressionType, Operand bufferSize, Operand header, + Operand fieldDelim, Operand useQuoteDelim, Operand naValue, + Operand selectCols, Iterable> recordDefaults, Operand excludeCols, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("CSVDatasetV2", scope.makeOpName("CSVDatasetV2")); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); @@ -69,33 +88,25 @@ public static CSVDatasetV2 create(Scope scope, Operand filenames, Opera opBuilder.addInput(excludeCols.asOutput()); opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new CSVDatasetV2(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSVDatasetV2"; - - private Output handle; - - private CSVDatasetV2(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java index 25431c48ec6..3552ddc829f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDataset.java @@ -27,66 +27,73 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** - * Creates a dataset that caches elements from `input_dataset`. - *

+ * Creates a dataset that caches elements from {@code input_dataset}. * A CacheDataset will iterate over the input_dataset, and store tensors. If the * cache already exists, the cache will be used. If the cache is inappropriate * (e.g. cannot be opened, contains tensors of the wrong shape / size), an error * will the returned when used. */ public final class CacheDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CacheDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private CacheDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CacheDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset the inputDataset value * @param filename A path on the filesystem where we should cache the dataset. Note: this * will be a directory. - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of CacheDataset */ - @Endpoint(describeByClass = true) - public static CacheDataset create(Scope scope, Operand inputDataset, Operand filename, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static CacheDataset create(Scope scope, Operand inputDataset, + Operand filename, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("CacheDataset", scope.makeOpName("CacheDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(filename.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new CacheDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CacheDataset"; - - private Output handle; - - private CacheDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDatasetV2.java index c5cd457be55..0d9a3da0312 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDatasetV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/CacheDatasetV2.java @@ -27,27 +27,44 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The CacheDatasetV2 operation */ public final class CacheDatasetV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CacheDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private CacheDatasetV2(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CacheDatasetV2 operation. - * + * * @param scope current scope - * @param inputDataset - * @param filename - * @param cache - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param filename the filename value + * @param cache the cache value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of CacheDatasetV2 */ - @Endpoint(describeByClass = true) - public static CacheDatasetV2 create(Scope scope, Operand inputDataset, Operand filename, Operand cache, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static CacheDatasetV2 create(Scope scope, Operand inputDataset, + Operand filename, Operand cache, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("CacheDatasetV2", scope.makeOpName("CacheDatasetV2")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(filename.asOutput()); @@ -55,33 +72,25 @@ public static CacheDatasetV2 create(Scope scope, Operand inputDataset, Operan opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new CacheDatasetV2(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CacheDatasetV2"; - - private Output handle; - - private CacheDatasetV2(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestDataset.java index e29e27f73f4..b6ed6fa0598 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ChooseFastestDataset.java @@ -27,58 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The ChooseFastestDataset operation */ public final class ChooseFastestDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ChooseFastestDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ChooseFastestDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ChooseFastestDataset operation. - * + * * @param scope current scope - * @param inputDatasets - * @param numExperiments - * @param outputTypes - * @param outputShapes + * @param inputDatasets the inputDatasets value + * @param numExperiments the value of the numExperiments property + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of ChooseFastestDataset */ - @Endpoint(describeByClass = true) - public static ChooseFastestDataset create(Scope scope, Iterable> inputDatasets, Long numExperiments, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static ChooseFastestDataset create(Scope scope, + Iterable> inputDatasets, Long numExperiments, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ChooseFastestDataset", scope.makeOpName("ChooseFastestDataset")); opBuilder.addInputList(Operands.asOutputs(inputDatasets)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_experiments", numExperiments); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ChooseFastestDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ChooseFastestDataset"; - - private Output handle; - - private ChooseFastestDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ConcatenateDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ConcatenateDataset.java index bd32060b138..c5193836610 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ConcatenateDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ConcatenateDataset.java @@ -31,56 +31,67 @@ import org.tensorflow.types.family.TType; /** - * Creates a dataset that concatenates `input_dataset` with `another_dataset`. + * Creates a dataset that concatenates {@code input_dataset} with {@code another_dataset}. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class ConcatenateDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConcatenateDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ConcatenateDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ConcatenateDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param anotherDataset - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param anotherDataset the anotherDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of ConcatenateDataset */ - @Endpoint(describeByClass = true) - public static ConcatenateDataset create(Scope scope, Operand inputDataset, Operand anotherDataset, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static ConcatenateDataset create(Scope scope, Operand inputDataset, + Operand anotherDataset, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ConcatenateDataset", scope.makeOpName("ConcatenateDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(anotherDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ConcatenateDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConcatenateDataset"; - - private Output handle; - - private ConcatenateDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetCardinality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetCardinality.java index 121ae2d2120..69fa37fb80e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetCardinality.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetCardinality.java @@ -24,52 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** - * Returns the cardinality of `input_dataset`. - *

- * Returns the cardinality of `input_dataset`. + * Returns the cardinality of {@code input_dataset}. + * Returns the cardinality of {@code input_dataset}. */ public final class DatasetCardinality extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DatasetCardinality"; + + private Output cardinality; + + private DatasetCardinality(Operation operation) { + super(operation); + int outputIdx = 0; + cardinality = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DatasetCardinality operation. - * + * * @param scope current scope * @param inputDataset A variant tensor representing the dataset to return cardinality for. * @return a new instance of DatasetCardinality */ - @Endpoint(describeByClass = true) - public static DatasetCardinality create(Scope scope, Operand inputDataset) { + @Endpoint( + describeByClass = true + ) + public static DatasetCardinality create(Scope scope, Operand inputDataset) { OperationBuilder opBuilder = scope.env().opBuilder("DatasetCardinality", scope.makeOpName("DatasetCardinality")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); return new DatasetCardinality(opBuilder.build()); } - + /** - * The cardinality of `input_dataset`. Named constants are used to represent + * Gets cardinality. + * The cardinality of {@code input_dataset}. Named constants are used to represent * infinite and unknown cardinality. + * @return cardinality. */ public Output cardinality() { return cardinality; } - + @Override public Output asOutput() { return cardinality; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetCardinality"; - - private Output cardinality; - - private DatasetCardinality(Operation operation) { - super(operation); - int outputIdx = 0; - cardinality = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFromGraph.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFromGraph.java index 71ba9356f09..3961ea15eab 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFromGraph.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetFromGraph.java @@ -24,53 +24,57 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** - * Creates a dataset from the given `graph_def`. - *

- * Creates a dataset from the provided `graph_def`. + * Creates a dataset from the given {@code graph_def}. + * Creates a dataset from the provided {@code graph_def}. */ public final class DatasetFromGraph extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DatasetFromGraph"; + + private Output handle; + + @SuppressWarnings("unchecked") + private DatasetFromGraph(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DatasetFromGraph operation. - * + * * @param scope current scope * @param graphDef The graph representation of the dataset (as serialized GraphDef). * @return a new instance of DatasetFromGraph */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DatasetFromGraph create(Scope scope, Operand graphDef) { OperationBuilder opBuilder = scope.env().opBuilder("DatasetFromGraph", scope.makeOpName("DatasetFromGraph")); opBuilder.addInput(graphDef.asOutput()); opBuilder = scope.apply(opBuilder); return new DatasetFromGraph(opBuilder.build()); } - + /** + * Gets handle. * A variant tensor representing the dataset. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetFromGraph"; - - private Output handle; - - private DatasetFromGraph(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToGraph.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToGraph.java index e9f5757cd40..1d0681e31e4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToGraph.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToGraph.java @@ -24,54 +24,40 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** - * Returns a serialized GraphDef representing `input_dataset`. - *

- * Returns a graph representation for `input_dataset`. + * Returns a serialized GraphDef representing {@code input_dataset}. + * Returns a graph representation for {@code input_dataset}. */ public final class DatasetToGraph extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.DatasetToGraph} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param externalStatePolicy - */ - public Options externalStatePolicy(Long externalStatePolicy) { - this.externalStatePolicy = externalStatePolicy; - return this; - } - - /** - * @param stripDeviceAssignment - */ - public Options stripDeviceAssignment(Boolean stripDeviceAssignment) { - this.stripDeviceAssignment = stripDeviceAssignment; - return this; - } - - private Long externalStatePolicy; - private Boolean stripDeviceAssignment; - - private Options() { - } + public static final String OP_NAME = "DatasetToGraphV2"; + + private Output graph; + + private DatasetToGraph(Operation operation) { + super(operation); + int outputIdx = 0; + graph = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new DatasetToGraph operation. - * + * Factory method to create a class wrapping a new DatasetToGraphV2 operation. + * * @param scope current scope * @param inputDataset A variant tensor representing the dataset to return the graph representation for. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DatasetToGraph */ - @Endpoint(describeByClass = true) - public static DatasetToGraph create(Scope scope, Operand inputDataset, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DatasetToGraph create(Scope scope, Operand inputDataset, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DatasetToGraphV2", scope.makeOpName("DatasetToGraph")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); @@ -87,41 +73,72 @@ public static DatasetToGraph create(Scope scope, Operand inputDataset, Option } return new DatasetToGraph(opBuilder.build()); } - + /** - * @param externalStatePolicy + * Sets the externalStatePolicy option. + * + * @param externalStatePolicy the externalStatePolicy option + * @return this Options instance. */ public static Options externalStatePolicy(Long externalStatePolicy) { return new Options().externalStatePolicy(externalStatePolicy); } - + /** - * @param stripDeviceAssignment + * Sets the stripDeviceAssignment option. + * + * @param stripDeviceAssignment the stripDeviceAssignment option + * @return this Options instance. */ public static Options stripDeviceAssignment(Boolean stripDeviceAssignment) { return new Options().stripDeviceAssignment(stripDeviceAssignment); } - + /** + * Gets graph. * The graph representation of the dataset (as serialized GraphDef). + * @return graph. */ public Output graph() { return graph; } - + @Override public Output asOutput() { return graph; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetToGraphV2"; - - private Output graph; - - private DatasetToGraph(Operation operation) { - super(operation); - int outputIdx = 0; - graph = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.DatasetToGraph} + */ + public static class Options { + private Long externalStatePolicy; + + private Boolean stripDeviceAssignment; + + private Options() { + } + + /** + * Sets the externalStatePolicy option. + * + * @param externalStatePolicy the externalStatePolicy option + * @return this Options instance. + */ + public Options externalStatePolicy(Long externalStatePolicy) { + this.externalStatePolicy = externalStatePolicy; + return this; + } + + /** + * Sets the stripDeviceAssignment option. + * + * @param stripDeviceAssignment the stripDeviceAssignment option + * @return this Options instance. + */ + public Options stripDeviceAssignment(Boolean stripDeviceAssignment) { + this.stripDeviceAssignment = stripDeviceAssignment; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToSingleElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToSingleElement.java index a74413e1935..c3ebfccb906 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToSingleElement.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToSingleElement.java @@ -29,60 +29,66 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Outputs the single element from the given dataset. */ public final class DatasetToSingleElement extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DatasetToSingleElement"; + + private List> components; + + @SuppressWarnings("unchecked") + private DatasetToSingleElement(Operation operation) { + super(operation); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; + } + /** * Factory method to create a class wrapping a new DatasetToSingleElement operation. - * + * * @param scope current scope * @param dataset A handle to a dataset that contains a single element. - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of DatasetToSingleElement */ - @Endpoint(describeByClass = true) - public static DatasetToSingleElement create(Scope scope, Operand dataset, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static DatasetToSingleElement create(Scope scope, Operand dataset, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("DatasetToSingleElement", scope.makeOpName("DatasetToSingleElement")); opBuilder.addInput(dataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new DatasetToSingleElement(opBuilder.build()); } - + /** - * The components of the single element of `input`. + * Gets components. + * The components of the single element of {@code input}. + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetToSingleElement"; - - private List> components; - - private DatasetToSingleElement(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToTfRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToTfRecord.java index 12504c93af8..d3cd2a4d8a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToTfRecord.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DatasetToTfRecord.java @@ -23,26 +23,37 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Writes the given dataset to the given file using the TFRecord format. */ public final class DatasetToTfRecord extends RawOp { - /** - * Factory method to create a class wrapping a new DatasetToTfRecord operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DatasetToTFRecord"; + + private DatasetToTfRecord(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new DatasetToTFRecord operation. + * * @param scope current scope * @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". + * compression), (ii) "ZLIB", or (iii) "GZIP". * @return a new instance of DatasetToTfRecord */ - @Endpoint(describeByClass = true) - public static DatasetToTfRecord create(Scope scope, Operand inputDataset, Operand filename, Operand compressionType) { + @Endpoint( + describeByClass = true + ) + public static DatasetToTfRecord create(Scope scope, Operand inputDataset, + Operand filename, Operand compressionType) { OperationBuilder opBuilder = scope.env().opBuilder("DatasetToTFRecord", scope.makeOpName("DatasetToTfRecord")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(filename.asOutput()); @@ -50,11 +61,4 @@ public static DatasetToTfRecord create(Scope scope, Operand inputDataset, Ope opBuilder = scope.apply(opBuilder); return new DatasetToTfRecord(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DatasetToTFRecord"; - - private DatasetToTfRecord(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteIterator.java index 2995866c0f6..a57a205c616 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteIterator.java @@ -24,34 +24,41 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * A container for an iterator resource. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class DeleteIterator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeleteIterator"; + + private DeleteIterator(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new DeleteIterator operation. - * + * * @param scope current scope * @param handle A handle to the iterator to delete. * @param deleter A variant deleter. * @return a new instance of DeleteIterator */ - @Endpoint(describeByClass = true) - public static DeleteIterator create(Scope scope, Operand handle, Operand deleter) { + @Endpoint( + describeByClass = true + ) + public static DeleteIterator create(Scope scope, Operand handle, + Operand deleter) { OperationBuilder opBuilder = scope.env().opBuilder("DeleteIterator", scope.makeOpName("DeleteIterator")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(deleter.asOutput()); opBuilder = scope.apply(opBuilder); return new DeleteIterator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteIterator"; - - private DeleteIterator(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMemoryCache.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMemoryCache.java index 4faca573dc8..3fd27f09429 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMemoryCache.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMemoryCache.java @@ -23,33 +23,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** + * The DeleteMemoryCache operation */ public final class DeleteMemoryCache extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeleteMemoryCache"; + + private DeleteMemoryCache(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new DeleteMemoryCache operation. - * + * * @param scope current scope - * @param handle - * @param deleter + * @param handle the handle value + * @param deleter the deleter value * @return a new instance of DeleteMemoryCache */ - @Endpoint(describeByClass = true) - public static DeleteMemoryCache create(Scope scope, Operand handle, Operand deleter) { + @Endpoint( + describeByClass = true + ) + public static DeleteMemoryCache create(Scope scope, Operand handle, + Operand deleter) { OperationBuilder opBuilder = scope.env().opBuilder("DeleteMemoryCache", scope.makeOpName("DeleteMemoryCache")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(deleter.asOutput()); opBuilder = scope.apply(opBuilder); return new DeleteMemoryCache(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteMemoryCache"; - - private DeleteMemoryCache(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMultiDeviceIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMultiDeviceIterator.java index 12fbd2e3cdf..a8dcedb5ecb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMultiDeviceIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeleteMultiDeviceIterator.java @@ -24,24 +24,36 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * A container for an iterator resource. */ public final class DeleteMultiDeviceIterator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeleteMultiDeviceIterator"; + + private DeleteMultiDeviceIterator(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new DeleteMultiDeviceIterator operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static DeleteMultiDeviceIterator create(Scope scope, Operand multiDeviceIterator, Iterable> iterators, Operand deleter) { + @Endpoint( + describeByClass = true + ) + public static DeleteMultiDeviceIterator create(Scope scope, + Operand multiDeviceIterator, Iterable> iterators, + Operand deleter) { OperationBuilder opBuilder = scope.env().opBuilder("DeleteMultiDeviceIterator", scope.makeOpName("DeleteMultiDeviceIterator")); opBuilder.addInput(multiDeviceIterator.asOutput()); opBuilder.addInputList(Operands.asOutputs(iterators)); @@ -49,11 +61,4 @@ public static DeleteMultiDeviceIterator create(Scope scope, Operand multiDevi opBuilder = scope.apply(opBuilder); return new DeleteMultiDeviceIterator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteMultiDeviceIterator"; - - private DeleteMultiDeviceIterator(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DenseToSparseBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DenseToSparseBatchDataset.java index 1b5c9ec6ceb..6389138e683 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DenseToSparseBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DenseToSparseBatchDataset.java @@ -27,7 +27,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,23 +34,40 @@ * Creates a dataset that batches input elements into a SparseTensor. */ public final class DenseToSparseBatchDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DenseToSparseBatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private DenseToSparseBatchDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DenseToSparseBatchDataset operation. - * + * * @param scope current scope * @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 `-1` to indicate + * 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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of DenseToSparseBatchDataset */ - @Endpoint(describeByClass = true) - public static DenseToSparseBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand rowShape, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static DenseToSparseBatchDataset create(Scope scope, Operand inputDataset, + Operand batchSize, Operand rowShape, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("DenseToSparseBatchDataset", scope.makeOpName("DenseToSparseBatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSize.asOutput()); @@ -59,33 +75,25 @@ public static DenseToSparseBatchDataset create(Scope scope, Operand inputData opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new DenseToSparseBatchDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseToSparseBatchDataset"; - - private Output handle; - - private DenseToSparseBatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeserializeIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeserializeIterator.java index 54e1df16001..ccd8e16d9df 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeserializeIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DeserializeIterator.java @@ -24,35 +24,42 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Converts the given variant tensor to an iterator and stores it in the given resource. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class DeserializeIterator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeserializeIterator"; + + private DeserializeIterator(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new DeserializeIterator operation. - * + * * @param scope current scope * @param resourceHandle A handle to an iterator resource. * @param serialized A variant tensor storing the state of the iterator contained in the * resource. * @return a new instance of DeserializeIterator */ - @Endpoint(describeByClass = true) - public static DeserializeIterator create(Scope scope, Operand resourceHandle, Operand serialized) { + @Endpoint( + describeByClass = true + ) + public static DeserializeIterator create(Scope scope, Operand resourceHandle, + Operand serialized) { OperationBuilder opBuilder = scope.env().opBuilder("DeserializeIterator", scope.makeOpName("DeserializeIterator")); opBuilder.addInput(resourceHandle.asOutput()); opBuilder.addInput(serialized.asOutput()); opBuilder = scope.apply(opBuilder); return new DeserializeIterator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeserializeIterator"; - - private DeserializeIterator(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DirectedInterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DirectedInterleaveDataset.java index 0e543dc351a..cd1cef1a070 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DirectedInterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/DirectedInterleaveDataset.java @@ -27,61 +27,70 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * A substitute for `InterleaveDataset` on a fixed list of `N` datasets. + * A substitute for {@code InterleaveDataset} on a fixed list of {@code N} datasets. */ public final class DirectedInterleaveDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DirectedInterleaveDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private DirectedInterleaveDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DirectedInterleaveDataset operation. - * + * * @param scope current scope - * @param selectorInputDataset A dataset of scalar `DT_INT64` elements that determines which of the - * `N` data inputs should produce the next output element. - * @param dataInputDatasets `N` datasets with the same type that will be interleaved according to - * the values of `selector_input_dataset`. - * @param outputTypes - * @param outputShapes + * @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 property + * @param outputShapes the value of the outputShapes property * @return a new instance of DirectedInterleaveDataset */ - @Endpoint(describeByClass = true) - public static DirectedInterleaveDataset create(Scope scope, Operand selectorInputDataset, Iterable> dataInputDatasets, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static DirectedInterleaveDataset create(Scope scope, + Operand selectorInputDataset, + Iterable> dataInputDatasets, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("DirectedInterleaveDataset", scope.makeOpName("DirectedInterleaveDataset")); opBuilder.addInput(selectorInputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(dataInputDatasets)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new DirectedInterleaveDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DirectedInterleaveDataset"; - - private Output handle; - - private DirectedInterleaveDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterByLastComponentDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterByLastComponentDataset.java index d1d1c55e08f..44b4b08a329 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterByLastComponentDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FilterByLastComponentDataset.java @@ -27,57 +27,65 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset containing elements of first component of `input_dataset` having true in the last component. + * Creates a dataset containing elements of first component of {@code input_dataset} having true in the last component. */ public final class FilterByLastComponentDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FilterByLastComponentDataset"; + + private Output output; + + @SuppressWarnings("unchecked") + private FilterByLastComponentDataset(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FilterByLastComponentDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of FilterByLastComponentDataset */ - @Endpoint(describeByClass = true) - public static FilterByLastComponentDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static FilterByLastComponentDataset create(Scope scope, + Operand inputDataset, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("FilterByLastComponentDataset", scope.makeOpName("FilterByLastComponentDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new FilterByLastComponentDataset(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FilterByLastComponentDataset"; - - private Output output; - - private FilterByLastComponentDataset(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FixedLengthRecordDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FixedLengthRecordDataset.java index 10a7c791e17..8d1f567c391 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FixedLengthRecordDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/FixedLengthRecordDataset.java @@ -24,29 +24,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The FixedLengthRecordDatasetV2 operation */ public final class FixedLengthRecordDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new FixedLengthRecordDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FixedLengthRecordDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private FixedLengthRecordDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FixedLengthRecordDatasetV2 operation. + * * @param scope current scope - * @param filenames - * @param headerBytes - * @param recordBytes - * @param footerBytes - * @param bufferSize - * @param compressionType + * @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 * @return a new instance of FixedLengthRecordDataset */ - @Endpoint(describeByClass = true) - public static FixedLengthRecordDataset create(Scope scope, Operand filenames, Operand headerBytes, Operand recordBytes, Operand footerBytes, Operand bufferSize, Operand compressionType) { + @Endpoint( + describeByClass = true + ) + public static FixedLengthRecordDataset create(Scope scope, Operand filenames, + Operand headerBytes, Operand recordBytes, Operand footerBytes, + Operand bufferSize, Operand compressionType) { OperationBuilder opBuilder = scope.env().opBuilder("FixedLengthRecordDatasetV2", scope.makeOpName("FixedLengthRecordDataset")); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(headerBytes.asOutput()); @@ -57,27 +74,19 @@ public static FixedLengthRecordDataset create(Scope scope, Operand file opBuilder = scope.apply(opBuilder); return new FixedLengthRecordDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FixedLengthRecordDatasetV2"; - - private Output handle; - - private FixedLengthRecordDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IgnoreErrorsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IgnoreErrorsDataset.java index 02c64a0b24e..334d2d7ad11 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IgnoreErrorsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IgnoreErrorsDataset.java @@ -27,51 +27,47 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset that contains the elements of `input_dataset` ignoring errors. + * Creates a dataset that contains the elements of {@code input_dataset} ignoring errors. */ public final class IgnoreErrorsDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.IgnoreErrorsDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param logWarning - */ - public Options logWarning(Boolean logWarning) { - this.logWarning = logWarning; - return this; - } - - private Boolean logWarning; - - private Options() { - } + public static final String OP_NAME = "IgnoreErrorsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private IgnoreErrorsDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new IgnoreErrorsDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @param inputDataset the inputDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of IgnoreErrorsDataset */ - @Endpoint(describeByClass = true) - public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("IgnoreErrorsDataset", scope.makeOpName("IgnoreErrorsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -84,34 +80,50 @@ public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, L } return new IgnoreErrorsDataset(opBuilder.build()); } - + /** - * @param logWarning + * Sets the logWarning option. + * + * @param logWarning the logWarning option + * @return this Options instance. */ public static Options logWarning(Boolean logWarning) { return new Options().logWarning(logWarning); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IgnoreErrorsDataset"; - - private Output handle; - - private IgnoreErrorsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.IgnoreErrorsDataset} + */ + public static class Options { + private Boolean logWarning; + + private Options() { + } + + /** + * Sets the logWarning option. + * + * @param logWarning the logWarning option + * @return this Options instance. + */ + public Options logWarning(Boolean logWarning) { + this.logWarning = logWarning; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InitializeTableFromDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InitializeTableFromDataset.java index 3008e032cb5..79f20eff235 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InitializeTableFromDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/InitializeTableFromDataset.java @@ -23,33 +23,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** + * The InitializeTableFromDataset operation */ public final class InitializeTableFromDataset extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InitializeTableFromDataset"; + + private InitializeTableFromDataset(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new InitializeTableFromDataset operation. - * + * * @param scope current scope - * @param tableHandle - * @param dataset + * @param tableHandle the tableHandle value + * @param dataset the dataset value * @return a new instance of InitializeTableFromDataset */ - @Endpoint(describeByClass = true) - public static InitializeTableFromDataset create(Scope scope, Operand tableHandle, Operand dataset) { + @Endpoint( + describeByClass = true + ) + public static InitializeTableFromDataset create(Scope scope, Operand tableHandle, + Operand dataset) { OperationBuilder opBuilder = scope.env().opBuilder("InitializeTableFromDataset", scope.makeOpName("InitializeTableFromDataset")); opBuilder.addInput(tableHandle.asOutput()); opBuilder.addInput(dataset.asOutput()); opBuilder = scope.apply(opBuilder); return new InitializeTableFromDataset(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InitializeTableFromDataset"; - - private InitializeTableFromDataset(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/Iterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/Iterator.java index d20e98d5c9b..3b3b3a04f6b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/Iterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/Iterator.java @@ -31,55 +31,66 @@ import org.tensorflow.types.family.TType; /** + * The IteratorV2 operation */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class Iterator extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Iterator operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private Iterator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IteratorV2 operation. + * * @param scope current scope - * @param sharedName - * @param container - * @param outputTypes - * @param outputShapes + * @param sharedName the value of the sharedName property + * @param container the value of the container property + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of Iterator */ - @Endpoint(describeByClass = true) - public static Iterator create(Scope scope, String sharedName, String container, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static Iterator create(Scope scope, String sharedName, String container, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("IteratorV2", scope.makeOpName("Iterator")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shared_name", sharedName); opBuilder.setAttr("container", container); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new Iterator(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorV2"; - - private Output handle; - - private Iterator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorFromStringHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorFromStringHandle.java index 4de1a9f1e9e..c218c81909d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorFromStringHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorFromStringHandle.java @@ -17,6 +17,7 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -27,44 +28,41 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The IteratorFromStringHandleV2 operation */ public final class IteratorFromStringHandle extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.IteratorFromStringHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param outputShapes - */ - public Options outputShapes(List outputShapes) { - this.outputShapes = outputShapes; - return this; - } - - private List outputShapes; - - private Options() { - } + public static final String OP_NAME = "IteratorFromStringHandleV2"; + + private Output resourceHandle; + + @SuppressWarnings("unchecked") + private IteratorFromStringHandle(Operation operation) { + super(operation); + int outputIdx = 0; + resourceHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new IteratorFromStringHandle operation. - * + * Factory method to create a class wrapping a new IteratorFromStringHandleV2 operation. + * * @param scope current scope - * @param stringHandle - * @param outputTypes - * @param options carries optional attributes values + * @param stringHandle the stringHandle value + * @param outputTypes the value of the outputTypes property + * @param options carries optional attribute values * @return a new instance of IteratorFromStringHandle */ - @Endpoint(describeByClass = true) - public static IteratorFromStringHandle create(Scope scope, Operand stringHandle, List> outputTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static IteratorFromStringHandle create(Scope scope, Operand stringHandle, + List> outputTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("IteratorFromStringHandleV2", scope.makeOpName("IteratorFromStringHandle")); opBuilder.addInput(stringHandle.asOutput()); opBuilder = scope.apply(opBuilder); @@ -73,7 +71,7 @@ public static IteratorFromStringHandle create(Scope scope, Operand stri for (Options opts : options) { if (opts.outputShapes != null) { Shape[] outputShapesArray = new Shape[opts.outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = opts.outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -82,34 +80,71 @@ public static IteratorFromStringHandle create(Scope scope, Operand stri } return new IteratorFromStringHandle(opBuilder.build()); } - + /** - * @param outputShapes + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. */ public static Options outputShapes(List outputShapes) { return new Options().outputShapes(outputShapes); } - + + /** + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. + */ + public static Options outputShapes(Shape[] outputShapes) { + return new Options().outputShapes(outputShapes); + } + /** + * Gets resourceHandle. + * + * @return resourceHandle. */ - public Output resourceHandle() { + public Output resourceHandle() { return resourceHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) resourceHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorFromStringHandleV2"; - - private Output resourceHandle; - - private IteratorFromStringHandle(Operation operation) { - super(operation); - int outputIdx = 0; - resourceHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.IteratorFromStringHandle} + */ + public static class Options { + private List outputShapes; + + private Options() { + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. + */ + public Options outputShapes(List outputShapes) { + this.outputShapes = outputShapes; + return this; + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes the outputShapes option + * @return this Options instance. + */ + public Options outputShapes(Shape... outputShapes) { + this.outputShapes = Arrays.asList(outputShapes); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetDevice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetDevice.java index a07649736c9..7a7c2bf2652 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetDevice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetDevice.java @@ -24,48 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** - * Returns the name of the device on which `resource` has been placed. + * Returns the name of the device on which {@code resource} has been placed. */ public final class IteratorGetDevice extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorGetDevice"; + + private Output device; + + private IteratorGetDevice(Operation operation) { + super(operation); + int outputIdx = 0; + device = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IteratorGetDevice operation. - * + * * @param scope current scope - * @param resource + * @param resource the resource value * @return a new instance of IteratorGetDevice */ - @Endpoint(describeByClass = true) - public static IteratorGetDevice create(Scope scope, Operand resource) { + @Endpoint( + describeByClass = true + ) + public static IteratorGetDevice create(Scope scope, Operand resource) { OperationBuilder opBuilder = scope.env().opBuilder("IteratorGetDevice", scope.makeOpName("IteratorGetDevice")); opBuilder.addInput(resource.asOutput()); opBuilder = scope.apply(opBuilder); return new IteratorGetDevice(opBuilder.build()); } - + /** + * Gets device. + * + * @return device. */ public Output device() { return device; } - + @Override public Output asOutput() { return device; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorGetDevice"; - - private Output device; - - private IteratorGetDevice(Operation operation) { - super(operation); - int outputIdx = 0; - device = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNext.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNext.java index a41f441f650..e40b54a0426 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNext.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNext.java @@ -35,54 +35,64 @@ /** * Gets the next output from the given iterator . */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class IteratorGetNext extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorGetNext"; + + private List> components; + + @SuppressWarnings("unchecked") + private IteratorGetNext(Operation operation) { + super(operation); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; + } + /** * Factory method to create a class wrapping a new IteratorGetNext operation. - * + * * @param scope current scope - * @param iterator - * @param outputTypes - * @param outputShapes + * @param iterator the iterator value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of IteratorGetNext */ - @Endpoint(describeByClass = true) - public static IteratorGetNext create(Scope scope, Operand iterator, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static IteratorGetNext create(Scope scope, Operand iterator, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("IteratorGetNext", scope.makeOpName("IteratorGetNext")); opBuilder.addInput(iterator.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new IteratorGetNext(opBuilder.build()); } - + /** + * Gets components. + * + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorGetNext"; - - private List> components; - - private IteratorGetNext(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextAsOptional.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextAsOptional.java index 7d4f441eb83..1507334e561 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextAsOptional.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextAsOptional.java @@ -33,52 +33,62 @@ /** * Gets the next output from the given iterator as an Optional variant. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class IteratorGetNextAsOptional extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorGetNextAsOptional"; + + private Output optional; + + @SuppressWarnings("unchecked") + private IteratorGetNextAsOptional(Operation operation) { + super(operation); + int outputIdx = 0; + optional = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IteratorGetNextAsOptional operation. - * + * * @param scope current scope - * @param iterator - * @param outputTypes - * @param outputShapes + * @param iterator the iterator value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of IteratorGetNextAsOptional */ - @Endpoint(describeByClass = true) - public static IteratorGetNextAsOptional create(Scope scope, Operand iterator, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static IteratorGetNextAsOptional create(Scope scope, Operand iterator, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("IteratorGetNextAsOptional", scope.makeOpName("IteratorGetNextAsOptional")); opBuilder.addInput(iterator.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new IteratorGetNextAsOptional(opBuilder.build()); } - + /** + * Gets optional. + * + * @return optional. */ - public Output optional() { + public Output optional() { return optional; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) optional; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorGetNextAsOptional"; - - private Output optional; - - private IteratorGetNextAsOptional(Operation operation) { - super(operation); - int outputIdx = 0; - optional = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextSync.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextSync.java index bdce447dd0a..5fa4809cc6d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextSync.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorGetNextSync.java @@ -34,60 +34,69 @@ /** * 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). */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class IteratorGetNextSync extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorGetNextSync"; + + private List> components; + + @SuppressWarnings("unchecked") + private IteratorGetNextSync(Operation operation) { + super(operation); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; + } + /** * Factory method to create a class wrapping a new IteratorGetNextSync operation. - * + * * @param scope current scope - * @param iterator - * @param outputTypes - * @param outputShapes + * @param iterator the iterator value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of IteratorGetNextSync */ - @Endpoint(describeByClass = true) - public static IteratorGetNextSync create(Scope scope, Operand iterator, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static IteratorGetNextSync create(Scope scope, Operand iterator, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("IteratorGetNextSync", scope.makeOpName("IteratorGetNextSync")); opBuilder.addInput(iterator.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new IteratorGetNextSync(opBuilder.build()); } - + /** + * Gets components. + * + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorGetNextSync"; - - private List> components; - - private IteratorGetNextSync(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorToStringHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorToStringHandle.java index 94dd5feace7..ad1d7422cc4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorToStringHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/IteratorToStringHandle.java @@ -26,48 +26,57 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** - * Converts the given `resource_handle` representing an iterator to a string. + * Converts the given {@code resource_handle} representing an iterator to a string. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class IteratorToStringHandle extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IteratorToStringHandle"; + + private Output stringHandle; + + private IteratorToStringHandle(Operation operation) { + super(operation); + int outputIdx = 0; + stringHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IteratorToStringHandle operation. - * + * * @param scope current scope * @param resourceHandle A handle to an iterator resource. * @return a new instance of IteratorToStringHandle */ - @Endpoint(describeByClass = true) - public static IteratorToStringHandle create(Scope scope, Operand resourceHandle) { + @Endpoint( + describeByClass = true + ) + public static IteratorToStringHandle create(Scope scope, + Operand resourceHandle) { OperationBuilder opBuilder = scope.env().opBuilder("IteratorToStringHandle", scope.makeOpName("IteratorToStringHandle")); opBuilder.addInput(resourceHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new IteratorToStringHandle(opBuilder.build()); } - + /** + * Gets stringHandle. * A string representation of the given handle. + * @return stringHandle. */ public Output stringHandle() { return stringHandle; } - + @Override public Output asOutput() { return stringHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IteratorToStringHandle"; - - private Output stringHandle; - - private IteratorToStringHandle(Operation operation) { - super(operation); - int outputIdx = 0; - stringHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LMDBDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LMDBDataset.java index c67912ec018..0ed1d8ddf75 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LMDBDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LMDBDataset.java @@ -27,70 +27,74 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * 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 `.mdb` suffix. - *

- * Each output element consists of a key-value pair represented as a pair of - * scalar string `Tensor`s, where the first `Tensor` contains the key and the - * second `Tensor` contains the value. - *

- * LMDB uses different file formats on big- and little-endian machines. - * `data.LMDBDataset` can only read files in the format of the host machine. + * 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. */ public final class LMDBDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LMDBDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private LMDBDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LMDBDataset operation. - * + * * @param scope current scope * @param filenames A scalar or a vector containing the name(s) of the binary file(s) to be * read. - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of LMDBDataset */ - @Endpoint(describeByClass = true) - public static LMDBDataset create(Scope scope, Operand filenames, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static LMDBDataset create(Scope scope, Operand filenames, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("LMDBDataset", scope.makeOpName("LMDBDataset")); opBuilder.addInput(filenames.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new LMDBDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LMDBDataset"; - - private Output handle; - - private LMDBDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LatencyStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LatencyStatsDataset.java index 047057a1c25..7e890e8429b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LatencyStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LatencyStatsDataset.java @@ -27,60 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** - * Records the latency of producing `input_dataset` elements in a StatsAggregator. + * Records the latency of producing {@code input_dataset} elements in a StatsAggregator. */ public final class LatencyStatsDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LatencyStatsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private LatencyStatsDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LatencyStatsDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param tag - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param tag the tag value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of LatencyStatsDataset */ - @Endpoint(describeByClass = true) - public static LatencyStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static LatencyStatsDataset create(Scope scope, Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("LatencyStatsDataset", scope.makeOpName("LatencyStatsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new LatencyStatsDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LatencyStatsDataset"; - - private Output handle; - - private LatencyStatsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LeakyReluGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LeakyReluGrad.java index 3b41dd2e918..032522050f3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LeakyReluGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/LeakyReluGrad.java @@ -24,47 +24,43 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Computes rectified linear gradients for a LeakyRelu operation. - * - * @param data type for {@code backprops()} output + * + * @param data type for {@code backprops} output */ public final class LeakyReluGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.LeakyReluGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alpha - */ - public Options alpha(Float alpha) { - this.alpha = alpha; - return this; - } - - private Float alpha; - - private Options() { - } + public static final String OP_NAME = "LeakyReluGrad"; + + private Output backprops; + + private LeakyReluGrad(Operation operation) { + super(operation); + int outputIdx = 0; + backprops = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LeakyReluGrad operation. - * + * * @param scope current scope * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code LeakyReluGrad} output and operands * @return a new instance of LeakyReluGrad */ - @Endpoint(describeByClass = true) - public static LeakyReluGrad create(Scope scope, Operand gradients, Operand features, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LeakyReluGrad create(Scope scope, Operand gradients, + Operand features, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LeakyReluGrad", scope.makeOpName("LeakyReluGrad")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); @@ -76,36 +72,51 @@ public static LeakyReluGrad create(Scope scope, Operand(opBuilder.build()); + return new LeakyReluGrad<>(opBuilder.build()); } - + /** - * @param alpha + * Sets the alpha option. + * + * @param alpha the alpha option + * @return this Options instance. */ public static Options alpha(Float alpha) { return new Options().alpha(alpha); } - + /** - * `gradients * (features > 0) + alpha * gradients * (features <= 0)`. + * Gets backprops. + * {@code gradients * (features > 0) + alpha * gradients * (features <= 0)}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LeakyReluGrad"; - - private Output backprops; - - private LeakyReluGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.LeakyReluGrad} + */ + public static class Options { + private Float alpha; + + private Options() { + } + + /** + * Sets the alpha option. + * + * @param alpha the alpha option + * @return this Options instance. + */ + public Options alpha(Float alpha) { + this.alpha = alpha; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MakeIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MakeIterator.java index 7bd453d2fd7..446caa5aca2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MakeIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MakeIterator.java @@ -24,37 +24,43 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** - * Makes a new iterator from the given `dataset` and stores it in `iterator`. - *

+ * 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 `iterator` to the first element of `dataset`. + * iterator in {@code iterator} to the first element of {@code dataset}. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class MakeIterator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MakeIterator"; + + private MakeIterator(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new MakeIterator operation. - * + * * @param scope current scope - * @param dataset - * @param iterator + * @param dataset the dataset value + * @param iterator the iterator value * @return a new instance of MakeIterator */ - @Endpoint(describeByClass = true) - public static MakeIterator create(Scope scope, Operand dataset, Operand iterator) { + @Endpoint( + describeByClass = true + ) + public static MakeIterator create(Scope scope, Operand dataset, + Operand iterator) { OperationBuilder opBuilder = scope.env().opBuilder("MakeIterator", scope.makeOpName("MakeIterator")); opBuilder.addInput(dataset.asOutput()); opBuilder.addInput(iterator.asOutput()); opBuilder = scope.apply(opBuilder); return new MakeIterator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MakeIterator"; - - private MakeIterator(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MatchingFilesDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MatchingFilesDataset.java index c6a0d3b64d8..b8926e6bbb2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MatchingFilesDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MatchingFilesDataset.java @@ -24,49 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The MatchingFilesDataset operation */ public final class MatchingFilesDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatchingFilesDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private MatchingFilesDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MatchingFilesDataset operation. - * + * * @param scope current scope - * @param patterns + * @param patterns the patterns value * @return a new instance of MatchingFilesDataset */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MatchingFilesDataset create(Scope scope, Operand patterns) { OperationBuilder opBuilder = scope.env().opBuilder("MatchingFilesDataset", scope.makeOpName("MatchingFilesDataset")); opBuilder.addInput(patterns.asOutput()); opBuilder = scope.apply(opBuilder); return new MatchingFilesDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatchingFilesDataset"; - - private Output handle; - - private MatchingFilesDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MaxIntraOpParallelismDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MaxIntraOpParallelismDataset.java index 14a35d14d07..d99b31adb6a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MaxIntraOpParallelismDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MaxIntraOpParallelismDataset.java @@ -27,7 +27,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,52 +34,61 @@ * Creates a dataset that overrides the maximum intra-op parallelism. */ public final class MaxIntraOpParallelismDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MaxIntraOpParallelismDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private MaxIntraOpParallelismDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MaxIntraOpParallelismDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset the inputDataset value * @param maxIntraOpParallelism Identifies the maximum intra-op parallelism to use. - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of MaxIntraOpParallelismDataset */ - @Endpoint(describeByClass = true) - public static MaxIntraOpParallelismDataset create(Scope scope, Operand inputDataset, Operand maxIntraOpParallelism, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static MaxIntraOpParallelismDataset create(Scope scope, + Operand inputDataset, Operand maxIntraOpParallelism, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("MaxIntraOpParallelismDataset", scope.makeOpName("MaxIntraOpParallelismDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(maxIntraOpParallelism.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new MaxIntraOpParallelismDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxIntraOpParallelismDataset"; - - private Output handle; - - private MaxIntraOpParallelismDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ModelDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ModelDataset.java index 6b102be4fc7..4bbafbc1e02 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ModelDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ModelDataset.java @@ -27,71 +27,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Identity transformation that models performance. - *

* Identity transformation that models performance. */ public final class ModelDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.ModelDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param algorithm - */ - public Options algorithm(Long algorithm) { - this.algorithm = algorithm; - return this; - } - - /** - * @param cpuBudget - */ - public Options cpuBudget(Long cpuBudget) { - this.cpuBudget = cpuBudget; - return this; - } - - /** - * @param ramBudget - */ - public Options ramBudget(Long ramBudget) { - this.ramBudget = ramBudget; - return this; - } - - private Long algorithm; - private Long cpuBudget; - private Long ramBudget; - - private Options() { - } + public static final String OP_NAME = "ModelDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ModelDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ModelDataset operation. - * + * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of ModelDataset */ - @Endpoint(describeByClass = true) - public static ModelDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ModelDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ModelDataset", scope.makeOpName("ModelDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -110,48 +87,96 @@ public static ModelDataset create(Scope scope, Operand inputDataset, List handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ModelDataset"; - - private Output handle; - - private ModelDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ModelDataset} + */ + public static class Options { + private Long algorithm; + + private Long cpuBudget; + + private Long ramBudget; + + private Options() { + } + + /** + * Sets the algorithm option. + * + * @param algorithm the algorithm option + * @return this Options instance. + */ + public Options algorithm(Long algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Sets the cpuBudget option. + * + * @param cpuBudget the cpuBudget option + * @return this Options instance. + */ + public Options cpuBudget(Long cpuBudget) { + this.cpuBudget = cpuBudget; + return this; + } + + /** + * Sets the ramBudget option. + * + * @param ramBudget the ramBudget option + * @return this Options instance. + */ + public Options ramBudget(Long ramBudget) { + this.ramBudget = ramBudget; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIterator.java index e6ee9d12c02..89552a58475 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIterator.java @@ -27,17 +27,29 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates a MultiDeviceIterator resource. */ public final class MultiDeviceIterator extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MultiDeviceIterator"; + + private Output handle; + + @SuppressWarnings("unchecked") + private MultiDeviceIterator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MultiDeviceIterator operation. - * + * * @param scope current scope * @param devices A list of devices the iterator works across. * @param sharedName If non-empty, this resource will be shared under the given name @@ -48,12 +60,15 @@ public final class MultiDeviceIterator extends RawOp implements Operand { * @param outputShapes The list of shapes being produced. * @return a new instance of MultiDeviceIterator */ - @Endpoint(describeByClass = true) - public static MultiDeviceIterator create(Scope scope, List devices, String sharedName, String container, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIterator create(Scope scope, List devices, String sharedName, + String container, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIterator", scope.makeOpName("MultiDeviceIterator")); opBuilder = scope.apply(opBuilder); String[] devicesArray = new String[devices.size()]; - for (int i = 0; i < devicesArray.length; ++i) { + for (int i = 0 ; i < devicesArray.length ; i++) { devicesArray[i] = devices.get(i); } opBuilder.setAttr("devices", devicesArray); @@ -61,34 +76,25 @@ public static MultiDeviceIterator create(Scope scope, List devices, Stri opBuilder.setAttr("container", container); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new MultiDeviceIterator(opBuilder.build()); } - + /** + * Gets handle. * Handle to the resource created. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIterator"; - - private Output handle; - - private MultiDeviceIterator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorFromStringHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorFromStringHandle.java index 5e6fdb1c640..58cf8dd6a46 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorFromStringHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorFromStringHandle.java @@ -17,6 +17,7 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -27,7 +28,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -35,37 +35,34 @@ * Generates a MultiDeviceIterator resource from its provided string handle. */ public final class MultiDeviceIteratorFromStringHandle extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.MultiDeviceIteratorFromStringHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param outputShapes The list of shapes being produced. - */ - public Options outputShapes(List outputShapes) { - this.outputShapes = outputShapes; - return this; - } - - private List outputShapes; - - private Options() { - } + public static final String OP_NAME = "MultiDeviceIteratorFromStringHandle"; + + private Output multiDeviceIterator; + + @SuppressWarnings("unchecked") + private MultiDeviceIteratorFromStringHandle(Operation operation) { + super(operation); + int outputIdx = 0; + multiDeviceIterator = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MultiDeviceIteratorFromStringHandle operation. - * + * * @param scope current scope * @param stringHandle String representing the resource. * @param outputTypes The type list for the return values. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of MultiDeviceIteratorFromStringHandle */ - @Endpoint(describeByClass = true) - public static MultiDeviceIteratorFromStringHandle create(Scope scope, Operand stringHandle, List> outputTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIteratorFromStringHandle create(Scope scope, + Operand stringHandle, List> outputTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIteratorFromStringHandle", scope.makeOpName("MultiDeviceIteratorFromStringHandle")); opBuilder.addInput(stringHandle.asOutput()); opBuilder = scope.apply(opBuilder); @@ -74,7 +71,7 @@ public static MultiDeviceIteratorFromStringHandle create(Scope scope, Operand outputShapes) { return new Options().outputShapes(outputShapes); } - + + /** + * Sets the outputShapes option. + * + * @param outputShapes The list of shapes being produced. + * @return this Options instance. + */ + public static Options outputShapes(Shape[] outputShapes) { + return new Options().outputShapes(outputShapes); + } + /** + * Gets multiDeviceIterator. * A MultiDeviceIterator resource. + * @return multiDeviceIterator. */ - public Output multiDeviceIterator() { + public Output multiDeviceIterator() { return multiDeviceIterator; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) multiDeviceIterator; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIteratorFromStringHandle"; - - private Output multiDeviceIterator; - - private MultiDeviceIteratorFromStringHandle(Operation operation) { - super(operation); - int outputIdx = 0; - multiDeviceIterator = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.MultiDeviceIteratorFromStringHandle} + */ + public static class Options { + private List outputShapes; + + private Options() { + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes The list of shapes being produced. + * @return this Options instance. + */ + public Options outputShapes(List outputShapes) { + this.outputShapes = outputShapes; + return this; + } + + /** + * Sets the outputShapes option. + * + * @param outputShapes The list of shapes being produced. + * @return this Options instance. + */ + public Options outputShapes(Shape... outputShapes) { + this.outputShapes = Arrays.asList(outputShapes); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorGetNextFromShard.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorGetNextFromShard.java index 578bf00fe78..bd70cf3d33c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorGetNextFromShard.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorGetNextFromShard.java @@ -29,7 +29,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -38,10 +37,25 @@ * Gets next element for the provided shard number. */ public final class MultiDeviceIteratorGetNextFromShard extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MultiDeviceIteratorGetNextFromShard"; + + private List> components; + + @SuppressWarnings("unchecked") + private MultiDeviceIteratorGetNextFromShard(Operation operation) { + super(operation); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; + } + /** * Factory method to create a class wrapping a new MultiDeviceIteratorGetNextFromShard operation. - * + * * @param scope current scope * @param multiDeviceIterator A MultiDeviceIterator resource. * @param shardNum Integer representing which shard to fetch data for. @@ -50,8 +64,13 @@ public final class MultiDeviceIteratorGetNextFromShard extends RawOp implements * @param outputShapes The list of shapes being produced. * @return a new instance of MultiDeviceIteratorGetNextFromShard */ - @Endpoint(describeByClass = true) - public static MultiDeviceIteratorGetNextFromShard create(Scope scope, Operand multiDeviceIterator, Operand shardNum, Operand incarnationId, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIteratorGetNextFromShard create(Scope scope, + Operand multiDeviceIterator, Operand shardNum, + Operand incarnationId, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIteratorGetNextFromShard", scope.makeOpName("MultiDeviceIteratorGetNextFromShard")); opBuilder.addInput(multiDeviceIterator.asOutput()); opBuilder.addInput(shardNum.asOutput()); @@ -59,36 +78,25 @@ public static MultiDeviceIteratorGetNextFromShard create(Scope scope, Operand opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new MultiDeviceIteratorGetNextFromShard(opBuilder.build()); } - + /** + * Gets components. * Result of the get_next on the dataset. + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIteratorGetNextFromShard"; - - private List> components; - - private MultiDeviceIteratorGetNextFromShard(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorInit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorInit.java index 3c57db226a5..e6f41f1c6e3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorInit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorInit.java @@ -24,25 +24,40 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Initializes the multi device iterator with the given dataset. */ public final class MultiDeviceIteratorInit extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MultiDeviceIteratorInit"; + + private Output incarnationId; + + private MultiDeviceIteratorInit(Operation operation) { + super(operation); + int outputIdx = 0; + incarnationId = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MultiDeviceIteratorInit operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static MultiDeviceIteratorInit create(Scope scope, Operand dataset, Operand multiDeviceIterator, Operand maxBufferSize) { + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIteratorInit create(Scope scope, Operand dataset, + Operand multiDeviceIterator, Operand maxBufferSize) { OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIteratorInit", scope.makeOpName("MultiDeviceIteratorInit")); opBuilder.addInput(dataset.asOutput()); opBuilder.addInput(multiDeviceIterator.asOutput()); @@ -50,28 +65,19 @@ public static MultiDeviceIteratorInit create(Scope scope, Operand dataset, Op opBuilder = scope.apply(opBuilder); return new MultiDeviceIteratorInit(opBuilder.build()); } - + /** + * Gets incarnationId. * An int64 indicating which incarnation of the MultiDeviceIterator * is running. + * @return incarnationId. */ public Output incarnationId() { return incarnationId; } - + @Override public Output asOutput() { return incarnationId; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIteratorInit"; - - private Output incarnationId; - - private MultiDeviceIteratorInit(Operation operation) { - super(operation); - int outputIdx = 0; - incarnationId = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorToStringHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorToStringHandle.java index 028d0a9497c..623530eb4f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorToStringHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/MultiDeviceIteratorToStringHandle.java @@ -24,49 +24,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Produces a string handle for the given MultiDeviceIterator. */ public final class MultiDeviceIteratorToStringHandle extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MultiDeviceIteratorToStringHandle"; + + private Output stringHandle; + + private MultiDeviceIteratorToStringHandle(Operation operation) { + super(operation); + int outputIdx = 0; + stringHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MultiDeviceIteratorToStringHandle operation. - * + * * @param scope current scope * @param multiDeviceIterator A MultiDeviceIterator resource. * @return a new instance of MultiDeviceIteratorToStringHandle */ - @Endpoint(describeByClass = true) - public static MultiDeviceIteratorToStringHandle create(Scope scope, Operand multiDeviceIterator) { + @Endpoint( + describeByClass = true + ) + public static MultiDeviceIteratorToStringHandle create(Scope scope, + Operand multiDeviceIterator) { OperationBuilder opBuilder = scope.env().opBuilder("MultiDeviceIteratorToStringHandle", scope.makeOpName("MultiDeviceIteratorToStringHandle")); opBuilder.addInput(multiDeviceIterator.asOutput()); opBuilder = scope.apply(opBuilder); return new MultiDeviceIteratorToStringHandle(opBuilder.build()); } - + /** + * Gets stringHandle. * A string representing the resource. + * @return stringHandle. */ public Output stringHandle() { return stringHandle; } - + @Override public Output asOutput() { return stringHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MultiDeviceIteratorToStringHandle"; - - private Output stringHandle; - - private MultiDeviceIteratorToStringHandle(Operation operation) { - super(operation); - int outputIdx = 0; - stringHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/NonSerializableDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/NonSerializableDataset.java index 49fece5850f..d6b6b043cf5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/NonSerializableDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/NonSerializableDataset.java @@ -27,56 +27,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The NonSerializableDataset operation */ public final class NonSerializableDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NonSerializableDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private NonSerializableDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NonSerializableDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of NonSerializableDataset */ - @Endpoint(describeByClass = true) - public static NonSerializableDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static NonSerializableDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("NonSerializableDataset", scope.makeOpName("NonSerializableDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new NonSerializableDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NonSerializableDataset"; - - private Output handle; - - private NonSerializableDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDataset.java index c9bd55a0320..3ee2024af63 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDataset.java @@ -17,6 +17,7 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -27,56 +28,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** - * Creates a dataset by applying optimizations to `input_dataset`. - *

- * Creates a dataset by applying optimizations to `input_dataset`. + * Creates a dataset by applying optimizations to {@code input_dataset}. + * Creates a dataset by applying optimizations to {@code input_dataset}. */ public final class OptimizeDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.OptimizeDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param optimizationConfigs - */ - public Options optimizationConfigs(List optimizationConfigs) { - this.optimizationConfigs = optimizationConfigs; - return this; - } - - private List optimizationConfigs; - - private Options() { - } + public static final String OP_NAME = "OptimizeDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private OptimizeDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OptimizeDataset operation. - * + * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. - * @param optimizations A `tf.string` vector `tf.Tensor` identifying optimizations to use. - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @param optimizations A {@code tf.string} vector {@code tf.Tensor} identifying optimizations to use. + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of OptimizeDataset */ - @Endpoint(describeByClass = true) - public static OptimizeDataset create(Scope scope, Operand inputDataset, Operand optimizations, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OptimizeDataset create(Scope scope, Operand inputDataset, + Operand optimizations, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OptimizeDataset", scope.makeOpName("OptimizeDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(optimizations.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -84,7 +81,7 @@ public static OptimizeDataset create(Scope scope, Operand inputDataset, Opera for (Options opts : options) { if (opts.optimizationConfigs != null) { String[] optimizationConfigsArray = new String[opts.optimizationConfigs.size()]; - for (int i = 0; i < optimizationConfigsArray.length; ++i) { + for (int i = 0 ; i < optimizationConfigsArray.length ; i++) { optimizationConfigsArray[i] = opts.optimizationConfigs.get(i); } opBuilder.setAttr("optimization_configs", optimizationConfigsArray); @@ -93,34 +90,71 @@ public static OptimizeDataset create(Scope scope, Operand inputDataset, Opera } return new OptimizeDataset(opBuilder.build()); } - + /** - * @param optimizationConfigs + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. */ public static Options optimizationConfigs(List optimizationConfigs) { return new Options().optimizationConfigs(optimizationConfigs); } - + + /** + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. + */ + public static Options optimizationConfigs(String[] optimizationConfigs) { + return new Options().optimizationConfigs(optimizationConfigs); + } + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptimizeDataset"; - - private Output handle; - - private OptimizeDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.OptimizeDataset} + */ + public static class Options { + private List optimizationConfigs; + + private Options() { + } + + /** + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. + */ + public Options optimizationConfigs(List optimizationConfigs) { + this.optimizationConfigs = optimizationConfigs; + return this; + } + + /** + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. + */ + public Options optimizationConfigs(String... optimizationConfigs) { + this.optimizationConfigs = Arrays.asList(optimizationConfigs); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDatasetV2.java index 06e90b20cbc..b0e1d15badf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDatasetV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptimizeDatasetV2.java @@ -17,6 +17,7 @@ package org.tensorflow.op.data; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -27,51 +28,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** - * Creates a dataset by applying related optimizations to `input_dataset`. - *

- * Creates a dataset by applying related optimizations to `input_dataset`. + * Creates a dataset by applying related optimizations to {@code input_dataset}. + * Creates a dataset by applying related optimizations to {@code input_dataset}. */ public final class OptimizeDatasetV2 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.OptimizeDatasetV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param optimizationConfigs - */ - public Options optimizationConfigs(List optimizationConfigs) { - this.optimizationConfigs = optimizationConfigs; - return this; - } - - private List optimizationConfigs; - - private Options() { - } + public static final String OP_NAME = "OptimizeDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private OptimizeDatasetV2(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OptimizeDatasetV2 operation. - * + * * @param scope current scope * @param inputDataset A variant tensor representing the input dataset. - * @param optimizationsEnabled A `tf.string` vector `tf.Tensor` identifying user enabled optimizations. - * @param optimizationsDisabled A `tf.string` vector `tf.Tensor` identifying user disabled optimizations. - * @param optimizationsDefault A `tf.string` vector `tf.Tensor` identifying optimizations by default. - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of OptimizeDatasetV2 */ - @Endpoint(describeByClass = true) - public static OptimizeDatasetV2 create(Scope scope, Operand inputDataset, Operand optimizationsEnabled, Operand optimizationsDisabled, Operand optimizationsDefault, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OptimizeDatasetV2 create(Scope scope, Operand inputDataset, + Operand optimizationsEnabled, Operand optimizationsDisabled, + Operand optimizationsDefault, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OptimizeDatasetV2", scope.makeOpName("OptimizeDatasetV2")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(optimizationsEnabled.asOutput()); @@ -80,7 +78,7 @@ public static OptimizeDatasetV2 create(Scope scope, Operand inputDataset, Ope opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -88,7 +86,7 @@ public static OptimizeDatasetV2 create(Scope scope, Operand inputDataset, Ope for (Options opts : options) { if (opts.optimizationConfigs != null) { String[] optimizationConfigsArray = new String[opts.optimizationConfigs.size()]; - for (int i = 0; i < optimizationConfigsArray.length; ++i) { + for (int i = 0 ; i < optimizationConfigsArray.length ; i++) { optimizationConfigsArray[i] = opts.optimizationConfigs.get(i); } opBuilder.setAttr("optimization_configs", optimizationConfigsArray); @@ -97,34 +95,71 @@ public static OptimizeDatasetV2 create(Scope scope, Operand inputDataset, Ope } return new OptimizeDatasetV2(opBuilder.build()); } - + /** - * @param optimizationConfigs + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. */ public static Options optimizationConfigs(List optimizationConfigs) { return new Options().optimizationConfigs(optimizationConfigs); } - + + /** + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. + */ + public static Options optimizationConfigs(String[] optimizationConfigs) { + return new Options().optimizationConfigs(optimizationConfigs); + } + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptimizeDatasetV2"; - - private Output handle; - - private OptimizeDatasetV2(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.OptimizeDatasetV2} + */ + public static class Options { + private List optimizationConfigs; + + private Options() { + } + + /** + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. + */ + public Options optimizationConfigs(List optimizationConfigs) { + this.optimizationConfigs = optimizationConfigs; + return this; + } + + /** + * Sets the optimizationConfigs option. + * + * @param optimizationConfigs the optimizationConfigs option + * @return this Options instance. + */ + public Options optimizationConfigs(String... optimizationConfigs) { + this.optimizationConfigs = Arrays.asList(optimizationConfigs); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java index 51a6f072b19..5182e8292cb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalFromValue.java @@ -31,44 +31,53 @@ /** * Constructs an Optional variant from a tuple of tensors. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class OptionalFromValue extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OptionalFromValue"; + + private Output optional; + + @SuppressWarnings("unchecked") + private OptionalFromValue(Operation operation) { + super(operation); + int outputIdx = 0; + optional = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OptionalFromValue operation. - * + * * @param scope current scope - * @param components + * @param components the components value * @return a new instance of OptionalFromValue */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OptionalFromValue create(Scope scope, Iterable> components) { OperationBuilder opBuilder = scope.env().opBuilder("OptionalFromValue", scope.makeOpName("OptionalFromValue")); opBuilder.addInputList(Operands.asOutputs(components)); opBuilder = scope.apply(opBuilder); return new OptionalFromValue(opBuilder.build()); } - + /** + * Gets optional. + * + * @return optional. */ - public Output optional() { + public Output optional() { return optional; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) optional; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptionalFromValue"; - - private Output optional; - - private OptionalFromValue(Operation operation) { - super(operation); - int outputIdx = 0; - optional = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalGetValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalGetValue.java index eeaa8d61642..f97316aef5a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalGetValue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalGetValue.java @@ -35,54 +35,64 @@ /** * Returns the value stored in an Optional variant or raises an error if none exists. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class OptionalGetValue extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OptionalGetValue"; + + private List> components; + + @SuppressWarnings("unchecked") + private OptionalGetValue(Operation operation) { + super(operation); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; + } + /** * Factory method to create a class wrapping a new OptionalGetValue operation. - * + * * @param scope current scope - * @param optional - * @param outputTypes - * @param outputShapes + * @param optional the optional value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of OptionalGetValue */ - @Endpoint(describeByClass = true) - public static OptionalGetValue create(Scope scope, Operand optional, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static OptionalGetValue create(Scope scope, Operand optional, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("OptionalGetValue", scope.makeOpName("OptionalGetValue")); opBuilder.addInput(optional.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new OptionalGetValue(opBuilder.build()); } - + /** + * Gets components. + * + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptionalGetValue"; - - private List> components; - - private OptionalGetValue(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalHasValue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalHasValue.java index 3d8da00f28e..1e178947fb9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalHasValue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalHasValue.java @@ -26,47 +26,56 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Returns true if and only if the given Optional variant has a value. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class OptionalHasValue extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OptionalHasValue"; + + private Output hasValue; + + private OptionalHasValue(Operation operation) { + super(operation); + int outputIdx = 0; + hasValue = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OptionalHasValue operation. - * + * * @param scope current scope - * @param optional + * @param optional the optional value * @return a new instance of OptionalHasValue */ - @Endpoint(describeByClass = true) - public static OptionalHasValue create(Scope scope, Operand optional) { + @Endpoint( + describeByClass = true + ) + public static OptionalHasValue create(Scope scope, Operand optional) { OperationBuilder opBuilder = scope.env().opBuilder("OptionalHasValue", scope.makeOpName("OptionalHasValue")); opBuilder.addInput(optional.asOutput()); opBuilder = scope.apply(opBuilder); return new OptionalHasValue(opBuilder.build()); } - + /** + * Gets hasValue. + * + * @return hasValue. */ public Output hasValue() { return hasValue; } - + @Override public Output asOutput() { return hasValue; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptionalHasValue"; - - private Output hasValue; - - private OptionalHasValue(Operation operation) { - super(operation); - int outputIdx = 0; - hasValue = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalNone.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalNone.java index 1262726a4b1..964867da2d8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalNone.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/OptionalNone.java @@ -30,42 +30,51 @@ /** * Creates an Optional variant with no value. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class OptionalNone extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OptionalNone"; + + private Output optional; + + @SuppressWarnings("unchecked") + private OptionalNone(Operation operation) { + super(operation); + int outputIdx = 0; + optional = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OptionalNone operation. - * + * * @param scope current scope * @return a new instance of OptionalNone */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OptionalNone create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("OptionalNone", scope.makeOpName("OptionalNone")); opBuilder = scope.apply(opBuilder); return new OptionalNone(opBuilder.build()); } - + /** + * Gets optional. + * + * @return optional. */ - public Output optional() { + public Output optional() { return optional; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) optional; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OptionalNone"; - - private Output optional; - - private OptionalNone(Operation operation) { - super(operation); - int outputIdx = 0; - optional = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PaddedBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PaddedBatchDataset.java index 24c19c1ebf6..34fb0f94ae4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PaddedBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PaddedBatchDataset.java @@ -27,56 +27,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Creates a dataset that batches and pads `batch_size` elements from the input. + * Creates a dataset that batches and pads {@code batch_size} elements from the input. */ public final class PaddedBatchDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.PaddedBatchDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param parallelCopy - */ - public Options parallelCopy(Boolean parallelCopy) { - this.parallelCopy = parallelCopy; - return this; - } - - private Boolean parallelCopy; - - private Options() { - } + public static final String OP_NAME = "PaddedBatchDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private PaddedBatchDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new PaddedBatchDataset operation. - * + * Factory method to create a class wrapping a new PaddedBatchDatasetV2 operation. + * * @param scope current scope - * @param inputDataset + * @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 `-1` to indicate that a particular dimension should be + * 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 - * @param options carries optional attributes values + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of PaddedBatchDataset */ - @Endpoint(describeByClass = true) - public static PaddedBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Iterable> paddedShapes, Iterable> paddingValues, Operand dropRemainder, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static PaddedBatchDataset create(Scope scope, Operand inputDataset, + Operand batchSize, Iterable> paddedShapes, + Iterable> paddingValues, Operand dropRemainder, List outputShapes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PaddedBatchDatasetV2", scope.makeOpName("PaddedBatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSize.asOutput()); @@ -85,7 +83,7 @@ public static PaddedBatchDataset create(Scope scope, Operand inputDataset, Op opBuilder.addInput(dropRemainder.asOutput()); opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -98,34 +96,50 @@ public static PaddedBatchDataset create(Scope scope, Operand inputDataset, Op } return new PaddedBatchDataset(opBuilder.build()); } - + /** - * @param parallelCopy + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. */ public static Options parallelCopy(Boolean parallelCopy) { return new Options().parallelCopy(parallelCopy); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PaddedBatchDatasetV2"; - - private Output handle; - - private PaddedBatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.PaddedBatchDataset} + */ + public static class Options { + private Boolean parallelCopy; + + private Options() { + } + + /** + * Sets the parallelCopy option. + * + * @param parallelCopy the parallelCopy option + * @return this Options instance. + */ + public Options parallelCopy(Boolean parallelCopy) { + this.parallelCopy = parallelCopy; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrefetchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrefetchDataset.java index 27409a575a9..9d3c49b4111 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrefetchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrefetchDataset.java @@ -27,73 +27,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Creates a dataset that asynchronously prefetches elements from `input_dataset`. + * Creates a dataset that asynchronously prefetches elements from {@code input_dataset}. */ public final class PrefetchDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.PrefetchDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param slackPeriod - */ - public Options slackPeriod(Long slackPeriod) { - this.slackPeriod = slackPeriod; - return this; - } - - /** - * @param legacyAutotune - */ - public Options legacyAutotune(Boolean legacyAutotune) { - this.legacyAutotune = legacyAutotune; - return this; - } - - /** - * @param bufferSizeMin - */ - public Options bufferSizeMin(Long bufferSizeMin) { - this.bufferSizeMin = bufferSizeMin; - return this; - } - - private Long slackPeriod; - private Boolean legacyAutotune; - private Long bufferSizeMin; - - private Options() { - } + public static final String OP_NAME = "PrefetchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private PrefetchDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new PrefetchDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset the inputDataset value * @param bufferSize The maximum number of elements to buffer in an iterator over * this dataset. - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of PrefetchDataset */ - @Endpoint(describeByClass = true) - public static PrefetchDataset create(Scope scope, Operand inputDataset, Operand bufferSize, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static PrefetchDataset create(Scope scope, Operand inputDataset, + Operand bufferSize, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PrefetchDataset", scope.makeOpName("PrefetchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(bufferSize.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -112,48 +91,96 @@ public static PrefetchDataset create(Scope scope, Operand inputDataset, Opera } return new PrefetchDataset(opBuilder.build()); } - + /** - * @param slackPeriod + * Sets the slackPeriod option. + * + * @param slackPeriod the slackPeriod option + * @return this Options instance. */ public static Options slackPeriod(Long slackPeriod) { return new Options().slackPeriod(slackPeriod); } - + /** - * @param legacyAutotune + * Sets the legacyAutotune option. + * + * @param legacyAutotune the legacyAutotune option + * @return this Options instance. */ public static Options legacyAutotune(Boolean legacyAutotune) { return new Options().legacyAutotune(legacyAutotune); } - + /** - * @param bufferSizeMin + * Sets the bufferSizeMin option. + * + * @param bufferSizeMin the bufferSizeMin option + * @return this Options instance. */ public static Options bufferSizeMin(Long bufferSizeMin) { return new Options().bufferSizeMin(bufferSizeMin); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PrefetchDataset"; - - private Output handle; - - private PrefetchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.PrefetchDataset} + */ + public static class Options { + private Long slackPeriod; + + private Boolean legacyAutotune; + + private Long bufferSizeMin; + + private Options() { + } + + /** + * Sets the slackPeriod option. + * + * @param slackPeriod the slackPeriod option + * @return this Options instance. + */ + public Options slackPeriod(Long slackPeriod) { + this.slackPeriod = slackPeriod; + return this; + } + + /** + * Sets the legacyAutotune option. + * + * @param legacyAutotune the legacyAutotune option + * @return this Options instance. + */ + public Options legacyAutotune(Boolean legacyAutotune) { + this.legacyAutotune = legacyAutotune; + return this; + } + + /** + * Sets the bufferSizeMin option. + * + * @param bufferSizeMin the bufferSizeMin option + * @return this Options instance. + */ + public Options bufferSizeMin(Long bufferSizeMin) { + this.bufferSizeMin = bufferSizeMin; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrivateThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrivateThreadPoolDataset.java index 92d7753b54a..ded8a1b216e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrivateThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/PrivateThreadPoolDataset.java @@ -27,60 +27,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Creates a dataset that uses a custom thread pool to compute `input_dataset`. + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ public final class PrivateThreadPoolDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "PrivateThreadPoolDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private PrivateThreadPoolDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new PrivateThreadPoolDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset the inputDataset value * @param numThreads Identifies the number of threads to use for the private threadpool. - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of PrivateThreadPoolDataset */ - @Endpoint(describeByClass = true) - public static PrivateThreadPoolDataset create(Scope scope, Operand inputDataset, Operand numThreads, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static PrivateThreadPoolDataset create(Scope scope, Operand inputDataset, + Operand numThreads, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("PrivateThreadPoolDataset", scope.makeOpName("PrivateThreadPoolDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numThreads.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new PrivateThreadPoolDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PrivateThreadPoolDataset"; - - private Output handle; - - private PrivateThreadPoolDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RandomDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RandomDataset.java index 5108bec6d0d..71002f903e2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RandomDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RandomDataset.java @@ -27,73 +27,77 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a Dataset that returns pseudorandom numbers. - *

* Creates a Dataset that returns a stream of uniformly distributed * pseudorandom 64-bit signed integers. - *

- * In the TensorFlow Python API, you can instantiate this dataset via the - * class `tf.data.experimental.RandomDataset`. - *

- * Instances of this dataset are also created as a result of the - * `hoist_random_uniform` static optimization. Whether this optimization is - * performed is determined by the `experimental_optimization.hoist_random_uniform` - * option of `tf.data.Options`. + *

In the TensorFlow Python API, you can instantiate this dataset via the + * class {@code tf.data.experimental.RandomDataset}. + *

Instances of this dataset are also created as a result of the + * {@code hoist_random_uniform} static optimization. Whether this optimization is + * performed is determined by the {@code experimental_optimization.hoist_random_uniform} + * option of {@code tf.data.Options}. */ public final class RandomDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RandomDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private RandomDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RandomDataset operation. - * + * * @param scope current scope * @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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of RandomDataset */ - @Endpoint(describeByClass = true) - public static RandomDataset create(Scope scope, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static RandomDataset create(Scope scope, Operand seed, Operand seed2, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("RandomDataset", scope.makeOpName("RandomDataset")); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new RandomDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomDataset"; - - private Output handle; - - private RandomDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RangeDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RangeDataset.java index 0acede3a72b..083200e4bfb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RangeDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RangeDataset.java @@ -34,22 +34,40 @@ /** * Creates a dataset with a range of values. Corresponds to python's xrange. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class RangeDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RangeDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private RangeDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RangeDataset operation. - * + * * @param scope current scope * @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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of RangeDataset */ - @Endpoint(describeByClass = true) - public static RangeDataset create(Scope scope, Operand start, Operand stop, Operand step, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static RangeDataset create(Scope scope, Operand start, Operand stop, + Operand step, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("RangeDataset", scope.makeOpName("RangeDataset")); opBuilder.addInput(start.asOutput()); opBuilder.addInput(stop.asOutput()); @@ -57,33 +75,25 @@ public static RangeDataset create(Scope scope, Operand start, Operand handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RangeDataset"; - - private Output handle; - - private RangeDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDataset.java index 4d73b0dbbcf..982bd16b905 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDataset.java @@ -27,59 +27,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that changes the batch size. - *

* Creates a dataset that changes the batch size of the dataset to current batch * size // num_workers. */ public final class RebatchDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.RebatchDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useFallback - */ - public Options useFallback(Boolean useFallback) { - this.useFallback = useFallback; - return this; - } - - private Boolean useFallback; - - private Options() { - } + public static final String OP_NAME = "RebatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private RebatchDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RebatchDataset operation. - * + * * @param scope current scope * @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 - * @param outputShapes - * @param options carries optional attributes values + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of RebatchDataset */ - @Endpoint(describeByClass = true) - public static RebatchDataset create(Scope scope, Operand inputDataset, Operand numReplicas, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RebatchDataset create(Scope scope, Operand inputDataset, + Operand numReplicas, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RebatchDataset", scope.makeOpName("RebatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numReplicas.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -92,34 +88,50 @@ public static RebatchDataset create(Scope scope, Operand inputDataset, Operan } return new RebatchDataset(opBuilder.build()); } - + /** - * @param useFallback + * Sets the useFallback option. + * + * @param useFallback the useFallback option + * @return this Options instance. */ public static Options useFallback(Boolean useFallback) { return new Options().useFallback(useFallback); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RebatchDataset"; - - private Output handle; - - private RebatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.RebatchDataset} + */ + public static class Options { + private Boolean useFallback; + + private Options() { + } + + /** + * Sets the useFallback option. + * + * @param useFallback the useFallback option + * @return this Options instance. + */ + public Options useFallback(Boolean useFallback) { + this.useFallback = useFallback; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDatasetV2.java index dd39cda094b..d3a6158133c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDatasetV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RebatchDatasetV2.java @@ -27,33 +27,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that changes the batch size. - *

- * Creates a dataset that rebatches elements from `input_dataset` into new batch + * Creates a dataset that rebatches elements from {@code input_dataset} into new batch * sizes. */ public final class RebatchDatasetV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RebatchDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private RebatchDatasetV2(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RebatchDatasetV2 operation. - * + * * @param scope current scope * @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 - * @param outputTypes - * @param outputShapes + * @param dropRemainder the dropRemainder value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of RebatchDatasetV2 */ - @Endpoint(describeByClass = true) - public static RebatchDatasetV2 create(Scope scope, Operand inputDataset, Operand batchSizes, Operand dropRemainder, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static RebatchDatasetV2 create(Scope scope, Operand inputDataset, + Operand batchSizes, Operand dropRemainder, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("RebatchDatasetV2", scope.makeOpName("RebatchDatasetV2")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSizes.asOutput()); @@ -61,33 +76,25 @@ public static RebatchDatasetV2 create(Scope scope, Operand inputDataset, Oper opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new RebatchDatasetV2(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RebatchDatasetV2"; - - private Output handle; - - private RebatchDatasetV2(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RegisterDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RegisterDataset.java index a211c35c009..73fccce5c3e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RegisterDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RegisterDataset.java @@ -24,27 +24,42 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Registers a dataset with the tf.data service. */ public final class RegisterDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RegisterDataset"; + + private Output datasetId; + + private RegisterDataset(Operation operation) { + super(operation); + int outputIdx = 0; + datasetId = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RegisterDataset operation. - * + * * @param scope current scope - * @param dataset - * @param address - * @param protocol - * @param externalStatePolicy + * @param dataset the dataset value + * @param address the address value + * @param protocol the protocol value + * @param externalStatePolicy the value of the externalStatePolicy property * @return a new instance of RegisterDataset */ - @Endpoint(describeByClass = true) - public static RegisterDataset create(Scope scope, Operand dataset, Operand address, Operand protocol, Long externalStatePolicy) { + @Endpoint( + describeByClass = true + ) + public static RegisterDataset create(Scope scope, Operand dataset, + Operand address, Operand protocol, Long externalStatePolicy) { OperationBuilder opBuilder = scope.env().opBuilder("RegisterDataset", scope.makeOpName("RegisterDataset")); opBuilder.addInput(dataset.asOutput()); opBuilder.addInput(address.asOutput()); @@ -53,26 +68,18 @@ public static RegisterDataset create(Scope scope, Operand dataset, Operand datasetId() { return datasetId; } - + @Override public Output asOutput() { return datasetId; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RegisterDataset"; - - private Output datasetId; - - private RegisterDataset(Operation operation) { - super(operation); - int outputIdx = 0; - datasetId = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RepeatDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RepeatDataset.java index ad327527c06..cc208dd626d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RepeatDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/RepeatDataset.java @@ -32,57 +32,67 @@ import org.tensorflow.types.family.TType; /** - * Creates a dataset that emits the outputs of `input_dataset` `count` times. + * Creates a dataset that emits the outputs of {@code input_dataset} {@code count} times. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class RepeatDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RepeatDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private RepeatDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RepeatDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param count A scalar representing the number of times that `input_dataset` should - * be repeated. A value of `-1` indicates that it should be repeated infinitely. - * @param outputTypes - * @param outputShapes + * @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 property + * @param outputShapes the value of the outputShapes property * @return a new instance of RepeatDataset */ - @Endpoint(describeByClass = true) - public static RepeatDataset create(Scope scope, Operand inputDataset, Operand count, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static RepeatDataset create(Scope scope, Operand inputDataset, + Operand count, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("RepeatDataset", scope.makeOpName("RepeatDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(count.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new RepeatDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RepeatDataset"; - - private Output handle; - - private RepeatDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SamplingDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SamplingDataset.java index 7f67f238136..0f602e6c528 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SamplingDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SamplingDataset.java @@ -27,37 +27,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Creates a dataset that takes a Bernoulli sample of the contents of another dataset. - *

- * There is no transformation in the `tf.data` Python API for creating this dataset. - * Instead, it is created as a result of the `filter_with_random_uniform_fusion` + * 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 - * `experimental_optimization.filter_with_random_uniform_fusion` option of - * `tf.data.Options`. + * {@code experimental_optimization.filter_with_random_uniform_fusion} option of + * {@code tf.data.Options}. */ public final class SamplingDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SamplingDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SamplingDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SamplingDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param rate A scalar representing the sample rate. Each element of `input_dataset` is + * @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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of SamplingDataset */ - @Endpoint(describeByClass = true) - public static SamplingDataset create(Scope scope, Operand inputDataset, Operand rate, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SamplingDataset create(Scope scope, Operand inputDataset, + Operand rate, Operand seed, Operand seed2, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("SamplingDataset", scope.makeOpName("SamplingDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(rate.asOutput()); @@ -66,33 +81,25 @@ public static SamplingDataset create(Scope scope, Operand inputDataset, Opera opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SamplingDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SamplingDataset"; - - private Output handle; - - private SamplingDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SerializeIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SerializeIterator.java index 4e9449781db..8f70a020ed1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SerializeIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SerializeIterator.java @@ -28,40 +28,39 @@ import org.tensorflow.types.family.TType; /** - * Converts the given `resource_handle` representing an iterator to a variant tensor. + * Converts the given {@code resource_handle} representing an iterator to a variant tensor. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class SerializeIterator extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.SerializeIterator} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param externalStatePolicy - */ - public Options externalStatePolicy(Long externalStatePolicy) { - this.externalStatePolicy = externalStatePolicy; - return this; - } - - private Long externalStatePolicy; - - private Options() { - } + public static final String OP_NAME = "SerializeIterator"; + + private Output serialized; + + @SuppressWarnings("unchecked") + private SerializeIterator(Operation operation) { + super(operation); + int outputIdx = 0; + serialized = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SerializeIterator operation. - * + * * @param scope current scope * @param resourceHandle A handle to an iterator resource. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of SerializeIterator */ - @Endpoint(describeByClass = true) - public static SerializeIterator create(Scope scope, Operand resourceHandle, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SerializeIterator create(Scope scope, Operand resourceHandle, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SerializeIterator", scope.makeOpName("SerializeIterator")); opBuilder.addInput(resourceHandle.asOutput()); opBuilder = scope.apply(opBuilder); @@ -74,36 +73,51 @@ public static SerializeIterator create(Scope scope, Operand resourceHandle, O } return new SerializeIterator(opBuilder.build()); } - + /** - * @param externalStatePolicy + * Sets the externalStatePolicy option. + * + * @param externalStatePolicy the externalStatePolicy option + * @return this Options instance. */ public static Options externalStatePolicy(Long externalStatePolicy) { return new Options().externalStatePolicy(externalStatePolicy); } - + /** + * Gets serialized. * A variant tensor storing the state of the iterator contained in the * resource. + * @return serialized. */ - public Output serialized() { + public Output serialized() { return serialized; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) serialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SerializeIterator"; - - private Output serialized; - - private SerializeIterator(Operation operation) { - super(operation); - int outputIdx = 0; - serialized = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.SerializeIterator} + */ + public static class Options { + private Long externalStatePolicy; + + private Options() { + } + + /** + * Sets the externalStatePolicy option. + * + * @param externalStatePolicy the externalStatePolicy option + * @return this Options instance. + */ + public Options externalStatePolicy(Long externalStatePolicy) { + this.externalStatePolicy = externalStatePolicy; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SetStatsAggregatorDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SetStatsAggregatorDataset.java index 7e774e3a103..e72e914bdbc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SetStatsAggregatorDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SetStatsAggregatorDataset.java @@ -27,28 +27,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The SetStatsAggregatorDataset operation */ public final class SetStatsAggregatorDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SetStatsAggregatorDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SetStatsAggregatorDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SetStatsAggregatorDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param statsAggregator - * @param tag - * @param counterPrefix - * @param outputTypes - * @param outputShapes + * @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 property + * @param outputShapes the value of the outputShapes property * @return a new instance of SetStatsAggregatorDataset */ - @Endpoint(describeByClass = true) - public static SetStatsAggregatorDataset create(Scope scope, Operand inputDataset, Operand statsAggregator, Operand tag, Operand counterPrefix, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SetStatsAggregatorDataset create(Scope scope, Operand inputDataset, + Operand statsAggregator, Operand tag, + Operand counterPrefix, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("SetStatsAggregatorDataset", scope.makeOpName("SetStatsAggregatorDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(statsAggregator.asOutput()); @@ -57,33 +75,25 @@ public static SetStatsAggregatorDataset create(Scope scope, Operand inputData opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SetStatsAggregatorDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SetStatsAggregatorDataset"; - - private Output handle; - - private SetStatsAggregatorDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShardDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShardDataset.java index 53b184949e7..95509b8fede 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShardDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShardDataset.java @@ -27,48 +27,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Creates a `Dataset` that includes only 1/`num_shards` of this dataset. + * Creates a {@code Dataset} that includes only 1/{@code num_shards} of this dataset. */ public final class ShardDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.ShardDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param requireNonEmpty - */ - public Options requireNonEmpty(Boolean requireNonEmpty) { - this.requireNonEmpty = requireNonEmpty; - return this; - } - - private Boolean requireNonEmpty; - - private Options() { - } + public static final String OP_NAME = "ShardDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ShardDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ShardDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @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 - * @param outputShapes - * @param options carries optional attributes values + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of ShardDataset */ - @Endpoint(describeByClass = true) - public static ShardDataset create(Scope scope, Operand inputDataset, Operand numShards, Operand index, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ShardDataset create(Scope scope, Operand inputDataset, + Operand numShards, Operand index, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ShardDataset", scope.makeOpName("ShardDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numShards.asOutput()); @@ -76,7 +73,7 @@ public static ShardDataset create(Scope scope, Operand inputDataset, Operand< opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -89,34 +86,50 @@ public static ShardDataset create(Scope scope, Operand inputDataset, Operand< } return new ShardDataset(opBuilder.build()); } - + /** - * @param requireNonEmpty + * Sets the requireNonEmpty option. + * + * @param requireNonEmpty the requireNonEmpty option + * @return this Options instance. */ public static Options requireNonEmpty(Boolean requireNonEmpty) { return new Options().requireNonEmpty(requireNonEmpty); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShardDataset"; - - private Output handle; - - private ShardDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ShardDataset} + */ + public static class Options { + private Boolean requireNonEmpty; + + private Options() { + } + + /** + * Sets the requireNonEmpty option. + * + * @param requireNonEmpty the requireNonEmpty option + * @return this Options instance. + */ + public Options requireNonEmpty(Boolean requireNonEmpty) { + this.requireNonEmpty = requireNonEmpty; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleAndRepeatDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleAndRepeatDataset.java index bc486a3777c..634a2aec7d2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleAndRepeatDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleAndRepeatDataset.java @@ -27,50 +27,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** + * The ShuffleAndRepeatDatasetV2 operation */ public final class ShuffleAndRepeatDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.ShuffleAndRepeatDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param reshuffleEachIteration - */ - public Options reshuffleEachIteration(Boolean reshuffleEachIteration) { - this.reshuffleEachIteration = reshuffleEachIteration; - return this; - } - - private Boolean reshuffleEachIteration; - - private Options() { - } + public static final String OP_NAME = "ShuffleAndRepeatDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ShuffleAndRepeatDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ShuffleAndRepeatDataset operation. - * + * Factory method to create a class wrapping a new ShuffleAndRepeatDatasetV2 operation. + * * @param scope current scope - * @param inputDataset - * @param bufferSize - * @param seed - * @param seed2 - * @param count - * @param seedGenerator - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of ShuffleAndRepeatDataset */ - @Endpoint(describeByClass = true) - public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDataset, Operand bufferSize, Operand seed, Operand seed2, Operand count, Operand seedGenerator, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDataset, + Operand bufferSize, Operand seed, Operand seed2, + Operand count, Operand seedGenerator, + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ShuffleAndRepeatDatasetV2", scope.makeOpName("ShuffleAndRepeatDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(bufferSize.asOutput()); @@ -81,7 +80,7 @@ public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDatase opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -94,34 +93,50 @@ public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDatase } return new ShuffleAndRepeatDataset(opBuilder.build()); } - + /** - * @param reshuffleEachIteration + * Sets the reshuffleEachIteration option. + * + * @param reshuffleEachIteration the reshuffleEachIteration option + * @return this Options instance. */ public static Options reshuffleEachIteration(Boolean reshuffleEachIteration) { return new Options().reshuffleEachIteration(reshuffleEachIteration); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShuffleAndRepeatDatasetV2"; - - private Output handle; - - private ShuffleAndRepeatDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ShuffleAndRepeatDataset} + */ + public static class Options { + private Boolean reshuffleEachIteration; + + private Options() { + } + + /** + * Sets the reshuffleEachIteration option. + * + * @param reshuffleEachIteration the reshuffleEachIteration option + * @return this Options instance. + */ + public Options reshuffleEachIteration(Boolean reshuffleEachIteration) { + this.reshuffleEachIteration = reshuffleEachIteration; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleDataset.java index d458c12b68c..ee99e969798 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ShuffleDataset.java @@ -27,49 +27,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** + * The ShuffleDatasetV3 operation */ public final class ShuffleDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.ShuffleDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param reshuffleEachIteration - */ - public Options reshuffleEachIteration(Boolean reshuffleEachIteration) { - this.reshuffleEachIteration = reshuffleEachIteration; - return this; - } - - private Boolean reshuffleEachIteration; - - private Options() { - } + public static final String OP_NAME = "ShuffleDatasetV3"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ShuffleDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ShuffleDataset operation. - * + * Factory method to create a class wrapping a new ShuffleDatasetV3 operation. + * * @param scope current scope - * @param inputDataset - * @param bufferSize - * @param seed - * @param seed2 - * @param seedGenerator - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of ShuffleDataset */ - @Endpoint(describeByClass = true) - public static ShuffleDataset create(Scope scope, Operand inputDataset, Operand bufferSize, Operand seed, Operand seed2, Operand seedGenerator, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ShuffleDataset create(Scope scope, Operand inputDataset, + Operand bufferSize, Operand seed, Operand seed2, + Operand seedGenerator, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ShuffleDatasetV3", scope.makeOpName("ShuffleDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(bufferSize.asOutput()); @@ -79,7 +78,7 @@ public static ShuffleDataset create(Scope scope, Operand inputDataset, Operan opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -92,34 +91,50 @@ public static ShuffleDataset create(Scope scope, Operand inputDataset, Operan } return new ShuffleDataset(opBuilder.build()); } - + /** - * @param reshuffleEachIteration + * Sets the reshuffleEachIteration option. + * + * @param reshuffleEachIteration the reshuffleEachIteration option + * @return this Options instance. */ public static Options reshuffleEachIteration(Boolean reshuffleEachIteration) { return new Options().reshuffleEachIteration(reshuffleEachIteration); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShuffleDatasetV3"; - - private Output handle; - - private ShuffleDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ShuffleDataset} + */ + public static class Options { + private Boolean reshuffleEachIteration; + + private Options() { + } + + /** + * Sets the reshuffleEachIteration option. + * + * @param reshuffleEachIteration the reshuffleEachIteration option + * @return this Options instance. + */ + public Options reshuffleEachIteration(Boolean reshuffleEachIteration) { + this.reshuffleEachIteration = reshuffleEachIteration; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SkipDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SkipDataset.java index dea92ac046b..ab8e7433809 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SkipDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SkipDataset.java @@ -32,57 +32,67 @@ import org.tensorflow.types.family.TType; /** - * Creates a dataset that skips `count` elements from the `input_dataset`. + * Creates a dataset that skips {@code count} elements from the {@code input_dataset}. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class SkipDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SkipDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SkipDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SkipDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param count A scalar representing the number of elements from the `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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of SkipDataset */ - @Endpoint(describeByClass = true) - public static SkipDataset create(Scope scope, Operand inputDataset, Operand count, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SkipDataset create(Scope scope, Operand inputDataset, + Operand count, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("SkipDataset", scope.makeOpName("SkipDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(count.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SkipDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SkipDataset"; - - private Output handle; - - private SkipDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SleepDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SleepDataset.java index 926cc93fe89..a34a262886a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SleepDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SleepDataset.java @@ -27,59 +27,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** + * The SleepDataset operation */ public final class SleepDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SleepDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SleepDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SleepDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param sleepMicroseconds - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param sleepMicroseconds the sleepMicroseconds value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of SleepDataset */ - @Endpoint(describeByClass = true) - public static SleepDataset create(Scope scope, Operand inputDataset, Operand sleepMicroseconds, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SleepDataset create(Scope scope, Operand inputDataset, + Operand sleepMicroseconds, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("SleepDataset", scope.makeOpName("SleepDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(sleepMicroseconds.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SleepDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SleepDataset"; - - private Output handle; - - private SleepDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SlidingWindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SlidingWindowDataset.java index 2c10ea43cd9..ec77f306bb8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SlidingWindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SlidingWindowDataset.java @@ -27,32 +27,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Creates a dataset that passes a sliding window over `input_dataset`. + * Creates a dataset that passes a sliding window over {@code input_dataset}. */ public final class SlidingWindowDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SlidingWindowDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SlidingWindowDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SlidingWindowDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of SlidingWindowDataset */ - @Endpoint(describeByClass = true) - public static SlidingWindowDataset create(Scope scope, Operand inputDataset, Operand windowSize, Operand windowShift, Operand windowStride, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SlidingWindowDataset create(Scope scope, Operand inputDataset, + Operand windowSize, Operand windowShift, Operand windowStride, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("SlidingWindowDataset", scope.makeOpName("SlidingWindowDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(windowSize.asOutput()); @@ -61,33 +77,25 @@ public static SlidingWindowDataset create(Scope scope, Operand inputDataset, opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SlidingWindowDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SlidingWindowDataset"; - - private Output handle; - - private SlidingWindowDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SparseTensorSliceDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SparseTensorSliceDataset.java index 540355e650b..ab51a3fe1da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SparseTensorSliceDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SparseTensorSliceDataset.java @@ -24,7 +24,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -32,18 +31,34 @@ * Creates a dataset that splits a SparseTensor into elements row-wise. */ public final class SparseTensorSliceDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseTensorSliceDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SparseTensorSliceDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseTensorSliceDataset operation. - * + * * @param scope current scope - * @param indices - * @param values - * @param denseShape + * @param indices the indices value + * @param values the values value + * @param denseShape the denseShape value * @return a new instance of SparseTensorSliceDataset */ - @Endpoint(describeByClass = true) - public static SparseTensorSliceDataset create(Scope scope, Operand indices, Operand values, Operand denseShape) { + @Endpoint( + describeByClass = true + ) + public static SparseTensorSliceDataset create(Scope scope, Operand indices, + Operand values, Operand denseShape) { OperationBuilder opBuilder = scope.env().opBuilder("SparseTensorSliceDataset", scope.makeOpName("SparseTensorSliceDataset")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); @@ -51,27 +66,19 @@ public static SparseTensorSliceDataset create(Scope scope, Operand indic opBuilder = scope.apply(opBuilder); return new SparseTensorSliceDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseTensorSliceDataset"; - - private Output handle; - - private SparseTensorSliceDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SqlDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SqlDataset.java index e22c4f13bb1..f4f38e09b8f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SqlDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/SqlDataset.java @@ -27,7 +27,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -35,20 +34,37 @@ * Creates a dataset that executes a SQL query and emits rows of the result set. */ public final class SqlDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SqlDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SqlDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SqlDataset operation. - * + * * @param scope current scope * @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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of SqlDataset */ - @Endpoint(describeByClass = true) - public static SqlDataset create(Scope scope, Operand driverName, Operand dataSourceName, Operand query, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SqlDataset create(Scope scope, Operand driverName, + Operand dataSourceName, Operand query, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("SqlDataset", scope.makeOpName("SqlDataset")); opBuilder.addInput(driverName.asOutput()); opBuilder.addInput(dataSourceName.asOutput()); @@ -56,33 +72,25 @@ public static SqlDataset create(Scope scope, Operand driverName, Operan opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SqlDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SqlDataset"; - - private Output handle; - - private SqlDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorHandle.java index 5a2f602bf62..5dca7232d89 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/StatsAggregatorHandle.java @@ -24,50 +24,36 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates a statistics manager resource. */ public final class StatsAggregatorHandle extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.StatsAggregatorHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "StatsAggregatorHandle"; + + private Output handle; + + @SuppressWarnings("unchecked") + private StatsAggregatorHandle(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StatsAggregatorHandle operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StatsAggregatorHandle */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StatsAggregatorHandle create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StatsAggregatorHandle", scope.makeOpName("StatsAggregatorHandle")); opBuilder = scope.apply(opBuilder); @@ -83,41 +69,73 @@ public static StatsAggregatorHandle create(Scope scope, Options... options) { } return new StatsAggregatorHandle(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatsAggregatorHandle"; - - private Output handle; - - private StatsAggregatorHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.StatsAggregatorHandle} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeDataset.java index 61d3ebc7916..a266eb15319 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TakeDataset.java @@ -32,58 +32,68 @@ import org.tensorflow.types.family.TType; /** - * Creates a dataset that contains `count` elements from the `input_dataset`. + * Creates a dataset that contains {@code count} elements from the {@code input_dataset}. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class TakeDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TakeDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private TakeDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TakeDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param count A scalar representing the number of elements from the `input_dataset` - * that should be taken. A value of `-1` indicates that all of `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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of TakeDataset */ - @Endpoint(describeByClass = true) - public static TakeDataset create(Scope scope, Operand inputDataset, Operand count, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static TakeDataset create(Scope scope, Operand inputDataset, + Operand count, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("TakeDataset", scope.makeOpName("TakeDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(count.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new TakeDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TakeDataset"; - - private Output handle; - - private TakeDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorDataset.java index 87dd3df1dbd..163886415ca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorDataset.java @@ -27,55 +27,62 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset that emits `components` as a tuple of tensors once. + * Creates a dataset that emits {@code components} as a tuple of tensors once. */ public final class TensorDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private TensorDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorDataset operation. - * + * * @param scope current scope - * @param components - * @param outputShapes + * @param components the components value + * @param outputShapes the value of the outputShapes property * @return a new instance of TensorDataset */ - @Endpoint(describeByClass = true) - public static TensorDataset create(Scope scope, Iterable> components, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static TensorDataset create(Scope scope, Iterable> components, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("TensorDataset", scope.makeOpName("TensorDataset")); opBuilder.addInputList(Operands.asOutputs(components)); opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new TensorDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorDataset"; - - private Output handle; - - private TensorDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorSliceDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorSliceDataset.java index 6af845b1176..47a755e5fd2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorSliceDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TensorSliceDataset.java @@ -31,52 +31,62 @@ import org.tensorflow.types.family.TType; /** - * Creates a dataset that emits each dim-0 slice of `components` once. + * Creates a dataset that emits each dim-0 slice of {@code components} once. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class TensorSliceDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorSliceDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private TensorSliceDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TensorSliceDataset operation. - * + * * @param scope current scope - * @param components - * @param outputShapes + * @param components the components value + * @param outputShapes the value of the outputShapes property * @return a new instance of TensorSliceDataset */ - @Endpoint(describeByClass = true) - public static TensorSliceDataset create(Scope scope, Iterable> components, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static TensorSliceDataset create(Scope scope, Iterable> components, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("TensorSliceDataset", scope.makeOpName("TensorSliceDataset")); opBuilder.addInputList(Operands.asOutputs(components)); opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new TensorSliceDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorSliceDataset"; - - private Output handle; - - private TensorSliceDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TextLineDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TextLineDataset.java index efa9ea5ba94..61ece6c9b65 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TextLineDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TextLineDataset.java @@ -32,22 +32,40 @@ /** * Creates a dataset that emits the lines of one or more text files. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class TextLineDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TextLineDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private TextLineDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TextLineDataset operation. - * + * * @param scope current scope * @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". + * compression), (ii) "ZLIB", or (iii) "GZIP". * @param bufferSize A scalar containing the number of bytes to buffer. * @return a new instance of TextLineDataset */ - @Endpoint(describeByClass = true) - public static TextLineDataset create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize) { + @Endpoint( + describeByClass = true + ) + public static TextLineDataset create(Scope scope, Operand filenames, + Operand compressionType, Operand bufferSize) { OperationBuilder opBuilder = scope.env().opBuilder("TextLineDataset", scope.makeOpName("TextLineDataset")); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); @@ -55,27 +73,19 @@ public static TextLineDataset create(Scope scope, Operand filenames, Op opBuilder = scope.apply(opBuilder); return new TextLineDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TextLineDataset"; - - private Output handle; - - private TextLineDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TfRecordDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TfRecordDataset.java index de774c113b4..d79e936fb32 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TfRecordDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/TfRecordDataset.java @@ -32,23 +32,41 @@ /** * Creates a dataset that emits the records from one or more TFRecord files. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class TfRecordDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TfRecordDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TFRecordDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private TfRecordDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TFRecordDataset operation. + * * @param scope current scope * @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". + * 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. * @return a new instance of TfRecordDataset */ - @Endpoint(describeByClass = true) - public static TfRecordDataset create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize) { + @Endpoint( + describeByClass = true + ) + public static TfRecordDataset create(Scope scope, Operand filenames, + Operand compressionType, Operand bufferSize) { OperationBuilder opBuilder = scope.env().opBuilder("TFRecordDataset", scope.makeOpName("TfRecordDataset")); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); @@ -56,27 +74,19 @@ public static TfRecordDataset create(Scope scope, Operand filenames, Op opBuilder = scope.apply(opBuilder); return new TfRecordDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TFRecordDataset"; - - private Output handle; - - private TfRecordDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolDataset.java index fe1f7d9f859..ea90a856b7f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolDataset.java @@ -27,59 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset that uses a custom thread pool to compute `input_dataset`. + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ public final class ThreadPoolDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ThreadPoolDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ThreadPoolDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ThreadPoolDataset operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset the inputDataset value * @param threadPool A resource produced by the ThreadPoolHandle op. - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of ThreadPoolDataset */ - @Endpoint(describeByClass = true) - public static ThreadPoolDataset create(Scope scope, Operand inputDataset, Operand threadPool, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static ThreadPoolDataset create(Scope scope, Operand inputDataset, + Operand threadPool, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ThreadPoolDataset", scope.makeOpName("ThreadPoolDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(threadPool.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ThreadPoolDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ThreadPoolDataset"; - - private Output handle; - - private ThreadPoolDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolHandle.java index e45932145c1..669aa031783 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ThreadPoolHandle.java @@ -24,65 +24,42 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset that uses a custom thread pool to compute `input_dataset`. + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ public final class ThreadPoolHandle extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.ThreadPoolHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this - * threadpool. - */ - public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { - this.maxIntraOpParallelism = maxIntraOpParallelism; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long maxIntraOpParallelism; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "ThreadPoolHandle"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ThreadPoolHandle(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ThreadPoolHandle operation. - * + * * @param scope current scope * @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. * threadpool. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ThreadPoolHandle */ - @Endpoint(describeByClass = true) - public static ThreadPoolHandle create(Scope scope, Long numThreads, String displayName, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ThreadPoolHandle create(Scope scope, Long numThreads, String displayName, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ThreadPoolHandle", scope.makeOpName("ThreadPoolHandle")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_threads", numThreads); @@ -102,51 +79,99 @@ public static ThreadPoolHandle create(Scope scope, Long numThreads, String displ } return new ThreadPoolHandle(opBuilder.build()); } - + /** + * Sets the maxIntraOpParallelism option. + * * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this * threadpool. + * @return this Options instance. */ public static Options maxIntraOpParallelism(Long maxIntraOpParallelism) { return new Options().maxIntraOpParallelism(maxIntraOpParallelism); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * A resource that can be consumed by one or more ExperimentalThreadPoolDataset * ops. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ThreadPoolHandle"; - - private Output handle; - - private ThreadPoolHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.ThreadPoolHandle} + */ + public static class Options { + private Long maxIntraOpParallelism; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the maxIntraOpParallelism option. + * + * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this + * threadpool. + * @return this Options instance. + */ + public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { + this.maxIntraOpParallelism = maxIntraOpParallelism; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnbatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnbatchDataset.java index 1e8cc5cd305..257705cc485 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnbatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnbatchDataset.java @@ -27,57 +27,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A dataset that splits the elements of its input into multiple elements. */ public final class UnbatchDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnbatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private UnbatchDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnbatchDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of UnbatchDataset */ - @Endpoint(describeByClass = true) - public static UnbatchDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static UnbatchDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("UnbatchDataset", scope.makeOpName("UnbatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new UnbatchDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnbatchDataset"; - - private Output handle; - - private UnbatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UniqueDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UniqueDataset.java index 6bd918a3db0..790f2c1da5e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UniqueDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UniqueDataset.java @@ -27,57 +27,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset that contains the unique elements of `input_dataset`. + * Creates a dataset that contains the unique elements of {@code input_dataset}. */ public final class UniqueDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UniqueDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private UniqueDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UniqueDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of UniqueDataset */ - @Endpoint(describeByClass = true) - public static UniqueDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static UniqueDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("UniqueDataset", scope.makeOpName("UniqueDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new UniqueDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UniqueDataset"; - - private Output handle; - - private UniqueDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnwrapDatasetVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnwrapDatasetVariant.java index 7798ca8c9cd..98a0399ba8d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnwrapDatasetVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/UnwrapDatasetVariant.java @@ -24,48 +24,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The UnwrapDatasetVariant operation */ public final class UnwrapDatasetVariant extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnwrapDatasetVariant"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private UnwrapDatasetVariant(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnwrapDatasetVariant operation. - * + * * @param scope current scope - * @param inputHandle + * @param inputHandle the inputHandle value * @return a new instance of UnwrapDatasetVariant */ - @Endpoint(describeByClass = true) - public static UnwrapDatasetVariant create(Scope scope, Operand inputHandle) { + @Endpoint( + describeByClass = true + ) + public static UnwrapDatasetVariant create(Scope scope, Operand inputHandle) { OperationBuilder opBuilder = scope.env().opBuilder("UnwrapDatasetVariant", scope.makeOpName("UnwrapDatasetVariant")); opBuilder.addInput(inputHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new UnwrapDatasetVariant(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnwrapDatasetVariant"; - - private Output outputHandle; - - private UnwrapDatasetVariant(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowDataset.java index a44807564c1..f6ed2ea62a9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WindowDataset.java @@ -27,114 +27,117 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Combines (nests of) input elements into a dataset of (nests of) windows. - *

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

- * The `shift` argument determines the number of input elements by which - * the window moves on each iteration. The first element in the `k`th window - * will be element - *

- *

{@code
- *   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 `stride` parameter is greater than 1, then each window will skip - * `(stride - 1)` input elements between each element that appears in the - * window. Output windows will still contain `size` elements regardless of - * the value of `stride`. - *

- * The `stride` argument determines the stride of the input elements, and the - * `shift` argument determines the shift of the window. - *

- * For example, letting `{...}` to represent a Dataset: - *

- * - `tf.data.Dataset.range(7).window(2)` produces - * `{{0, 1}, {2, 3}, {4, 5}, {6}}` - * - `tf.data.Dataset.range(7).window(3, 2, 1, True)` produces - * `{{0, 1, 2}, {2, 3, 4}, {4, 5, 6}}` - * - `tf.data.Dataset.range(7).window(3, 1, 2, True)` produces - * `{{0, 2, 4}, {1, 3, 5}, {2, 4, 6}}` - *

- * Note that when the `window` transformation is applied to a dataset of - * nested elements, it produces a dataset of nested windows. - *

- * For example: - *

- * - `tf.data.Dataset.from_tensor_slices((range(4), range(4))).window(2)` - * produces `{({0, 1}, {0, 1}), ({2, 3}, {2, 3})}` - * - `tf.data.Dataset.from_tensor_slices({"a": range(4)}).window(2)` - * produces `{{"a": {0, 1}}, {"a": {2, 3}}}` + * 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}}}}
  • + *
*/ public final class WindowDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WindowDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private WindowDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new WindowDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param size An integer scalar, representing the number of elements + * @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 `size`. + * 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". + * "retain every input element". * @param dropRemainder A Boolean scalar, representing whether the last window should be - * dropped if its size is smaller than `window_size`. - * @param outputTypes - * @param outputShapes + * dropped if its size is smaller than {@code window_size}. + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of WindowDataset */ - @Endpoint(describeByClass = true) - public static WindowDataset create(Scope scope, Operand inputDataset, Operand size, Operand shift, Operand stride, Operand dropRemainder, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static WindowDataset create(Scope scope, Operand inputDataset, + Operand sizeOutput, Operand shift, Operand stride, + Operand dropRemainder, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("WindowDataset", scope.makeOpName("WindowDataset")); opBuilder.addInput(inputDataset.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(shift.asOutput()); opBuilder.addInput(stride.asOutput()); opBuilder.addInput(dropRemainder.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new WindowDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WindowDataset"; - - private Output handle; - - private WindowDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WrapDatasetVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WrapDatasetVariant.java index 58823c1de2c..06916439033 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WrapDatasetVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/WrapDatasetVariant.java @@ -24,48 +24,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The WrapDatasetVariant operation */ public final class WrapDatasetVariant extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WrapDatasetVariant"; + + private Output outputHandle; + + @SuppressWarnings("unchecked") + private WrapDatasetVariant(Operation operation) { + super(operation); + int outputIdx = 0; + outputHandle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new WrapDatasetVariant operation. - * + * * @param scope current scope - * @param inputHandle + * @param inputHandle the inputHandle value * @return a new instance of WrapDatasetVariant */ - @Endpoint(describeByClass = true) - public static WrapDatasetVariant create(Scope scope, Operand inputHandle) { + @Endpoint( + describeByClass = true + ) + public static WrapDatasetVariant create(Scope scope, Operand inputHandle) { OperationBuilder opBuilder = scope.env().opBuilder("WrapDatasetVariant", scope.makeOpName("WrapDatasetVariant")); opBuilder.addInput(inputHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new WrapDatasetVariant(opBuilder.build()); } - + /** + * Gets outputHandle. + * + * @return outputHandle. */ - public Output outputHandle() { + public Output outputHandle() { return outputHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) outputHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WrapDatasetVariant"; - - private Output outputHandle; - - private WrapDatasetVariant(Operation operation) { - super(operation); - int outputIdx = 0; - outputHandle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ZipDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ZipDataset.java index 47dd0be0775..265b3f64dee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ZipDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ZipDataset.java @@ -31,60 +31,68 @@ import org.tensorflow.types.family.TType; /** - * Creates a dataset that zips together `input_datasets`. - *

+ * 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 + *

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. */ -@Operator(group = "data") +@Operator( + group = "data" +) public final class ZipDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ZipDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ZipDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ZipDataset operation. - * + * * @param scope current scope - * @param inputDatasets List of `N` variant Tensors representing datasets to be zipped together. - * @param outputTypes - * @param outputShapes + * @param inputDatasets List of {@code N} variant Tensors representing datasets to be zipped together. + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of ZipDataset */ - @Endpoint(describeByClass = true) - public static ZipDataset create(Scope scope, Iterable> inputDatasets, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static ZipDataset create(Scope scope, Iterable> inputDatasets, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ZipDataset", scope.makeOpName("ZipDataset")); opBuilder.addInputList(Operands.asOutputs(inputDatasets)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ZipDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ZipDataset"; - - private Output handle; - - private ZipDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertCardinalityDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertCardinalityDataset.java index 8ab5989b44b..d067a8da8ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertCardinalityDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertCardinalityDataset.java @@ -27,59 +27,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** + * The AssertCardinalityDataset operation */ public final class AssertCardinalityDataset extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AssertCardinalityDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private AssertCardinalityDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AssertCardinalityDataset operation. - * + * * @param scope current scope - * @param inputDataset - * @param cardinality - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param cardinality the cardinality value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of AssertCardinalityDataset */ - @Endpoint(describeByClass = true) - public static AssertCardinalityDataset create(Scope scope, Operand inputDataset, Operand cardinality, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static AssertCardinalityDataset create(Scope scope, Operand inputDataset, + Operand cardinality, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("AssertCardinalityDataset", scope.makeOpName("AssertCardinalityDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(cardinality.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new AssertCardinalityDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AssertCardinalityDataset"; - - private Output handle; - - private AssertCardinalityDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java index 2483e971723..4cb95fbccd2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AssertNextDataset.java @@ -27,59 +27,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The ExperimentalAssertNextDataset operation */ public final class AssertNextDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new AssertNextDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalAssertNextDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private AssertNextDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalAssertNextDataset operation. + * * @param scope current scope - * @param inputDataset - * @param transformations - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param transformations the transformations value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of AssertNextDataset */ - @Endpoint(describeByClass = true) - public static AssertNextDataset create(Scope scope, Operand inputDataset, Operand transformations, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static AssertNextDataset create(Scope scope, Operand inputDataset, + Operand transformations, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalAssertNextDataset", scope.makeOpName("AssertNextDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(transformations.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new AssertNextDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalAssertNextDataset"; - - private Output handle; - - private AssertNextDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AutoShardDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AutoShardDataset.java index fc630d53919..931e2db4ba1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AutoShardDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/AutoShardDataset.java @@ -27,56 +27,51 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * 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 + *

This dataset will throw a NotFound error if we cannot shard the dataset * automatically. */ public final class AutoShardDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.AutoShardDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param autoShardPolicy - */ - public Options autoShardPolicy(Long autoShardPolicy) { - this.autoShardPolicy = autoShardPolicy; - return this; - } - - private Long autoShardPolicy; - - private Options() { - } + public static final String OP_NAME = "ExperimentalAutoShardDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private AutoShardDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new AutoShardDataset operation. - * + * Factory method to create a class wrapping a new ExperimentalAutoShardDataset operation. + * * @param scope current scope * @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 - * @param outputShapes - * @param options carries optional attributes values + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of AutoShardDataset */ - @Endpoint(describeByClass = true) - public static AutoShardDataset create(Scope scope, Operand inputDataset, Operand numWorkers, Operand index, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AutoShardDataset create(Scope scope, Operand inputDataset, + Operand numWorkers, Operand index, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalAutoShardDataset", scope.makeOpName("AutoShardDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numWorkers.asOutput()); @@ -84,7 +79,7 @@ public static AutoShardDataset create(Scope scope, Operand inputDataset, Oper opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -97,34 +92,50 @@ public static AutoShardDataset create(Scope scope, Operand inputDataset, Oper } return new AutoShardDataset(opBuilder.build()); } - + /** - * @param autoShardPolicy + * Sets the autoShardPolicy option. + * + * @param autoShardPolicy the autoShardPolicy option + * @return this Options instance. */ public static Options autoShardPolicy(Long autoShardPolicy) { return new Options().autoShardPolicy(autoShardPolicy); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalAutoShardDataset"; - - private Output handle; - - private AutoShardDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.AutoShardDataset} + */ + public static class Options { + private Long autoShardPolicy; + + private Options() { + } + + /** + * Sets the autoShardPolicy option. + * + * @param autoShardPolicy the autoShardPolicy option + * @return this Options instance. + */ + public Options autoShardPolicy(Long autoShardPolicy) { + this.autoShardPolicy = autoShardPolicy; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/BytesProducedStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/BytesProducedStatsDataset.java index 76a5a96f895..524df6ddd0f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/BytesProducedStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/BytesProducedStatsDataset.java @@ -27,60 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** - * Records the bytes size of each element of `input_dataset` in a StatsAggregator. + * Records the bytes size of each element of {@code input_dataset} in a StatsAggregator. */ public final class BytesProducedStatsDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BytesProducedStatsDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalBytesProducedStatsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private BytesProducedStatsDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalBytesProducedStatsDataset operation. + * * @param scope current scope - * @param inputDataset - * @param tag - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param tag the tag value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of BytesProducedStatsDataset */ - @Endpoint(describeByClass = true) - public static BytesProducedStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static BytesProducedStatsDataset create(Scope scope, Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalBytesProducedStatsDataset", scope.makeOpName("BytesProducedStatsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new BytesProducedStatsDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalBytesProducedStatsDataset"; - - private Output handle; - - private BytesProducedStatsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CSVDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CSVDataset.java index b9af7f275db..0c26e1c263f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CSVDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CSVDataset.java @@ -27,34 +27,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The ExperimentalCSVDataset operation */ public final class CSVDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new CSVDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalCSVDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private CSVDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalCSVDataset operation. + * * @param scope current scope - * @param filenames - * @param compressionType - * @param bufferSize - * @param header - * @param fieldDelim - * @param useQuoteDelim - * @param naValue - * @param selectCols - * @param recordDefaults - * @param outputShapes + * @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 property * @return a new instance of CSVDataset */ - @Endpoint(describeByClass = true) - public static CSVDataset create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize, Operand header, Operand fieldDelim, Operand useQuoteDelim, Operand naValue, Operand selectCols, Iterable> recordDefaults, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static CSVDataset create(Scope scope, Operand filenames, + Operand compressionType, Operand bufferSize, Operand header, + Operand fieldDelim, Operand useQuoteDelim, Operand naValue, + Operand selectCols, Iterable> recordDefaults, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalCSVDataset", scope.makeOpName("CSVDataset")); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); @@ -67,33 +85,25 @@ public static CSVDataset create(Scope scope, Operand filenames, Operand opBuilder.addInputList(Operands.asOutputs(recordDefaults)); opBuilder = scope.apply(opBuilder); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new CSVDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalCSVDataset"; - - private Output handle; - - private CSVDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ChooseFastestDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ChooseFastestDataset.java index b735a535c48..093eccc41a3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ChooseFastestDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ChooseFastestDataset.java @@ -27,58 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The ExperimentalChooseFastestDataset operation */ public final class ChooseFastestDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ChooseFastestDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalChooseFastestDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ChooseFastestDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalChooseFastestDataset operation. + * * @param scope current scope - * @param inputDatasets - * @param numExperiments - * @param outputTypes - * @param outputShapes + * @param inputDatasets the inputDatasets value + * @param numExperiments the value of the numExperiments property + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of ChooseFastestDataset */ - @Endpoint(describeByClass = true) - public static ChooseFastestDataset create(Scope scope, Iterable> inputDatasets, Long numExperiments, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static ChooseFastestDataset create(Scope scope, + Iterable> inputDatasets, Long numExperiments, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalChooseFastestDataset", scope.makeOpName("ChooseFastestDataset")); opBuilder.addInputList(Operands.asOutputs(inputDatasets)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_experiments", numExperiments); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ChooseFastestDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalChooseFastestDataset"; - - private Output handle; - - private ChooseFastestDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CompressElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CompressElement.java index d4b0efb4dd3..093e7e6e5cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CompressElement.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/CompressElement.java @@ -25,49 +25,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Compresses a dataset element. */ public final class CompressElement extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CompressElement"; + + private Output compressed; + + @SuppressWarnings("unchecked") + private CompressElement(Operation operation) { + super(operation); + int outputIdx = 0; + compressed = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CompressElement operation. - * + * * @param scope current scope - * @param components + * @param components the components value * @return a new instance of CompressElement */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static CompressElement create(Scope scope, Iterable> components) { OperationBuilder opBuilder = scope.env().opBuilder("CompressElement", scope.makeOpName("CompressElement")); opBuilder.addInputList(Operands.asOutputs(components)); opBuilder = scope.apply(opBuilder); return new CompressElement(opBuilder.build()); } - + /** + * Gets compressed. + * + * @return compressed. */ - public Output compressed() { + public Output compressed() { return compressed; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) compressed; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CompressElement"; - - private Output compressed; - - private CompressElement(Operation operation) { - super(operation); - int outputIdx = 0; - compressed = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DataServiceDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DataServiceDataset.java index 6307dddf9dc..056c6bb0c21 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DataServiceDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DataServiceDataset.java @@ -33,47 +33,50 @@ import org.tensorflow.types.family.TType; /** + * The DataServiceDataset operation */ -@Operator(group = "data.experimental") +@Operator( + group = "data.experimental" +) public final class DataServiceDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.DataServiceDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param taskRefreshIntervalHintMs - */ - public Options taskRefreshIntervalHintMs(Long taskRefreshIntervalHintMs) { - this.taskRefreshIntervalHintMs = taskRefreshIntervalHintMs; - return this; - } - - private Long taskRefreshIntervalHintMs; - - private Options() { - } + public static final String OP_NAME = "DataServiceDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private DataServiceDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DataServiceDataset operation. - * + * * @param scope current scope - * @param datasetId - * @param processingMode - * @param address - * @param protocol - * @param jobName - * @param maxOutstandingRequests - * @param iterationCounter - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @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 maxOutstandingRequests the maxOutstandingRequests value + * @param iterationCounter the iterationCounter value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of DataServiceDataset */ - @Endpoint(describeByClass = true) - public static DataServiceDataset create(Scope scope, Operand datasetId, Operand processingMode, Operand address, Operand protocol, Operand jobName, Operand maxOutstandingRequests, Operand iterationCounter, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DataServiceDataset create(Scope scope, Operand datasetId, + Operand processingMode, Operand address, Operand protocol, + Operand jobName, Operand maxOutstandingRequests, + Operand iterationCounter, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DataServiceDataset", scope.makeOpName("DataServiceDataset")); opBuilder.addInput(datasetId.asOutput()); opBuilder.addInput(processingMode.asOutput()); @@ -85,7 +88,7 @@ public static DataServiceDataset create(Scope scope, Operand datasetId, opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -98,34 +101,50 @@ public static DataServiceDataset create(Scope scope, Operand datasetId, } return new DataServiceDataset(opBuilder.build()); } - + /** - * @param taskRefreshIntervalHintMs + * Sets the taskRefreshIntervalHintMs option. + * + * @param taskRefreshIntervalHintMs the taskRefreshIntervalHintMs option + * @return this Options instance. */ public static Options taskRefreshIntervalHintMs(Long taskRefreshIntervalHintMs) { return new Options().taskRefreshIntervalHintMs(taskRefreshIntervalHintMs); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DataServiceDataset"; - - private Output handle; - - private DataServiceDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.DataServiceDataset} + */ + public static class Options { + private Long taskRefreshIntervalHintMs; + + private Options() { + } + + /** + * Sets the taskRefreshIntervalHintMs option. + * + * @param taskRefreshIntervalHintMs the taskRefreshIntervalHintMs option + * @return this Options instance. + */ + public Options taskRefreshIntervalHintMs(Long taskRefreshIntervalHintMs) { + this.taskRefreshIntervalHintMs = taskRefreshIntervalHintMs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java index 638ef3e1220..dd3be793b80 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetCardinality.java @@ -24,52 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** - * Returns the cardinality of `input_dataset`. - *

- * Returns the cardinality of `input_dataset`. + * Returns the cardinality of {@code input_dataset}. + * Returns the cardinality of {@code input_dataset}. */ public final class DatasetCardinality extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new DatasetCardinality operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalDatasetCardinality"; + + private Output cardinality; + + private DatasetCardinality(Operation operation) { + super(operation); + int outputIdx = 0; + cardinality = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalDatasetCardinality operation. + * * @param scope current scope * @param inputDataset A variant tensor representing the dataset to return cardinality for. * @return a new instance of DatasetCardinality */ - @Endpoint(describeByClass = true) - public static DatasetCardinality create(Scope scope, Operand inputDataset) { + @Endpoint( + describeByClass = true + ) + public static DatasetCardinality create(Scope scope, Operand inputDataset) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDatasetCardinality", scope.makeOpName("DatasetCardinality")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); return new DatasetCardinality(opBuilder.build()); } - + /** - * The cardinality of `input_dataset`. Named constants are used to represent + * Gets cardinality. + * The cardinality of {@code input_dataset}. Named constants are used to represent * infinite and unknown cardinality. + * @return cardinality. */ public Output cardinality() { return cardinality; } - + @Override public Output asOutput() { return cardinality; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalDatasetCardinality"; - - private Output cardinality; - - private DatasetCardinality(Operation operation) { - super(operation); - int outputIdx = 0; - cardinality = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetToTFRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetToTFRecord.java index 5c57272415f..ad01668fe45 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetToTFRecord.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DatasetToTFRecord.java @@ -23,26 +23,37 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Writes the given dataset to the given file using the TFRecord format. */ public final class DatasetToTFRecord extends RawOp { - /** - * Factory method to create a class wrapping a new DatasetToTFRecord operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalDatasetToTFRecord"; + + private DatasetToTFRecord(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new ExperimentalDatasetToTFRecord operation. + * * @param scope current scope * @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". + * compression), (ii) "ZLIB", or (iii) "GZIP". * @return a new instance of DatasetToTFRecord */ - @Endpoint(describeByClass = true) - public static DatasetToTFRecord create(Scope scope, Operand inputDataset, Operand filename, Operand compressionType) { + @Endpoint( + describeByClass = true + ) + public static DatasetToTFRecord create(Scope scope, Operand inputDataset, + Operand filename, Operand compressionType) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDatasetToTFRecord", scope.makeOpName("DatasetToTFRecord")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(filename.asOutput()); @@ -50,11 +61,4 @@ public static DatasetToTFRecord create(Scope scope, Operand inputDataset, Ope opBuilder = scope.apply(opBuilder); return new DatasetToTFRecord(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalDatasetToTFRecord"; - - private DatasetToTFRecord(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DenseToSparseBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DenseToSparseBatchDataset.java index fd19c2fc45c..7ed96b92c8f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DenseToSparseBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DenseToSparseBatchDataset.java @@ -27,7 +27,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,23 +34,40 @@ * Creates a dataset that batches input elements into a SparseTensor. */ public final class DenseToSparseBatchDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new DenseToSparseBatchDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalDenseToSparseBatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private DenseToSparseBatchDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalDenseToSparseBatchDataset operation. + * * @param scope current scope * @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 `-1` to indicate + * 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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of DenseToSparseBatchDataset */ - @Endpoint(describeByClass = true) - public static DenseToSparseBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand rowShape, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static DenseToSparseBatchDataset create(Scope scope, Operand inputDataset, + Operand batchSize, Operand rowShape, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDenseToSparseBatchDataset", scope.makeOpName("DenseToSparseBatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSize.asOutput()); @@ -59,33 +75,25 @@ public static DenseToSparseBatchDataset create(Scope scope, Operand inputData opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new DenseToSparseBatchDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalDenseToSparseBatchDataset"; - - private Output handle; - - private DenseToSparseBatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DirectedInterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DirectedInterleaveDataset.java index c1bdefa37dc..7c5f70770d0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DirectedInterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DirectedInterleaveDataset.java @@ -27,61 +27,70 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * A substitute for `InterleaveDataset` on a fixed list of `N` datasets. + * A substitute for {@code InterleaveDataset} on a fixed list of {@code N} datasets. */ public final class DirectedInterleaveDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new DirectedInterleaveDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalDirectedInterleaveDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private DirectedInterleaveDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalDirectedInterleaveDataset operation. + * * @param scope current scope - * @param selectorInputDataset A dataset of scalar `DT_INT64` elements that determines which of the - * `N` data inputs should produce the next output element. - * @param dataInputDatasets `N` datasets with the same type that will be interleaved according to - * the values of `selector_input_dataset`. - * @param outputTypes - * @param outputShapes + * @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 property + * @param outputShapes the value of the outputShapes property * @return a new instance of DirectedInterleaveDataset */ - @Endpoint(describeByClass = true) - public static DirectedInterleaveDataset create(Scope scope, Operand selectorInputDataset, Iterable> dataInputDatasets, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static DirectedInterleaveDataset create(Scope scope, + Operand selectorInputDataset, + Iterable> dataInputDatasets, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDirectedInterleaveDataset", scope.makeOpName("DirectedInterleaveDataset")); opBuilder.addInput(selectorInputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(dataInputDatasets)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new DirectedInterleaveDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalDirectedInterleaveDataset"; - - private Output handle; - - private DirectedInterleaveDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DummyIterationCounter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DummyIterationCounter.java index 1ae74bfc8c9..2da650712fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DummyIterationCounter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/DummyIterationCounter.java @@ -24,46 +24,53 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The DummyIterationCounter operation */ public final class DummyIterationCounter extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DummyIterationCounter"; + + private Output handle; + + @SuppressWarnings("unchecked") + private DummyIterationCounter(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DummyIterationCounter operation. - * + * * @param scope current scope * @return a new instance of DummyIterationCounter */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DummyIterationCounter create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("DummyIterationCounter", scope.makeOpName("DummyIterationCounter")); opBuilder = scope.apply(opBuilder); return new DummyIterationCounter(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DummyIterationCounter"; - - private Output handle; - - private DummyIterationCounter(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IgnoreErrorsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IgnoreErrorsDataset.java index 83ddc19fe19..893974e4fa3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IgnoreErrorsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IgnoreErrorsDataset.java @@ -27,51 +27,47 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset that contains the elements of `input_dataset` ignoring errors. + * Creates a dataset that contains the elements of {@code input_dataset} ignoring errors. */ public final class IgnoreErrorsDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.IgnoreErrorsDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param logWarning - */ - public Options logWarning(Boolean logWarning) { - this.logWarning = logWarning; - return this; - } - - private Boolean logWarning; - - private Options() { - } + public static final String OP_NAME = "ExperimentalIgnoreErrorsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private IgnoreErrorsDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new IgnoreErrorsDataset operation. - * + * Factory method to create a class wrapping a new ExperimentalIgnoreErrorsDataset operation. + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes - * @param options carries optional attributes values + * @param inputDataset the inputDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of IgnoreErrorsDataset */ - @Endpoint(describeByClass = true) - public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalIgnoreErrorsDataset", scope.makeOpName("IgnoreErrorsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -84,34 +80,50 @@ public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, L } return new IgnoreErrorsDataset(opBuilder.build()); } - + /** - * @param logWarning + * Sets the logWarning option. + * + * @param logWarning the logWarning option + * @return this Options instance. */ public static Options logWarning(Boolean logWarning) { return new Options().logWarning(logWarning); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalIgnoreErrorsDataset"; - - private Output handle; - - private IgnoreErrorsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.IgnoreErrorsDataset} + */ + public static class Options { + private Boolean logWarning; + + private Options() { + } + + /** + * Sets the logWarning option. + * + * @param logWarning the logWarning option + * @return this Options instance. + */ + public Options logWarning(Boolean logWarning) { + this.logWarning = logWarning; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IteratorGetDevice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IteratorGetDevice.java index 5ee5a398f04..b2e0126d321 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IteratorGetDevice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/IteratorGetDevice.java @@ -24,48 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** - * Returns the name of the device on which `resource` has been placed. + * Returns the name of the device on which {@code resource} has been placed. */ public final class IteratorGetDevice extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new IteratorGetDevice operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalIteratorGetDevice"; + + private Output device; + + private IteratorGetDevice(Operation operation) { + super(operation); + int outputIdx = 0; + device = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalIteratorGetDevice operation. + * * @param scope current scope - * @param resource + * @param resource the resource value * @return a new instance of IteratorGetDevice */ - @Endpoint(describeByClass = true) - public static IteratorGetDevice create(Scope scope, Operand resource) { + @Endpoint( + describeByClass = true + ) + public static IteratorGetDevice create(Scope scope, Operand resource) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalIteratorGetDevice", scope.makeOpName("IteratorGetDevice")); opBuilder.addInput(resource.asOutput()); opBuilder = scope.apply(opBuilder); return new IteratorGetDevice(opBuilder.build()); } - + /** + * Gets device. + * + * @return device. */ public Output device() { return device; } - + @Override public Output asOutput() { return device; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalIteratorGetDevice"; - - private Output device; - - private IteratorGetDevice(Operation operation) { - super(operation); - int outputIdx = 0; - device = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LatencyStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LatencyStatsDataset.java index 1c333d77ac5..0b4756f3241 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LatencyStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LatencyStatsDataset.java @@ -27,60 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** - * Records the latency of producing `input_dataset` elements in a StatsAggregator. + * Records the latency of producing {@code input_dataset} elements in a StatsAggregator. */ public final class LatencyStatsDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new LatencyStatsDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalLatencyStatsDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private LatencyStatsDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalLatencyStatsDataset operation. + * * @param scope current scope - * @param inputDataset - * @param tag - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param tag the tag value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of LatencyStatsDataset */ - @Endpoint(describeByClass = true) - public static LatencyStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static LatencyStatsDataset create(Scope scope, Operand inputDataset, + Operand tag, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalLatencyStatsDataset", scope.makeOpName("LatencyStatsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new LatencyStatsDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalLatencyStatsDataset"; - - private Output handle; - - private LatencyStatsDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LmdbDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LmdbDataset.java index 4cdb41cc8e3..e7bab3a43b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LmdbDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/LmdbDataset.java @@ -27,57 +27,65 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The ExperimentalLMDBDataset operation */ public final class LmdbDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new LmdbDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalLMDBDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private LmdbDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalLMDBDataset operation. + * * @param scope current scope - * @param filenames - * @param outputTypes - * @param outputShapes + * @param filenames the filenames value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of LmdbDataset */ - @Endpoint(describeByClass = true) - public static LmdbDataset create(Scope scope, Operand filenames, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static LmdbDataset create(Scope scope, Operand filenames, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalLMDBDataset", scope.makeOpName("LmdbDataset")); opBuilder.addInput(filenames.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new LmdbDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalLMDBDataset"; - - private Output handle; - - private LmdbDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MatchingFilesDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MatchingFilesDataset.java index bb33854bea9..615ee0bfa0b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MatchingFilesDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MatchingFilesDataset.java @@ -24,49 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The ExperimentalMatchingFilesDataset operation */ public final class MatchingFilesDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new MatchingFilesDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalMatchingFilesDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private MatchingFilesDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalMatchingFilesDataset operation. + * * @param scope current scope - * @param patterns + * @param patterns the patterns value * @return a new instance of MatchingFilesDataset */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MatchingFilesDataset create(Scope scope, Operand patterns) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalMatchingFilesDataset", scope.makeOpName("MatchingFilesDataset")); opBuilder.addInput(patterns.asOutput()); opBuilder = scope.apply(opBuilder); return new MatchingFilesDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalMatchingFilesDataset"; - - private Output handle; - - private MatchingFilesDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MaxIntraOpParallelismDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MaxIntraOpParallelismDataset.java index 37d6f3915cc..ceaf099584e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MaxIntraOpParallelismDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/MaxIntraOpParallelismDataset.java @@ -27,7 +27,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,52 +34,61 @@ * Creates a dataset that overrides the maximum intra-op parallelism. */ public final class MaxIntraOpParallelismDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new MaxIntraOpParallelismDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalMaxIntraOpParallelismDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private MaxIntraOpParallelismDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalMaxIntraOpParallelismDataset operation. + * * @param scope current scope - * @param inputDataset + * @param inputDataset the inputDataset value * @param maxIntraOpParallelism Identifies the maximum intra-op parallelism to use. - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of MaxIntraOpParallelismDataset */ - @Endpoint(describeByClass = true) - public static MaxIntraOpParallelismDataset create(Scope scope, Operand inputDataset, Operand maxIntraOpParallelism, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static MaxIntraOpParallelismDataset create(Scope scope, + Operand inputDataset, Operand maxIntraOpParallelism, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalMaxIntraOpParallelismDataset", scope.makeOpName("MaxIntraOpParallelismDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(maxIntraOpParallelism.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new MaxIntraOpParallelismDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalMaxIntraOpParallelismDataset"; - - private Output handle; - - private MaxIntraOpParallelismDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/NonSerializableDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/NonSerializableDataset.java index ef096a1b19f..f74a0207ae2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/NonSerializableDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/NonSerializableDataset.java @@ -27,56 +27,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The ExperimentalNonSerializableDataset operation */ public final class NonSerializableDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new NonSerializableDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalNonSerializableDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private NonSerializableDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalNonSerializableDataset operation. + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of NonSerializableDataset */ - @Endpoint(describeByClass = true) - public static NonSerializableDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static NonSerializableDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalNonSerializableDataset", scope.makeOpName("NonSerializableDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new NonSerializableDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalNonSerializableDataset"; - - private Output handle; - - private NonSerializableDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParseExampleDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParseExampleDataset.java index eb9aceba455..38a6aeda19d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParseExampleDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ParseExampleDataset.java @@ -17,6 +17,7 @@ package org.tensorflow.op.data.experimental; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -27,66 +28,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** - * Transforms `input_dataset` containing `Example` protos as vectors of DT_STRING into a dataset of `Tensor` or `SparseTensor` objects representing the parsed features. + * 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. */ public final class ParseExampleDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.ParseExampleDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deterministic A string indicating the op-level determinism to use. Deterministic controls - * whether the dataset is allowed to return elements out of order if the next - * element to be returned isn't available, but a later element is. Options are - * "true", "false", and "default". "default" indicates that determinism should be - * decided by the `experimental_deterministic` parameter of `tf.data.Options`. - */ - public Options deterministic(String deterministic) { - this.deterministic = deterministic; - return this; - } - - /** - * @param raggedKeys - */ - public Options raggedKeys(List raggedKeys) { - this.raggedKeys = raggedKeys; - return this; - } - - private String deterministic; - private List raggedKeys; - - private Options() { - } + public static final String OP_NAME = "ParseExampleDatasetV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ParseExampleDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ParseExampleDataset operation. - * + * Factory method to create a class wrapping a new ParseExampleDatasetV2 operation. + * * @param scope current scope - * @param inputDataset - * @param numParallelCalls - * @param denseDefaults A dict mapping string keys to `Tensor`s. + * @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 `SparseTensor` objects. + * 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 `DTypes` of the same length as `sparse_keys`. - * Only `tf.float32` (`FloatList`), `tf.int64` (`Int64List`), - * and `tf.string` (`BytesList`) are supported. - * @param denseShapes List of tuples with the same length as `dense_keys`. - * The shape of the data for each dense feature referenced by `dense_keys`. - * Required for any input tensors identified by `dense_keys`. Must be + * @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 @@ -95,37 +76,44 @@ private Options() { * given feature along this dimension. * @param outputTypes The type list for the return values. * @param outputShapes The list of shapes being produced. - * @param raggedValueTypes - * @param raggedSplitTypes - * @param options carries optional attributes values + * @param raggedValueTypes the value of the raggedValueTypes property + * @param raggedSplitTypes the value of the raggedSplitTypes property + * @param options carries optional attribute values * @return a new instance of ParseExampleDataset */ - @Endpoint(describeByClass = true) - public static ParseExampleDataset create(Scope scope, Operand inputDataset, Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, List denseKeys, List> sparseTypes, List denseShapes, List> outputTypes, List outputShapes, List> raggedValueTypes, List> raggedSplitTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ParseExampleDataset create(Scope scope, Operand inputDataset, + Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, + List denseKeys, List> sparseTypes, List denseShapes, + List> outputTypes, List outputShapes, + List> raggedValueTypes, + List> raggedSplitTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ParseExampleDatasetV2", scope.makeOpName("ParseExampleDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numParallelCalls.asOutput()); opBuilder.addInputList(Operands.asOutputs(denseDefaults)); opBuilder = scope.apply(opBuilder); String[] sparseKeysArray = new String[sparseKeys.size()]; - for (int i = 0; i < sparseKeysArray.length; ++i) { + for (int i = 0 ; i < sparseKeysArray.length ; i++) { sparseKeysArray[i] = sparseKeys.get(i); } opBuilder.setAttr("sparse_keys", sparseKeysArray); String[] denseKeysArray = new String[denseKeys.size()]; - for (int i = 0; i < denseKeysArray.length; ++i) { + for (int i = 0 ; i < denseKeysArray.length ; i++) { denseKeysArray[i] = denseKeys.get(i); } opBuilder.setAttr("dense_keys", denseKeysArray); opBuilder.setAttr("sparse_types", Operands.toDataTypes(sparseTypes)); Shape[] denseShapesArray = new Shape[denseShapes.size()]; - for (int i = 0; i < denseShapesArray.length; ++i) { + for (int i = 0 ; i < denseShapesArray.length ; i++) { denseShapesArray[i] = denseShapes.get(i); } opBuilder.setAttr("dense_shapes", denseShapesArray); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -138,7 +126,7 @@ public static ParseExampleDataset create(Scope scope, Operand inputDataset, O } if (opts.raggedKeys != null) { String[] raggedKeysArray = new String[opts.raggedKeys.size()]; - for (int i = 0; i < raggedKeysArray.length; ++i) { + for (int i = 0 ; i < raggedKeysArray.length ; i++) { raggedKeysArray[i] = opts.raggedKeys.get(i); } opBuilder.setAttr("ragged_keys", raggedKeysArray); @@ -147,45 +135,102 @@ public static ParseExampleDataset create(Scope scope, Operand inputDataset, O } return new ParseExampleDataset(opBuilder.build()); } - + /** + * Sets the deterministic option. + * * @param deterministic A string indicating the op-level determinism to use. Deterministic controls * whether the dataset is allowed to return elements out of order if the next * element to be returned isn't available, but a later element is. Options are - * "true", "false", and "default". "default" indicates that determinism should be - * decided by the `experimental_deterministic` parameter of `tf.data.Options`. + * "true", "false", and "default". "default" indicates that determinism should be + * decided by the {@code experimental_deterministic} parameter of {@code tf.data.Options}. + * @return this Options instance. */ public static Options deterministic(String deterministic) { return new Options().deterministic(deterministic); } - + /** - * @param raggedKeys + * Sets the raggedKeys option. + * + * @param raggedKeys the raggedKeys option + * @return this Options instance. */ public static Options raggedKeys(List raggedKeys) { return new Options().raggedKeys(raggedKeys); } - + /** + * Sets the raggedKeys option. + * + * @param raggedKeys the raggedKeys option + * @return this Options instance. */ - public Output handle() { + public static Options raggedKeys(String[] raggedKeys) { + return new Options().raggedKeys(raggedKeys); + } + + /** + * Gets handle. + * + * @return handle. + */ + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseExampleDatasetV2"; - - private Output handle; - - private ParseExampleDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.ParseExampleDataset} + */ + public static class Options { + private String deterministic; + + private List raggedKeys; + + private Options() { + } + + /** + * Sets the deterministic option. + * + * @param deterministic A string indicating the op-level determinism to use. Deterministic controls + * whether the dataset is allowed to return elements out of order if the next + * element to be returned isn't available, but a later element is. Options are + * "true", "false", and "default". "default" indicates that determinism should be + * decided by the {@code experimental_deterministic} parameter of {@code tf.data.Options}. + * @return this Options instance. + */ + public Options deterministic(String deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * Sets the raggedKeys option. + * + * @param raggedKeys the raggedKeys option + * @return this Options instance. + */ + public Options raggedKeys(List raggedKeys) { + this.raggedKeys = raggedKeys; + return this; + } + + /** + * Sets the raggedKeys option. + * + * @param raggedKeys the raggedKeys option + * @return this Options instance. + */ + public Options raggedKeys(String... raggedKeys) { + this.raggedKeys = Arrays.asList(raggedKeys); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/PrivateThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/PrivateThreadPoolDataset.java index bc0a4750675..4a590bdd205 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/PrivateThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/PrivateThreadPoolDataset.java @@ -27,60 +27,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Creates a dataset that uses a custom thread pool to compute `input_dataset`. + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ public final class PrivateThreadPoolDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new PrivateThreadPoolDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalPrivateThreadPoolDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private PrivateThreadPoolDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalPrivateThreadPoolDataset operation. + * * @param scope current scope - * @param inputDataset + * @param inputDataset the inputDataset value * @param numThreads Identifies the number of threads to use for the private threadpool. - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of PrivateThreadPoolDataset */ - @Endpoint(describeByClass = true) - public static PrivateThreadPoolDataset create(Scope scope, Operand inputDataset, Operand numThreads, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static PrivateThreadPoolDataset create(Scope scope, Operand inputDataset, + Operand numThreads, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalPrivateThreadPoolDataset", scope.makeOpName("PrivateThreadPoolDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numThreads.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new PrivateThreadPoolDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalPrivateThreadPoolDataset"; - - private Output handle; - - private PrivateThreadPoolDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RandomDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RandomDataset.java index 435d331f68e..e7b815f7374 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RandomDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RandomDataset.java @@ -27,7 +27,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -35,54 +34,62 @@ * Creates a Dataset that returns pseudorandom numbers. */ public final class RandomDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new RandomDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalRandomDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private RandomDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalRandomDataset operation. + * * @param scope current scope * @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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of RandomDataset */ - @Endpoint(describeByClass = true) - public static RandomDataset create(Scope scope, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static RandomDataset create(Scope scope, Operand seed, Operand seed2, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalRandomDataset", scope.makeOpName("RandomDataset")); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new RandomDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalRandomDataset"; - - private Output handle; - - private RandomDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RebatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RebatchDataset.java index 219f9bd44b4..ec1c8db1ffe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RebatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/RebatchDataset.java @@ -27,59 +27,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * 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. */ public final class RebatchDataset extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.RebatchDataset} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useFallback - */ - public Options useFallback(Boolean useFallback) { - this.useFallback = useFallback; - return this; - } - - private Boolean useFallback; - - private Options() { - } + public static final String OP_NAME = "ExperimentalRebatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private RebatchDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new RebatchDataset operation. - * + * Factory method to create a class wrapping a new ExperimentalRebatchDataset operation. + * * @param scope current scope * @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 - * @param outputShapes - * @param options carries optional attributes values + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property + * @param options carries optional attribute values * @return a new instance of RebatchDataset */ - @Endpoint(describeByClass = true) - public static RebatchDataset create(Scope scope, Operand inputDataset, Operand numReplicas, List> outputTypes, List outputShapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RebatchDataset create(Scope scope, Operand inputDataset, + Operand numReplicas, List> outputTypes, + List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalRebatchDataset", scope.makeOpName("RebatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numReplicas.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); @@ -92,34 +88,50 @@ public static RebatchDataset create(Scope scope, Operand inputDataset, Operan } return new RebatchDataset(opBuilder.build()); } - + /** - * @param useFallback + * Sets the useFallback option. + * + * @param useFallback the useFallback option + * @return this Options instance. */ public static Options useFallback(Boolean useFallback) { return new Options().useFallback(useFallback); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalRebatchDataset"; - - private Output handle; - - private RebatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.RebatchDataset} + */ + public static class Options { + private Boolean useFallback; + + private Options() { + } + + /** + * Sets the useFallback option. + * + * @param useFallback the useFallback option + * @return this Options instance. + */ + public Options useFallback(Boolean useFallback) { + this.useFallback = useFallback; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SetStatsAggregatorDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SetStatsAggregatorDataset.java index b87aa6597ea..2e2ad4dc8f3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SetStatsAggregatorDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SetStatsAggregatorDataset.java @@ -27,28 +27,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** + * The ExperimentalSetStatsAggregatorDataset operation */ public final class SetStatsAggregatorDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SetStatsAggregatorDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalSetStatsAggregatorDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SetStatsAggregatorDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalSetStatsAggregatorDataset operation. + * * @param scope current scope - * @param inputDataset - * @param statsAggregator - * @param tag - * @param counterPrefix - * @param outputTypes - * @param outputShapes + * @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 property + * @param outputShapes the value of the outputShapes property * @return a new instance of SetStatsAggregatorDataset */ - @Endpoint(describeByClass = true) - public static SetStatsAggregatorDataset create(Scope scope, Operand inputDataset, Operand statsAggregator, Operand tag, Operand counterPrefix, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SetStatsAggregatorDataset create(Scope scope, Operand inputDataset, + Operand statsAggregator, Operand tag, + Operand counterPrefix, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSetStatsAggregatorDataset", scope.makeOpName("SetStatsAggregatorDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(statsAggregator.asOutput()); @@ -57,33 +75,25 @@ public static SetStatsAggregatorDataset create(Scope scope, Operand inputData opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SetStatsAggregatorDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalSetStatsAggregatorDataset"; - - private Output handle; - - private SetStatsAggregatorDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SleepDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SleepDataset.java index 4fac4cfc637..8ba7e87d492 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SleepDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SleepDataset.java @@ -27,59 +27,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** + * The ExperimentalSleepDataset operation */ public final class SleepDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SleepDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalSleepDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SleepDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalSleepDataset operation. + * * @param scope current scope - * @param inputDataset - * @param sleepMicroseconds - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param sleepMicroseconds the sleepMicroseconds value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of SleepDataset */ - @Endpoint(describeByClass = true) - public static SleepDataset create(Scope scope, Operand inputDataset, Operand sleepMicroseconds, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SleepDataset create(Scope scope, Operand inputDataset, + Operand sleepMicroseconds, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSleepDataset", scope.makeOpName("SleepDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(sleepMicroseconds.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SleepDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalSleepDataset"; - - private Output handle; - - private SleepDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SlidingWindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SlidingWindowDataset.java index 85dde0defb6..9632b88e997 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SlidingWindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SlidingWindowDataset.java @@ -27,32 +27,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Creates a dataset that passes a sliding window over `input_dataset`. + * Creates a dataset that passes a sliding window over {@code input_dataset}. */ public final class SlidingWindowDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SlidingWindowDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalSlidingWindowDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SlidingWindowDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalSlidingWindowDataset operation. + * * @param scope current scope - * @param inputDataset + * @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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of SlidingWindowDataset */ - @Endpoint(describeByClass = true) - public static SlidingWindowDataset create(Scope scope, Operand inputDataset, Operand windowSize, Operand windowShift, Operand windowStride, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SlidingWindowDataset create(Scope scope, Operand inputDataset, + Operand windowSize, Operand windowShift, Operand windowStride, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSlidingWindowDataset", scope.makeOpName("SlidingWindowDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(windowSize.asOutput()); @@ -61,33 +77,25 @@ public static SlidingWindowDataset create(Scope scope, Operand inputDataset, opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SlidingWindowDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalSlidingWindowDataset"; - - private Output handle; - - private SlidingWindowDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SqlDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SqlDataset.java index 6964f134918..01b026f7321 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SqlDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/SqlDataset.java @@ -27,7 +27,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; @@ -35,20 +34,37 @@ * Creates a dataset that executes a SQL query and emits rows of the result set. */ public final class SqlDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new SqlDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalSqlDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private SqlDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalSqlDataset operation. + * * @param scope current scope * @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 - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of SqlDataset */ - @Endpoint(describeByClass = true) - public static SqlDataset create(Scope scope, Operand driverName, Operand dataSourceName, Operand query, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static SqlDataset create(Scope scope, Operand driverName, + Operand dataSourceName, Operand query, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSqlDataset", scope.makeOpName("SqlDataset")); opBuilder.addInput(driverName.asOutput()); opBuilder.addInput(dataSourceName.asOutput()); @@ -56,33 +72,25 @@ public static SqlDataset create(Scope scope, Operand driverName, Operan opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new SqlDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalSqlDataset"; - - private Output handle; - - private SqlDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorHandle.java index b0443fd6b5d..792b01701f6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorHandle.java @@ -24,49 +24,36 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The StatsAggregatorHandleV2 operation */ public final class StatsAggregatorHandle extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.StatsAggregatorHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "StatsAggregatorHandleV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private StatsAggregatorHandle(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new StatsAggregatorHandle operation. - * + * Factory method to create a class wrapping a new StatsAggregatorHandleV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StatsAggregatorHandle */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StatsAggregatorHandle create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StatsAggregatorHandleV2", scope.makeOpName("StatsAggregatorHandle")); opBuilder = scope.apply(opBuilder); @@ -82,41 +69,73 @@ public static StatsAggregatorHandle create(Scope scope, Options... options) { } return new StatsAggregatorHandle(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatsAggregatorHandleV2"; - - private Output handle; - - private StatsAggregatorHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.StatsAggregatorHandle} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSetSummaryWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSetSummaryWriter.java index 12a27ab77c7..bdbc08f505a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSetSummaryWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSetSummaryWriter.java @@ -23,34 +23,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Set a summary_writer_interface to record statistics using given stats_aggregator. */ public final class StatsAggregatorSetSummaryWriter extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatsAggregatorSetSummaryWriter"; + + private StatsAggregatorSetSummaryWriter(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new StatsAggregatorSetSummaryWriter operation. - * + * * @param scope current scope - * @param statsAggregator - * @param summary + * @param statsAggregator the statsAggregator value + * @param summary the summary value * @return a new instance of StatsAggregatorSetSummaryWriter */ - @Endpoint(describeByClass = true) - public static StatsAggregatorSetSummaryWriter create(Scope scope, Operand statsAggregator, Operand summary) { + @Endpoint( + describeByClass = true + ) + public static StatsAggregatorSetSummaryWriter create(Scope scope, + Operand statsAggregator, Operand summary) { OperationBuilder opBuilder = scope.env().opBuilder("StatsAggregatorSetSummaryWriter", scope.makeOpName("StatsAggregatorSetSummaryWriter")); opBuilder.addInput(statsAggregator.asOutput()); opBuilder.addInput(summary.asOutput()); opBuilder = scope.apply(opBuilder); return new StatsAggregatorSetSummaryWriter(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatsAggregatorSetSummaryWriter"; - - private StatsAggregatorSetSummaryWriter(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSummary.java index d259ccd5712..84ab19fd114 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/StatsAggregatorSummary.java @@ -24,48 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Produces a summary of any statistics recorded by the given statistics manager. */ public final class StatsAggregatorSummary extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new StatsAggregatorSummary operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalStatsAggregatorSummary"; + + private Output summary; + + private StatsAggregatorSummary(Operation operation) { + super(operation); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalStatsAggregatorSummary operation. + * * @param scope current scope - * @param iterator + * @param iterator the iterator value * @return a new instance of StatsAggregatorSummary */ - @Endpoint(describeByClass = true) - public static StatsAggregatorSummary create(Scope scope, Operand iterator) { + @Endpoint( + describeByClass = true + ) + public static StatsAggregatorSummary create(Scope scope, Operand iterator) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalStatsAggregatorSummary", scope.makeOpName("StatsAggregatorSummary")); opBuilder.addInput(iterator.asOutput()); opBuilder = scope.apply(opBuilder); return new StatsAggregatorSummary(opBuilder.build()); } - + /** + * Gets summary. + * + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalStatsAggregatorSummary"; - - private Output summary; - - private StatsAggregatorSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolDataset.java index fb2af7e60a7..6dc3e5057ae 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolDataset.java @@ -27,59 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset that uses a custom thread pool to compute `input_dataset`. + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ public final class ThreadPoolDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ThreadPoolDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalThreadPoolDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ThreadPoolDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalThreadPoolDataset operation. + * * @param scope current scope - * @param inputDataset + * @param inputDataset the inputDataset value * @param threadPool A resource produced by the ThreadPoolHandle op. - * @param outputTypes - * @param outputShapes + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of ThreadPoolDataset */ - @Endpoint(describeByClass = true) - public static ThreadPoolDataset create(Scope scope, Operand inputDataset, Operand threadPool, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static ThreadPoolDataset create(Scope scope, Operand inputDataset, + Operand threadPool, List> outputTypes, + List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalThreadPoolDataset", scope.makeOpName("ThreadPoolDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(threadPool.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new ThreadPoolDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalThreadPoolDataset"; - - private Output handle; - - private ThreadPoolDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolHandle.java index c378b9fcf76..67806fe8b9b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/ThreadPoolHandle.java @@ -24,65 +24,42 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset that uses a custom thread pool to compute `input_dataset`. + * Creates a dataset that uses a custom thread pool to compute {@code input_dataset}. */ public final class ThreadPoolHandle extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.data.experimental.ThreadPoolHandle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this - * threadpool. - */ - public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { - this.maxIntraOpParallelism = maxIntraOpParallelism; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long maxIntraOpParallelism; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "ExperimentalThreadPoolHandle"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ThreadPoolHandle(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ThreadPoolHandle operation. - * + * Factory method to create a class wrapping a new ExperimentalThreadPoolHandle operation. + * * @param scope current scope * @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. * threadpool. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ThreadPoolHandle */ - @Endpoint(describeByClass = true) - public static ThreadPoolHandle create(Scope scope, Long numThreads, String displayName, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ThreadPoolHandle create(Scope scope, Long numThreads, String displayName, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalThreadPoolHandle", scope.makeOpName("ThreadPoolHandle")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_threads", numThreads); @@ -102,51 +79,99 @@ public static ThreadPoolHandle create(Scope scope, Long numThreads, String displ } return new ThreadPoolHandle(opBuilder.build()); } - + /** + * Sets the maxIntraOpParallelism option. + * * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this * threadpool. + * @return this Options instance. */ public static Options maxIntraOpParallelism(Long maxIntraOpParallelism) { return new Options().maxIntraOpParallelism(maxIntraOpParallelism); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * A resource that can be consumed by one or more ExperimentalThreadPoolDataset * ops. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalThreadPoolHandle"; - - private Output handle; - - private ThreadPoolHandle(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.data.experimental.ThreadPoolHandle} + */ + public static class Options { + private Long maxIntraOpParallelism; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the maxIntraOpParallelism option. + * + * @param maxIntraOpParallelism The maximum degree of parallelism to use within operations that execute on this + * threadpool. + * @return this Options instance. + */ + public Options maxIntraOpParallelism(Long maxIntraOpParallelism) { + this.maxIntraOpParallelism = maxIntraOpParallelism; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UnbatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UnbatchDataset.java index c00d3fe5470..19a3eaf10cd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UnbatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UnbatchDataset.java @@ -27,57 +27,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A dataset that splits the elements of its input into multiple elements. */ public final class UnbatchDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new UnbatchDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalUnbatchDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private UnbatchDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalUnbatchDataset operation. + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of UnbatchDataset */ - @Endpoint(describeByClass = true) - public static UnbatchDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static UnbatchDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalUnbatchDataset", scope.makeOpName("UnbatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new UnbatchDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalUnbatchDataset"; - - private Output handle; - - private UnbatchDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UncompressElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UncompressElement.java index 36e07fe069c..af2519a6111 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UncompressElement.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UncompressElement.java @@ -29,59 +29,66 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Uncompresses a compressed dataset element. */ public final class UncompressElement extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UncompressElement"; + + private List> components; + + @SuppressWarnings("unchecked") + private UncompressElement(Operation operation) { + super(operation); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; + } + /** * Factory method to create a class wrapping a new UncompressElement operation. - * + * * @param scope current scope - * @param compressed - * @param outputTypes - * @param outputShapes + * @param compressed the compressed value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of UncompressElement */ - @Endpoint(describeByClass = true) - public static UncompressElement create(Scope scope, Operand compressed, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static UncompressElement create(Scope scope, Operand compressed, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("UncompressElement", scope.makeOpName("UncompressElement")); opBuilder.addInput(compressed.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new UncompressElement(opBuilder.build()); } - + /** + * Gets components. + * + * @return components. */ public List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UncompressElement"; - - private List> components; - - private UncompressElement(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UniqueDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UniqueDataset.java index 6461c5afafa..a4e373cf734 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UniqueDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/experimental/UniqueDataset.java @@ -27,57 +27,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Creates a dataset that contains the unique elements of `input_dataset`. + * Creates a dataset that contains the unique elements of {@code input_dataset}. */ public final class UniqueDataset extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new UniqueDataset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExperimentalUniqueDataset"; + + private Output handle; + + @SuppressWarnings("unchecked") + private UniqueDataset(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ExperimentalUniqueDataset operation. + * * @param scope current scope - * @param inputDataset - * @param outputTypes - * @param outputShapes + * @param inputDataset the inputDataset value + * @param outputTypes the value of the outputTypes property + * @param outputShapes the value of the outputShapes property * @return a new instance of UniqueDataset */ - @Endpoint(describeByClass = true) - public static UniqueDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + @Endpoint( + describeByClass = true + ) + public static UniqueDataset create(Scope scope, Operand inputDataset, + List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalUniqueDataset", scope.makeOpName("UniqueDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_types", Operands.toDataTypes(outputTypes)); Shape[] outputShapesArray = new Shape[outputShapes.size()]; - for (int i = 0; i < outputShapesArray.length; ++i) { + for (int i = 0 ; i < outputShapesArray.length ; i++) { outputShapesArray[i] = outputShapes.get(i); } opBuilder.setAttr("output_shapes", outputShapesArray); return new UniqueDataset(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExperimentalUniqueDataset"; - - private Output handle; - - private UniqueDataset(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/CheckNumerics.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/CheckNumerics.java index a24bde53102..50eb425c04f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/CheckNumerics.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/CheckNumerics.java @@ -24,57 +24,63 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Checks a tensor for NaN, -Inf 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. + * When run, reports an {@code InvalidArgument} error if {@code tensor} has any values + * that are not a number (NaN) or infinity (Inf). Otherwise, passes {@code tensor} as-is. * Unlike CheckNumerics (V1), CheckNumericsV2 distinguishes -Inf and +Inf in the * errors it throws. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class CheckNumerics extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new CheckNumerics operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CheckNumericsV2"; + + private Output output; + + private CheckNumerics(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new CheckNumericsV2 operation. + * * @param scope current scope - * @param tensor + * @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 */ - @Endpoint(describeByClass = true) - public static CheckNumerics create(Scope scope, Operand tensor, String message) { + @Endpoint( + describeByClass = true + ) + public static CheckNumerics create(Scope scope, Operand tensor, + String message) { OperationBuilder opBuilder = scope.env().opBuilder("CheckNumericsV2", scope.makeOpName("CheckNumerics")); opBuilder.addInput(tensor.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("message", message); - return new CheckNumerics(opBuilder.build()); + return new CheckNumerics<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CheckNumericsV2"; - - private Output output; - - private CheckNumerics(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientIdentity.java index f5357beefd9..3de60d9b847 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientIdentity.java @@ -24,54 +24,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Identity op for gradient debugging. - *

* This op is hidden from public in Python. It is used by TensorFlow Debugger to * register gradient tensors for gradient debugging. * This op operates on non-reference-type tensors. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class DebugGradientIdentity extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DebugGradientIdentity"; + + private Output output; + + private DebugGradientIdentity(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DebugGradientIdentity operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code DebugGradientIdentity} output and operands * @return a new instance of DebugGradientIdentity */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DebugGradientIdentity create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("DebugGradientIdentity", scope.makeOpName("DebugGradientIdentity")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new DebugGradientIdentity(opBuilder.build()); + return new DebugGradientIdentity<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugGradientIdentity"; - - private Output output; - - private DebugGradientIdentity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientRefIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientRefIdentity.java index 6d980f76706..caab8f1eef7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientRefIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugGradientRefIdentity.java @@ -24,54 +24,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Identity op for gradient debugging. - *

* This op is hidden from public in Python. It is used by TensorFlow Debugger to * register gradient tensors for gradient debugging. * This op operates on reference-type tensors. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class DebugGradientRefIdentity extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DebugGradientRefIdentity"; + + private Output output; + + private DebugGradientRefIdentity(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DebugGradientRefIdentity operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code DebugGradientRefIdentity} output and operands * @return a new instance of DebugGradientRefIdentity */ - @Endpoint(describeByClass = true) - public static DebugGradientRefIdentity create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static DebugGradientRefIdentity create(Scope scope, + Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("DebugGradientRefIdentity", scope.makeOpName("DebugGradientRefIdentity")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new DebugGradientRefIdentity(opBuilder.build()); + return new DebugGradientRefIdentity<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugGradientRefIdentity"; - - private Output output; - - private DebugGradientRefIdentity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugIdentity.java index ea516aac2e6..2f563306c0b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugIdentity.java @@ -17,6 +17,7 @@ package org.tensorflow.op.debugging; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,112 +26,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Debug Identity V2 Op. - *

* Provides an identity mapping from input to output, while writing the content of * the input tensor by calling DebugEventsWriter. - *

- * The semantics of the input tensor depends on tensor_debug_mode. In typical + *

The semantics of the input tensor depends on tensor_debug_mode. In typical * usage, the input tensor comes directly from the user computation only when * graph_debug_mode is FULL_TENSOR (see protobuf/debug_event.proto for a * list of all the possible values of graph_debug_mode). For the other debug modes, * the input tensor should be produced by an additional op or subgraph that * computes summary information about one or more tensors. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class DebugIdentity extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.debugging.DebugIdentity} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tfdbgContextId A tfdbg-generated ID for the context that the op belongs to, - * e.g., a concrete compiled tf.function. - */ - public Options tfdbgContextId(String tfdbgContextId) { - this.tfdbgContextId = tfdbgContextId; - return this; - } - - /** - * @param opName Optional. Name of the op that the debug op is concerned with. - * Used only for single-tensor trace. - */ - public Options opName(String opName) { - this.opName = opName; - return this; - } - - /** - * @param outputSlot Optional. Output slot index of the tensor that the debug op - * is concerned with. Used only for single-tensor trace. - */ - public Options outputSlot(Long outputSlot) { - this.outputSlot = outputSlot; - return this; - } - - /** - * @param tensorDebugMode TensorDebugMode enum value. See debug_event.proto for details. - */ - public Options tensorDebugMode(Long tensorDebugMode) { - this.tensorDebugMode = tensorDebugMode; - return this; - } - - /** - * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. - */ - public Options debugUrls(List debugUrls) { - this.debugUrls = debugUrls; - return this; - } - - /** - * @param circularBufferSize - */ - public Options circularBufferSize(Long circularBufferSize) { - this.circularBufferSize = circularBufferSize; - return this; - } - - /** - * @param tfdbgRunId - */ - public Options tfdbgRunId(String tfdbgRunId) { - this.tfdbgRunId = tfdbgRunId; - return this; - } - - private String tfdbgContextId; - private String opName; - private Long outputSlot; - private Long tensorDebugMode; - private List debugUrls; - private Long circularBufferSize; - private String tfdbgRunId; - - private Options() { - } + public static final String OP_NAME = "DebugIdentityV2"; + + private Output output; + + private DebugIdentity(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new DebugIdentity operation. - * + * Factory method to create a class wrapping a new DebugIdentityV2 operation. + * * @param scope current scope * @param input Input tensor, non-Reference type - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DebugIdentityV2} output and operands * @return a new instance of DebugIdentity */ - @Endpoint(describeByClass = true) - public static DebugIdentity create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DebugIdentity create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DebugIdentityV2", scope.makeOpName("DebugIdentity")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -150,7 +88,7 @@ public static DebugIdentity create(Scope scope, Operand } if (opts.debugUrls != null) { String[] debugUrlsArray = new String[opts.debugUrls.size()]; - for (int i = 0; i < debugUrlsArray.length; ++i) { + for (int i = 0 ; i < debugUrlsArray.length ; i++) { debugUrlsArray[i] = opts.debugUrls.get(i); } opBuilder.setAttr("debug_urls", debugUrlsArray); @@ -163,80 +101,216 @@ public static DebugIdentity create(Scope scope, Operand } } } - return new DebugIdentity(opBuilder.build()); + return new DebugIdentity<>(opBuilder.build()); } - + /** + * Sets the tfdbgContextId option. + * * @param tfdbgContextId A tfdbg-generated ID for the context that the op belongs to, - * e.g., a concrete compiled tf.function. + * e.g., a concrete compiled tf.function. + * @return this Options instance. */ public static Options tfdbgContextId(String tfdbgContextId) { return new Options().tfdbgContextId(tfdbgContextId); } - + /** + * Sets the opName option. + * * @param opName Optional. Name of the op that the debug op is concerned with. - * Used only for single-tensor trace. + * Used only for single-tensor trace. + * @return this Options instance. */ public static Options opName(String opName) { return new Options().opName(opName); } - + /** + * Sets the outputSlot option. + * * @param outputSlot Optional. Output slot index of the tensor that the debug op - * is concerned with. Used only for single-tensor trace. + * is concerned with. Used only for single-tensor trace. + * @return this Options instance. */ public static Options outputSlot(Long outputSlot) { return new Options().outputSlot(outputSlot); } - + /** + * Sets the tensorDebugMode option. + * * @param tensorDebugMode TensorDebugMode enum value. See debug_event.proto for details. + * @return this Options instance. */ public static Options tensorDebugMode(Long tensorDebugMode) { return new Options().tensorDebugMode(tensorDebugMode); } - + /** + * Sets the debugUrls option. + * * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. + * @return this Options instance. */ public static Options debugUrls(List debugUrls) { return new Options().debugUrls(debugUrls); } - + /** - * @param circularBufferSize + * Sets the debugUrls option. + * + * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. + * @return this Options instance. + */ + public static Options debugUrls(String[] debugUrls) { + return new Options().debugUrls(debugUrls); + } + + /** + * Sets the circularBufferSize option. + * + * @param circularBufferSize the circularBufferSize option + * @return this Options instance. */ public static Options circularBufferSize(Long circularBufferSize) { return new Options().circularBufferSize(circularBufferSize); } - + /** - * @param tfdbgRunId + * Sets the tfdbgRunId option. + * + * @param tfdbgRunId the tfdbgRunId option + * @return this Options instance. */ public static Options tfdbgRunId(String tfdbgRunId) { return new Options().tfdbgRunId(tfdbgRunId); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugIdentityV2"; - - private Output output; - - private DebugIdentity(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.debugging.DebugIdentity} + */ + public static class Options { + private String tfdbgContextId; + + private String opName; + + private Long outputSlot; + + private Long tensorDebugMode; + + private List debugUrls; + + private Long circularBufferSize; + + private String tfdbgRunId; + + private Options() { + } + + /** + * Sets the tfdbgContextId option. + * + * @param tfdbgContextId A tfdbg-generated ID for the context that the op belongs to, + * e.g., a concrete compiled tf.function. + * @return this Options instance. + */ + public Options tfdbgContextId(String tfdbgContextId) { + this.tfdbgContextId = tfdbgContextId; + return this; + } + + /** + * Sets the opName option. + * + * @param opName Optional. Name of the op that the debug op is concerned with. + * Used only for single-tensor trace. + * @return this Options instance. + */ + public Options opName(String opName) { + this.opName = opName; + return this; + } + + /** + * Sets the outputSlot option. + * + * @param outputSlot Optional. Output slot index of the tensor that the debug op + * is concerned with. Used only for single-tensor trace. + * @return this Options instance. + */ + public Options outputSlot(Long outputSlot) { + this.outputSlot = outputSlot; + return this; + } + + /** + * Sets the tensorDebugMode option. + * + * @param tensorDebugMode TensorDebugMode enum value. See debug_event.proto for details. + * @return this Options instance. + */ + public Options tensorDebugMode(Long tensorDebugMode) { + this.tensorDebugMode = tensorDebugMode; + return this; + } + + /** + * Sets the debugUrls option. + * + * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. + * @return this Options instance. + */ + public Options debugUrls(List debugUrls) { + this.debugUrls = debugUrls; + return this; + } + + /** + * Sets the debugUrls option. + * + * @param debugUrls List of URLs to debug targets, e.g., file:///foo/tfdbg_dump. + * @return this Options instance. + */ + public Options debugUrls(String... debugUrls) { + this.debugUrls = Arrays.asList(debugUrls); + return this; + } + + /** + * Sets the circularBufferSize option. + * + * @param circularBufferSize the circularBufferSize option + * @return this Options instance. + */ + public Options circularBufferSize(Long circularBufferSize) { + this.circularBufferSize = circularBufferSize; + return this; + } + + /** + * Sets the tfdbgRunId option. + * + * @param tfdbgRunId the tfdbgRunId option + * @return this Options instance. + */ + public Options tfdbgRunId(String tfdbgRunId) { + this.tfdbgRunId = tfdbgRunId; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNanCount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNanCount.java index 0c3648fcc53..fc1c74982e6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNanCount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNanCount.java @@ -17,6 +17,7 @@ package org.tensorflow.op.debugging; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,79 +26,40 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Debug NaN Value Counter Op. - *

* Counts number of NaNs in the input tensor, for debugging. */ public final class DebugNanCount extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.debugging.DebugNanCount} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deviceName - */ - public Options deviceName(String deviceName) { - this.deviceName = deviceName; - return this; - } - - /** - * @param tensorName Name of the input tensor. - */ - public Options tensorName(String tensorName) { - this.tensorName = tensorName; - return this; - } - - /** - * @param debugUrls List of URLs to debug targets, e.g., - * file:///foo/tfdbg_dump, grpc:://localhost:11011. - */ - public Options debugUrls(List debugUrls) { - this.debugUrls = debugUrls; - return this; - } - - /** - * @param gatedGrpc Whether this op will be gated. If any of the debug_urls of this - * debug node is of the grpc:// scheme, when the value of this attribute is set - * to True, the data will not actually be sent via the grpc stream unless this - * debug op has been enabled at the debug_url. If all of the debug_urls of this - * debug node are of the grpc:// scheme and the debug op is enabled at none of - * them, the output will be an empty Tensor. - */ - public Options gatedGrpc(Boolean gatedGrpc) { - this.gatedGrpc = gatedGrpc; - return this; - } - - private String deviceName; - private String tensorName; - private List debugUrls; - private Boolean gatedGrpc; - - private Options() { - } + public static final String OP_NAME = "DebugNanCount"; + + private Output output; + + private DebugNanCount(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DebugNanCount operation. - * + * * @param scope current scope * @param input Input tensor, non-Reference type. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of DebugNanCount */ - @Endpoint(describeByClass = true) - public static DebugNanCount create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DebugNanCount create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DebugNanCount", scope.makeOpName("DebugNanCount")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -111,7 +73,7 @@ public static DebugNanCount create(Scope scope, Operand input, } if (opts.debugUrls != null) { String[] debugUrlsArray = new String[opts.debugUrls.size()]; - for (int i = 0; i < debugUrlsArray.length; ++i) { + for (int i = 0 ; i < debugUrlsArray.length ; i++) { debugUrlsArray[i] = opts.debugUrls.get(i); } opBuilder.setAttr("debug_urls", debugUrlsArray); @@ -123,60 +85,153 @@ public static DebugNanCount create(Scope scope, Operand input, } return new DebugNanCount(opBuilder.build()); } - + /** - * @param deviceName + * Sets the deviceName option. + * + * @param deviceName the deviceName option + * @return this Options instance. */ public static Options deviceName(String deviceName) { return new Options().deviceName(deviceName); } - + /** + * Sets the tensorName option. + * * @param tensorName Name of the input tensor. + * @return this Options instance. */ public static Options tensorName(String tensorName) { return new Options().tensorName(tensorName); } - + /** + * Sets the debugUrls option. + * * @param debugUrls List of URLs to debug targets, e.g., - * file:///foo/tfdbg_dump, grpc:://localhost:11011. + * file:///foo/tfdbg_dump, grpc:://localhost:11011. + * @return this Options instance. */ public static Options debugUrls(List debugUrls) { return new Options().debugUrls(debugUrls); } - + + /** + * Sets the debugUrls option. + * + * @param debugUrls List of URLs to debug targets, e.g., + * file:///foo/tfdbg_dump, grpc:://localhost:11011. + * @return this Options instance. + */ + public static Options debugUrls(String[] debugUrls) { + return new Options().debugUrls(debugUrls); + } + /** - * @param gatedGrpc Whether this op will be gated. If any of the debug_urls of this - * debug node is of the grpc:// scheme, when the value of this attribute is set - * to True, the data will not actually be sent via the grpc stream unless this - * debug op has been enabled at the debug_url. If all of the debug_urls of this - * debug node are of the grpc:// scheme and the debug op is enabled at none of - * them, the output will be an empty Tensor. + * Sets the gatedGrpc option. + * + * @param gatedGrpc Whether this op will be gated. If any of the debug_urls of this + * debug node is of the grpc:// scheme, when the value of this attribute is set + * to True, the data will not actually be sent via the grpc stream unless this + * debug op has been enabled at the debug_url. If all of the debug_urls of this + * debug node are of the grpc:// scheme and the debug op is enabled at none of + * them, the output will be an empty Tensor. + * @return this Options instance. */ public static Options gatedGrpc(Boolean gatedGrpc) { return new Options().gatedGrpc(gatedGrpc); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugNanCount"; - - private Output output; - - private DebugNanCount(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.debugging.DebugNanCount} + */ + public static class Options { + private String deviceName; + + private String tensorName; + + private List debugUrls; + + private Boolean gatedGrpc; + + private Options() { + } + + /** + * Sets the deviceName option. + * + * @param deviceName the deviceName option + * @return this Options instance. + */ + public Options deviceName(String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Sets the tensorName option. + * + * @param tensorName Name of the input tensor. + * @return this Options instance. + */ + public Options tensorName(String tensorName) { + this.tensorName = tensorName; + return this; + } + + /** + * Sets the debugUrls option. + * + * @param debugUrls List of URLs to debug targets, e.g., + * file:///foo/tfdbg_dump, grpc:://localhost:11011. + * @return this Options instance. + */ + public Options debugUrls(List debugUrls) { + this.debugUrls = debugUrls; + return this; + } + + /** + * Sets the debugUrls option. + * + * @param debugUrls List of URLs to debug targets, e.g., + * file:///foo/tfdbg_dump, grpc:://localhost:11011. + * @return this Options instance. + */ + public Options debugUrls(String... debugUrls) { + this.debugUrls = Arrays.asList(debugUrls); + return this; + } + + /** + * Sets the gatedGrpc option. + * + * @param gatedGrpc Whether this op will be gated. If any of the debug_urls of this + * debug node is of the grpc:// scheme, when the value of this attribute is set + * to True, the data will not actually be sent via the grpc stream unless this + * debug op has been enabled at the debug_url. If all of the debug_urls of this + * debug node are of the grpc:// scheme and the debug op is enabled at none of + * them, the output will be an empty Tensor. + * @return this Options instance. + */ + public Options gatedGrpc(Boolean gatedGrpc) { + this.gatedGrpc = gatedGrpc; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java index 7482e821f72..d06285ff947 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/debugging/DebugNumericsSummary.java @@ -25,114 +25,47 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Debug Numeric Summary V2 Op. - *

* Computes a numeric summary of the input tensor. The shape of the output * depends on the tensor_debug_mode attribute. * This op is used internally by TensorFlow Debugger (tfdbg) v2. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class DebugNumericsSummary extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.debugging.DebugNumericsSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tensorDebugMode Tensor debug mode: the mode in which the input tensor is summarized - * by the op. See the TensorDebugMode enum in - * tensorflow/core/protobuf/debug_event.proto for details. - *

- * Supported values: - * 2 (CURT_HEALTH): Output a float32/64 tensor of shape [2]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The 2nd - * element is a bit which is set to 1 if the input tensor has an - * infinity or nan value, or zero otherwise. - *

- * 3 (CONCISE_HEALTH): Output a float32/64 tensor of shape [5]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The - * remaining four slots are the total number of elements, -infs, - * +infs, and nans in the input tensor respectively. - *

- * 4 (FULL_HEALTH): Output a float32/64 tensor of shape [11]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The 2nd - * element is the device_id, if provided, and -1 otherwise. The 3rd - * element holds the datatype value of the input tensor as according - * to the enumerated type in tensorflow/core/framework/types.proto. - * The remaining elements hold the total number of elements, -infs, - * +infs, nans, negative finite numbers, zeros, and positive finite - * numbers in the input tensor respectively. - *

- * 5 (SHAPE): Output a float32/64 tensor of shape [10]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The 2nd - * element holds the datatype value of the input tensor as according - * to the enumerated type in tensorflow/core/framework/types.proto. - * The 3rd element holds the rank of the tensor. The 4th element holds - * the number of elements within the tensor. Finally the remaining 6 - * elements hold the shape of the tensor. If the rank of the tensor - * is lower than 6, the shape is right padded with zeros. If the rank - * is greater than 6, the head of the shape is truncated. - *

- * 6 (FULL_NUMERICS): Output a float32/64 tensor of shape [22]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The 2nd - * element is the device_id, if provided, and -1 otherwise. The 3rd - * element holds the datatype value of the input tensor as according - * to the enumerated type in tensorflow/core/framework/types.proto. - * The 4th element holds the rank of the tensor. The 5th to 11th - * elements hold the shape of the tensor. If the rank of the tensor - * is lower than 6, the shape is right padded with zeros. If the rank - * is greater than 6, the head of the shape is truncated. The 12th to - * 18th elements hold the number of elements, -infs, +infs, nans, - * denormal floats, negative finite numbers, zeros, and positive - * finite numbers in the input tensor respectively. The final four - * elements hold the min value, max value, mean, and variance of the - * input tensor. - *

- * 8 (REDUCE_INF_NAN_THREE_SLOTS): Output a float32/64 tensor of shape - * [3]. The 1st element is -inf if any elements of the input tensor - * is -inf, or zero otherwise. The 2nd element is +inf if any elements - * of the input tensor is +inf, or zero otherwise. The 3rd element is - * nan if any element of the input tensor is nan, or zero otherwise. - */ - public Options tensorDebugMode(Long tensorDebugMode) { - this.tensorDebugMode = tensorDebugMode; - return this; - } - - /** - * @param tensorId Optional. An integer identifier for the tensor being summarized by this op. - */ - public Options tensorId(Long tensorId) { - this.tensorId = tensorId; - return this; - } - - private Long tensorDebugMode; - private Long tensorId; - - private Options() { - } + public static final String OP_NAME = "DebugNumericSummaryV2"; + + private Output output; + + private DebugNumericsSummary(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new DebugNumericsSummary operation. - * + * Factory method to create a class wrapping a new DebugNumericSummaryV2 operation. + * * @param scope current scope * @param input Input tensor, to be summarized by the op. * @param outputDtype Optional. The type of the output. Can be float32 or float64 (default: float32). - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DebugNumericSummaryV2} output and operands * @return a new instance of DebugNumericsSummary */ - @Endpoint(describeByClass = true) - public static DebugNumericsSummary create(Scope scope, Operand input, Class outputDtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DebugNumericsSummary create(Scope scope, + Operand input, Class outputDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DebugNumericSummaryV2", scope.makeOpName("DebugNumericsSummary")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -147,108 +80,184 @@ public static DebugNumericsSummary create(Scope scope, Op } } } - return new DebugNumericsSummary(opBuilder.build()); + return new DebugNumericsSummary<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new DebugNumericsSummary operation using default output types. - * + * Factory method to create a class wrapping a new DebugNumericSummaryV2 operation, with the default output types. + * * @param scope current scope * @param input Input tensor, to be summarized by the op. - * @param options carries optional attributes values - * @return a new instance of DebugNumericsSummary + * @param options carries optional attribute values + * @return a new instance of DebugNumericsSummary, with default output types */ - @Endpoint(describeByClass = true) - public static DebugNumericsSummary create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DebugNumericsSummary create(Scope scope, Operand input, + Options[] options) { return create(scope, input, TFloat32.class, options); } - + /** + * Sets the tensorDebugMode option. + * * @param tensorDebugMode Tensor debug mode: the mode in which the input tensor is summarized - * by the op. See the TensorDebugMode enum in - * tensorflow/core/protobuf/debug_event.proto for details. - *

- * Supported values: - * 2 (CURT_HEALTH): Output a float32/64 tensor of shape [2]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The 2nd - * element is a bit which is set to 1 if the input tensor has an - * infinity or nan value, or zero otherwise. - *

- * 3 (CONCISE_HEALTH): Output a float32/64 tensor of shape [5]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The - * remaining four slots are the total number of elements, -infs, - * +infs, and nans in the input tensor respectively. - *

- * 4 (FULL_HEALTH): Output a float32/64 tensor of shape [11]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The 2nd - * element is the device_id, if provided, and -1 otherwise. The 3rd - * element holds the datatype value of the input tensor as according - * to the enumerated type in tensorflow/core/framework/types.proto. - * The remaining elements hold the total number of elements, -infs, - * +infs, nans, negative finite numbers, zeros, and positive finite - * numbers in the input tensor respectively. - *

- * 5 (SHAPE): Output a float32/64 tensor of shape [10]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The 2nd - * element holds the datatype value of the input tensor as according - * to the enumerated type in tensorflow/core/framework/types.proto. - * The 3rd element holds the rank of the tensor. The 4th element holds - * the number of elements within the tensor. Finally the remaining 6 - * elements hold the shape of the tensor. If the rank of the tensor - * is lower than 6, the shape is right padded with zeros. If the rank - * is greater than 6, the head of the shape is truncated. - *

- * 6 (FULL_NUMERICS): Output a float32/64 tensor of shape [22]. The 1st - * element is the tensor_id, if provided, and -1 otherwise. The 2nd - * element is the device_id, if provided, and -1 otherwise. The 3rd - * element holds the datatype value of the input tensor as according - * to the enumerated type in tensorflow/core/framework/types.proto. - * The 4th element holds the rank of the tensor. The 5th to 11th - * elements hold the shape of the tensor. If the rank of the tensor - * is lower than 6, the shape is right padded with zeros. If the rank - * is greater than 6, the head of the shape is truncated. The 12th to - * 18th elements hold the number of elements, -infs, +infs, nans, - * denormal floats, negative finite numbers, zeros, and positive - * finite numbers in the input tensor respectively. The final four - * elements hold the min value, max value, mean, and variance of the - * input tensor. - *

- * 8 (REDUCE_INF_NAN_THREE_SLOTS): Output a float32/64 tensor of shape - * [3]. The 1st element is -inf if any elements of the input tensor - * is -inf, or zero otherwise. The 2nd element is +inf if any elements - * of the input tensor is +inf, or zero otherwise. The 3rd element is - * nan if any element of the input tensor is nan, or zero otherwise. + * by the op. See the TensorDebugMode enum in + * tensorflow/core/protobuf/debug_event.proto for details. + *

Supported values: + * 2 (CURT_HEALTH): Output a float32/64 tensor of shape [2]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element is a bit which is set to 1 if the input tensor has an + * infinity or nan value, or zero otherwise. + *

3 (CONCISE_HEALTH): Output a float32/64 tensor of shape [5]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The + * remaining four slots are the total number of elements, -infs, + * +infs, and nans in the input tensor respectively. + *

4 (FULL_HEALTH): Output a float32/64 tensor of shape [11]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element is the device_id, if provided, and -1 otherwise. The 3rd + * element holds the datatype value of the input tensor as according + * to the enumerated type in tensorflow/core/framework/types.proto. + * The remaining elements hold the total number of elements, -infs, + * +infs, nans, negative finite numbers, zeros, and positive finite + * numbers in the input tensor respectively. + *

5 (SHAPE): Output a float32/64 tensor of shape [10]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element holds the datatype value of the input tensor as according + * to the enumerated type in tensorflow/core/framework/types.proto. + * The 3rd element holds the rank of the tensor. The 4th element holds + * the number of elements within the tensor. Finally the remaining 6 + * elements hold the shape of the tensor. If the rank of the tensor + * is lower than 6, the shape is right padded with zeros. If the rank + * is greater than 6, the head of the shape is truncated. + *

6 (FULL_NUMERICS): Output a float32/64 tensor of shape [22]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element is the device_id, if provided, and -1 otherwise. The 3rd + * element holds the datatype value of the input tensor as according + * to the enumerated type in tensorflow/core/framework/types.proto. + * The 4th element holds the rank of the tensor. The 5th to 11th + * elements hold the shape of the tensor. If the rank of the tensor + * is lower than 6, the shape is right padded with zeros. If the rank + * is greater than 6, the head of the shape is truncated. The 12th to + * 18th elements hold the number of elements, -infs, +infs, nans, + * denormal floats, negative finite numbers, zeros, and positive + * finite numbers in the input tensor respectively. The final four + * elements hold the min value, max value, mean, and variance of the + * input tensor. + *

8 (REDUCE_INF_NAN_THREE_SLOTS): Output a float32/64 tensor of shape + * [3]. The 1st element is -inf if any elements of the input tensor + * is -inf, or zero otherwise. The 2nd element is +inf if any elements + * of the input tensor is +inf, or zero otherwise. The 3rd element is + * nan if any element of the input tensor is nan, or zero otherwise. + * @return this Options instance. */ public static Options tensorDebugMode(Long tensorDebugMode) { return new Options().tensorDebugMode(tensorDebugMode); } - + /** + * Sets the tensorId option. + * * @param tensorId Optional. An integer identifier for the tensor being summarized by this op. + * @return this Options instance. */ public static Options tensorId(Long tensorId) { return new Options().tensorId(tensorId); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DebugNumericSummaryV2"; - - private Output output; - - private DebugNumericsSummary(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.debugging.DebugNumericsSummary} + */ + public static class Options { + private Long tensorDebugMode; + + private Long tensorId; + + private Options() { + } + + /** + * Sets the tensorDebugMode option. + * + * @param tensorDebugMode Tensor debug mode: the mode in which the input tensor is summarized + * by the op. See the TensorDebugMode enum in + * tensorflow/core/protobuf/debug_event.proto for details. + *

Supported values: + * 2 (CURT_HEALTH): Output a float32/64 tensor of shape [2]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element is a bit which is set to 1 if the input tensor has an + * infinity or nan value, or zero otherwise. + *

3 (CONCISE_HEALTH): Output a float32/64 tensor of shape [5]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The + * remaining four slots are the total number of elements, -infs, + * +infs, and nans in the input tensor respectively. + *

4 (FULL_HEALTH): Output a float32/64 tensor of shape [11]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element is the device_id, if provided, and -1 otherwise. The 3rd + * element holds the datatype value of the input tensor as according + * to the enumerated type in tensorflow/core/framework/types.proto. + * The remaining elements hold the total number of elements, -infs, + * +infs, nans, negative finite numbers, zeros, and positive finite + * numbers in the input tensor respectively. + *

5 (SHAPE): Output a float32/64 tensor of shape [10]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element holds the datatype value of the input tensor as according + * to the enumerated type in tensorflow/core/framework/types.proto. + * The 3rd element holds the rank of the tensor. The 4th element holds + * the number of elements within the tensor. Finally the remaining 6 + * elements hold the shape of the tensor. If the rank of the tensor + * is lower than 6, the shape is right padded with zeros. If the rank + * is greater than 6, the head of the shape is truncated. + *

6 (FULL_NUMERICS): Output a float32/64 tensor of shape [22]. The 1st + * element is the tensor_id, if provided, and -1 otherwise. The 2nd + * element is the device_id, if provided, and -1 otherwise. The 3rd + * element holds the datatype value of the input tensor as according + * to the enumerated type in tensorflow/core/framework/types.proto. + * The 4th element holds the rank of the tensor. The 5th to 11th + * elements hold the shape of the tensor. If the rank of the tensor + * is lower than 6, the shape is right padded with zeros. If the rank + * is greater than 6, the head of the shape is truncated. The 12th to + * 18th elements hold the number of elements, -infs, +infs, nans, + * denormal floats, negative finite numbers, zeros, and positive + * finite numbers in the input tensor respectively. The final four + * elements hold the min value, max value, mean, and variance of the + * input tensor. + *

8 (REDUCE_INF_NAN_THREE_SLOTS): Output a float32/64 tensor of shape + * [3]. The 1st element is -inf if any elements of the input tensor + * is -inf, or zero otherwise. The 2nd element is +inf if any elements + * of the input tensor is +inf, or zero otherwise. The 3rd element is + * nan if any element of the input tensor is nan, or zero otherwise. + * @return this Options instance. + */ + public Options tensorDebugMode(Long tensorDebugMode) { + this.tensorDebugMode = tensorDebugMode; + return this; + } + + /** + * Sets the tensorId option. + * + * @param tensorId Optional. An integer identifier for the tensor being summarized by this op. + * @return this Options instance. + */ + public Options tensorId(Long tensorId) { + this.tensorId = tensorId; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclAllReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclAllReduce.java index 8eacb80357a..9fca1e2f8f9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclAllReduce.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclAllReduce.java @@ -24,69 +24,73 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * 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 `c`, - * then `num_devices` ops will run with shared_name value `c`. Failure to do so + *

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 `num_devices` 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. * num_devices: The number of devices participating in this reduction. * shared_name: Identifier that shared between ops of the same reduction. - * - * @param data type for {@code data()} output + * + * @param data type for {@code data} output */ public final class NcclAllReduce extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NcclAllReduce"; + + private Output data; + + private NcclAllReduce(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclAllReduce operation. - * + * * @param scope current scope - * @param input - * @param reduction - * @param numDevices - * @param sharedName + * @param input the input value + * @param reduction the value of the reduction property + * @param numDevices the value of the numDevices property + * @param sharedName the value of the sharedName property + * @param data type for {@code NcclAllReduce} output and operands * @return a new instance of NcclAllReduce */ - @Endpoint(describeByClass = true) - public static NcclAllReduce create(Scope scope, Operand input, String reduction, Long numDevices, String sharedName) { + @Endpoint( + describeByClass = true + ) + public static NcclAllReduce create(Scope scope, Operand input, + String reduction, Long numDevices, String sharedName) { OperationBuilder opBuilder = scope.env().opBuilder("NcclAllReduce", scope.makeOpName("NcclAllReduce")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("reduction", reduction); opBuilder.setAttr("num_devices", numDevices); opBuilder.setAttr("shared_name", sharedName); - return new NcclAllReduce(opBuilder.build()); + return new NcclAllReduce<>(opBuilder.build()); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclAllReduce"; - - private Output data; - - private NcclAllReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclBroadcast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclBroadcast.java index 9a0557fb6e8..3ec4061857d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclBroadcast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclBroadcast.java @@ -25,62 +25,65 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * Sends `input` to all devices that are connected to the output. - *

- * Sends `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 + * 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. + *

input: The input to the broadcast. * output: The same as input. * shape: The shape of the input tensor. - * - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class NcclBroadcast extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NcclBroadcast"; + + private Output output; + + private NcclBroadcast(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclBroadcast operation. - * + * * @param scope current scope - * @param input - * @param shape + * @param input the input value + * @param shape the value of the shape property + * @param data type for {@code NcclBroadcast} output and operands * @return a new instance of NcclBroadcast */ - @Endpoint(describeByClass = true) - public static NcclBroadcast create(Scope scope, Operand input, Shape shape) { + @Endpoint( + describeByClass = true + ) + public static NcclBroadcast create(Scope scope, Operand input, + Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("NcclBroadcast", scope.makeOpName("NcclBroadcast")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new NcclBroadcast(opBuilder.build()); + return new NcclBroadcast<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclBroadcast"; - - private Output output; - - private NcclBroadcast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclReduce.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclReduce.java index cc0c25b3c5a..67a947860b0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclReduce.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/distribute/NcclReduce.java @@ -25,61 +25,65 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * Reduces `input` from `num_devices` using `reduction` to a single device. - *

- * Reduces `input` from `num_devices` using `reduction` to a single device. - *

- * The graph should be constructed so that all inputs have a valid device + * 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 `num_devices` 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 data type for {@code data()} output + * + * @param data type for {@code data} output */ public final class NcclReduce extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NcclReduce"; + + private Output data; + + private NcclReduce(Operation operation) { + super(operation); + int outputIdx = 0; + data = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NcclReduce operation. - * + * * @param scope current scope - * @param input - * @param reduction + * @param input the input value + * @param reduction the value of the reduction property + * @param data type for {@code NcclReduce} output and operands * @return a new instance of NcclReduce */ - @Endpoint(describeByClass = true) - public static NcclReduce create(Scope scope, Iterable> input, String reduction) { + @Endpoint( + describeByClass = true + ) + public static NcclReduce create(Scope scope, Iterable> input, + String reduction) { OperationBuilder opBuilder = scope.env().opBuilder("NcclReduce", scope.makeOpName("NcclReduce")); opBuilder.addInputList(Operands.asOutputs(input)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("reduction", reduction); - return new NcclReduce(opBuilder.build()); + return new NcclReduce<>(opBuilder.build()); } - + /** + * Gets data. + * + * @return data. */ public Output data() { return data; } - + @Override public Output asOutput() { return data; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NcclReduce"; - - private Output data; - - private NcclReduce(Operation operation) { - super(operation); - int outputIdx = 0; - data = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java index 90405452574..e1bfd6c3e28 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/AsString.java @@ -30,92 +30,50 @@ /** * Converts each entry in the given tensor to strings. - *

* Supports many numeric types and boolean. - *

- * For Unicode, see the + *

For Unicode, see the * [https://www.tensorflow.org/tutorials/representation/unicode](Working with Unicode text) * tutorial. - *

- * Examples: - *

- * >>> tf.strings.as_string([3, 2]) - * - * >>> tf.strings.as_string([3.1415926, 2.71828], precision=2).numpy() + *

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) + *

+ *
+ *
*/ -@Operator(group = "dtypes") +@Operator( + group = "dtypes" +) public final class AsString extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.dtypes.AsString} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param precision The post-decimal precision to use for floating point numbers. - * Only used if precision > -1. - */ - public Options precision(Long precision) { - this.precision = precision; - return this; - } - - /** - * @param scientific Use scientific notation for floating point numbers. - */ - public Options scientific(Boolean scientific) { - this.scientific = scientific; - return this; - } - - /** - * @param shortest Use shortest representation (either scientific or standard) for - * floating point numbers. - */ - public Options shortest(Boolean shortest) { - this.shortest = shortest; - return this; - } - - /** - * @param width Pad pre-decimal numbers to this width. - * Applies to both floating point and integer numbers. - * Only used if width > -1. - */ - public Options width(Long width) { - this.width = width; - return this; - } - - /** - * @param fill The value to pad if width > -1. If empty, pads with spaces. - * Another typical value is '0'. String cannot be longer than 1 character. - */ - public Options fill(String fill) { - this.fill = fill; - return this; - } - - private Long precision; - private Boolean scientific; - private Boolean shortest; - private Long width; - private String fill; - - private Options() { - } + public static final String OP_NAME = "AsString"; + + private Output output; + + private AsString(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AsString operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static AsString create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AsString", scope.makeOpName("AsString")); opBuilder.addInput(input.asOutput()); @@ -141,66 +99,151 @@ public static AsString create(Scope scope, Operand input, Optio } return new AsString(opBuilder.build()); } - + /** + * Sets the precision option. + * * @param precision The post-decimal precision to use for floating point numbers. - * Only used if precision > -1. + * Only used if precision > -1. + * @return this Options instance. */ public static Options precision(Long precision) { return new Options().precision(precision); } - + /** + * Sets the scientific option. + * * @param scientific Use scientific notation for floating point numbers. + * @return this Options instance. */ public static Options scientific(Boolean scientific) { return new Options().scientific(scientific); } - + /** + * Sets the shortest option. + * * @param shortest Use shortest representation (either scientific or standard) for * floating point numbers. + * @return this Options instance. */ public static Options shortest(Boolean shortest) { return new Options().shortest(shortest); } - + /** + * Sets the width option. + * * @param width Pad pre-decimal numbers to this width. * Applies to both floating point and integer numbers. - * Only used if width > -1. + * Only used if width > -1. + * @return this Options instance. */ public static Options width(Long width) { return new Options().width(width); } - + /** - * @param fill The value to pad if width > -1. If empty, pads with spaces. + * Sets the fill option. + * + * @param fill The value to pad if width > -1. If empty, pads with spaces. * Another typical value is '0'. String cannot be longer than 1 character. + * @return this Options instance. */ public static Options fill(String fill) { return new Options().fill(fill); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AsString"; - - private Output output; - - private AsString(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.dtypes.AsString} + */ + public static class Options { + private Long precision; + + private Boolean scientific; + + private Boolean shortest; + + private Long width; + + private String fill; + + private Options() { + } + + /** + * Sets the precision option. + * + * @param precision The post-decimal precision to use for floating point numbers. + * Only used if precision > -1. + * @return this Options instance. + */ + public Options precision(Long precision) { + this.precision = precision; + return this; + } + + /** + * Sets the scientific option. + * + * @param scientific Use scientific notation for floating point numbers. + * @return this Options instance. + */ + public Options scientific(Boolean scientific) { + this.scientific = scientific; + return this; + } + + /** + * Sets the shortest option. + * + * @param shortest Use shortest representation (either scientific or standard) for + * floating point numbers. + * @return this Options instance. + */ + public Options shortest(Boolean shortest) { + this.shortest = shortest; + return this; + } + + /** + * Sets the width option. + * + * @param width Pad pre-decimal numbers to this width. + * Applies to both floating point and integer numbers. + * Only used if width > -1. + * @return this Options instance. + */ + public Options width(Long width) { + this.width = width; + return this; + } + + /** + * Sets the fill option. + * + * @param fill The value to pad if width > -1. If empty, pads with spaces. + * Another typical value is '0'. String cannot be longer than 1 character. + * @return this Options instance. + */ + public Options fill(String fill) { + this.fill = fill; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Cast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Cast.java index 06fe5919afd..925e2fdf87a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Cast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Cast.java @@ -30,42 +30,41 @@ /** * Cast x of type SrcT to y of DstT. - * - * @param data type for {@code y()} output + * + * @param data type for {@code y} output */ -@Operator(group = "dtypes") +@Operator( + group = "dtypes" +) public final class Cast extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.dtypes.Cast} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param Truncate - */ - public Options Truncate(Boolean Truncate) { - this.Truncate = Truncate; - return this; - } - - private Boolean Truncate; - - private Options() { - } + public static final String OP_NAME = "Cast"; + + private Output y; + + private Cast(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Cast operation. - * + * * @param scope current scope - * @param x - * @param DstT - * @param options carries optional attributes values + * @param x the x value + * @param DstT the value of the DstT property + * @param options carries optional attribute values + * @param data type for {@code Cast} output and operands * @return a new instance of Cast */ - @Endpoint(describeByClass = true) - public static Cast create(Scope scope, Operand x, Class DstT, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Cast create(Scope scope, Operand x, + Class DstT, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Cast", scope.makeOpName("Cast")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); @@ -77,35 +76,51 @@ public static Cast create(Scope scope, Operand(opBuilder.build()); + return new Cast<>(opBuilder.build()); } - + /** - * @param Truncate + * Sets the Truncate option. + * + * @param Truncate the Truncate option + * @return this Options instance. */ public static Options Truncate(Boolean Truncate) { return new Options().Truncate(Truncate); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cast"; - - private Output y; - - private Cast(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.dtypes.Cast} + */ + public static class Options { + private Boolean Truncate; + + private Options() { + } + + /** + * Sets the Truncate option. + * + * @param Truncate the Truncate option + * @return this Options instance. + */ + public Options Truncate(Boolean Truncate) { + this.Truncate = Truncate; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Complex.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Complex.java index 126d26f5945..2e9208f57a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Complex.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/Complex.java @@ -31,65 +31,72 @@ /** * 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]]
- * }
- * - * - * @param data type for {@code out()} output + * tf.complex(real, imag) ==> [[2.25 + 4.75j], [3.25 + 5.75j]] + *
+ * + * @param data type for {@code out} output */ -@Operator(group = "dtypes") +@Operator( + group = "dtypes" +) public final class Complex extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Complex"; + + private Output out; + + private Complex(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Complex operation. - * + * * @param scope current scope - * @param real - * @param imag - * @param Tout + * @param real the real value + * @param imag the imag value + * @param Tout the value of the Tout property + * @param data type for {@code Complex} output and operands + * @param data type for {@code Complex} output and operands * @return a new instance of Complex */ - @Endpoint(describeByClass = true) - public static Complex create(Scope scope, Operand real, Operand imag, Class Tout) { + @Endpoint( + describeByClass = true + ) + public static Complex create(Scope scope, Operand real, + Operand imag, Class Tout) { OperationBuilder opBuilder = scope.env().opBuilder("Complex", scope.makeOpName("Complex")); opBuilder.addInput(real.asOutput()); opBuilder.addInput(imag.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new Complex(opBuilder.build()); + return new Complex<>(opBuilder.build()); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Complex"; - - private Output out; - - private Complex(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/ToBool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/ToBool.java index 32b0e91eca4..bd8e87f20ab 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/ToBool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/dtypes/ToBool.java @@ -24,62 +24,69 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.family.TType; /** * 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 + *

    + *
  • + *

    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. */ public final class ToBool extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ToBool"; + + private Output output; + + private ToBool(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ToBool operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of ToBool */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ToBool create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("ToBool", scope.makeOpName("ToBool")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new ToBool(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ToBool"; - - private Output output; - - private ToBool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesAggregateStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesAggregateStats.java index 5991fee593d..39ed87bb4a6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesAggregateStats.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesAggregateStats.java @@ -24,20 +24,30 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; /** * Aggregates the summary of accumulated stats for the batch. - *

* The summary stats contains gradients and hessians accumulated for each node, feature dimension id and bucket. */ public final class BoostedTreesAggregateStats extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesAggregateStats"; + + private Output statsSummary; + + private BoostedTreesAggregateStats(Operation operation) { + super(operation); + int outputIdx = 0; + statsSummary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesAggregateStats operation. - * + * * @param scope current scope * @param nodeIds int32; Rank 1 Tensor containing node ids for each example, shape [batch_size]. * @param gradients float32; Rank 2 Tensor (shape=[batch_size, logits_dimension]) with gradients for each example. @@ -47,8 +57,12 @@ public final class BoostedTreesAggregateStats extends RawOp implements Operand nodeIds, Operand gradients, Operand hessians, Operand feature, Long maxSplits, Long numBuckets) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesAggregateStats create(Scope scope, Operand nodeIds, + Operand gradients, Operand hessians, Operand feature, + Long maxSplits, Long numBuckets) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesAggregateStats", scope.makeOpName("BoostedTreesAggregateStats")); opBuilder.addInput(nodeIds.asOutput()); opBuilder.addInput(gradients.asOutput()); @@ -59,28 +73,19 @@ public static BoostedTreesAggregateStats create(Scope scope, Operand nod opBuilder.setAttr("num_buckets", numBuckets); return new BoostedTreesAggregateStats(opBuilder.build()); } - + /** + * Gets statsSummary. * output Rank 4 Tensor (shape=[splits, feature_dimension, buckets, logits_dimension + hessian_dimension]) * containing accumulated stats for each node, feature dimension and bucket. + * @return statsSummary. */ public Output statsSummary() { return statsSummary; } - + @Override public Output asOutput() { return statsSummary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesAggregateStats"; - - private Output statsSummary; - - private BoostedTreesAggregateStats(Operation operation) { - super(operation); - int outputIdx = 0; - statsSummary = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesBucketize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesBucketize.java index 6bf473c044a..c6dbe81ae67 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesBucketize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesBucketize.java @@ -28,60 +28,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; /** * Bucketize each feature based on bucket boundaries. - *

* An op that returns a list of float tensors, where each tensor represents the * bucketized values for a single feature. */ public final class BoostedTreesBucketize extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesBucketize"; + + private List> buckets; + + @SuppressWarnings("unchecked") + private BoostedTreesBucketize(Operation operation) { + super(operation); + int outputIdx = 0; + int bucketsLength = operation.outputListLength("buckets"); + buckets = Arrays.asList((Output[]) operation.outputList(outputIdx, bucketsLength)); + outputIdx += bucketsLength; + } + /** * Factory method to create a class wrapping a new BoostedTreesBucketize operation. - * + * * @param scope current scope * @param floatValues float; List of Rank 1 Tensor each containing float values for a single feature. * @param bucketBoundaries float; List of Rank 1 Tensors each containing the bucket boundaries for a single * feature. * @return a new instance of BoostedTreesBucketize */ - @Endpoint(describeByClass = true) - public static BoostedTreesBucketize create(Scope scope, Iterable> floatValues, Iterable> bucketBoundaries) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesBucketize create(Scope scope, Iterable> floatValues, + Iterable> bucketBoundaries) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesBucketize", scope.makeOpName("BoostedTreesBucketize")); opBuilder.addInputList(Operands.asOutputs(floatValues)); opBuilder.addInputList(Operands.asOutputs(bucketBoundaries)); opBuilder = scope.apply(opBuilder); return new BoostedTreesBucketize(opBuilder.build()); } - + /** + * Gets buckets. * int; List of Rank 1 Tensors each containing the bucketized values for a single feature. + * @return buckets. */ public List> buckets() { return buckets; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) buckets.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesBucketize"; - - private List> buckets; - - @SuppressWarnings("unchecked") - private BoostedTreesBucketize(Operation operation) { - super(operation); - int outputIdx = 0; - int bucketsLength = operation.outputListLength("buckets"); - buckets = Arrays.asList((Output[])operation.outputList(outputIdx, bucketsLength)); - outputIdx += bucketsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplit.java index 757c198e1a3..478abad9db1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplit.java @@ -24,48 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; /** * Calculates gains for each feature and returns the best possible split information for the feature. - *

* The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature. - *

- * It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return `node_ids_list` for each feature, containing the list of nodes that this feature can be used to split. - *

- * In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features). - *

- * The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature. + *

It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return {@code node_ids_list} for each feature, containing the list of nodes that this feature can be used to split. + *

In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features). + *

The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature. */ public final class BoostedTreesCalculateBestFeatureSplit extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesCalculateBestFeatureSplit} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param splitType A string indicating if this Op should perform inequality split or equality split. - */ - public Options splitType(String splitType) { - this.splitType = splitType; - return this; - } - - private String splitType; - - private Options() { - } + public static final String OP_NAME = "BoostedTreesCalculateBestFeatureSplit"; + + private Output nodeIds; + + private Output gains; + + private Output featureDimensions; + + private Output thresholds; + + private Output leftNodeContribs; + + private Output rightNodeContribs; + + private Output splitWithDefaultDirections; + + private BoostedTreesCalculateBestFeatureSplit(Operation operation) { + super(operation); + int outputIdx = 0; + nodeIds = operation.output(outputIdx++); + gains = operation.output(outputIdx++); + featureDimensions = operation.output(outputIdx++); + thresholds = operation.output(outputIdx++); + leftNodeContribs = operation.output(outputIdx++); + rightNodeContribs = operation.output(outputIdx++); + splitWithDefaultDirections = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BoostedTreesCalculateBestFeatureSplit operation. - * + * * @param scope current scope - * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive). + * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within {@code stats_summary_list}. The nodes are iterated between the two nodes specified by the tensor, as like {@code for node_id in range(node_id_range[0], node_id_range[1])} (Note that the last index node_id_range[1] is exclusive). * @param statsSummary A Rank 4 tensor (#shape=[max_splits, feature_dims, bucket, stats_dims]) for accumulated stats summary (gradient/hessian) per node, per dimension, per buckets for each feature. * The first dimension of the tensor is the maximum number of splits, and thus not all elements of it will be used, but only the indexes specified by node_ids will be used. * @param l1 l1 regularization factor on leaf weights, per instance based. @@ -73,11 +79,16 @@ private Options() { * @param treeComplexity adjustment to the gain, per leaf based. * @param minNodeWeight minimum avg of hessians in a node before required for the node to be considered for splitting. * @param logitsDimension The dimension of logit, i.e., number of classes. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BoostedTreesCalculateBestFeatureSplit */ - @Endpoint(describeByClass = true) - public static BoostedTreesCalculateBestFeatureSplit create(Scope scope, Operand nodeIdRange, Operand statsSummary, Operand l1, Operand l2, Operand treeComplexity, Operand minNodeWeight, Long logitsDimension, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesCalculateBestFeatureSplit create(Scope scope, + Operand nodeIdRange, Operand statsSummary, Operand l1, + Operand l2, Operand treeComplexity, Operand minNodeWeight, + Long logitsDimension, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesCalculateBestFeatureSplit", scope.makeOpName("BoostedTreesCalculateBestFeatureSplit")); opBuilder.addInput(nodeIdRange.asOutput()); opBuilder.addInput(statsSummary.asOutput()); @@ -96,84 +107,99 @@ public static BoostedTreesCalculateBestFeatureSplit create(Scope scope, Operand< } return new BoostedTreesCalculateBestFeatureSplit(opBuilder.build()); } - + /** + * Sets the splitType option. + * * @param splitType A string indicating if this Op should perform inequality split or equality split. + * @return this Options instance. */ public static Options splitType(String splitType) { return new Options().splitType(splitType); } - + /** + * Gets nodeIds. * A Rank 1 tensors indicating possible split node ids for each feature. The length of the list is num_features, but each tensor has different size as each feature provides different possible nodes. See above for details like shapes and sizes. + * @return nodeIds. */ public Output nodeIds() { return nodeIds; } - + /** + * Gets gains. * A Rank 1 tensors indicating the best gains for each feature to split for certain nodes. See above for details like shapes and sizes. + * @return gains. */ public Output gains() { return gains; } - + /** + * Gets featureDimensions. * A Rank 1 tensors indicating the best feature dimension for each feature to split for certain nodes if the feature is multi-dimension. See above for details like shapes and sizes. + * @return featureDimensions. */ public Output featureDimensions() { return featureDimensions; } - + /** + * Gets thresholds. * A Rank 1 tensors indicating the bucket id to compare with (as a threshold) for split in each node. See above for details like shapes and sizes. + * @return thresholds. */ public Output thresholds() { return thresholds; } - + /** + * Gets leftNodeContribs. * A Rank 2 tensors indicating the contribution of the left nodes when branching from parent nodes (given by the tensor element in the output node_ids_list) to the left direction by the given threshold for each feature. This value will be used to make the left node value by adding to the parent node value. Second dimension size is 1 for 1-dimensional logits, but would be larger for multi-class problems. See above for details like shapes and sizes. + * @return leftNodeContribs. */ public Output leftNodeContribs() { return leftNodeContribs; } - + /** + * Gets rightNodeContribs. * A Rank 2 tensors, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. + * @return rightNodeContribs. */ public Output rightNodeContribs() { return rightNodeContribs; } - + /** + * Gets splitWithDefaultDirections. * A Rank 1 tensors indicating the which direction to go if data is missing. See above for details like shapes and sizes. * Inequality with default left returns 0, inequality with default right returns 1, equality with default right returns 2. + * @return splitWithDefaultDirections. */ public Output splitWithDefaultDirections() { return splitWithDefaultDirections; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesCalculateBestFeatureSplit"; - - private Output nodeIds; - private Output gains; - private Output featureDimensions; - private Output thresholds; - private Output leftNodeContribs; - private Output rightNodeContribs; - private Output splitWithDefaultDirections; - - private BoostedTreesCalculateBestFeatureSplit(Operation operation) { - super(operation); - int outputIdx = 0; - nodeIds = operation.output(outputIdx++); - gains = operation.output(outputIdx++); - featureDimensions = operation.output(outputIdx++); - thresholds = operation.output(outputIdx++); - leftNodeContribs = operation.output(outputIdx++); - rightNodeContribs = operation.output(outputIdx++); - splitWithDefaultDirections = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesCalculateBestFeatureSplit} + */ + public static class Options { + private String splitType; + + private Options() { + } + + /** + * Sets the splitType option. + * + * @param splitType A string indicating if this Op should perform inequality split or equality split. + * @return this Options instance. + */ + public Options splitType(String splitType) { + this.splitType = splitType; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplitV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplitV2.java index dee309bbc36..76d9c8142bd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplitV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestFeatureSplitV2.java @@ -25,29 +25,57 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; /** * Calculates gains for each feature and returns the best possible split information for each node. However, if no split is found, then no split information is returned for that node. - *

* The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature. - *

- * It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return `node_ids_list` for each feature, containing the list of nodes that this feature can be used to split. - *

- * In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features). - *

- * The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature. + *

It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return {@code node_ids_list} for each feature, containing the list of nodes that this feature can be used to split. + *

In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features). + *

The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature. */ public final class BoostedTreesCalculateBestFeatureSplitV2 extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesCalculateBestFeatureSplitV2"; + + private Output nodeIds; + + private Output gains; + + private Output featureIds; + + private Output featureDimensions; + + private Output thresholds; + + private Output leftNodeContribs; + + private Output rightNodeContribs; + + private Output splitWithDefaultDirections; + + private BoostedTreesCalculateBestFeatureSplitV2(Operation operation) { + super(operation); + int outputIdx = 0; + nodeIds = operation.output(outputIdx++); + gains = operation.output(outputIdx++); + featureIds = operation.output(outputIdx++); + featureDimensions = operation.output(outputIdx++); + thresholds = operation.output(outputIdx++); + leftNodeContribs = operation.output(outputIdx++); + rightNodeContribs = operation.output(outputIdx++); + splitWithDefaultDirections = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesCalculateBestFeatureSplitV2 operation. - * + * * @param scope current scope - * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive). + * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within {@code stats_summary_list}. The nodes are iterated between the two nodes specified by the tensor, as like {@code for node_id in range(node_id_range[0], node_id_range[1])} (Note that the last index node_id_range[1] is exclusive). * @param statsSummariesList A list of Rank 4 tensor (#shape=[max_splits, feature_dims, bucket, stats_dims]) for accumulated stats summary (gradient/hessian) per node, per dimension, per buckets for each feature. * The first dimension of the tensor is the maximum number of splits, and thus not all elements of it will be used, but only the indexes specified by node_ids will be used. * @param splitTypes A Rank 1 tensor indicating if this Op should perform inequality split or equality split per feature. @@ -59,8 +87,14 @@ public final class BoostedTreesCalculateBestFeatureSplitV2 extends RawOp { * @param logitsDimension The dimension of logit, i.e., number of classes. * @return a new instance of BoostedTreesCalculateBestFeatureSplitV2 */ - @Endpoint(describeByClass = true) - public static BoostedTreesCalculateBestFeatureSplitV2 create(Scope scope, Operand nodeIdRange, Iterable> statsSummariesList, Operand splitTypes, Operand candidateFeatureIds, Operand l1, Operand l2, Operand treeComplexity, Operand minNodeWeight, Long logitsDimension) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesCalculateBestFeatureSplitV2 create(Scope scope, + Operand nodeIdRange, Iterable> statsSummariesList, + Operand splitTypes, Operand candidateFeatureIds, Operand l1, + Operand l2, Operand treeComplexity, Operand minNodeWeight, + Long logitsDimension) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesCalculateBestFeatureSplitV2", scope.makeOpName("BoostedTreesCalculateBestFeatureSplitV2")); opBuilder.addInput(nodeIdRange.asOutput()); opBuilder.addInputList(Operands.asOutputs(statsSummariesList)); @@ -74,86 +108,77 @@ public static BoostedTreesCalculateBestFeatureSplitV2 create(Scope scope, Operan opBuilder.setAttr("logits_dimension", logitsDimension); return new BoostedTreesCalculateBestFeatureSplitV2(opBuilder.build()); } - + /** + * Gets nodeIds. * A Rank 1 tensors indicating possible split node ids for each feature. The length of the list is num_features, but each tensor has different size as each feature provides different possible nodes. See above for details like shapes and sizes. + * @return nodeIds. */ public Output nodeIds() { return nodeIds; } - + /** + * Gets gains. * A Rank 1 tensor indicating the best gains for each feature to split for certain nodes. See above for details like shapes and sizes. + * @return gains. */ public Output gains() { return gains; } - + /** + * Gets featureIds. * A Rank 1 tensors indicating the best feature id for each node. See above for details like shapes and sizes. + * @return featureIds. */ public Output featureIds() { return featureIds; } - + /** + * Gets featureDimensions. * A Rank 1 tensors indicating the best feature dimension for each feature to split for certain nodes if the feature is multi-dimension. See above for details like shapes and sizes. + * @return featureDimensions. */ public Output featureDimensions() { return featureDimensions; } - + /** + * Gets thresholds. * A Rank 1 tensors indicating the bucket id to compare with (as a threshold) for split in each node. See above for details like shapes and sizes. + * @return thresholds. */ public Output thresholds() { return thresholds; } - + /** + * Gets leftNodeContribs. * A Rank 2 tensors indicating the contribution of the left nodes when branching from parent nodes (given by the tensor element in the output node_ids_list) to the left direction by the given threshold for each feature. This value will be used to make the left node value by adding to the parent node value. Second dimension size is 1 for 1-dimensional logits, but would be larger for multi-class problems. See above for details like shapes and sizes. + * @return leftNodeContribs. */ public Output leftNodeContribs() { return leftNodeContribs; } - + /** + * Gets rightNodeContribs. * A Rank 2 tensors, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. + * @return rightNodeContribs. */ public Output rightNodeContribs() { return rightNodeContribs; } - + /** + * Gets splitWithDefaultDirections. * A Rank 1 tensors indicating the which direction to go if data is missing. See above for details like shapes and sizes. * Inequality with default left returns 0, inequality with default right returns 1, equality with default right returns 2. + * @return splitWithDefaultDirections. */ public Output splitWithDefaultDirections() { return splitWithDefaultDirections; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesCalculateBestFeatureSplitV2"; - - private Output nodeIds; - private Output gains; - private Output featureIds; - private Output featureDimensions; - private Output thresholds; - private Output leftNodeContribs; - private Output rightNodeContribs; - private Output splitWithDefaultDirections; - - private BoostedTreesCalculateBestFeatureSplitV2(Operation operation) { - super(operation); - int outputIdx = 0; - nodeIds = operation.output(outputIdx++); - gains = operation.output(outputIdx++); - featureIds = operation.output(outputIdx++); - featureDimensions = operation.output(outputIdx++); - thresholds = operation.output(outputIdx++); - leftNodeContribs = operation.output(outputIdx++); - rightNodeContribs = operation.output(outputIdx++); - splitWithDefaultDirections = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestGainsPerFeature.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestGainsPerFeature.java index fc5451604aa..9566a717e1b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestGainsPerFeature.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCalculateBestGainsPerFeature.java @@ -27,29 +27,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; /** * Calculates gains for each feature and returns the best possible split information for the feature. - *

* The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature. - *

- * It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return `node_ids_list` for each feature, containing the list of nodes that this feature can be used to split. - *

- * In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features). - *

- * The length of output lists are all of the same length, `num_features`. + *

It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return {@code node_ids_list} for each feature, containing the list of nodes that this feature can be used to split. + *

In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features). + *

The length of output lists are all of the same length, {@code num_features}. * The output shapes are compatible in a way that the first dimension of all tensors of all lists are the same and equal to the number of possible split nodes for each feature. */ public final class BoostedTreesCalculateBestGainsPerFeature extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesCalculateBestGainsPerFeature"; + + private List> nodeIdsList; + + private List> gainsList; + + private List> thresholdsList; + + private List> leftNodeContribsList; + + private List> rightNodeContribsList; + + @SuppressWarnings("unchecked") + private BoostedTreesCalculateBestGainsPerFeature(Operation operation) { + super(operation); + int outputIdx = 0; + int nodeIdsListLength = operation.outputListLength("node_ids_list"); + nodeIdsList = Arrays.asList((Output[]) operation.outputList(outputIdx, nodeIdsListLength)); + outputIdx += nodeIdsListLength; + int gainsListLength = operation.outputListLength("gains_list"); + gainsList = Arrays.asList((Output[]) operation.outputList(outputIdx, gainsListLength)); + outputIdx += gainsListLength; + int thresholdsListLength = operation.outputListLength("thresholds_list"); + thresholdsList = Arrays.asList((Output[]) operation.outputList(outputIdx, thresholdsListLength)); + outputIdx += thresholdsListLength; + int leftNodeContribsListLength = operation.outputListLength("left_node_contribs_list"); + leftNodeContribsList = Arrays.asList((Output[]) operation.outputList(outputIdx, leftNodeContribsListLength)); + outputIdx += leftNodeContribsListLength; + int rightNodeContribsListLength = operation.outputListLength("right_node_contribs_list"); + rightNodeContribsList = Arrays.asList((Output[]) operation.outputList(outputIdx, rightNodeContribsListLength)); + outputIdx += rightNodeContribsListLength; + } + /** * Factory method to create a class wrapping a new BoostedTreesCalculateBestGainsPerFeature operation. - * + * * @param scope current scope - * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive). + * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within {@code stats_summary_list}. The nodes are iterated between the two nodes specified by the tensor, as like {@code for node_id in range(node_id_range[0], node_id_range[1])} (Note that the last index node_id_range[1] is exclusive). * @param statsSummaryList A list of Rank 3 tensor (#shape=[max_splits, bucket, 2]) for accumulated stats summary (gradient/hessian) per node per buckets for each feature. The first dimension of the tensor is the maximum number of splits, and thus not all elements of it will be used, but only the indexes specified by node_ids will be used. * @param l1 l1 regularization factor on leaf weights, per instance based. * @param l2 l2 regularization factor on leaf weights, per instance based. @@ -58,8 +88,13 @@ public final class BoostedTreesCalculateBestGainsPerFeature extends RawOp { * @param maxSplits the number of nodes that can be split in the whole tree. Used as a dimension of output tensors. * @return a new instance of BoostedTreesCalculateBestGainsPerFeature */ - @Endpoint(describeByClass = true) - public static BoostedTreesCalculateBestGainsPerFeature create(Scope scope, Operand nodeIdRange, Iterable> statsSummaryList, Operand l1, Operand l2, Operand treeComplexity, Operand minNodeWeight, Long maxSplits) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesCalculateBestGainsPerFeature create(Scope scope, + Operand nodeIdRange, Iterable> statsSummaryList, + Operand l1, Operand l2, Operand treeComplexity, + Operand minNodeWeight, Long maxSplits) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesCalculateBestGainsPerFeature", scope.makeOpName("BoostedTreesCalculateBestGainsPerFeature")); opBuilder.addInput(nodeIdRange.asOutput()); opBuilder.addInputList(Operands.asOutputs(statsSummaryList)); @@ -71,69 +106,49 @@ public static BoostedTreesCalculateBestGainsPerFeature create(Scope scope, Opera opBuilder.setAttr("max_splits", maxSplits); return new BoostedTreesCalculateBestGainsPerFeature(opBuilder.build()); } - + /** + * Gets nodeIdsList. * An output list of Rank 1 tensors indicating possible split node ids for each feature. The length of the list is num_features, but each tensor has different size as each feature provides different possible nodes. See above for details like shapes and sizes. + * @return nodeIdsList. */ public List> nodeIdsList() { return nodeIdsList; } - + /** + * Gets gainsList. * An output list of Rank 1 tensors indicating the best gains for each feature to split for certain nodes. See above for details like shapes and sizes. + * @return gainsList. */ public List> gainsList() { return gainsList; } - + /** + * Gets thresholdsList. * An output list of Rank 1 tensors indicating the bucket id to compare with (as a threshold) for split in each node. See above for details like shapes and sizes. + * @return thresholdsList. */ public List> thresholdsList() { return thresholdsList; } - + /** + * Gets leftNodeContribsList. * A list of Rank 2 tensors indicating the contribution of the left nodes when branching from parent nodes (given by the tensor element in the output node_ids_list) to the left direction by the given threshold for each feature. This value will be used to make the left node value by adding to the parent node value. Second dimension size is 1 for 1-dimensional logits, but would be larger for multi-class problems. See above for details like shapes and sizes. + * @return leftNodeContribsList. */ public List> leftNodeContribsList() { return leftNodeContribsList; } - + /** + * Gets rightNodeContribsList. * A list of Rank 2 tensors, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. + * @return rightNodeContribsList. */ public List> rightNodeContribsList() { return rightNodeContribsList; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesCalculateBestGainsPerFeature"; - - private List> nodeIdsList; - private List> gainsList; - private List> thresholdsList; - private List> leftNodeContribsList; - private List> rightNodeContribsList; - - @SuppressWarnings("unchecked") - private BoostedTreesCalculateBestGainsPerFeature(Operation operation) { - super(operation); - int outputIdx = 0; - int nodeIdsListLength = operation.outputListLength("node_ids_list"); - nodeIdsList = Arrays.asList((Output[])operation.outputList(outputIdx, nodeIdsListLength)); - outputIdx += nodeIdsListLength; - int gainsListLength = operation.outputListLength("gains_list"); - gainsList = Arrays.asList((Output[])operation.outputList(outputIdx, gainsListLength)); - outputIdx += gainsListLength; - int thresholdsListLength = operation.outputListLength("thresholds_list"); - thresholdsList = Arrays.asList((Output[])operation.outputList(outputIdx, thresholdsListLength)); - outputIdx += thresholdsListLength; - int leftNodeContribsListLength = operation.outputListLength("left_node_contribs_list"); - leftNodeContribsList = Arrays.asList((Output[])operation.outputList(outputIdx, leftNodeContribsListLength)); - outputIdx += leftNodeContribsListLength; - int rightNodeContribsListLength = operation.outputListLength("right_node_contribs_list"); - rightNodeContribsList = Arrays.asList((Output[])operation.outputList(outputIdx, rightNodeContribsListLength)); - outputIdx += rightNodeContribsListLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCenterBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCenterBias.java index d19d2e37da8..d6c86fa7030 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCenterBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCenterBias.java @@ -24,18 +24,30 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TType; /** * Calculates the prior from the training data (the bias) and fills in the first node with the logits' prior. Returns a boolean indicating whether to continue centering. */ public final class BoostedTreesCenterBias extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesCenterBias"; + + private Output continueCentering; + + private BoostedTreesCenterBias(Operation operation) { + super(operation); + int outputIdx = 0; + continueCentering = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesCenterBias operation. - * + * * @param scope current scope * @param treeEnsembleHandle Handle to the tree ensemble. * @param meanGradients A tensor with shape=[logits_dimension] with mean of gradients for a first node. @@ -44,8 +56,12 @@ public final class BoostedTreesCenterBias extends RawOp implements Operand treeEnsembleHandle, Operand meanGradients, Operand meanHessians, Operand l1, Operand l2) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesCenterBias create(Scope scope, + Operand treeEnsembleHandle, Operand meanGradients, + Operand meanHessians, Operand l1, Operand l2) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesCenterBias", scope.makeOpName("BoostedTreesCenterBias")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder.addInput(meanGradients.asOutput()); @@ -55,27 +71,18 @@ public static BoostedTreesCenterBias create(Scope scope, Operand treeEnsemble opBuilder = scope.apply(opBuilder); return new BoostedTreesCenterBias(opBuilder.build()); } - + /** + * Gets continueCentering. * Bool, whether to continue bias centering. + * @return continueCentering. */ public Output continueCentering() { return continueCentering; } - + @Override public Output asOutput() { return continueCentering; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesCenterBias"; - - private Output continueCentering; - - private BoostedTreesCenterBias(Operation operation) { - super(operation); - int outputIdx = 0; - continueCentering = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateEnsemble.java index 530b49b4db2..cf0705baa52 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateEnsemble.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateEnsemble.java @@ -23,26 +23,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Creates a tree ensemble model and returns a handle to it. */ public final class BoostedTreesCreateEnsemble extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesCreateEnsemble"; + + private BoostedTreesCreateEnsemble(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new BoostedTreesCreateEnsemble operation. - * + * * @param scope current scope * @param treeEnsembleHandle Handle to the tree ensemble resource to be created. * @param stampToken Token to use as the initial value of the resource stamp. * @param treeEnsembleSerialized Serialized proto of the tree ensemble. * @return a new instance of BoostedTreesCreateEnsemble */ - @Endpoint(describeByClass = true) - public static BoostedTreesCreateEnsemble create(Scope scope, Operand treeEnsembleHandle, Operand stampToken, Operand treeEnsembleSerialized) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesCreateEnsemble create(Scope scope, + Operand treeEnsembleHandle, Operand stampToken, + Operand treeEnsembleSerialized) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesCreateEnsemble", scope.makeOpName("BoostedTreesCreateEnsemble")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder.addInput(stampToken.asOutput()); @@ -50,11 +62,4 @@ public static BoostedTreesCreateEnsemble create(Scope scope, Operand treeEnse opBuilder = scope.apply(opBuilder); return new BoostedTreesCreateEnsemble(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesCreateEnsemble"; - - private BoostedTreesCreateEnsemble(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateQuantileStreamResource.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateQuantileStreamResource.java index f1983f2d01c..524620026f2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateQuantileStreamResource.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesCreateQuantileStreamResource.java @@ -23,46 +23,39 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Create the Resource for Quantile Streams. */ public final class BoostedTreesCreateQuantileStreamResource extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesCreateQuantileStreamResource} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxElements int; The maximum number of data points that can be fed to the stream. - */ - public Options maxElements(Long maxElements) { - this.maxElements = maxElements; - return this; - } - - private Long maxElements; - - private Options() { - } + public static final String OP_NAME = "BoostedTreesCreateQuantileStreamResource"; + + private BoostedTreesCreateQuantileStreamResource(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new BoostedTreesCreateQuantileStreamResource operation. - * + * * @param scope current scope * @param quantileStreamResourceHandle resource; Handle to quantile stream resource. * @param epsilon float; The required approximation error of the stream resource. * @param numStreams int; The number of streams managed by the resource that shares the same epsilon. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BoostedTreesCreateQuantileStreamResource */ - @Endpoint(describeByClass = true) - public static BoostedTreesCreateQuantileStreamResource create(Scope scope, Operand quantileStreamResourceHandle, Operand epsilon, Operand numStreams, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesCreateQuantileStreamResource create(Scope scope, + Operand quantileStreamResourceHandle, Operand epsilon, + Operand numStreams, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesCreateQuantileStreamResource", scope.makeOpName("BoostedTreesCreateQuantileStreamResource")); opBuilder.addInput(quantileStreamResourceHandle.asOutput()); opBuilder.addInput(epsilon.asOutput()); @@ -77,18 +70,35 @@ public static BoostedTreesCreateQuantileStreamResource create(Scope scope, Opera } return new BoostedTreesCreateQuantileStreamResource(opBuilder.build()); } - + /** + * Sets the maxElements option. + * * @param maxElements int; The maximum number of data points that can be fed to the stream. + * @return this Options instance. */ public static Options maxElements(Long maxElements) { return new Options().maxElements(maxElements); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesCreateQuantileStreamResource"; - - private BoostedTreesCreateQuantileStreamResource(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesCreateQuantileStreamResource} + */ + public static class Options { + private Long maxElements; + + private Options() { + } + + /** + * Sets the maxElements option. + * + * @param maxElements int; The maximum number of data points that can be fed to the stream. + * @return this Options instance. + */ + public Options maxElements(Long maxElements) { + this.maxElements = maxElements; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesDeserializeEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesDeserializeEnsemble.java index 269095b3297..dbd0fa5fde3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesDeserializeEnsemble.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesDeserializeEnsemble.java @@ -23,28 +23,39 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Deserializes a serialized tree ensemble config and replaces current tree - *

* ensemble. */ public final class BoostedTreesDeserializeEnsemble extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesDeserializeEnsemble"; + + private BoostedTreesDeserializeEnsemble(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new BoostedTreesDeserializeEnsemble operation. - * + * * @param scope current scope * @param treeEnsembleHandle Handle to the tree ensemble. * @param stampToken Token to use as the new value of the resource stamp. * @param treeEnsembleSerialized Serialized proto of the ensemble. * @return a new instance of BoostedTreesDeserializeEnsemble */ - @Endpoint(describeByClass = true) - public static BoostedTreesDeserializeEnsemble create(Scope scope, Operand treeEnsembleHandle, Operand stampToken, Operand treeEnsembleSerialized) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesDeserializeEnsemble create(Scope scope, + Operand treeEnsembleHandle, Operand stampToken, + Operand treeEnsembleSerialized) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesDeserializeEnsemble", scope.makeOpName("BoostedTreesDeserializeEnsemble")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder.addInput(stampToken.asOutput()); @@ -52,11 +63,4 @@ public static BoostedTreesDeserializeEnsemble create(Scope scope, Operand tre opBuilder = scope.apply(opBuilder); return new BoostedTreesDeserializeEnsemble(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesDeserializeEnsemble"; - - private BoostedTreesDeserializeEnsemble(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesEnsembleResourceHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesEnsembleResourceHandleOp.java index 33d537e65f2..5498299dd35 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesEnsembleResourceHandleOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesEnsembleResourceHandleOp.java @@ -24,50 +24,36 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates a handle to a BoostedTreesEnsembleResource */ public final class BoostedTreesEnsembleResourceHandleOp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesEnsembleResourceHandleOp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "BoostedTreesEnsembleResourceHandleOp"; + + private Output resource; + + @SuppressWarnings("unchecked") + private BoostedTreesEnsembleResourceHandleOp(Operation operation) { + super(operation); + int outputIdx = 0; + resource = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BoostedTreesEnsembleResourceHandleOp operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BoostedTreesEnsembleResourceHandleOp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BoostedTreesEnsembleResourceHandleOp create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesEnsembleResourceHandleOp", scope.makeOpName("BoostedTreesEnsembleResourceHandleOp")); opBuilder = scope.apply(opBuilder); @@ -83,41 +69,73 @@ public static BoostedTreesEnsembleResourceHandleOp create(Scope scope, Options.. } return new BoostedTreesEnsembleResourceHandleOp(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets resource. + * + * @return resource. */ - public Output resource() { + public Output resource() { return resource; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) resource; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesEnsembleResourceHandleOp"; - - private Output resource; - - private BoostedTreesEnsembleResourceHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesEnsembleResourceHandleOp} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesExampleDebugOutputs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesExampleDebugOutputs.java index efc8b1d18b3..3fbe45ce51a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesExampleDebugOutputs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesExampleDebugOutputs.java @@ -25,32 +25,47 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Debugging/model interpretability outputs for each example. - *

* It traverses all the trees and computes debug metrics for individual examples, * such as getting split feature ids and logits after each split along the decision * path used to compute directional feature contributions. */ public final class BoostedTreesExampleDebugOutputs extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesExampleDebugOutputs"; + + private Output examplesDebugOutputsSerialized; + + private BoostedTreesExampleDebugOutputs(Operation operation) { + super(operation); + int outputIdx = 0; + examplesDebugOutputsSerialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesExampleDebugOutputs operation. - * + * * @param scope current scope - * @param treeEnsembleHandle + * @param treeEnsembleHandle the treeEnsembleHandle value * @param bucketizedFeatures A list of rank 1 Tensors containing bucket id for each * feature. * @param logitsDimension scalar, dimension of the logits, to be used for constructing the protos in * examples_debug_outputs_serialized. * @return a new instance of BoostedTreesExampleDebugOutputs */ - @Endpoint(describeByClass = true) - public static BoostedTreesExampleDebugOutputs create(Scope scope, Operand treeEnsembleHandle, Iterable> bucketizedFeatures, Long logitsDimension) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesExampleDebugOutputs create(Scope scope, + Operand treeEnsembleHandle, Iterable> bucketizedFeatures, + Long logitsDimension) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesExampleDebugOutputs", scope.makeOpName("BoostedTreesExampleDebugOutputs")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder.addInputList(Operands.asOutputs(bucketizedFeatures)); @@ -58,27 +73,18 @@ public static BoostedTreesExampleDebugOutputs create(Scope scope, Operand tre opBuilder.setAttr("logits_dimension", logitsDimension); return new BoostedTreesExampleDebugOutputs(opBuilder.build()); } - + /** + * Gets examplesDebugOutputsSerialized. * Output rank 1 Tensor containing a proto serialized as a string for each example. + * @return examplesDebugOutputsSerialized. */ public Output examplesDebugOutputsSerialized() { return examplesDebugOutputsSerialized; } - + @Override public Output asOutput() { return examplesDebugOutputsSerialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesExampleDebugOutputs"; - - private Output examplesDebugOutputsSerialized; - - private BoostedTreesExampleDebugOutputs(Operation operation) { - super(operation); - int outputIdx = 0; - examplesDebugOutputsSerialized = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesFlushQuantileSummaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesFlushQuantileSummaries.java index 4938265cc16..3bcdfd6f5d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesFlushQuantileSummaries.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesFlushQuantileSummaries.java @@ -27,58 +27,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TType; /** * Flush the quantile summaries from each quantile stream resource. - *

* An op that outputs a list of quantile summaries of a quantile stream resource. * Each summary Tensor is rank 2, containing summaries (value, weight, min_rank, * max_rank) for a single feature. */ public final class BoostedTreesFlushQuantileSummaries extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesFlushQuantileSummaries"; + + private List> summaries; + + @SuppressWarnings("unchecked") + private BoostedTreesFlushQuantileSummaries(Operation operation) { + super(operation); + int outputIdx = 0; + int summariesLength = operation.outputListLength("summaries"); + summaries = Arrays.asList((Output[]) operation.outputList(outputIdx, summariesLength)); + outputIdx += summariesLength; + } + /** * Factory method to create a class wrapping a new BoostedTreesFlushQuantileSummaries operation. - * + * * @param scope current scope * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. - * @param numFeatures + * @param numFeatures the value of the numFeatures property * @return a new instance of BoostedTreesFlushQuantileSummaries */ - @Endpoint(describeByClass = true) - public static BoostedTreesFlushQuantileSummaries create(Scope scope, Operand quantileStreamResourceHandle, Long numFeatures) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesFlushQuantileSummaries create(Scope scope, + Operand quantileStreamResourceHandle, Long numFeatures) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesFlushQuantileSummaries", scope.makeOpName("BoostedTreesFlushQuantileSummaries")); opBuilder.addInput(quantileStreamResourceHandle.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_features", numFeatures); return new BoostedTreesFlushQuantileSummaries(opBuilder.build()); } - + /** + * Gets summaries. + * + * @return summaries. */ public List> summaries() { return summaries; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) summaries.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesFlushQuantileSummaries"; - - private List> summaries; - - @SuppressWarnings("unchecked") - private BoostedTreesFlushQuantileSummaries(Operation operation) { - super(operation); - int outputIdx = 0; - int summariesLength = operation.outputListLength("summaries"); - summaries = Arrays.asList((Output[])operation.outputList(outputIdx, summariesLength)); - outputIdx += summariesLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesGetEnsembleStates.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesGetEnsembleStates.java index 08f3aced676..91283cb4e91 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesGetEnsembleStates.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesGetEnsembleStates.java @@ -24,82 +24,100 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Retrieves the tree ensemble resource stamp token, number of trees and growing statistics. */ public final class BoostedTreesGetEnsembleStates extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesGetEnsembleStates"; + + private Output stampToken; + + private Output numTrees; + + private Output numFinalizedTrees; + + private Output numAttemptedLayers; + + private Output lastLayerNodesRange; + + private BoostedTreesGetEnsembleStates(Operation operation) { + super(operation); + int outputIdx = 0; + stampToken = operation.output(outputIdx++); + numTrees = operation.output(outputIdx++); + numFinalizedTrees = operation.output(outputIdx++); + numAttemptedLayers = operation.output(outputIdx++); + lastLayerNodesRange = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesGetEnsembleStates operation. - * + * * @param scope current scope * @param treeEnsembleHandle Handle to the tree ensemble. * @return a new instance of BoostedTreesGetEnsembleStates */ - @Endpoint(describeByClass = true) - public static BoostedTreesGetEnsembleStates create(Scope scope, Operand treeEnsembleHandle) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesGetEnsembleStates create(Scope scope, + Operand treeEnsembleHandle) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesGetEnsembleStates", scope.makeOpName("BoostedTreesGetEnsembleStates")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new BoostedTreesGetEnsembleStates(opBuilder.build()); } - + /** + * Gets stampToken. * Stamp token of the tree ensemble resource. + * @return stampToken. */ public Output stampToken() { return stampToken; } - + /** + * Gets numTrees. * The number of trees in the tree ensemble resource. + * @return numTrees. */ public Output numTrees() { return numTrees; } - + /** + * Gets numFinalizedTrees. * The number of trees that were finished successfully. + * @return numFinalizedTrees. */ public Output numFinalizedTrees() { return numFinalizedTrees; } - + /** + * Gets numAttemptedLayers. * The number of layers we attempted to build (but not necessarily succeeded). + * @return numAttemptedLayers. */ public Output numAttemptedLayers() { return numAttemptedLayers; } - + /** + * Gets lastLayerNodesRange. * Rank size 2 tensor that contains start and end ids of the nodes in the latest * layer. + * @return lastLayerNodesRange. */ public Output lastLayerNodesRange() { return lastLayerNodesRange; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesGetEnsembleStates"; - - private Output stampToken; - private Output numTrees; - private Output numFinalizedTrees; - private Output numAttemptedLayers; - private Output lastLayerNodesRange; - - private BoostedTreesGetEnsembleStates(Operation operation) { - super(operation); - int outputIdx = 0; - stampToken = operation.output(outputIdx++); - numTrees = operation.output(outputIdx++); - numFinalizedTrees = operation.output(outputIdx++); - numAttemptedLayers = operation.output(outputIdx++); - lastLayerNodesRange = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeQuantileSummaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeQuantileSummaries.java index 20c5aefea81..9178217dba0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeQuantileSummaries.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeQuantileSummaries.java @@ -28,28 +28,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Makes the summary of quantiles for the batch. - *

* An op that takes a list of tensors (one tensor per feature) and outputs the * quantile summaries for each tensor. */ public final class BoostedTreesMakeQuantileSummaries extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesMakeQuantileSummaries"; + + private List> summaries; + + @SuppressWarnings("unchecked") + private BoostedTreesMakeQuantileSummaries(Operation operation) { + super(operation); + int outputIdx = 0; + int summariesLength = operation.outputListLength("summaries"); + summaries = Arrays.asList((Output[]) operation.outputList(outputIdx, summariesLength)); + outputIdx += summariesLength; + } + /** * Factory method to create a class wrapping a new BoostedTreesMakeQuantileSummaries operation. - * + * * @param scope current scope * @param floatValues float; List of Rank 1 Tensors each containing values for a single feature. * @param exampleWeights float; Rank 1 Tensor with weights per instance. * @param epsilon float; The required maximum approximation error. * @return a new instance of BoostedTreesMakeQuantileSummaries */ - @Endpoint(describeByClass = true) - public static BoostedTreesMakeQuantileSummaries create(Scope scope, Iterable> floatValues, Operand exampleWeights, Operand epsilon) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesMakeQuantileSummaries create(Scope scope, + Iterable> floatValues, Operand exampleWeights, + Operand epsilon) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesMakeQuantileSummaries", scope.makeOpName("BoostedTreesMakeQuantileSummaries")); opBuilder.addInputList(Operands.asOutputs(floatValues)); opBuilder.addInput(exampleWeights.asOutput()); @@ -57,32 +74,20 @@ public static BoostedTreesMakeQuantileSummaries create(Scope scope, Iterable> summaries() { return summaries; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) summaries.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesMakeQuantileSummaries"; - - private List> summaries; - - @SuppressWarnings("unchecked") - private BoostedTreesMakeQuantileSummaries(Operation operation) { - super(operation); - int outputIdx = 0; - int summariesLength = operation.outputListLength("summaries"); - summaries = Arrays.asList((Output[])operation.outputList(outputIdx, summariesLength)); - outputIdx += summariesLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeStatsSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeStatsSummary.java index 63c20cb03fe..3552cb6e986 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeStatsSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesMakeStatsSummary.java @@ -25,20 +25,30 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; /** * Makes the summary of accumulated stats for the batch. - *

* The summary stats contains gradients and hessians accumulated into the corresponding node and bucket for each example. */ public final class BoostedTreesMakeStatsSummary extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesMakeStatsSummary"; + + private Output statsSummary; + + private BoostedTreesMakeStatsSummary(Operation operation) { + super(operation); + int outputIdx = 0; + statsSummary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesMakeStatsSummary operation. - * + * * @param scope current scope * @param nodeIds int32 Rank 1 Tensor containing node ids, which each example falls into for the requested layer. * @param gradients float32; Rank 2 Tensor (shape=[#examples, 1]) for gradients. @@ -48,8 +58,12 @@ public final class BoostedTreesMakeStatsSummary extends RawOp implements Operand * @param numBuckets int; equals to the maximum possible value of bucketized feature. * @return a new instance of BoostedTreesMakeStatsSummary */ - @Endpoint(describeByClass = true) - public static BoostedTreesMakeStatsSummary create(Scope scope, Operand nodeIds, Operand gradients, Operand hessians, Iterable> bucketizedFeaturesList, Long maxSplits, Long numBuckets) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesMakeStatsSummary create(Scope scope, Operand nodeIds, + Operand gradients, Operand hessians, + Iterable> bucketizedFeaturesList, Long maxSplits, Long numBuckets) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesMakeStatsSummary", scope.makeOpName("BoostedTreesMakeStatsSummary")); opBuilder.addInput(nodeIds.asOutput()); opBuilder.addInput(gradients.asOutput()); @@ -60,27 +74,18 @@ public static BoostedTreesMakeStatsSummary create(Scope scope, Operand n opBuilder.setAttr("num_buckets", numBuckets); return new BoostedTreesMakeStatsSummary(opBuilder.build()); } - + /** + * Gets statsSummary. * output Rank 4 Tensor (shape=[#features, #splits, #buckets, 2]) containing accumulated stats put into the corresponding node and bucket. The first index of 4th dimension refers to gradients, and the second to hessians. + * @return statsSummary. */ public Output statsSummary() { return statsSummary; } - + @Override public Output asOutput() { return statsSummary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesMakeStatsSummary"; - - private Output statsSummary; - - private BoostedTreesMakeStatsSummary(Operation operation) { - super(operation); - int outputIdx = 0; - statsSummary = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesPredict.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesPredict.java index c1363d21a6f..98807d14ad3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesPredict.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesPredict.java @@ -25,31 +25,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Runs multiple additive regression ensemble predictors on input instances and - *

* computes the logits. It is designed to be used during prediction. * It traverses all the trees and calculates the final score for each instance. */ public final class BoostedTreesPredict extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesPredict"; + + private Output logits; + + private BoostedTreesPredict(Operation operation) { + super(operation); + int outputIdx = 0; + logits = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesPredict operation. - * + * * @param scope current scope - * @param treeEnsembleHandle + * @param treeEnsembleHandle the treeEnsembleHandle value * @param bucketizedFeatures A list of rank 1 Tensors containing bucket id for each * feature. * @param logitsDimension scalar, dimension of the logits, to be used for partial logits * shape. * @return a new instance of BoostedTreesPredict */ - @Endpoint(describeByClass = true) - public static BoostedTreesPredict create(Scope scope, Operand treeEnsembleHandle, Iterable> bucketizedFeatures, Long logitsDimension) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesPredict create(Scope scope, Operand treeEnsembleHandle, + Iterable> bucketizedFeatures, Long logitsDimension) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesPredict", scope.makeOpName("BoostedTreesPredict")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder.addInputList(Operands.asOutputs(bucketizedFeatures)); @@ -57,27 +71,18 @@ public static BoostedTreesPredict create(Scope scope, Operand treeEnsembleHan opBuilder.setAttr("logits_dimension", logitsDimension); return new BoostedTreesPredict(opBuilder.build()); } - + /** + * Gets logits. * Output rank 2 Tensor containing logits for each example. + * @return logits. */ public Output logits() { return logits; } - + @Override public Output asOutput() { return logits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesPredict"; - - private Output logits; - - private BoostedTreesPredict(Operation operation) { - super(operation); - int outputIdx = 0; - logits = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceAddSummaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceAddSummaries.java index d892cd3911e..b0e678c8b69 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceAddSummaries.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceAddSummaries.java @@ -24,39 +24,43 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TType; /** * Add the quantile summaries to each quantile stream resource. - *

* An op that adds a list of quantile summaries to a quantile stream resource. Each * summary Tensor is rank 2, containing summaries (value, weight, min_rank, max_rank) * for a single feature. */ public final class BoostedTreesQuantileStreamResourceAddSummaries extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesQuantileStreamResourceAddSummaries"; + + private BoostedTreesQuantileStreamResourceAddSummaries(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceAddSummaries operation. - * + * * @param scope current scope * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. * @param summaries string; List of Rank 2 Tensor each containing the summaries for a single feature. * @return a new instance of BoostedTreesQuantileStreamResourceAddSummaries */ - @Endpoint(describeByClass = true) - public static BoostedTreesQuantileStreamResourceAddSummaries create(Scope scope, Operand quantileStreamResourceHandle, Iterable> summaries) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesQuantileStreamResourceAddSummaries create(Scope scope, + Operand quantileStreamResourceHandle, + Iterable> summaries) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesQuantileStreamResourceAddSummaries", scope.makeOpName("BoostedTreesQuantileStreamResourceAddSummaries")); opBuilder.addInput(quantileStreamResourceHandle.asOutput()); opBuilder.addInputList(Operands.asOutputs(summaries)); opBuilder = scope.apply(opBuilder); return new BoostedTreesQuantileStreamResourceAddSummaries(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceAddSummaries"; - - private BoostedTreesQuantileStreamResourceAddSummaries(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceDeserialize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceDeserialize.java index 600c960b82f..e7f43f229b5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceDeserialize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceDeserialize.java @@ -24,37 +24,41 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TType; /** * Deserialize bucket boundaries and ready flag into current QuantileAccumulator. - *

* An op that deserializes bucket boundaries and are boundaries ready flag into current QuantileAccumulator. */ public final class BoostedTreesQuantileStreamResourceDeserialize extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesQuantileStreamResourceDeserialize"; + + private BoostedTreesQuantileStreamResourceDeserialize(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceDeserialize operation. - * + * * @param scope current scope * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. * @param bucketBoundaries float; List of Rank 1 Tensors each containing the bucket boundaries for a feature. * @return a new instance of BoostedTreesQuantileStreamResourceDeserialize */ - @Endpoint(describeByClass = true) - public static BoostedTreesQuantileStreamResourceDeserialize create(Scope scope, Operand quantileStreamResourceHandle, Iterable> bucketBoundaries) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesQuantileStreamResourceDeserialize create(Scope scope, + Operand quantileStreamResourceHandle, + Iterable> bucketBoundaries) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesQuantileStreamResourceDeserialize", scope.makeOpName("BoostedTreesQuantileStreamResourceDeserialize")); opBuilder.addInput(quantileStreamResourceHandle.asOutput()); opBuilder.addInputList(Operands.asOutputs(bucketBoundaries)); opBuilder = scope.apply(opBuilder); return new BoostedTreesQuantileStreamResourceDeserialize(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceDeserialize"; - - private BoostedTreesQuantileStreamResourceDeserialize(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceFlush.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceFlush.java index e11545a2160..63e96f628ce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceFlush.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceFlush.java @@ -23,51 +23,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Flush the summaries for a quantile stream resource. - *

* An op that flushes the summaries for a quantile stream resource. */ public final class BoostedTreesQuantileStreamResourceFlush extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesQuantileStreamResourceFlush} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param generateQuantiles bool; If True, the output will be the num_quantiles for each stream where the ith - * entry is the ith quantile of the input with an approximation error of epsilon. - * Duplicate values may be present. - * If False, the output will be the points in the histogram that we got which roughly - * translates to 1/epsilon boundaries and without any duplicates. - * Default to False. - */ - public Options generateQuantiles(Boolean generateQuantiles) { - this.generateQuantiles = generateQuantiles; - return this; - } - - private Boolean generateQuantiles; - - private Options() { - } + public static final String OP_NAME = "BoostedTreesQuantileStreamResourceFlush"; + + private BoostedTreesQuantileStreamResourceFlush(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceFlush operation. - * + * * @param scope current scope * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. * @param numBuckets int; approximate number of buckets unless using generate_quantiles. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BoostedTreesQuantileStreamResourceFlush */ - @Endpoint(describeByClass = true) - public static BoostedTreesQuantileStreamResourceFlush create(Scope scope, Operand quantileStreamResourceHandle, Operand numBuckets, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesQuantileStreamResourceFlush create(Scope scope, + Operand quantileStreamResourceHandle, Operand numBuckets, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesQuantileStreamResourceFlush", scope.makeOpName("BoostedTreesQuantileStreamResourceFlush")); opBuilder.addInput(quantileStreamResourceHandle.asOutput()); opBuilder.addInput(numBuckets.asOutput()); @@ -81,23 +68,45 @@ public static BoostedTreesQuantileStreamResourceFlush create(Scope scope, Operan } return new BoostedTreesQuantileStreamResourceFlush(opBuilder.build()); } - + /** + * Sets the generateQuantiles option. + * * @param generateQuantiles bool; If True, the output will be the num_quantiles for each stream where the ith * entry is the ith quantile of the input with an approximation error of epsilon. * Duplicate values may be present. * If False, the output will be the points in the histogram that we got which roughly * translates to 1/epsilon boundaries and without any duplicates. * Default to False. + * @return this Options instance. */ public static Options generateQuantiles(Boolean generateQuantiles) { return new Options().generateQuantiles(generateQuantiles); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceFlush"; - - private BoostedTreesQuantileStreamResourceFlush(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesQuantileStreamResourceFlush} + */ + public static class Options { + private Boolean generateQuantiles; + + private Options() { + } + + /** + * Sets the generateQuantiles option. + * + * @param generateQuantiles bool; If True, the output will be the num_quantiles for each stream where the ith + * entry is the ith quantile of the input with an approximation error of epsilon. + * Duplicate values may be present. + * If False, the output will be the points in the histogram that we got which roughly + * translates to 1/epsilon boundaries and without any duplicates. + * Default to False. + * @return this Options instance. + */ + public Options generateQuantiles(Boolean generateQuantiles) { + this.generateQuantiles = generateQuantiles; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java index e5692091bc9..68eb24ee4e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java @@ -27,58 +27,63 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; +import org.tensorflow.types.family.TType; /** * Generate the bucket boundaries for each feature based on accumulated summaries. - *

* An op that returns a list of float tensors for a quantile stream resource. Each * tensor is Rank 1 containing bucket boundaries for a single feature. */ public final class BoostedTreesQuantileStreamResourceGetBucketBoundaries extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesQuantileStreamResourceGetBucketBoundaries"; + + private List> bucketBoundaries; + + @SuppressWarnings("unchecked") + private BoostedTreesQuantileStreamResourceGetBucketBoundaries(Operation operation) { + super(operation); + int outputIdx = 0; + int bucketBoundariesLength = operation.outputListLength("bucket_boundaries"); + bucketBoundaries = Arrays.asList((Output[]) operation.outputList(outputIdx, bucketBoundariesLength)); + outputIdx += bucketBoundariesLength; + } + /** * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceGetBucketBoundaries operation. - * + * * @param scope current scope * @param quantileStreamResourceHandle resource handle referring to a QuantileStreamResource. * @param numFeatures inferred int; number of features to get bucket boundaries for. * @return a new instance of BoostedTreesQuantileStreamResourceGetBucketBoundaries */ - @Endpoint(describeByClass = true) - public static BoostedTreesQuantileStreamResourceGetBucketBoundaries create(Scope scope, Operand quantileStreamResourceHandle, Long numFeatures) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesQuantileStreamResourceGetBucketBoundaries create(Scope scope, + Operand quantileStreamResourceHandle, Long numFeatures) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesQuantileStreamResourceGetBucketBoundaries", scope.makeOpName("BoostedTreesQuantileStreamResourceGetBucketBoundaries")); opBuilder.addInput(quantileStreamResourceHandle.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_features", numFeatures); return new BoostedTreesQuantileStreamResourceGetBucketBoundaries(opBuilder.build()); } - + /** + * Gets bucketBoundaries. * float; List of Rank 1 Tensors each containing the bucket boundaries for a feature. + * @return bucketBoundaries. */ public List> bucketBoundaries() { return bucketBoundaries; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) bucketBoundaries.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceGetBucketBoundaries"; - - private List> bucketBoundaries; - - @SuppressWarnings("unchecked") - private BoostedTreesQuantileStreamResourceGetBucketBoundaries(Operation operation) { - super(operation); - int outputIdx = 0; - int bucketBoundariesLength = operation.outputListLength("bucket_boundaries"); - bucketBoundaries = Arrays.asList((Output[])operation.outputList(outputIdx, bucketBoundariesLength)); - outputIdx += bucketBoundariesLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceHandleOp.java index cfc56887f64..0e0dcd74f2b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceHandleOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesQuantileStreamResourceHandleOp.java @@ -24,50 +24,36 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Creates a handle to a BoostedTreesQuantileStreamResource. */ public final class BoostedTreesQuantileStreamResourceHandleOp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesQuantileStreamResourceHandleOp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "BoostedTreesQuantileStreamResourceHandleOp"; + + private Output resource; + + @SuppressWarnings("unchecked") + private BoostedTreesQuantileStreamResourceHandleOp(Operation operation) { + super(operation); + int outputIdx = 0; + resource = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceHandleOp operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BoostedTreesQuantileStreamResourceHandleOp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BoostedTreesQuantileStreamResourceHandleOp create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesQuantileStreamResourceHandleOp", scope.makeOpName("BoostedTreesQuantileStreamResourceHandleOp")); opBuilder = scope.apply(opBuilder); @@ -83,41 +69,73 @@ public static BoostedTreesQuantileStreamResourceHandleOp create(Scope scope, Opt } return new BoostedTreesQuantileStreamResourceHandleOp(opBuilder.build()); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets resource. + * + * @return resource. */ - public Output resource() { + public Output resource() { return resource; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) resource; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesQuantileStreamResourceHandleOp"; - - private Output resource; - - private BoostedTreesQuantileStreamResourceHandleOp(Operation operation) { - super(operation); - int outputIdx = 0; - resource = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesQuantileStreamResourceHandleOp} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSerializeEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSerializeEnsemble.java index 475c0eded18..6ee4ee2ebce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSerializeEnsemble.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSerializeEnsemble.java @@ -24,54 +24,63 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Serializes the tree ensemble to a proto. */ public final class BoostedTreesSerializeEnsemble extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesSerializeEnsemble"; + + private Output stampToken; + + private Output treeEnsembleSerialized; + + private BoostedTreesSerializeEnsemble(Operation operation) { + super(operation); + int outputIdx = 0; + stampToken = operation.output(outputIdx++); + treeEnsembleSerialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesSerializeEnsemble operation. - * + * * @param scope current scope * @param treeEnsembleHandle Handle to the tree ensemble. * @return a new instance of BoostedTreesSerializeEnsemble */ - @Endpoint(describeByClass = true) - public static BoostedTreesSerializeEnsemble create(Scope scope, Operand treeEnsembleHandle) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesSerializeEnsemble create(Scope scope, + Operand treeEnsembleHandle) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesSerializeEnsemble", scope.makeOpName("BoostedTreesSerializeEnsemble")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new BoostedTreesSerializeEnsemble(opBuilder.build()); } - + /** + * Gets stampToken. * Stamp token of the tree ensemble resource. + * @return stampToken. */ public Output stampToken() { return stampToken; } - + /** + * Gets treeEnsembleSerialized. * Serialized proto of the ensemble. + * @return treeEnsembleSerialized. */ public Output treeEnsembleSerialized() { return treeEnsembleSerialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesSerializeEnsemble"; - - private Output stampToken; - private Output treeEnsembleSerialized; - - private BoostedTreesSerializeEnsemble(Operation operation) { - super(operation); - int outputIdx = 0; - stampToken = operation.output(outputIdx++); - treeEnsembleSerialized = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseAggregateStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseAggregateStats.java index 7f1cdd96d82..7497e933574 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseAggregateStats.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseAggregateStats.java @@ -24,20 +24,36 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; /** * Aggregates the summary of accumulated stats for the batch. - *

* The summary stats contains gradients and hessians accumulated for each node, bucket and dimension id. */ public final class BoostedTreesSparseAggregateStats extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesSparseAggregateStats"; + + private Output statsSummaryIndices; + + private Output statsSummaryValues; + + private Output statsSummaryShape; + + private BoostedTreesSparseAggregateStats(Operation operation) { + super(operation); + int outputIdx = 0; + statsSummaryIndices = operation.output(outputIdx++); + statsSummaryValues = operation.output(outputIdx++); + statsSummaryShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesSparseAggregateStats operation. - * + * * @param scope current scope * @param nodeIds int32; Rank 1 Tensor containing node ids for each example, shape [batch_size]. * @param gradients float32; Rank 2 Tensor (shape=[batch_size, logits_dimension]) with gradients for each example. @@ -55,8 +71,13 @@ public final class BoostedTreesSparseAggregateStats extends RawOp { * @param numBuckets int; equals to the maximum possible value of bucketized feature + 1. * @return a new instance of BoostedTreesSparseAggregateStats */ - @Endpoint(describeByClass = true) - public static BoostedTreesSparseAggregateStats create(Scope scope, Operand nodeIds, Operand gradients, Operand hessians, Operand featureIndices, Operand featureValues, Operand featureShape, Long maxSplits, Long numBuckets) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesSparseAggregateStats create(Scope scope, Operand nodeIds, + Operand gradients, Operand hessians, Operand featureIndices, + Operand featureValues, Operand featureShape, Long maxSplits, + Long numBuckets) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesSparseAggregateStats", scope.makeOpName("BoostedTreesSparseAggregateStats")); opBuilder.addInput(nodeIds.asOutput()); opBuilder.addInput(gradients.asOutput()); @@ -69,47 +90,38 @@ public static BoostedTreesSparseAggregateStats create(Scope scope, Operand statsSummaryIndices() { return statsSummaryIndices; } - + /** + * Gets statsSummaryValues. * output Rank 1 Tensor (shape=[number of non zero statistics]) + * @return statsSummaryValues. */ public Output statsSummaryValues() { return statsSummaryValues; } - + /** + * Gets statsSummaryShape. * output Rank 1 Tensor (shape=[4]) * The tensor has following 4 values: [max_splits, feature_dimension, num_buckets, statistics_dimension], * where statistics_dimension = gradient_dimension + hessian_dimension. gradient_dimension * is the same as label_dimension, i.e., the output space. hessian_dimension can be the same * as logits dimension when diagonal hessian is used, or label_dimension^2 when full * hessian is used. + * @return statsSummaryShape. */ public Output statsSummaryShape() { return statsSummaryShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesSparseAggregateStats"; - - private Output statsSummaryIndices; - private Output statsSummaryValues; - private Output statsSummaryShape; - - private BoostedTreesSparseAggregateStats(Operation operation) { - super(operation); - int outputIdx = 0; - statsSummaryIndices = operation.output(outputIdx++); - statsSummaryValues = operation.output(outputIdx++); - statsSummaryShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseCalculateBestFeatureSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseCalculateBestFeatureSplit.java index 40bdd797fa6..6e0bff134c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseCalculateBestFeatureSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesSparseCalculateBestFeatureSplit.java @@ -24,48 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; /** * Calculates gains for each feature and returns the best possible split information for the feature. - *

* The split information is the best threshold (bucket id), gains and left/right node contributions per node for each feature. - *

- * It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return `node_ids_list` for each feature, containing the list of nodes that this feature can be used to split. - *

- * In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features). - *

- * The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature. + *

It is possible that not all nodes can be split on each feature. Hence, the list of possible nodes can differ between the features. Therefore, we return {@code node_ids_list} for each feature, containing the list of nodes that this feature can be used to split. + *

In this manner, the output is the best split per features and per node, so that it needs to be combined later to produce the best split for each node (among all possible features). + *

The output shapes are compatible in a way that the first dimension of all tensors are the same and equal to the number of possible split nodes for each feature. */ public final class BoostedTreesSparseCalculateBestFeatureSplit extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesSparseCalculateBestFeatureSplit} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param splitType A string indicating if this Op should perform inequality split or equality split. - */ - public Options splitType(String splitType) { - this.splitType = splitType; - return this; - } - - private String splitType; - - private Options() { - } + public static final String OP_NAME = "BoostedTreesSparseCalculateBestFeatureSplit"; + + private Output nodeIds; + + private Output gains; + + private Output featureDimensions; + + private Output thresholds; + + private Output leftNodeContribs; + + private Output rightNodeContribs; + + private Output splitWithDefaultDirections; + + private BoostedTreesSparseCalculateBestFeatureSplit(Operation operation) { + super(operation); + int outputIdx = 0; + nodeIds = operation.output(outputIdx++); + gains = operation.output(outputIdx++); + featureDimensions = operation.output(outputIdx++); + thresholds = operation.output(outputIdx++); + leftNodeContribs = operation.output(outputIdx++); + rightNodeContribs = operation.output(outputIdx++); + splitWithDefaultDirections = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BoostedTreesSparseCalculateBestFeatureSplit operation. - * + * * @param scope current scope - * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within `stats_summary_list`. The nodes are iterated between the two nodes specified by the tensor, as like `for node_id in range(node_id_range[0], node_id_range[1])` (Note that the last index node_id_range[1] is exclusive). + * @param nodeIdRange A Rank 1 tensor (shape=[2]) to specify the range [first, last) of node ids to process within {@code stats_summary_list}. The nodes are iterated between the two nodes specified by the tensor, as like {@code for node_id in range(node_id_range[0], node_id_range[1])} (Note that the last index node_id_range[1] is exclusive). * @param statsSummaryIndices A Rank 2 int64 tensor of dense shape [N, 4] (N specifies the number of non-zero values) for accumulated stats summary (gradient/hessian) per node per bucket for each feature. The second dimension contains node id, feature dimension, bucket id, and stats dim. * stats dim is the sum of logits dimension and hessian dimension, hessian dimension can either be logits dimension if diagonal hessian is used, or logits dimension^2 if full hessian is used. * @param statsSummaryValues A Rank 1 float tensor of dense shape [N] (N specifies the number of non-zero values), which supplies the values for each element in summary_indices. @@ -75,11 +81,17 @@ private Options() { * @param treeComplexity adjustment to the gain, per leaf based. * @param minNodeWeight minimum avg of hessians in a node before required for the node to be considered for splitting. * @param logitsDimension The dimension of logit, i.e., number of classes. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BoostedTreesSparseCalculateBestFeatureSplit */ - @Endpoint(describeByClass = true) - public static BoostedTreesSparseCalculateBestFeatureSplit create(Scope scope, Operand nodeIdRange, Operand statsSummaryIndices, Operand statsSummaryValues, Operand statsSummaryShape, Operand l1, Operand l2, Operand treeComplexity, Operand minNodeWeight, Long logitsDimension, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesSparseCalculateBestFeatureSplit create(Scope scope, + Operand nodeIdRange, Operand statsSummaryIndices, + Operand statsSummaryValues, Operand statsSummaryShape, Operand l1, + Operand l2, Operand treeComplexity, Operand minNodeWeight, + Long logitsDimension, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesSparseCalculateBestFeatureSplit", scope.makeOpName("BoostedTreesSparseCalculateBestFeatureSplit")); opBuilder.addInput(nodeIdRange.asOutput()); opBuilder.addInput(statsSummaryIndices.asOutput()); @@ -100,85 +112,100 @@ public static BoostedTreesSparseCalculateBestFeatureSplit create(Scope scope, Op } return new BoostedTreesSparseCalculateBestFeatureSplit(opBuilder.build()); } - + /** + * Sets the splitType option. + * * @param splitType A string indicating if this Op should perform inequality split or equality split. + * @return this Options instance. */ public static Options splitType(String splitType) { return new Options().splitType(splitType); } - + /** + * Gets nodeIds. * A Rank 1 tensor indicating possible node ids that can be split. + * @return nodeIds. */ public Output nodeIds() { return nodeIds; } - + /** + * Gets gains. * A Rank 1 tensor indicating the best gains to split each node. + * @return gains. */ public Output gains() { return gains; } - + /** + * Gets featureDimensions. * A Rank 1 tensor indicating the best feature dimension for each feature to split for each node. + * @return featureDimensions. */ public Output featureDimensions() { return featureDimensions; } - + /** + * Gets thresholds. * A Rank 1 tensor indicating the bucket id to compare with (as a threshold) for split in each node. + * @return thresholds. */ public Output thresholds() { return thresholds; } - + /** + * Gets leftNodeContribs. * A Rank 2 tensor indicating the contribution of the left nodes when branching from parent nodes to the left direction by the given threshold for each feature. * This value will be used to make the left node value by adding to the parent node value. Second dimension size is logits dimension. + * @return leftNodeContribs. */ public Output leftNodeContribs() { return leftNodeContribs; } - + /** + * Gets rightNodeContribs. * A Rank 2 tensor, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. + * @return rightNodeContribs. */ public Output rightNodeContribs() { return rightNodeContribs; } - + /** + * Gets splitWithDefaultDirections. * A Rank 1 tensor indicating which direction to go if data is missing. * Inequality with default left returns 0, inequality with default right returns 1, equality with default right returns 2. + * @return splitWithDefaultDirections. */ public Output splitWithDefaultDirections() { return splitWithDefaultDirections; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesSparseCalculateBestFeatureSplit"; - - private Output nodeIds; - private Output gains; - private Output featureDimensions; - private Output thresholds; - private Output leftNodeContribs; - private Output rightNodeContribs; - private Output splitWithDefaultDirections; - - private BoostedTreesSparseCalculateBestFeatureSplit(Operation operation) { - super(operation); - int outputIdx = 0; - nodeIds = operation.output(outputIdx++); - gains = operation.output(outputIdx++); - featureDimensions = operation.output(outputIdx++); - thresholds = operation.output(outputIdx++); - leftNodeContribs = operation.output(outputIdx++); - rightNodeContribs = operation.output(outputIdx++); - splitWithDefaultDirections = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesSparseCalculateBestFeatureSplit} + */ + public static class Options { + private String splitType; + + private Options() { + } + + /** + * Sets the splitType option. + * + * @param splitType A string indicating if this Op should perform inequality split or equality split. + * @return this Options instance. + */ + public Options splitType(String splitType) { + this.splitType = splitType; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesTrainingPredict.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesTrainingPredict.java index 3de7758a2d0..7c762ab8092 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesTrainingPredict.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesTrainingPredict.java @@ -25,24 +25,41 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Runs multiple additive regression ensemble predictors on input instances and - *

* computes the update to cached logits. It is designed to be used during training. * It traverses the trees starting from cached tree id and cached node id and * calculates the updates to be pushed to the cache. */ public final class BoostedTreesTrainingPredict extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesTrainingPredict"; + + private Output partialLogits; + + private Output treeIds; + + private Output nodeIds; + + private BoostedTreesTrainingPredict(Operation operation) { + super(operation); + int outputIdx = 0; + partialLogits = operation.output(outputIdx++); + treeIds = operation.output(outputIdx++); + nodeIds = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BoostedTreesTrainingPredict operation. - * + * * @param scope current scope - * @param treeEnsembleHandle + * @param treeEnsembleHandle the treeEnsembleHandle value * @param cachedTreeIds Rank 1 Tensor containing cached tree ids which is the starting * tree of prediction. * @param cachedNodeIds Rank 1 Tensor containing cached node id which is the starting @@ -53,8 +70,13 @@ public final class BoostedTreesTrainingPredict extends RawOp { * shape. * @return a new instance of BoostedTreesTrainingPredict */ - @Endpoint(describeByClass = true) - public static BoostedTreesTrainingPredict create(Scope scope, Operand treeEnsembleHandle, Operand cachedTreeIds, Operand cachedNodeIds, Iterable> bucketizedFeatures, Long logitsDimension) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesTrainingPredict create(Scope scope, + Operand treeEnsembleHandle, Operand cachedTreeIds, + Operand cachedNodeIds, Iterable> bucketizedFeatures, + Long logitsDimension) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesTrainingPredict", scope.makeOpName("BoostedTreesTrainingPredict")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder.addInput(cachedTreeIds.asOutput()); @@ -64,41 +86,32 @@ public static BoostedTreesTrainingPredict create(Scope scope, Operand treeEns opBuilder.setAttr("logits_dimension", logitsDimension); return new BoostedTreesTrainingPredict(opBuilder.build()); } - + /** + * Gets partialLogits. * Rank 2 Tensor containing logits update (with respect to cached * values stored) for each example. + * @return partialLogits. */ public Output partialLogits() { return partialLogits; } - + /** + * Gets treeIds. * Rank 1 Tensor containing new tree ids for each example. + * @return treeIds. */ public Output treeIds() { return treeIds; } - + /** + * Gets nodeIds. * Rank 1 Tensor containing new node ids in the new tree_ids. + * @return nodeIds. */ public Output nodeIds() { return nodeIds; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesTrainingPredict"; - - private Output partialLogits; - private Output treeIds; - private Output nodeIds; - - private BoostedTreesTrainingPredict(Operation operation) { - super(operation); - int outputIdx = 0; - partialLogits = operation.output(outputIdx++); - treeIds = operation.output(outputIdx++); - nodeIds = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsemble.java index 99c818f679d..1a5cf40a62d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsemble.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsemble.java @@ -24,20 +24,27 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Updates the tree ensemble by either adding a layer to the last tree being grown - *

* or by starting a new tree. */ public final class BoostedTreesUpdateEnsemble extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BoostedTreesUpdateEnsemble"; + + private BoostedTreesUpdateEnsemble(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new BoostedTreesUpdateEnsemble operation. - * + * * @param scope current scope * @param treeEnsembleHandle Handle to the ensemble variable. * @param featureIds Rank 1 tensor with ids for each feature. This is the real id of @@ -59,8 +66,15 @@ public final class BoostedTreesUpdateEnsemble extends RawOp { * @param pruningMode 0-No pruning, 1-Pre-pruning, 2-Post-pruning. * @return a new instance of BoostedTreesUpdateEnsemble */ - @Endpoint(describeByClass = true) - public static BoostedTreesUpdateEnsemble create(Scope scope, Operand treeEnsembleHandle, Operand featureIds, Iterable> nodeIds, Iterable> gains, Iterable> thresholds, Iterable> leftNodeContribs, Iterable> rightNodeContribs, Operand maxDepth, Operand learningRate, Long pruningMode) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesUpdateEnsemble create(Scope scope, + Operand treeEnsembleHandle, Operand featureIds, + Iterable> nodeIds, Iterable> gains, + Iterable> thresholds, Iterable> leftNodeContribs, + Iterable> rightNodeContribs, Operand maxDepth, + Operand learningRate, Long pruningMode) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesUpdateEnsemble", scope.makeOpName("BoostedTreesUpdateEnsemble")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder.addInput(featureIds.asOutput()); @@ -75,11 +89,4 @@ public static BoostedTreesUpdateEnsemble create(Scope scope, Operand treeEnse opBuilder.setAttr("pruning_mode", pruningMode); return new BoostedTreesUpdateEnsemble(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesUpdateEnsemble"; - - private BoostedTreesUpdateEnsemble(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsembleV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsembleV2.java index 1395258e233..971af4f268c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsembleV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/BoostedTreesUpdateEnsembleV2.java @@ -24,40 +24,28 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Updates the tree ensemble by adding a layer to the last tree being grown - *

* or by starting a new tree. */ public final class BoostedTreesUpdateEnsembleV2 extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesUpdateEnsembleV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param logitsDimension scalar, dimension of the logits - */ - public Options logitsDimension(Long logitsDimension) { - this.logitsDimension = logitsDimension; - return this; - } - - private Long logitsDimension; - - private Options() { - } + public static final String OP_NAME = "BoostedTreesUpdateEnsembleV2"; + + private BoostedTreesUpdateEnsembleV2(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new BoostedTreesUpdateEnsembleV2 operation. - * + * * @param scope current scope * @param treeEnsembleHandle Handle to the ensemble variable. * @param featureIds Rank 1 tensor with ids for each feature. This is the real id of @@ -79,11 +67,19 @@ private Options() { * @param maxDepth Max depth of the tree to build. * @param learningRate shrinkage const for each new tree. * @param pruningMode 0-No pruning, 1-Pre-pruning, 2-Post-pruning. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of BoostedTreesUpdateEnsembleV2 */ - @Endpoint(describeByClass = true) - public static BoostedTreesUpdateEnsembleV2 create(Scope scope, Operand treeEnsembleHandle, Iterable> featureIds, Iterable> dimensionIds, Iterable> nodeIds, Iterable> gains, Iterable> thresholds, Iterable> leftNodeContribs, Iterable> rightNodeContribs, Iterable> splitTypes, Operand maxDepth, Operand learningRate, Operand pruningMode, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BoostedTreesUpdateEnsembleV2 create(Scope scope, + Operand treeEnsembleHandle, Iterable> featureIds, + Iterable> dimensionIds, Iterable> nodeIds, + Iterable> gains, Iterable> thresholds, + Iterable> leftNodeContribs, Iterable> rightNodeContribs, + Iterable> splitTypes, Operand maxDepth, + Operand learningRate, Operand pruningMode, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BoostedTreesUpdateEnsembleV2", scope.makeOpName("BoostedTreesUpdateEnsembleV2")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder.addInputList(Operands.asOutputs(featureIds)); @@ -103,22 +99,69 @@ public static BoostedTreesUpdateEnsembleV2 create(Scope scope, Operand treeEn if (opts.logitsDimension != null) { opBuilder.setAttr("logits_dimension", opts.logitsDimension); } + if (opts.numGroups != null) { + opBuilder.setAttr("num_groups", opts.numGroups); + } } } return new BoostedTreesUpdateEnsembleV2(opBuilder.build()); } - + /** + * Sets the logitsDimension option. + * * @param logitsDimension scalar, dimension of the logits + * @return this Options instance. */ public static Options logitsDimension(Long logitsDimension) { return new Options().logitsDimension(logitsDimension); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BoostedTreesUpdateEnsembleV2"; - - private BoostedTreesUpdateEnsembleV2(Operation operation) { - super(operation); + + /** + * Sets the numGroups option. + * + * @param numGroups Number of groups of split information to process, where a group contains feature + * ids that are processed together in BoostedTreesCalculateBestFeatureSplitOpV2. + * INFERRED. + * @return this Options instance. + */ + public static Options numGroups(Long numGroups) { + return new Options().numGroups(numGroups); + } + + /** + * Optional attributes for {@link org.tensorflow.op.estimator.BoostedTreesUpdateEnsembleV2} + */ + public static class Options { + private Long logitsDimension; + + private Long numGroups; + + private Options() { + } + + /** + * Sets the logitsDimension option. + * + * @param logitsDimension scalar, dimension of the logits + * @return this Options instance. + */ + public Options logitsDimension(Long logitsDimension) { + this.logitsDimension = logitsDimension; + return this; + } + + /** + * Sets the numGroups option. + * + * @param numGroups Number of groups of split information to process, where a group contains feature + * ids that are processed together in BoostedTreesCalculateBestFeatureSplitOpV2. + * INFERRED. + * @return this Options instance. + */ + public Options numGroups(Long numGroups) { + this.numGroups = numGroups; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesEnsembleInitialized.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesEnsembleInitialized.java index d525478a12d..df85bcd5ddb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesEnsembleInitialized.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesEnsembleInitialized.java @@ -24,49 +24,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Checks whether a tree ensemble has been initialized. */ public final class IsBoostedTreesEnsembleInitialized extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsBoostedTreesEnsembleInitialized"; + + private Output isInitialized; + + private IsBoostedTreesEnsembleInitialized(Operation operation) { + super(operation); + int outputIdx = 0; + isInitialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsBoostedTreesEnsembleInitialized operation. - * + * * @param scope current scope * @param treeEnsembleHandle Handle to the tree ensemble resource. * @return a new instance of IsBoostedTreesEnsembleInitialized */ - @Endpoint(describeByClass = true) - public static IsBoostedTreesEnsembleInitialized create(Scope scope, Operand treeEnsembleHandle) { + @Endpoint( + describeByClass = true + ) + public static IsBoostedTreesEnsembleInitialized create(Scope scope, + Operand treeEnsembleHandle) { OperationBuilder opBuilder = scope.env().opBuilder("IsBoostedTreesEnsembleInitialized", scope.makeOpName("IsBoostedTreesEnsembleInitialized")); opBuilder.addInput(treeEnsembleHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new IsBoostedTreesEnsembleInitialized(opBuilder.build()); } - + /** + * Gets isInitialized. * output boolean on whether it is initialized or not. + * @return isInitialized. */ public Output isInitialized() { return isInitialized; } - + @Override public Output asOutput() { return isInitialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsBoostedTreesEnsembleInitialized"; - - private Output isInitialized; - - private IsBoostedTreesEnsembleInitialized(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesQuantileStreamResourceInitialized.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesQuantileStreamResourceInitialized.java index 63ec45e9504..3358263f345 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesQuantileStreamResourceInitialized.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/estimator/IsBoostedTreesQuantileStreamResourceInitialized.java @@ -24,51 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Checks whether a quantile stream has been initialized. - *

* An Op that checks if quantile stream resource is initialized. */ public final class IsBoostedTreesQuantileStreamResourceInitialized extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsBoostedTreesQuantileStreamResourceInitialized"; + + private Output isInitialized; + + private IsBoostedTreesQuantileStreamResourceInitialized(Operation operation) { + super(operation); + int outputIdx = 0; + isInitialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsBoostedTreesQuantileStreamResourceInitialized operation. - * + * * @param scope current scope * @param quantileStreamResourceHandle resource; The reference to quantile stream resource handle. * @return a new instance of IsBoostedTreesQuantileStreamResourceInitialized */ - @Endpoint(describeByClass = true) - public static IsBoostedTreesQuantileStreamResourceInitialized create(Scope scope, Operand quantileStreamResourceHandle) { + @Endpoint( + describeByClass = true + ) + public static IsBoostedTreesQuantileStreamResourceInitialized create(Scope scope, + Operand quantileStreamResourceHandle) { OperationBuilder opBuilder = scope.env().opBuilder("IsBoostedTreesQuantileStreamResourceInitialized", scope.makeOpName("IsBoostedTreesQuantileStreamResourceInitialized")); opBuilder.addInput(quantileStreamResourceHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new IsBoostedTreesQuantileStreamResourceInitialized(opBuilder.build()); } - + /** + * Gets isInitialized. * bool; True if the resource is initialized, False otherwise. + * @return isInitialized. */ public Output isInitialized() { return isInitialized; } - + @Override public Output asOutput() { return isInitialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsBoostedTreesQuantileStreamResourceInitialized"; - - private Output isInitialized; - - private IsBoostedTreesQuantileStreamResourceInitialized(Operation operation) { - super(operation); - int outputIdx = 0; - isInitialized = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustContrast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustContrast.java index 1c3eb4b86bc..86bbca9334a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustContrast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustContrast.java @@ -30,59 +30,65 @@ /** * 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`. - * - * @param data type for {@code output()} output + * {@code (x - mean) * contrast_factor + mean}. + * + * @param data type for {@code output} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class AdjustContrast extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new AdjustContrast operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AdjustContrastv2"; + + private Output output; + + private AdjustContrast(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AdjustContrastv2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static AdjustContrast create(Scope scope, Operand images, Operand contrastFactor) { + @Endpoint( + describeByClass = true + ) + public static AdjustContrast create(Scope scope, Operand images, + Operand contrastFactor) { OperationBuilder opBuilder = scope.env().opBuilder("AdjustContrastv2", scope.makeOpName("AdjustContrast")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(contrastFactor.asOutput()); opBuilder = scope.apply(opBuilder); - return new AdjustContrast(opBuilder.build()); + return new AdjustContrast<>(opBuilder.build()); } - + /** + * Gets output. * The contrast-adjusted image or images. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AdjustContrastv2"; - - private Output output; - - private AdjustContrast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustHue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustHue.java index fa9d0e9a50c..64b03a7600f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustHue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustHue.java @@ -30,56 +30,63 @@ /** * Adjust the hue of one or more images. - *

- * `images` is a tensor of at least 3 dimensions. The last dimension is + * {@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 + *

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 data type for {@code output} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class AdjustHue extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AdjustHue"; + + private Output output; + + private AdjustHue(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AdjustHue operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static AdjustHue create(Scope scope, Operand images, Operand delta) { + @Endpoint( + describeByClass = true + ) + public static AdjustHue create(Scope scope, Operand images, + Operand delta) { OperationBuilder opBuilder = scope.env().opBuilder("AdjustHue", scope.makeOpName("AdjustHue")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(delta.asOutput()); opBuilder = scope.apply(opBuilder); - return new AdjustHue(opBuilder.build()); + return new AdjustHue<>(opBuilder.build()); } - + /** + * Gets output. * The hue-adjusted image or images. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AdjustHue"; - - private Output output; - - private AdjustHue(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustSaturation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustSaturation.java index 5c023d89c6b..a87a80aef4c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustSaturation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/AdjustSaturation.java @@ -30,56 +30,63 @@ /** * Adjust the saturation of one or more images. - *

- * `images` is a tensor of at least 3 dimensions. The last dimension is + * {@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 + *

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 data type for {@code output} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class AdjustSaturation extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AdjustSaturation"; + + private Output output; + + private AdjustSaturation(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AdjustSaturation operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static AdjustSaturation create(Scope scope, Operand images, Operand scale) { + @Endpoint( + describeByClass = true + ) + public static AdjustSaturation create(Scope scope, Operand images, + Operand scale) { OperationBuilder opBuilder = scope.env().opBuilder("AdjustSaturation", scope.makeOpName("AdjustSaturation")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(scale.asOutput()); opBuilder = scope.apply(opBuilder); - return new AdjustSaturation(opBuilder.build()); + return new AdjustSaturation<>(opBuilder.build()); } - + /** + * Gets output. * The hue-adjusted image or images. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AdjustSaturation"; - - private Output output; - - private AdjustSaturation(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CombinedNonMaxSuppression.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CombinedNonMaxSuppression.java index 4b1b82f5585..c20c3f981bd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CombinedNonMaxSuppression.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CombinedNonMaxSuppression.java @@ -30,7 +30,6 @@ /** * 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 @@ -45,51 +44,40 @@ * The output of this operation is the final boxes, scores and classes tensor * returned after performing non_max_suppression. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class CombinedNonMaxSuppression extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.CombinedNonMaxSuppression} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param padPerClass If false, the output nmsed boxes, scores and classes - * are padded/clipped to `max_total_size`. If true, the - * output nmsed boxes, scores and classes are padded to be of length - * `max_size_per_class`*`num_classes`, unless it exceeds `max_total_size` in - * which case it is clipped to `max_total_size`. Defaults to false. - */ - public Options padPerClass(Boolean padPerClass) { - this.padPerClass = padPerClass; - return this; - } - - /** - * @param clipBoxes If true, assume the box coordinates are between [0, 1] and clip the output boxes - * if they fall beyond [0, 1]. If false, do not do clipping and output the box - * coordinates as it is. - */ - public Options clipBoxes(Boolean clipBoxes) { - this.clipBoxes = clipBoxes; - return this; - } - - private Boolean padPerClass; - private Boolean clipBoxes; - - private Options() { - } + public static final String OP_NAME = "CombinedNonMaxSuppression"; + + private Output nmsedBoxes; + + private Output nmsedScores; + + private Output nmsedClasses; + + private Output validDetections; + + private CombinedNonMaxSuppression(Operation operation) { + super(operation); + int outputIdx = 0; + nmsedBoxes = operation.output(outputIdx++); + nmsedScores = operation.output(outputIdx++); + nmsedClasses = operation.output(outputIdx++); + validDetections = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CombinedNonMaxSuppression operation. - * + * * @param scope current scope - * @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 * boxes to be selected by non max suppression per class @@ -98,11 +86,15 @@ private Options() { * 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 */ - @Endpoint(describeByClass = true) - public static CombinedNonMaxSuppression create(Scope scope, Operand boxes, Operand scores, Operand maxOutputSizePerClass, Operand maxTotalSize, Operand iouThreshold, Operand scoreThreshold, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CombinedNonMaxSuppression create(Scope scope, Operand boxes, + Operand scores, Operand maxOutputSizePerClass, Operand maxTotalSize, + Operand iouThreshold, Operand scoreThreshold, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CombinedNonMaxSuppression", scope.makeOpName("CombinedNonMaxSuppression")); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(scores.asOutput()); @@ -123,75 +115,112 @@ public static CombinedNonMaxSuppression create(Scope scope, Operand bo } return new CombinedNonMaxSuppression(opBuilder.build()); } - + /** + * Sets the padPerClass option. + * * @param padPerClass If false, the output nmsed boxes, scores and classes - * are padded/clipped to `max_total_size`. If true, the + * are padded/clipped to {@code max_total_size}. If true, the * output nmsed boxes, scores and classes are padded to be of length - * `max_size_per_class`*`num_classes`, unless it exceeds `max_total_size` in - * which case it is clipped to `max_total_size`. Defaults to false. + * {@code max_size_per_class}*{@code num_classes}, unless it exceeds {@code max_total_size} in + * which case it is clipped to {@code max_total_size}. Defaults to false. + * @return this Options instance. */ public static Options padPerClass(Boolean padPerClass) { return new Options().padPerClass(padPerClass); } - + /** + * Sets the clipBoxes option. + * * @param clipBoxes If true, assume the box coordinates are between [0, 1] and clip the output boxes * if they fall beyond [0, 1]. If false, do not do clipping and output the box * coordinates as it is. + * @return this Options instance. */ public static Options clipBoxes(Boolean clipBoxes) { return new Options().clipBoxes(clipBoxes); } - + /** + * Gets nmsedBoxes. * A [batch_size, max_detections, 4] float32 tensor * containing the non-max suppressed boxes. + * @return nmsedBoxes. */ public Output nmsedBoxes() { return nmsedBoxes; } - + /** + * Gets nmsedScores. * A [batch_size, max_detections] float32 tensor * containing the scores for the boxes. + * @return nmsedScores. */ public Output nmsedScores() { return nmsedScores; } - + /** + * Gets nmsedClasses. * A [batch_size, max_detections] float32 tensor * containing the classes for the boxes. + * @return nmsedClasses. */ public Output nmsedClasses() { return nmsedClasses; } - + /** + * Gets validDetections. * A [batch_size] int32 tensor indicating the number of * valid detections per batch item. Only the top num_detections[i] entries in * nms_boxes[i], nms_scores[i] and nms_class[i] are valid. The rest of the * entries are zero paddings. + * @return validDetections. */ public Output validDetections() { return validDetections; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CombinedNonMaxSuppression"; - - private Output nmsedBoxes; - private Output nmsedScores; - private Output nmsedClasses; - private Output validDetections; - - private CombinedNonMaxSuppression(Operation operation) { - super(operation); - int outputIdx = 0; - nmsedBoxes = operation.output(outputIdx++); - nmsedScores = operation.output(outputIdx++); - nmsedClasses = operation.output(outputIdx++); - validDetections = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.CombinedNonMaxSuppression} + */ + public static class Options { + private Boolean padPerClass; + + private Boolean clipBoxes; + + private Options() { + } + + /** + * Sets the padPerClass option. + * + * @param padPerClass If false, the output nmsed boxes, scores and classes + * are padded/clipped to {@code max_total_size}. If true, the + * output nmsed boxes, scores and classes are padded to be of length + * {@code max_size_per_class}*{@code num_classes}, unless it exceeds {@code max_total_size} in + * which case it is clipped to {@code max_total_size}. Defaults to false. + * @return this Options instance. + */ + public Options padPerClass(Boolean padPerClass) { + this.padPerClass = padPerClass; + return this; + } + + /** + * Sets the clipBoxes option. + * + * @param clipBoxes If true, assume the box coordinates are between [0, 1] and clip the output boxes + * if they fall beyond [0, 1]. If false, do not do clipping and output the box + * coordinates as it is. + * @return this Options instance. + */ + public Options clipBoxes(Boolean clipBoxes) { + this.clipBoxes = clipBoxes; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResize.java index 3607c38dddf..85bca3e2d4e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResize.java @@ -31,83 +31,69 @@ /** * 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`. + * {@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}. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class CropAndResize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.CropAndResize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param method A string specifying the sampling method for resizing. It can be either - * `"bilinear"` or `"nearest"` and default to `"bilinear"`. Currently two sampling - * methods are supported: Bilinear and Nearest Neighbor. - */ - public Options method(String method) { - this.method = method; - return this; - } - - /** - * @param extrapolationValue Value used for extrapolation, when applicable. - */ - public Options extrapolationValue(Float extrapolationValue) { - this.extrapolationValue = extrapolationValue; - return this; - } - - private String method; - private Float extrapolationValue; - - private Options() { - } + public static final String OP_NAME = "CropAndResize"; + + private Output crops; + + private CropAndResize(Operation operation) { + super(operation); + int outputIdx = 0; + crops = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CropAndResize operation. - * + * * @param scope current scope - * @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 + * @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 */ - @Endpoint(describeByClass = true) - public static CropAndResize create(Scope scope, Operand image, Operand boxes, Operand boxInd, Operand cropSize, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CropAndResize create(Scope scope, Operand image, + Operand boxes, Operand boxInd, Operand cropSize, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CropAndResize", scope.makeOpName("CropAndResize")); opBuilder.addInput(image.asOutput()); opBuilder.addInput(boxes.asOutput()); @@ -126,43 +112,76 @@ public static CropAndResize create(Scope scope, Operand image } return new CropAndResize(opBuilder.build()); } - + /** + * Sets the method option. + * * @param method A string specifying the sampling method for resizing. It can be either - * `"bilinear"` or `"nearest"` and default to `"bilinear"`. Currently two sampling + * {@code "bilinear"} or {@code "nearest"} and default to {@code "bilinear"}. Currently two sampling * methods are supported: Bilinear and Nearest Neighbor. + * @return this Options instance. */ public static Options method(String method) { return new Options().method(method); } - + /** + * Sets the extrapolationValue option. + * * @param extrapolationValue Value used for extrapolation, when applicable. + * @return this Options instance. */ public static Options extrapolationValue(Float extrapolationValue) { return new Options().extrapolationValue(extrapolationValue); } - + /** - * A 4-D tensor of shape `[num_boxes, crop_height, crop_width, depth]`. + * Gets crops. + * A 4-D tensor of shape {@code [num_boxes, crop_height, crop_width, depth]}. + * @return crops. */ public Output crops() { return crops; } - + @Override public Output asOutput() { return crops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CropAndResize"; - - private Output crops; - - private CropAndResize(Operation operation) { - super(operation); - int outputIdx = 0; - crops = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.CropAndResize} + */ + public static class Options { + private String method; + + private Float extrapolationValue; + + private Options() { + } + + /** + * Sets the method option. + * + * @param method A string specifying the sampling method for resizing. It can be either + * {@code "bilinear"} or {@code "nearest"} and default to {@code "bilinear"}. Currently two sampling + * methods are supported: Bilinear and Nearest Neighbor. + * @return this Options instance. + */ + public Options method(String method) { + this.method = method; + return this; + } + + /** + * Sets the extrapolationValue option. + * + * @param extrapolationValue Value used for extrapolation, when applicable. + * @return this Options instance. + */ + public Options extrapolationValue(Float extrapolationValue) { + this.extrapolationValue = extrapolationValue; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradBoxes.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradBoxes.java index a6b53c85a85..9eaddcb47ee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradBoxes.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradBoxes.java @@ -32,53 +32,47 @@ /** * Computes the gradient of the crop_and_resize op wrt the input boxes tensor. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class CropAndResizeGradBoxes extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradBoxes} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param method A string specifying the interpolation method. Only 'bilinear' is - * supported for now. - */ - public Options method(String method) { - this.method = method; - return this; - } - - private String method; - - private Options() { - } + public static final String OP_NAME = "CropAndResizeGradBoxes"; + + private Output output; + + private CropAndResizeGradBoxes(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CropAndResizeGradBoxes operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static CropAndResizeGradBoxes create(Scope scope, Operand grads, Operand image, Operand boxes, Operand boxInd, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CropAndResizeGradBoxes create(Scope scope, Operand grads, + Operand image, Operand boxes, Operand boxInd, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CropAndResizeGradBoxes", scope.makeOpName("CropAndResizeGradBoxes")); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(image.asOutput()); @@ -94,35 +88,51 @@ public static CropAndResizeGradBoxes create(Scope scope, Operand grads } return new CropAndResizeGradBoxes(opBuilder.build()); } - + /** + * Sets the method option. + * * @param method A string specifying the interpolation method. Only 'bilinear' is * supported for now. + * @return this Options instance. */ public static Options method(String method) { return new Options().method(method); } - + /** - * A 2-D tensor of shape `[num_boxes, 4]`. + * Gets output. + * A 2-D tensor of shape {@code [num_boxes, 4]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CropAndResizeGradBoxes"; - - private Output output; - - private CropAndResizeGradBoxes(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradBoxes} + */ + public static class Options { + private String method; + + private Options() { + } + + /** + * Sets the method option. + * + * @param method A string specifying the interpolation method. Only 'bilinear' is + * supported for now. + * @return this Options instance. + */ + public Options method(String method) { + this.method = method; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradImage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradImage.java index 97cd59a6db6..8091f63b647 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradImage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/CropAndResizeGradImage.java @@ -32,58 +32,53 @@ /** * Computes the gradient of the crop_and_resize op wrt the input image tensor. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class CropAndResizeGradImage extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradImage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param method A string specifying the interpolation method. Only 'bilinear' is - * supported for now. - */ - public Options method(String method) { - this.method = method; - return this; - } - - private String method; - - private Options() { - } + public static final String OP_NAME = "CropAndResizeGradImage"; + + private Output output; + + private CropAndResizeGradImage(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CropAndResizeGradImage operation. - * + * * @param scope current scope - * @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 property + * @param options carries optional attribute values + * @param data type for {@code CropAndResizeGradImage} output and operands * @return a new instance of CropAndResizeGradImage */ - @Endpoint(describeByClass = true) - public static CropAndResizeGradImage create(Scope scope, Operand grads, Operand boxes, Operand boxInd, Operand imageSize, Class T, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CropAndResizeGradImage create(Scope scope, + Operand grads, Operand boxes, Operand boxInd, + Operand imageSize, Class T, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CropAndResizeGradImage", scope.makeOpName("CropAndResizeGradImage")); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(boxes.asOutput()); @@ -98,37 +93,53 @@ public static CropAndResizeGradImage create(Scope scope, } } } - return new CropAndResizeGradImage(opBuilder.build()); + return new CropAndResizeGradImage<>(opBuilder.build()); } - + /** + * Sets the method option. + * * @param method A string specifying the interpolation method. Only 'bilinear' is * supported for now. + * @return this Options instance. */ public static Options method(String method) { return new Options().method(method); } - + /** - * A 4-D tensor of shape `[batch, image_height, image_width, depth]`. + * Gets output. + * A 4-D tensor of shape {@code [batch, image_height, image_width, depth]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CropAndResizeGradImage"; - - private Output output; - - private CropAndResizeGradImage(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradImage} + */ + public static class Options { + private String method; + + private Options() { + } + + /** + * Sets the method option. + * + * @param method A string specifying the interpolation method. Only 'bilinear' is + * supported for now. + * @return this Options instance. + */ + public Options method(String method) { + this.method = method; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeAndCropJpeg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeAndCropJpeg.java index cebf06eb326..ca839df34f5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeAndCropJpeg.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeAndCropJpeg.java @@ -31,117 +31,53 @@ /** * 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. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class DecodeAndCropJpeg extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodeAndCropJpeg} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels Number of color channels for the decoded image. - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - /** - * @param ratio Downscaling ratio. - */ - public Options ratio(Long ratio) { - this.ratio = ratio; - return this; - } - - /** - * @param fancyUpscaling If true use a slower but nicer upscaling of the - * chroma planes (yuv420/422 only). - */ - public Options fancyUpscaling(Boolean fancyUpscaling) { - this.fancyUpscaling = fancyUpscaling; - return this; - } - - /** - * @param tryRecoverTruncated If true try to recover an image from truncated input. - */ - public Options tryRecoverTruncated(Boolean tryRecoverTruncated) { - this.tryRecoverTruncated = tryRecoverTruncated; - return this; - } - - /** - * @param acceptableFraction The minimum required fraction of lines before a truncated - * input is accepted. - */ - public Options acceptableFraction(Float acceptableFraction) { - this.acceptableFraction = acceptableFraction; - return this; - } - - /** - * @param dctMethod string specifying a hint about the algorithm used for - * decompression. Defaults to "" which maps to a system-specific - * default. Currently valid values are ["INTEGER_FAST", - * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal - * jpeg library changes to a version that does not have that specific - * option.) - */ - public Options dctMethod(String dctMethod) { - this.dctMethod = dctMethod; - return this; - } - - private Long channels; - private Long ratio; - private Boolean fancyUpscaling; - private Boolean tryRecoverTruncated; - private Float acceptableFraction; - private String dctMethod; - - private Options() { - } + public static final String OP_NAME = "DecodeAndCropJpeg"; + + private Output image; + + private DecodeAndCropJpeg(Operation operation) { + super(operation); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeAndCropJpeg operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static DecodeAndCropJpeg create(Scope scope, Operand contents, Operand cropWindow, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodeAndCropJpeg create(Scope scope, Operand contents, + Operand cropWindow, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeAndCropJpeg", scope.makeOpName("DecodeAndCropJpeg")); opBuilder.addInput(contents.asOutput()); opBuilder.addInput(cropWindow.asOutput()); @@ -170,76 +106,178 @@ public static DecodeAndCropJpeg create(Scope scope, Operand contents, O } return new DecodeAndCropJpeg(opBuilder.build()); } - + /** + * Sets the channels option. + * * @param channels Number of color channels for the decoded image. + * @return this Options instance. */ public static Options channels(Long channels) { return new Options().channels(channels); } - + /** + * Sets the ratio option. + * * @param ratio Downscaling ratio. + * @return this Options instance. */ public static Options ratio(Long ratio) { return new Options().ratio(ratio); } - + /** + * Sets the fancyUpscaling option. + * * @param fancyUpscaling If true use a slower but nicer upscaling of the * chroma planes (yuv420/422 only). + * @return this Options instance. */ public static Options fancyUpscaling(Boolean fancyUpscaling) { return new Options().fancyUpscaling(fancyUpscaling); } - + /** + * Sets the tryRecoverTruncated option. + * * @param tryRecoverTruncated If true try to recover an image from truncated input. + * @return this Options instance. */ public static Options tryRecoverTruncated(Boolean tryRecoverTruncated) { return new Options().tryRecoverTruncated(tryRecoverTruncated); } - + /** + * Sets the acceptableFraction option. + * * @param acceptableFraction The minimum required fraction of lines before a truncated * input is accepted. + * @return this Options instance. */ public static Options acceptableFraction(Float acceptableFraction) { return new Options().acceptableFraction(acceptableFraction); } - + /** + * Sets the dctMethod option. + * * @param dctMethod string specifying a hint about the algorithm used for - * decompression. Defaults to "" which maps to a system-specific - * default. Currently valid values are ["INTEGER_FAST", - * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal + * decompression. Defaults to "" which maps to a system-specific + * default. Currently valid values are ["INTEGER_FAST", + * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal * jpeg library changes to a version that does not have that specific * option.) + * @return this Options instance. */ public static Options dctMethod(String dctMethod) { return new Options().dctMethod(dctMethod); } - + /** - * 3-D with shape `[height, width, channels]`.. + * Gets image. + * 3-D with shape {@code [height, width, channels]}.. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeAndCropJpeg"; - - private Output image; - - private DecodeAndCropJpeg(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeAndCropJpeg} + */ + public static class Options { + private Long channels; + + private Long ratio; + + private Boolean fancyUpscaling; + + private Boolean tryRecoverTruncated; + + private Float acceptableFraction; + + private String dctMethod; + + private Options() { + } + + /** + * Sets the channels option. + * + * @param channels Number of color channels for the decoded image. + * @return this Options instance. + */ + public Options channels(Long channels) { + this.channels = channels; + return this; + } + + /** + * Sets the ratio option. + * + * @param ratio Downscaling ratio. + * @return this Options instance. + */ + public Options ratio(Long ratio) { + this.ratio = ratio; + return this; + } + + /** + * Sets the fancyUpscaling option. + * + * @param fancyUpscaling If true use a slower but nicer upscaling of the + * chroma planes (yuv420/422 only). + * @return this Options instance. + */ + public Options fancyUpscaling(Boolean fancyUpscaling) { + this.fancyUpscaling = fancyUpscaling; + return this; + } + + /** + * Sets the tryRecoverTruncated option. + * + * @param tryRecoverTruncated If true try to recover an image from truncated input. + * @return this Options instance. + */ + public Options tryRecoverTruncated(Boolean tryRecoverTruncated) { + this.tryRecoverTruncated = tryRecoverTruncated; + return this; + } + + /** + * Sets the acceptableFraction option. + * + * @param acceptableFraction The minimum required fraction of lines before a truncated + * input is accepted. + * @return this Options instance. + */ + public Options acceptableFraction(Float acceptableFraction) { + this.acceptableFraction = acceptableFraction; + return this; + } + + /** + * Sets the dctMethod option. + * + * @param dctMethod string specifying a hint about the algorithm used for + * decompression. Defaults to "" which maps to a system-specific + * default. Currently valid values are ["INTEGER_FAST", + * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal + * jpeg library changes to a version that does not have that specific + * option.) + * @return this Options instance. + */ + public Options dctMethod(String dctMethod) { + this.dctMethod = dctMethod; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeBmp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeBmp.java index 72f6920b650..e2f57633dc5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeBmp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeBmp.java @@ -30,52 +30,43 @@ /** * Decode the first frame of a BMP-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 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.
  • + *
*/ -@Operator(group = "image") +@Operator( + group = "image" +) public final class DecodeBmp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodeBmp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - private Long channels; - - private Options() { - } + public static final String OP_NAME = "DecodeBmp"; + + private Output image; + + private DecodeBmp(Operation operation) { + super(operation); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeBmp operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeBmp create(Scope scope, Operand contents, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeBmp", scope.makeOpName("DecodeBmp")); opBuilder.addInput(contents.asOutput()); @@ -89,34 +80,49 @@ public static DecodeBmp create(Scope scope, Operand contents, Options.. } return new DecodeBmp(opBuilder.build()); } - + /** - * @param channels + * Sets the channels option. + * + * @param channels the channels option + * @return this Options instance. */ public static Options channels(Long channels) { return new Options().channels(channels); } - + /** - * 3-D with shape `[height, width, channels]`. RGB order + * Gets image. + * 3-D with shape {@code [height, width, channels]}. RGB order + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeBmp"; - - private Output image; - - private DecodeBmp(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeBmp} + */ + public static class Options { + private Long channels; + + private Options() { + } + + /** + * Sets the channels option. + * + * @param channels the channels option + * @return this Options instance. + */ + public Options channels(Long channels) { + this.channels = channels; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeGif.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeGif.java index 93f5f6116f3..f1aac55bf5d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeGif.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeGif.java @@ -30,54 +30,60 @@ /** * 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.io.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}. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class DecodeGif extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DecodeGif"; + + private Output image; + + private DecodeGif(Operation operation) { + super(operation); + int outputIdx = 0; + image = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DecodeGif operation. - * + * * @param scope current scope * @param contents 0-D. The GIF-encoded image. * @return a new instance of DecodeGif */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeGif create(Scope scope, Operand contents) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeGif", scope.makeOpName("DecodeGif")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.apply(opBuilder); return new DecodeGif(opBuilder.build()); } - + /** - * 4-D with shape `[num_frames, height, width, 3]`. RGB channel order. + * Gets image. + * 4-D with shape {@code [num_frames, height, width, 3]}. RGB channel order. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeGif"; - - private Output image; - - private DecodeGif(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java index 2f307368b9b..4b372bec4a6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeImage.java @@ -32,72 +32,56 @@ /** * Function for decode_bmp, decode_gif, decode_jpeg, and decode_png. - *

* Detects whether an image is a BMP, GIF, JPEG, or PNG, and performs the * appropriate operation to convert the input bytes string into a Tensor of type * dtype. - *

- * NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as + *

NOTE: decode_gif returns a 4-D array [num_frames, height, width, 3], as * opposed to decode_bmp, decode_jpeg and decode_png, which return 3-D arrays * [height, width, num_channels]. Make sure to take this into account when * constructing your graph if you are intermixing GIF 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 * animated GIF files to the first frame. - *

- * NOTE: If the first frame of an animated GIF does not occupy the entire + *

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 data type for {@code image()} output + * + * @param data type for {@code image} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class DecodeImage extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodeImage} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels Number of color channels for the decoded image. - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - /** - * @param expandAnimations Controls the output shape of the returned op. If True, the returned op will - * produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all - * GIFs, whether animated or not. If, False, the returned op will produce a 3-D - * tensor for all file types and will truncate animated GIFs to the first frame. - */ - public Options expandAnimations(Boolean expandAnimations) { - this.expandAnimations = expandAnimations; - return this; - } - - private Long channels; - private Boolean expandAnimations; - - private Options() { - } + public static final String OP_NAME = "DecodeImage"; + + private Output image; + + private DecodeImage(Operation operation) { + super(operation); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeImage operation. - * + * * @param scope current scope * @param contents 0-D. The encoded image bytes. * @param dtype The desired DType of the returned Tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DecodeImage} output and operands * @return a new instance of DecodeImage */ - @Endpoint(describeByClass = true) - public static DecodeImage create(Scope scope, Operand contents, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodeImage create(Scope scope, Operand contents, + Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeImage", scope.makeOpName("DecodeImage")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.apply(opBuilder); @@ -112,60 +96,97 @@ public static DecodeImage create(Scope scope, Operand(opBuilder.build()); + return new DecodeImage<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new DecodeImage operation using default output types. - * + * Factory method to create a class wrapping a new DecodeImage operation, with the default output types. + * * @param scope current scope * @param contents 0-D. The encoded image bytes. - * @param options carries optional attributes values - * @return a new instance of DecodeImage + * @param options carries optional attribute values + * @return a new instance of DecodeImage, with default output types */ - @Endpoint(describeByClass = true) - public static DecodeImage create(Scope scope, Operand contents, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodeImage create(Scope scope, Operand contents, + Options[] options) { return create(scope, contents, TUint8.class, options); } - + /** + * Sets the channels option. + * * @param channels Number of color channels for the decoded image. + * @return this Options instance. */ public static Options channels(Long channels) { return new Options().channels(channels); } - + /** + * Sets the expandAnimations option. + * * @param expandAnimations Controls the output shape of the returned op. If True, the returned op will * produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all * GIFs, whether animated or not. If, False, the returned op will produce a 3-D * tensor for all file types and will truncate animated GIFs to the first frame. + * @return this Options instance. */ public static Options expandAnimations(Boolean expandAnimations) { return new Options().expandAnimations(expandAnimations); } - + /** - * 3-D with shape `[height, width, channels]` or 4-D with shape - * `[frame, height, width, channels]`.. + * Gets image. + * 3-D with shape {@code [height, width, channels]} or 4-D with shape + * {@code [frame, height, width, channels]}.. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeImage"; - - private Output image; - - private DecodeImage(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeImage} + */ + public static class Options { + private Long channels; + + private Boolean expandAnimations; + + private Options() { + } + + /** + * Sets the channels option. + * + * @param channels Number of color channels for the decoded image. + * @return this Options instance. + */ + public Options channels(Long channels) { + this.channels = channels; + return this; + } + + /** + * Sets the expandAnimations option. + * + * @param expandAnimations Controls the output shape of the returned op. If True, the returned op will + * produce a 3-D tensor for PNG, JPEG, and BMP files; and a 4-D tensor for all + * GIFs, whether animated or not. If, False, the returned op will produce a 3-D + * tensor for all file types and will truncate animated GIFs to the first frame. + * @return this Options instance. + */ + public Options expandAnimations(Boolean expandAnimations) { + this.expandAnimations = expandAnimations; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeJpeg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeJpeg.java index 0c2298f12b6..8cdbda731b5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeJpeg.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodeJpeg.java @@ -30,115 +30,50 @@ /** * 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.io.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}. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class DecodeJpeg extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodeJpeg} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels Number of color channels for the decoded image. - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - /** - * @param ratio Downscaling ratio. - */ - public Options ratio(Long ratio) { - this.ratio = ratio; - return this; - } - - /** - * @param fancyUpscaling If true use a slower but nicer upscaling of the - * chroma planes (yuv420/422 only). - */ - public Options fancyUpscaling(Boolean fancyUpscaling) { - this.fancyUpscaling = fancyUpscaling; - return this; - } - - /** - * @param tryRecoverTruncated If true try to recover an image from truncated input. - */ - public Options tryRecoverTruncated(Boolean tryRecoverTruncated) { - this.tryRecoverTruncated = tryRecoverTruncated; - return this; - } - - /** - * @param acceptableFraction The minimum required fraction of lines before a truncated - * input is accepted. - */ - public Options acceptableFraction(Float acceptableFraction) { - this.acceptableFraction = acceptableFraction; - return this; - } - - /** - * @param dctMethod string specifying a hint about the algorithm used for - * decompression. Defaults to "" which maps to a system-specific - * default. Currently valid values are ["INTEGER_FAST", - * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal - * jpeg library changes to a version that does not have that specific - * option.) - */ - public Options dctMethod(String dctMethod) { - this.dctMethod = dctMethod; - return this; - } - - private Long channels; - private Long ratio; - private Boolean fancyUpscaling; - private Boolean tryRecoverTruncated; - private Float acceptableFraction; - private String dctMethod; - - private Options() { - } + public static final String OP_NAME = "DecodeJpeg"; + + private Output image; + + private DecodeJpeg(Operation operation) { + super(operation); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeJpeg operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeJpeg create(Scope scope, Operand contents, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeJpeg", scope.makeOpName("DecodeJpeg")); opBuilder.addInput(contents.asOutput()); @@ -167,76 +102,178 @@ public static DecodeJpeg create(Scope scope, Operand contents, Options. } return new DecodeJpeg(opBuilder.build()); } - + /** + * Sets the channels option. + * * @param channels Number of color channels for the decoded image. + * @return this Options instance. */ public static Options channels(Long channels) { return new Options().channels(channels); } - + /** + * Sets the ratio option. + * * @param ratio Downscaling ratio. + * @return this Options instance. */ public static Options ratio(Long ratio) { return new Options().ratio(ratio); } - + /** + * Sets the fancyUpscaling option. + * * @param fancyUpscaling If true use a slower but nicer upscaling of the * chroma planes (yuv420/422 only). + * @return this Options instance. */ public static Options fancyUpscaling(Boolean fancyUpscaling) { return new Options().fancyUpscaling(fancyUpscaling); } - + /** + * Sets the tryRecoverTruncated option. + * * @param tryRecoverTruncated If true try to recover an image from truncated input. + * @return this Options instance. */ public static Options tryRecoverTruncated(Boolean tryRecoverTruncated) { return new Options().tryRecoverTruncated(tryRecoverTruncated); } - + /** + * Sets the acceptableFraction option. + * * @param acceptableFraction The minimum required fraction of lines before a truncated * input is accepted. + * @return this Options instance. */ public static Options acceptableFraction(Float acceptableFraction) { return new Options().acceptableFraction(acceptableFraction); } - + /** + * Sets the dctMethod option. + * * @param dctMethod string specifying a hint about the algorithm used for - * decompression. Defaults to "" which maps to a system-specific - * default. Currently valid values are ["INTEGER_FAST", - * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal + * decompression. Defaults to "" which maps to a system-specific + * default. Currently valid values are ["INTEGER_FAST", + * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal * jpeg library changes to a version that does not have that specific * option.) + * @return this Options instance. */ public static Options dctMethod(String dctMethod) { return new Options().dctMethod(dctMethod); } - + /** - * 3-D with shape `[height, width, channels]`.. + * Gets image. + * 3-D with shape {@code [height, width, channels]}.. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeJpeg"; - - private Output image; - - private DecodeJpeg(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodeJpeg} + */ + public static class Options { + private Long channels; + + private Long ratio; + + private Boolean fancyUpscaling; + + private Boolean tryRecoverTruncated; + + private Float acceptableFraction; + + private String dctMethod; + + private Options() { + } + + /** + * Sets the channels option. + * + * @param channels Number of color channels for the decoded image. + * @return this Options instance. + */ + public Options channels(Long channels) { + this.channels = channels; + return this; + } + + /** + * Sets the ratio option. + * + * @param ratio Downscaling ratio. + * @return this Options instance. + */ + public Options ratio(Long ratio) { + this.ratio = ratio; + return this; + } + + /** + * Sets the fancyUpscaling option. + * + * @param fancyUpscaling If true use a slower but nicer upscaling of the + * chroma planes (yuv420/422 only). + * @return this Options instance. + */ + public Options fancyUpscaling(Boolean fancyUpscaling) { + this.fancyUpscaling = fancyUpscaling; + return this; + } + + /** + * Sets the tryRecoverTruncated option. + * + * @param tryRecoverTruncated If true try to recover an image from truncated input. + * @return this Options instance. + */ + public Options tryRecoverTruncated(Boolean tryRecoverTruncated) { + this.tryRecoverTruncated = tryRecoverTruncated; + return this; + } + + /** + * Sets the acceptableFraction option. + * + * @param acceptableFraction The minimum required fraction of lines before a truncated + * input is accepted. + * @return this Options instance. + */ + public Options acceptableFraction(Float acceptableFraction) { + this.acceptableFraction = acceptableFraction; + return this; + } + + /** + * Sets the dctMethod option. + * + * @param dctMethod string specifying a hint about the algorithm used for + * decompression. Defaults to "" which maps to a system-specific + * default. Currently valid values are ["INTEGER_FAST", + * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal + * jpeg library changes to a version that does not have that specific + * option.) + * @return this Options instance. + */ + public Options dctMethod(String dctMethod) { + this.dctMethod = dctMethod; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java index c2eb543f629..edefdf308f7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DecodePng.java @@ -32,66 +32,54 @@ /** * 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.io.decode_image`. - * - * @param data type for {@code image()} output + *

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 */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class DecodePng extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.DecodePng} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param channels Number of color channels for the decoded image. - */ - public Options channels(Long channels) { - this.channels = channels; - return this; - } - - private Long channels; - - private Options() { - } + public static final String OP_NAME = "DecodePng"; + + private Output image; + + private DecodePng(Operation operation) { + super(operation); + int outputIdx = 0; + image = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodePng operation. - * + * * @param scope current scope * @param contents 0-D. The PNG-encoded image. - * @param dtype - * @param options carries optional attributes values + * @param dtype the value of the dtype property + * @param options carries optional attribute values + * @param data type for {@code DecodePng} output and operands * @return a new instance of DecodePng */ - @Endpoint(describeByClass = true) - public static DecodePng create(Scope scope, Operand contents, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodePng create(Scope scope, Operand contents, + Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodePng", scope.makeOpName("DecodePng")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.apply(opBuilder); @@ -103,49 +91,67 @@ public static DecodePng create(Scope scope, Operand(opBuilder.build()); + return new DecodePng<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new DecodePng operation using default output types. - * + * Factory method to create a class wrapping a new DecodePng operation, with the default output types. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static DecodePng create(Scope scope, Operand contents, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodePng create(Scope scope, Operand contents, + Options[] options) { return create(scope, contents, TUint8.class, options); } - + /** + * Sets the channels option. + * * @param channels Number of color channels for the decoded image. + * @return this Options instance. */ public static Options channels(Long channels) { return new Options().channels(channels); } - + /** - * 3-D with shape `[height, width, channels]`. + * Gets image. + * 3-D with shape {@code [height, width, channels]}. + * @return image. */ public Output image() { return image; } - + @Override public Output asOutput() { return image; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodePng"; - - private Output image; - - private DecodePng(Operation operation) { - super(operation); - int outputIdx = 0; - image = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.DecodePng} + */ + public static class Options { + private Long channels; + + private Options() { + } + + /** + * Sets the channels option. + * + * @param channels Number of color channels for the decoded image. + * @return this Options instance. + */ + public Options channels(Long channels) { + this.channels = channels; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DrawBoundingBoxes.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DrawBoundingBoxes.java index 5204c603b31..660dad4034f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DrawBoundingBoxes.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/DrawBoundingBoxes.java @@ -30,65 +30,71 @@ /** * 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 + *

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 data type for {@code output} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class DrawBoundingBoxes extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new DrawBoundingBoxes operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DrawBoundingBoxesV2"; + + private Output output; + + private DrawBoundingBoxes(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DrawBoundingBoxesV2 operation. + * * @param scope current scope - * @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 + * @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 */ - @Endpoint(describeByClass = true) - public static DrawBoundingBoxes create(Scope scope, Operand images, Operand boxes, Operand colors) { + @Endpoint( + describeByClass = true + ) + public static DrawBoundingBoxes create(Scope scope, Operand images, + Operand boxes, Operand colors) { OperationBuilder opBuilder = scope.env().opBuilder("DrawBoundingBoxesV2", scope.makeOpName("DrawBoundingBoxes")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(colors.asOutput()); opBuilder = scope.apply(opBuilder); - return new DrawBoundingBoxes(opBuilder.build()); + return new DrawBoundingBoxes<>(opBuilder.build()); } - + /** - * 4-D with the same shape as `images`. The batch of input images with + * Gets output. + * 4-D with the same shape as {@code images}. The batch of input images with * bounding boxes drawn on the images. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DrawBoundingBoxesV2"; - - private Output output; - - private DrawBoundingBoxes(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpeg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpeg.java index ae29290d8a5..b03e10d8025 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpeg.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpeg.java @@ -30,137 +30,51 @@ /** * 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. + *
  • 1: Output a grayscale image.
  • + *
  • 3: Output an RGB image.
  • + *
*/ -@Operator(group = "image") +@Operator( + group = "image" +) public final class EncodeJpeg extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.EncodeJpeg} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param format Per pixel image format. - */ - public Options format(String format) { - this.format = format; - return this; - } - - /** - * @param quality Quality of the compression from 0 to 100 (higher is better and slower). - */ - public Options quality(Long quality) { - this.quality = quality; - return this; - } - - /** - * @param progressive If True, create a JPEG that loads progressively (coarse to fine). - */ - public Options progressive(Boolean progressive) { - this.progressive = progressive; - return this; - } - - /** - * @param optimizeSize If True, spend CPU/RAM to reduce size with no quality change. - */ - public Options optimizeSize(Boolean optimizeSize) { - this.optimizeSize = optimizeSize; - return this; - } - - /** - * @param chromaDownsampling See http://en.wikipedia.org/wiki/Chroma_subsampling. - */ - public Options chromaDownsampling(Boolean chromaDownsampling) { - this.chromaDownsampling = chromaDownsampling; - return this; - } - - /** - * @param densityUnit Unit used to specify `x_density` and `y_density`: - * pixels per inch (`'in'`) or centimeter (`'cm'`). - */ - public Options densityUnit(String densityUnit) { - this.densityUnit = densityUnit; - return this; - } - - /** - * @param xDensity Horizontal pixels per density unit. - */ - public Options xDensity(Long xDensity) { - this.xDensity = xDensity; - return this; - } - - /** - * @param yDensity Vertical pixels per density unit. - */ - public Options yDensity(Long yDensity) { - this.yDensity = yDensity; - return this; - } - - /** - * @param xmpMetadata If not empty, embed this XMP metadata in the image header. - */ - public Options xmpMetadata(String xmpMetadata) { - this.xmpMetadata = xmpMetadata; - return this; - } - - private String format; - private Long quality; - private Boolean progressive; - private Boolean optimizeSize; - private Boolean chromaDownsampling; - private String densityUnit; - private Long xDensity; - private Long yDensity; - private String xmpMetadata; - - private Options() { - } + public static final String OP_NAME = "EncodeJpeg"; + + private Output contents; + + private EncodeJpeg(Operation operation) { + super(operation); + int outputIdx = 0; + contents = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EncodeJpeg operation. - * + * * @param scope current scope - * @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 EncodeJpeg */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static EncodeJpeg create(Scope scope, Operand image, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EncodeJpeg", scope.makeOpName("EncodeJpeg")); opBuilder.addInput(image.asOutput()); @@ -198,91 +112,235 @@ public static EncodeJpeg create(Scope scope, Operand image, Options... o } return new EncodeJpeg(opBuilder.build()); } - + /** + * Sets the format option. + * * @param format Per pixel image format. + * @return this Options instance. */ public static Options format(String format) { return new Options().format(format); } - + /** + * Sets the quality option. + * * @param quality Quality of the compression from 0 to 100 (higher is better and slower). + * @return this Options instance. */ public static Options quality(Long quality) { return new Options().quality(quality); } - + /** + * Sets the progressive option. + * * @param progressive If True, create a JPEG that loads progressively (coarse to fine). + * @return this Options instance. */ public static Options progressive(Boolean progressive) { return new Options().progressive(progressive); } - + /** + * Sets the optimizeSize option. + * * @param optimizeSize If True, spend CPU/RAM to reduce size with no quality change. + * @return this Options instance. */ public static Options optimizeSize(Boolean optimizeSize) { return new Options().optimizeSize(optimizeSize); } - + /** + * Sets the chromaDownsampling option. + * * @param chromaDownsampling See http://en.wikipedia.org/wiki/Chroma_subsampling. + * @return this Options instance. */ public static Options chromaDownsampling(Boolean chromaDownsampling) { return new Options().chromaDownsampling(chromaDownsampling); } - + /** - * @param densityUnit Unit used to specify `x_density` and `y_density`: - * pixels per inch (`'in'`) or centimeter (`'cm'`). + * Sets the densityUnit option. + * + * @param densityUnit Unit used to specify {@code x_density} and {@code y_density}: + * pixels per inch ({@code 'in'}) or centimeter ({@code 'cm'}). + * @return this Options instance. */ public static Options densityUnit(String densityUnit) { return new Options().densityUnit(densityUnit); } - + /** + * Sets the xDensity option. + * * @param xDensity Horizontal pixels per density unit. + * @return this Options instance. */ public static Options xDensity(Long xDensity) { return new Options().xDensity(xDensity); } - + /** + * Sets the yDensity option. + * * @param yDensity Vertical pixels per density unit. + * @return this Options instance. */ public static Options yDensity(Long yDensity) { return new Options().yDensity(yDensity); } - + /** + * Sets the xmpMetadata option. + * * @param xmpMetadata If not empty, embed this XMP metadata in the image header. + * @return this Options instance. */ public static Options xmpMetadata(String xmpMetadata) { return new Options().xmpMetadata(xmpMetadata); } - + /** + * Gets contents. * 0-D. JPEG-encoded image. + * @return contents. */ public Output contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeJpeg"; - - private Output contents; - - private EncodeJpeg(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.EncodeJpeg} + */ + public static class Options { + private String format; + + private Long quality; + + private Boolean progressive; + + private Boolean optimizeSize; + + private Boolean chromaDownsampling; + + private String densityUnit; + + private Long xDensity; + + private Long yDensity; + + private String xmpMetadata; + + private Options() { + } + + /** + * Sets the format option. + * + * @param format Per pixel image format. + * @return this Options instance. + */ + public Options format(String format) { + this.format = format; + return this; + } + + /** + * Sets the quality option. + * + * @param quality Quality of the compression from 0 to 100 (higher is better and slower). + * @return this Options instance. + */ + public Options quality(Long quality) { + this.quality = quality; + return this; + } + + /** + * Sets the progressive option. + * + * @param progressive If True, create a JPEG that loads progressively (coarse to fine). + * @return this Options instance. + */ + public Options progressive(Boolean progressive) { + this.progressive = progressive; + return this; + } + + /** + * Sets the optimizeSize option. + * + * @param optimizeSize If True, spend CPU/RAM to reduce size with no quality change. + * @return this Options instance. + */ + public Options optimizeSize(Boolean optimizeSize) { + this.optimizeSize = optimizeSize; + return this; + } + + /** + * Sets the chromaDownsampling option. + * + * @param chromaDownsampling See http://en.wikipedia.org/wiki/Chroma_subsampling. + * @return this Options instance. + */ + public Options chromaDownsampling(Boolean chromaDownsampling) { + this.chromaDownsampling = chromaDownsampling; + return this; + } + + /** + * Sets the densityUnit option. + * + * @param densityUnit Unit used to specify {@code x_density} and {@code y_density}: + * pixels per inch ({@code 'in'}) or centimeter ({@code 'cm'}). + * @return this Options instance. + */ + public Options densityUnit(String densityUnit) { + this.densityUnit = densityUnit; + return this; + } + + /** + * Sets the xDensity option. + * + * @param xDensity Horizontal pixels per density unit. + * @return this Options instance. + */ + public Options xDensity(Long xDensity) { + this.xDensity = xDensity; + return this; + } + + /** + * Sets the yDensity option. + * + * @param yDensity Vertical pixels per density unit. + * @return this Options instance. + */ + public Options yDensity(Long yDensity) { + this.yDensity = yDensity; + return this; + } + + /** + * Sets the xmpMetadata option. + * + * @param xmpMetadata If not empty, embed this XMP metadata in the image header. + * @return this Options instance. + */ + public Options xmpMetadata(String xmpMetadata) { + this.xmpMetadata = xmpMetadata; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpegVariableQuality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpegVariableQuality.java index cbd80e29413..5128843c1e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpegVariableQuality.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodeJpegVariableQuality.java @@ -31,51 +31,57 @@ /** * 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. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class EncodeJpegVariableQuality extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EncodeJpegVariableQuality"; + + private Output contents; + + private EncodeJpegVariableQuality(Operation operation) { + super(operation); + int outputIdx = 0; + contents = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EncodeJpegVariableQuality operation. - * + * * @param scope current scope * @param images Images to adjust. At least 3-D. * @param quality An int quality to encode to. * @return a new instance of EncodeJpegVariableQuality */ - @Endpoint(describeByClass = true) - public static EncodeJpegVariableQuality create(Scope scope, Operand images, Operand quality) { + @Endpoint( + describeByClass = true + ) + public static EncodeJpegVariableQuality create(Scope scope, Operand images, + Operand quality) { OperationBuilder opBuilder = scope.env().opBuilder("EncodeJpegVariableQuality", scope.makeOpName("EncodeJpegVariableQuality")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(quality.asOutput()); opBuilder = scope.apply(opBuilder); return new EncodeJpegVariableQuality(opBuilder.build()); } - + /** + * Gets contents. * 0-D. JPEG-encoded image. + * @return contents. */ public Output contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeJpegVariableQuality"; - - private Output contents; - - private EncodeJpegVariableQuality(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodePng.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodePng.java index 7d998947efe..09f0b5b8b44 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodePng.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/EncodePng.java @@ -30,59 +30,48 @@ /** * 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. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class EncodePng extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.EncodePng} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param compression Compression level. - */ - public Options compression(Long compression) { - this.compression = compression; - return this; - } - - private Long compression; - - private Options() { - } + public static final String OP_NAME = "EncodePng"; + + private Output contents; + + private EncodePng(Operation operation) { + super(operation); + int outputIdx = 0; + contents = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EncodePng operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static EncodePng create(Scope scope, Operand image, Options... options) { + @Endpoint( + describeByClass = true + ) + public static EncodePng create(Scope scope, Operand image, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EncodePng", scope.makeOpName("EncodePng")); opBuilder.addInput(image.asOutput()); opBuilder = scope.apply(opBuilder); @@ -95,34 +84,49 @@ public static EncodePng create(Scope scope, Operand image, Op } return new EncodePng(opBuilder.build()); } - + /** + * Sets the compression option. + * * @param compression Compression level. + * @return this Options instance. */ public static Options compression(Long compression) { return new Options().compression(compression); } - + /** + * Gets contents. * 0-D. PNG-encoded image. + * @return contents. */ public Output contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodePng"; - - private Output contents; - - private EncodePng(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.EncodePng} + */ + public static class Options { + private Long compression; + + private Options() { + } + + /** + * Sets the compression option. + * + * @param compression Compression level. + * @return this Options instance. + */ + public Options compression(Long compression) { + this.compression = compression; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractGlimpse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractGlimpse.java index 36a3c904689..7c038ac4fd9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractGlimpse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractGlimpse.java @@ -24,112 +24,66 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; /** * 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. + *
  • 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.
  • + *
*/ public final class ExtractGlimpse extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ExtractGlimpse} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param centered indicates if the offset coordinates are centered relative to - * the image, in which case the (0, 0) offset is relative to the center - * of the input images. If false, the (0,0) offset corresponds to the - * upper left corner of the input images. - */ - public Options centered(Boolean centered) { - this.centered = centered; - return this; - } - - /** - * @param normalized indicates if the offset coordinates are normalized. - */ - public Options normalized(Boolean normalized) { - this.normalized = normalized; - return this; - } - - /** - * @param uniformNoise indicates if the noise should be generated using a - * uniform distribution or a Gaussian distribution. - */ - public Options uniformNoise(Boolean uniformNoise) { - this.uniformNoise = uniformNoise; - return this; - } - - /** - * @param noise indicates if the noise should `uniform`, `gaussian`, or - * `zero`. The default is `uniform` which means the the noise type - * will be decided by `uniform_noise`. - */ - public Options noise(String noise) { - this.noise = noise; - return this; - } - - private Boolean centered; - private Boolean normalized; - private Boolean uniformNoise; - private String noise; - - private Options() { - } + public static final String OP_NAME = "ExtractGlimpseV2"; + + private Output glimpse; + + private ExtractGlimpse(Operation operation) { + super(operation); + int outputIdx = 0; + glimpse = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ExtractGlimpse operation. - * + * Factory method to create a class wrapping a new ExtractGlimpseV2 operation. + * * @param scope current scope - * @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 + * @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 */ - @Endpoint(describeByClass = true) - public static ExtractGlimpse create(Scope scope, Operand input, Operand size, Operand offsets, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ExtractGlimpse create(Scope scope, Operand input, + Operand sizeOutput, Operand offsets, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ExtractGlimpseV2", scope.makeOpName("ExtractGlimpse")); opBuilder.addInput(input.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(offsets.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { @@ -150,62 +104,130 @@ public static ExtractGlimpse create(Scope scope, Operand input, Operan } return new ExtractGlimpse(opBuilder.build()); } - + /** + * Sets the centered option. + * * @param centered indicates if the offset coordinates are centered relative to * the image, in which case the (0, 0) offset is relative to the center * of the input images. If false, the (0,0) offset corresponds to the * upper left corner of the input images. + * @return this Options instance. */ public static Options centered(Boolean centered) { return new Options().centered(centered); } - + /** + * Sets the normalized option. + * * @param normalized indicates if the offset coordinates are normalized. + * @return this Options instance. */ public static Options normalized(Boolean normalized) { return new Options().normalized(normalized); } - + /** + * Sets the uniformNoise option. + * * @param uniformNoise indicates if the noise should be generated using a * uniform distribution or a Gaussian distribution. + * @return this Options instance. */ public static Options uniformNoise(Boolean uniformNoise) { return new Options().uniformNoise(uniformNoise); } - + /** - * @param noise indicates if the noise should `uniform`, `gaussian`, or - * `zero`. The default is `uniform` which means the the noise type - * will be decided by `uniform_noise`. + * Sets the noise option. + * + * @param noise indicates if the noise should {@code uniform}, {@code gaussian}, or + * {@code zero}. The default is {@code uniform} which means the the noise type + * will be decided by {@code uniform_noise}. + * @return this Options instance. */ public static Options noise(String noise) { return new Options().noise(noise); } - + /** - * A tensor representing the glimpses `[batch_size, - * glimpse_height, glimpse_width, channels]`. + * Gets glimpse. + * A tensor representing the glimpses {@code [batch_size, glimpse_height, glimpse_width, channels]}. + * @return glimpse. */ public Output glimpse() { return glimpse; } - + @Override public Output asOutput() { return glimpse; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExtractGlimpseV2"; - - private Output glimpse; - - private ExtractGlimpse(Operation operation) { - super(operation); - int outputIdx = 0; - glimpse = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ExtractGlimpse} + */ + public static class Options { + private Boolean centered; + + private Boolean normalized; + + private Boolean uniformNoise; + + private String noise; + + private Options() { + } + + /** + * Sets the centered option. + * + * @param centered indicates if the offset coordinates are centered relative to + * the image, in which case the (0, 0) offset is relative to the center + * of the input images. If false, the (0,0) offset corresponds to the + * upper left corner of the input images. + * @return this Options instance. + */ + public Options centered(Boolean centered) { + this.centered = centered; + return this; + } + + /** + * Sets the normalized option. + * + * @param normalized indicates if the offset coordinates are normalized. + * @return this Options instance. + */ + public Options normalized(Boolean normalized) { + this.normalized = normalized; + return this; + } + + /** + * Sets the uniformNoise option. + * + * @param uniformNoise indicates if the noise should be generated using a + * uniform distribution or a Gaussian distribution. + * @return this Options instance. + */ + public Options uniformNoise(Boolean uniformNoise) { + this.uniformNoise = uniformNoise; + return this; + } + + /** + * Sets the noise option. + * + * @param noise indicates if the noise should {@code uniform}, {@code gaussian}, or + * {@code zero}. The default is {@code uniform} which means the the noise type + * will be decided by {@code uniform_noise}. + * @return this Options instance. + */ + public Options noise(String noise) { + this.noise = noise; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractImagePatches.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractImagePatches.java index 24707b85233..89a2979726b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractImagePatches.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractImagePatches.java @@ -29,77 +29,85 @@ import org.tensorflow.types.family.TType; /** - * Extract `patches` from `images` and put them in the "depth" output dimension. - * - * @param data type for {@code patches()} output + * Extract {@code patches} from {@code images} and put them in the "depth" output dimension. + * + * @param data type for {@code patches} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class ExtractImagePatches extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExtractImagePatches"; + + private Output patches; + + private ExtractImagePatches(Operation operation) { + super(operation); + int outputIdx = 0; + patches = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ExtractImagePatches operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static ExtractImagePatches create(Scope scope, Operand images, List ksizes, List strides, List rates, String padding) { + @Endpoint( + describeByClass = true + ) + public static ExtractImagePatches create(Scope scope, Operand images, + List ksizes, List strides, List rates, String padding) { OperationBuilder opBuilder = scope.env().opBuilder("ExtractImagePatches", scope.makeOpName("ExtractImagePatches")); opBuilder.addInput(images.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizesArray = new long[ksizes.size()]; - for (int i = 0; i < ksizesArray.length; ++i) { + for (int i = 0 ; i < ksizesArray.length ; i++) { ksizesArray[i] = ksizes.get(i); } opBuilder.setAttr("ksizes", ksizesArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); long[] ratesArray = new long[rates.size()]; - for (int i = 0; i < ratesArray.length; ++i) { + for (int i = 0 ; i < ratesArray.length ; i++) { ratesArray[i] = rates.get(i); } opBuilder.setAttr("rates", ratesArray); opBuilder.setAttr("padding", padding); - return new ExtractImagePatches(opBuilder.build()); + return new ExtractImagePatches<>(opBuilder.build()); } - + /** - * 4-D Tensor with shape `[batch, out_rows, out_cols, ksize_rows * - * ksize_cols * depth]` containing image patches with size - * `ksize_rows x ksize_cols x depth` vectorized in the "depth" dimension. Note - * `out_rows` and `out_cols` are the dimensions of the output patches. + * Gets patches. + * 4-D Tensor with shape {@code [batch, out_rows, out_cols, ksize_rows * ksize_cols * depth]} containing image patches with size + * {@code ksize_rows x ksize_cols x depth} vectorized in the "depth" dimension. Note + * {@code out_rows} and {@code out_cols} are the dimensions of the output patches. + * @return patches. */ public Output patches() { return patches; } - + @Override public Output asOutput() { return patches; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExtractImagePatches"; - - private Output patches; - - private ExtractImagePatches(Operation operation) { - super(operation); - int outputIdx = 0; - patches = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractJpegShape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractJpegShape.java index bb12cb5cb1a..5b1a97ac1dc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractJpegShape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ExtractJpegShape.java @@ -32,64 +32,74 @@ /** * 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 data type for {@code image_shape} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class ExtractJpegShape extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ExtractJpegShape"; + + private Output imageShape; + + private ExtractJpegShape(Operation operation) { + super(operation); + int outputIdx = 0; + imageShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ExtractJpegShape operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static ExtractJpegShape create(Scope scope, Operand contents, Class outputType) { + @Endpoint( + describeByClass = true + ) + public static ExtractJpegShape create(Scope scope, + Operand contents, Class outputType) { OperationBuilder opBuilder = scope.env().opBuilder("ExtractJpegShape", scope.makeOpName("ExtractJpegShape")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_type", Operands.toDataType(outputType)); - return new ExtractJpegShape(opBuilder.build()); + return new ExtractJpegShape<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ExtractJpegShape operation using default output types. - * + * Factory method to create a class wrapping a new ExtractJpegShape operation, with the default output types. + * * @param scope current scope * @param contents 0-D. The JPEG-encoded image. - * @return a new instance of ExtractJpegShape + * @return a new instance of ExtractJpegShape, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ExtractJpegShape create(Scope scope, Operand contents) { return create(scope, contents, TInt32.class); } - + /** + * Gets imageShape. * 1-D. The image shape with format [height, width, channels]. + * @return imageShape. */ public Output imageShape() { return imageShape; } - + @Override public Output asOutput() { return imageShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ExtractJpegShape"; - - private Output imageShape; - - private ExtractJpegShape(Operation operation) { - super(operation); - int outputIdx = 0; - imageShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/GenerateBoundingBoxProposals.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/GenerateBoundingBoxProposals.java index 52a693a5061..895afd33b3b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/GenerateBoundingBoxProposals.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/GenerateBoundingBoxProposals.java @@ -24,63 +24,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; /** * 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. + *

+ *   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.
+ * 
*/ public final class GenerateBoundingBoxProposals extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.GenerateBoundingBoxProposals} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param postNmsTopn An integer. Maximum number of rois in the output. - */ - public Options postNmsTopn(Long postNmsTopn) { - this.postNmsTopn = postNmsTopn; - return this; - } - - private Long postNmsTopn; - - private Options() { - } + public static final String OP_NAME = "GenerateBoundingBoxProposals"; + + private Output rois; + + private Output roiProbabilities; + + private GenerateBoundingBoxProposals(Operation operation) { + super(operation); + int outputIdx = 0; + rois = operation.output(outputIdx++); + roiProbabilities = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new GenerateBoundingBoxProposals operation. - * + * * @param scope current scope - * @param scores A 4-D float tensor of shape `[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 `[num_images, height, width, 4 x num_anchors]`. encoding boxes with respec to each anchor. + * @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 `[num_images, 5]` containing image information Height, Width, Scale. - * @param anchors A 2-D float tensor of shape `[num_anchors, 4]` describing the anchor boxes. Boxes are formatted in the form [y1, x1, y2, x2]. + * @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 attributes values + * @param options carries optional attribute values * @return a new instance of GenerateBoundingBoxProposals */ - @Endpoint(describeByClass = true) - public static GenerateBoundingBoxProposals create(Scope scope, Operand scores, Operand bboxDeltas, Operand imageInfo, Operand anchors, Operand nmsThreshold, Operand preNmsTopn, Operand minSize, Options... options) { + @Endpoint( + describeByClass = true + ) + public static GenerateBoundingBoxProposals create(Scope scope, Operand scores, + Operand bboxDeltas, Operand imageInfo, Operand anchors, + Operand nmsThreshold, Operand preNmsTopn, Operand minSize, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("GenerateBoundingBoxProposals", scope.makeOpName("GenerateBoundingBoxProposals")); opBuilder.addInput(scores.asOutput()); opBuilder.addInput(bboxDeltas.asOutput()); @@ -99,40 +100,55 @@ public static GenerateBoundingBoxProposals create(Scope scope, Operand } return new GenerateBoundingBoxProposals(opBuilder.build()); } - + /** + * Sets the postNmsTopn option. + * * @param postNmsTopn An integer. Maximum number of rois in the output. + * @return this Options instance. */ public static Options postNmsTopn(Long postNmsTopn) { return new Options().postNmsTopn(postNmsTopn); } - + /** - * A 3-D float tensor of shape `[num_images,post_nms_topn,4]` representing the selected + * Gets rois. + * A 3-D float tensor of shape {@code [num_images,post_nms_topn,4]} representing the selected * region of interest boxes. Sorted in descending order in scores. + * @return rois. */ public Output rois() { return rois; } - + /** - * A 2-D float tensor of shape `[num_images, post_nms_topn]` representing the score of the - * region of interest box in `rois` tensor at the same index. + * Gets roiProbabilities. + * A 2-D float tensor of shape {@code [num_images, post_nms_topn]} representing the score of the + * region of interest box in {@code rois} tensor at the same index. + * @return roiProbabilities. */ public Output roiProbabilities() { return roiProbabilities; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GenerateBoundingBoxProposals"; - - private Output rois; - private Output roiProbabilities; - - private GenerateBoundingBoxProposals(Operation operation) { - super(operation); - int outputIdx = 0; - rois = operation.output(outputIdx++); - roiProbabilities = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.GenerateBoundingBoxProposals} + */ + public static class Options { + private Long postNmsTopn; + + private Options() { + } + + /** + * Sets the postNmsTopn option. + * + * @param postNmsTopn An integer. Maximum number of rois in the output. + * @return this Options instance. + */ + public Options postNmsTopn(Long postNmsTopn) { + this.postNmsTopn = postNmsTopn; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/HsvToRgb.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/HsvToRgb.java index 7934480bad9..f87b0d696ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/HsvToRgb.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/HsvToRgb.java @@ -29,53 +29,59 @@ /** * 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 data type for {@code output} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class HsvToRgb extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new HsvToRgb operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "HSVToRGB"; + + private Output output; + + private HsvToRgb(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new HSVToRGB operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static HsvToRgb create(Scope scope, Operand images) { OperationBuilder opBuilder = scope.env().opBuilder("HSVToRGB", scope.makeOpName("HsvToRgb")); opBuilder.addInput(images.asOutput()); opBuilder = scope.apply(opBuilder); - return new HsvToRgb(opBuilder.build()); + return new HsvToRgb<>(opBuilder.build()); } - + /** - * `images` converted to RGB. + * Gets output. + * {@code images} converted to RGB. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "HSVToRGB"; - - private Output output; - - private HsvToRgb(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV2.java index 5fd57e44754..cfd556a54d8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV2.java @@ -24,58 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Applies the given transform to each of the images. - *

- * If one row of `transforms` is `[a0, a1, a2, b0, b1, b2, c0, c1]`, then it maps - * the output point `(x, y)` to a transformed input point - * `(x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)`, where - * `k = c0 x + c1 y + 1`. If the transformed point lays outside of the input + * 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 data type for {@code transformedImages()} output + * + * @param data type for {@code transformed_images} output */ public final class ImageProjectiveTransformV2 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ImageProjectiveTransformV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". - */ - public Options fillMode(String fillMode) { - this.fillMode = fillMode; - return this; - } - - private String fillMode; - - private Options() { - } + public static final String OP_NAME = "ImageProjectiveTransformV2"; + + private Output transformedImages; + + private ImageProjectiveTransformV2(Operation operation) { + super(operation); + int outputIdx = 0; + transformedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ImageProjectiveTransformV2 operation. - * + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param transforms 2-D Tensor, `[batch, 8]` or `[1, 8]` matrix, where each row corresponds to a 3 x 3 + * @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 attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ImageProjectiveTransformV2 create(Scope scope, Operand images, Operand transforms, Operand outputShape, String interpolation, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ImageProjectiveTransformV2 create(Scope scope, + Operand images, Operand transforms, Operand outputShape, + String interpolation, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ImageProjectiveTransformV2", scope.makeOpName("ImageProjectiveTransformV2")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(transforms.asOutput()); @@ -89,37 +85,52 @@ public static ImageProjectiveTransformV2 create(Scope sco } } } - return new ImageProjectiveTransformV2(opBuilder.build()); + return new ImageProjectiveTransformV2<>(opBuilder.build()); } - + /** - * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * Sets the fillMode option. + * + * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * @return this Options instance. */ public static Options fillMode(String fillMode) { return new Options().fillMode(fillMode); } - + /** + * Gets transformedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return transformedImages. */ public Output transformedImages() { return transformedImages; } - + @Override public Output asOutput() { return transformedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImageProjectiveTransformV2"; - - private Output transformedImages; - - private ImageProjectiveTransformV2(Operation operation) { - super(operation); - int outputIdx = 0; - transformedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ImageProjectiveTransformV2} + */ + public static class Options { + private String fillMode; + + private Options() { + } + + /** + * Sets the fillMode option. + * + * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * @return this Options instance. + */ + public Options fillMode(String fillMode) { + this.fillMode = fillMode; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV3.java index 2b4de22d4d4..94cef1d7502 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ImageProjectiveTransformV3.java @@ -24,59 +24,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Applies the given transform to each of the images. - *

- * If one row of `transforms` is `[a0, a1, a2, b0, b1, b2, c0, c1]`, then it maps - * the output point `(x, y)` to a transformed input point - * `(x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k)`, where - * `k = c0 x + c1 y + 1`. If the transformed point lays outside of the input + * 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 data type for {@code transformedImages()} output + * + * @param data type for {@code transformed_images} output */ public final class ImageProjectiveTransformV3 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ImageProjectiveTransformV3} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". - */ - public Options fillMode(String fillMode) { - this.fillMode = fillMode; - return this; - } - - private String fillMode; - - private Options() { - } + public static final String OP_NAME = "ImageProjectiveTransformV3"; + + private Output transformedImages; + + private ImageProjectiveTransformV3(Operation operation) { + super(operation); + int outputIdx = 0; + transformedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ImageProjectiveTransformV3 operation. - * + * * @param scope current scope - * @param images 4-D with shape `[batch, height, width, channels]`. - * @param transforms 2-D Tensor, `[batch, 8]` or `[1, 8]` matrix, where each row corresponds to a 3 x 3 + * @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 attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ImageProjectiveTransformV3 create(Scope scope, Operand images, Operand transforms, Operand outputShape, Operand fillValue, String interpolation, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ImageProjectiveTransformV3 create(Scope scope, + Operand images, Operand transforms, Operand outputShape, + Operand fillValue, String interpolation, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ImageProjectiveTransformV3", scope.makeOpName("ImageProjectiveTransformV3")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(transforms.asOutput()); @@ -91,37 +87,52 @@ public static ImageProjectiveTransformV3 create(Scope sco } } } - return new ImageProjectiveTransformV3(opBuilder.build()); + return new ImageProjectiveTransformV3<>(opBuilder.build()); } - + /** - * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * Sets the fillMode option. + * + * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * @return this Options instance. */ public static Options fillMode(String fillMode) { return new Options().fillMode(fillMode); } - + /** + * Gets transformedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return transformedImages. */ public Output transformedImages() { return transformedImages; } - + @Override public Output asOutput() { return transformedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImageProjectiveTransformV3"; - - private Output transformedImages; - - private ImageProjectiveTransformV3(Operation operation) { - super(operation); - int outputIdx = 0; - transformedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ImageProjectiveTransformV3} + */ + public static class Options { + private String fillMode; + + private Options() { + } + + /** + * Sets the fillMode option. + * + * @param fillMode Fill mode, "REFLECT", "WRAP", or "CONSTANT". + * @return this Options instance. + */ + public Options fillMode(String fillMode) { + this.fillMode = fillMode; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NearestNeighbors.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NearestNeighbors.java index b33577f2e32..4583d0b0f53 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NearestNeighbors.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NearestNeighbors.java @@ -24,22 +24,35 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; /** * 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. */ public final class NearestNeighbors extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NearestNeighbors"; + + private Output nearestCenterIndices; + + private Output nearestCenterDistances; + + private NearestNeighbors(Operation operation) { + super(operation); + int outputIdx = 0; + nearestCenterIndices = operation.output(outputIdx++); + nearestCenterDistances = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NearestNeighbors operation. - * + * * @param scope current scope * @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. @@ -47,8 +60,11 @@ public final class NearestNeighbors extends RawOp { * only m centers are returned. * @return a new instance of NearestNeighbors */ - @Endpoint(describeByClass = true) - public static NearestNeighbors create(Scope scope, Operand points, Operand centers, Operand k) { + @Endpoint( + describeByClass = true + ) + public static NearestNeighbors create(Scope scope, Operand points, + Operand centers, Operand k) { OperationBuilder opBuilder = scope.env().opBuilder("NearestNeighbors", scope.makeOpName("NearestNeighbors")); opBuilder.addInput(points.asOutput()); opBuilder.addInput(centers.asOutput()); @@ -56,33 +72,24 @@ public static NearestNeighbors create(Scope scope, Operand points, Ope opBuilder = scope.apply(opBuilder); return new NearestNeighbors(opBuilder.build()); } - + /** + * Gets nearestCenterIndices. * Matrix of shape (n, min(m, k)). Each row contains the indices of the centers * closest to the corresponding point, ordered by increasing distance. + * @return nearestCenterIndices. */ public Output nearestCenterIndices() { return nearestCenterIndices; } - + /** + * Gets nearestCenterDistances. * Matrix of shape (n, min(m, k)). Each row contains the squared L2 distance to the * corresponding center in nearest_center_indices. + * @return nearestCenterDistances. */ public Output nearestCenterDistances() { return nearestCenterDistances; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NearestNeighbors"; - - private Output nearestCenterIndices; - private Output nearestCenterDistances; - - private NearestNeighbors(Operation operation) { - super(operation); - int outputIdx = 0; - nearestCenterIndices = operation.output(outputIdx++); - nearestCenterDistances = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppression.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppression.java index 0f2e983f786..53126904212 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppression.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppression.java @@ -30,10 +30,9 @@ /** * 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 @@ -44,47 +43,47 @@ * 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 data type for {@code selected_scores} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class NonMaxSuppression extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.NonMaxSuppression} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param padToMaxOutputSize If true, the output `selected_indices` is padded to be of length - * `max_output_size`. Defaults to false. - */ - public Options padToMaxOutputSize(Boolean padToMaxOutputSize) { - this.padToMaxOutputSize = padToMaxOutputSize; - return this; - } - - private Boolean padToMaxOutputSize; - - private Options() { - } + public static final String OP_NAME = "NonMaxSuppressionV5"; + + private Output selectedIndices; + + private Output selectedScores; + + private Output validOutputs; + + private NonMaxSuppression(Operation operation) { + super(operation); + int outputIdx = 0; + selectedIndices = operation.output(outputIdx++); + selectedScores = operation.output(outputIdx++); + validOutputs = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new NonMaxSuppression operation. - * + * Factory method to create a class wrapping a new NonMaxSuppressionV5 operation. + * * @param scope current scope - * @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. @@ -93,13 +92,18 @@ private Options() { * @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 */ - @Endpoint(describeByClass = true) - public static NonMaxSuppression create(Scope scope, Operand boxes, Operand scores, Operand maxOutputSize, Operand iouThreshold, Operand scoreThreshold, Operand softNmsSigma, Options... options) { + @Endpoint( + describeByClass = true + ) + public static NonMaxSuppression create(Scope scope, Operand boxes, + Operand scores, Operand maxOutputSize, Operand iouThreshold, + Operand scoreThreshold, Operand softNmsSigma, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("NonMaxSuppressionV5", scope.makeOpName("NonMaxSuppression")); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(scores.asOutput()); @@ -115,55 +119,71 @@ public static NonMaxSuppression create(Scope scope, Opera } } } - return new NonMaxSuppression(opBuilder.build()); + return new NonMaxSuppression<>(opBuilder.build()); } - + /** - * @param padToMaxOutputSize If true, the output `selected_indices` is padded to be of length - * `max_output_size`. Defaults to false. + * Sets the padToMaxOutputSize option. + * + * @param padToMaxOutputSize If true, the output {@code selected_indices} is padded to be of length + * {@code max_output_size}. Defaults to false. + * @return this Options instance. */ public static Options padToMaxOutputSize(Boolean padToMaxOutputSize) { return new Options().padToMaxOutputSize(padToMaxOutputSize); } - + /** - * A 1-D integer tensor of shape `[M]` representing the selected - * indices from the boxes tensor, where `M <= max_output_size`. + * Gets selectedIndices. + * A 1-D integer tensor of shape {@code [M]} representing the selected + * indices from the boxes tensor, where {@code M <= max_output_size}. + * @return selectedIndices. */ public Output selectedIndices() { return selectedIndices; } - + /** - * A 1-D float tensor of shape `[M]` representing the corresponding - * scores for each selected box, where `M <= max_output_size`. Scores only differ + * Gets selectedScores. + * A 1-D float tensor of shape {@code [M]} representing the corresponding + * scores for each selected box, where {@code M <= max_output_size}. Scores only differ * from corresponding input scores when using Soft NMS (i.e. when - * `soft_nms_sigma>0`) + * {@code soft_nms_sigma>0}) + * @return selectedScores. */ public Output selectedScores() { return selectedScores; } - + /** + * Gets validOutputs. * A 0-D integer tensor representing the number of valid elements in - * `selected_indices`, with the valid elements appearing first. + * {@code selected_indices}, with the valid elements appearing first. + * @return validOutputs. */ public Output validOutputs() { return validOutputs; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NonMaxSuppressionV5"; - - private Output selectedIndices; - private Output selectedScores; - private Output validOutputs; - - private NonMaxSuppression(Operation operation) { - super(operation); - int outputIdx = 0; - selectedIndices = operation.output(outputIdx++); - selectedScores = operation.output(outputIdx++); - validOutputs = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.NonMaxSuppression} + */ + public static class Options { + private Boolean padToMaxOutputSize; + + private Options() { + } + + /** + * Sets the padToMaxOutputSize option. + * + * @param padToMaxOutputSize If true, the output {@code selected_indices} is padded to be of length + * {@code max_output_size}. Defaults to false. + * @return this Options instance. + */ + public Options padToMaxOutputSize(Boolean padToMaxOutputSize) { + this.padToMaxOutputSize = padToMaxOutputSize; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppressionWithOverlaps.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppressionWithOverlaps.java index 892f9d9bb8b..79518d3ea12 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppressionWithOverlaps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/NonMaxSuppressionWithOverlaps.java @@ -30,32 +30,43 @@ /** * 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) */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class NonMaxSuppressionWithOverlaps extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NonMaxSuppressionWithOverlaps"; + + private Output selectedIndices; + + private NonMaxSuppressionWithOverlaps(Operation operation) { + super(operation); + int outputIdx = 0; + selectedIndices = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NonMaxSuppressionWithOverlaps operation. - * + * * @param scope current scope - * @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. @@ -65,8 +76,12 @@ public final class NonMaxSuppressionWithOverlaps extends RawOp implements Operan * boxes based on score. * @return a new instance of NonMaxSuppressionWithOverlaps */ - @Endpoint(describeByClass = true) - public static NonMaxSuppressionWithOverlaps create(Scope scope, Operand overlaps, Operand scores, Operand maxOutputSize, Operand overlapThreshold, Operand scoreThreshold) { + @Endpoint( + describeByClass = true + ) + public static NonMaxSuppressionWithOverlaps create(Scope scope, Operand overlaps, + Operand scores, Operand maxOutputSize, Operand overlapThreshold, + Operand scoreThreshold) { OperationBuilder opBuilder = scope.env().opBuilder("NonMaxSuppressionWithOverlaps", scope.makeOpName("NonMaxSuppressionWithOverlaps")); opBuilder.addInput(overlaps.asOutput()); opBuilder.addInput(scores.asOutput()); @@ -76,28 +91,19 @@ public static NonMaxSuppressionWithOverlaps create(Scope scope, Operand selectedIndices() { return selectedIndices; } - + @Override public Output asOutput() { return selectedIndices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NonMaxSuppressionWithOverlaps"; - - private Output selectedIndices; - - private NonMaxSuppressionWithOverlaps(Operation operation) { - super(operation); - int outputIdx = 0; - selectedIndices = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/QuantizedResizeBilinear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/QuantizedResizeBilinear.java index b024a697062..b22bae33b1d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/QuantizedResizeBilinear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/QuantizedResizeBilinear.java @@ -27,64 +27,59 @@ import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * Resize quantized `images` to `size` using quantized bilinear interpolation. - *

+ * 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 data type for {@code resized_images} output */ -@Operator(group = "image") -public final class QuantizedResizeBilinear extends RawOp { - +@Operator( + group = "image" +) +public final class QuantizedResizeBilinear extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.image.QuantizedResizeBilinear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are - * aligned, preserving the values at the corner pixels. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "QuantizedResizeBilinear"; + + private Output resizedImages; + + private Output outMin; + + private Output outMax; + + private QuantizedResizeBilinear(Operation operation) { + super(operation); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); + outMin = operation.output(outputIdx++); + outMax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedResizeBilinear operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedResizeBilinear create(Scope scope, Operand images, Operand size, Operand min, Operand max, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedResizeBilinear create(Scope scope, + Operand images, Operand sizeOutput, Operand min, Operand max, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedResizeBilinear", scope.makeOpName("QuantizedResizeBilinear")); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(min.asOutput()); opBuilder.addInput(max.asOutput()); opBuilder = scope.apply(opBuilder); @@ -98,56 +93,90 @@ public static QuantizedResizeBilinear create(Scope scope, O } } } - return new QuantizedResizeBilinear(opBuilder.build()); + return new QuantizedResizeBilinear<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + /** + * Gets outMin. + * + * @return outMin. */ public Output outMin() { return outMin; } - + /** + * Gets outMax. + * + * @return outMax. */ public Output outMax() { return outMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedResizeBilinear"; - - private Output resizedImages; - private Output outMin; - private Output outMax; - - private QuantizedResizeBilinear(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); - outMin = operation.output(outputIdx++); - outMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.QuantizedResizeBilinear} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = halfPixelCenters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RandomCrop.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RandomCrop.java index 133c38eaaa3..6e3ea00d657 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RandomCrop.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RandomCrop.java @@ -29,64 +29,50 @@ import org.tensorflow.types.family.TNumber; /** - * 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 data type for {@code output} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class RandomCrop extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.RandomCrop} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either seed or seed2 are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomCrop"; + + private Output output; + + private RandomCrop(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomCrop operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static RandomCrop create(Scope scope, Operand image, Operand size, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomCrop create(Scope scope, Operand image, + Operand sizeOutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomCrop", scope.makeOpName("RandomCrop")); opBuilder.addInput(image.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { @@ -98,45 +84,78 @@ public static RandomCrop create(Scope scope, Operand i } } } - return new RandomCrop(opBuilder.build()); + return new RandomCrop<>(opBuilder.build()); } - + /** + * Sets the seed option. + * * @param seed If either seed or seed2 are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * 3-D of shape `[crop_height, crop_width, channels].` + * Gets output. + * 3-D of shape {@code [crop_height, crop_width, channels].} + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomCrop"; - - private Output output; - - private RandomCrop(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.RandomCrop} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeArea.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeArea.java index d030c1192b7..45f3428ac25 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeArea.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeArea.java @@ -30,58 +30,52 @@ import org.tensorflow.types.family.TNumber; /** - * 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. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class ResizeArea extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeArea} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are - * aligned, preserving the values at the corner pixels. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - private Boolean alignCorners; - - private Options() { - } + public static final String OP_NAME = "ResizeArea"; + + private Output resizedImages; + + private ResizeArea(Operation operation) { + super(operation); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeArea operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static ResizeArea create(Scope scope, Operand images, Operand size, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResizeArea create(Scope scope, Operand images, + Operand sizeOutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeArea", scope.makeOpName("ResizeArea")); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { @@ -92,36 +86,52 @@ public static ResizeArea create(Scope scope, Operand images, } return new ResizeArea(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeArea"; - - private Output resizedImages; - - private ResizeArea(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeArea} + */ + public static class Options { + private Boolean alignCorners; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubic.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubic.java index dc6b33e3dc1..2d40c5ddb2c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubic.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubic.java @@ -30,57 +30,44 @@ import org.tensorflow.types.family.TNumber; /** - * 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. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class ResizeBicubic extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubic} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are - * aligned, preserving the values at the corner pixels. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeBicubic"; + + private Output resizedImages; + + private ResizeBicubic(Operation operation) { + super(operation); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeBicubic operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static ResizeBicubic create(Scope scope, Operand images, Operand size, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResizeBicubic create(Scope scope, Operand images, + Operand sizeOutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeBicubic", scope.makeOpName("ResizeBicubic")); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { @@ -94,43 +81,75 @@ public static ResizeBicubic create(Scope scope, Operand image } return new ResizeBicubic(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeBicubic"; - - private Output resizedImages; - - private ResizeBicubic(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubic} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = halfPixelCenters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubicGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubicGrad.java index e5526a769f3..9d4e3bb5eb8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubicGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBicubicGrad.java @@ -24,58 +24,44 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of bicubic interpolation. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class ResizeBicubicGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubicGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are - * aligned. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeBicubicGrad"; + + private Output output; + + private ResizeBicubicGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeBicubicGrad operation. - * + * * @param scope current scope - * @param grads 4-D with shape `[batch, height, width, channels]`. - * @param originalImage 4-D with shape `[batch, orig_height, orig_width, channels]`, + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResizeBicubicGrad} output and operands * @return a new instance of ResizeBicubicGrad */ - @Endpoint(describeByClass = true) - public static ResizeBicubicGrad create(Scope scope, Operand grads, Operand originalImage, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResizeBicubicGrad create(Scope scope, + Operand grads, Operand originalImage, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeBicubicGrad", scope.makeOpName("ResizeBicubicGrad")); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(originalImage.asOutput()); @@ -90,46 +76,78 @@ public static ResizeBicubicGrad create(Scope scope, Opera } } } - return new ResizeBicubicGrad(opBuilder.build()); + return new ResizeBicubicGrad<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are * aligned. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** - * 4-D with shape `[batch, orig_height, orig_width, channels]`. + * Gets output. + * 4-D with shape {@code [batch, orig_height, orig_width, channels]}. * Gradients with respect to the input image. Input image must have been * float or double. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeBicubicGrad"; - - private Output output; - - private ResizeBicubicGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubicGrad} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are + * aligned. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = halfPixelCenters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinear.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinear.java index aaf561156e2..77d6d1660e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinear.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinear.java @@ -30,57 +30,44 @@ import org.tensorflow.types.family.TNumber; /** - * Resize `images` to `size` using bilinear interpolation. - *

+ * Resize {@code images} to {@code size} using bilinear interpolation. * Input images can be of different types but output images are always float. */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class ResizeBilinear extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinear} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are - * aligned, preserving the values at the corner pixels. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeBilinear"; + + private Output resizedImages; + + private ResizeBilinear(Operation operation) { + super(operation); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeBilinear operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static ResizeBilinear create(Scope scope, Operand images, Operand size, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResizeBilinear create(Scope scope, Operand images, + Operand sizeOutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeBilinear", scope.makeOpName("ResizeBilinear")); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { @@ -94,43 +81,75 @@ public static ResizeBilinear create(Scope scope, Operand imag } return new ResizeBilinear(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeBilinear"; - - private Output resizedImages; - - private ResizeBilinear(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinear} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = halfPixelCenters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinearGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinearGrad.java index 38c20992da0..79e15102d2e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinearGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeBilinearGrad.java @@ -24,58 +24,44 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of bilinear interpolation. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class ResizeBilinearGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinearGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are - * aligned. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeBilinearGrad"; + + private Output output; + + private ResizeBilinearGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeBilinearGrad operation. - * + * * @param scope current scope - * @param grads 4-D with shape `[batch, height, width, channels]`. - * @param originalImage 4-D with shape `[batch, orig_height, orig_width, channels]`, + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResizeBilinearGrad} output and operands * @return a new instance of ResizeBilinearGrad */ - @Endpoint(describeByClass = true) - public static ResizeBilinearGrad create(Scope scope, Operand grads, Operand originalImage, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResizeBilinearGrad create(Scope scope, + Operand grads, Operand originalImage, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeBilinearGrad", scope.makeOpName("ResizeBilinearGrad")); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(originalImage.asOutput()); @@ -90,46 +76,78 @@ public static ResizeBilinearGrad create(Scope scope, Oper } } } - return new ResizeBilinearGrad(opBuilder.build()); + return new ResizeBilinearGrad<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are * aligned. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** - * 4-D with shape `[batch, orig_height, orig_width, channels]`. + * Gets output. + * 4-D with shape {@code [batch, orig_height, orig_width, channels]}. * Gradients with respect to the input image. Input image must have been * float or double. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeBilinearGrad"; - - private Output output; - - private ResizeBilinearGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinearGrad} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are + * aligned. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = halfPixelCenters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighbor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighbor.java index 3e4763c692c..48ea170bfa3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighbor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighbor.java @@ -29,57 +29,46 @@ import org.tensorflow.types.family.TNumber; /** - * Resize `images` to `size` using nearest neighbor interpolation. - * - * @param data type for {@code resizedImages()} output + * Resize {@code images} to {@code size} using nearest neighbor interpolation. + * + * @param data type for {@code resized_images} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class ResizeNearestNeighbor extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighbor} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are - * aligned, preserving the values at the corner pixels. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeNearestNeighbor"; + + private Output resizedImages; + + private ResizeNearestNeighbor(Operation operation) { + super(operation); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeNearestNeighbor operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static ResizeNearestNeighbor create(Scope scope, Operand images, Operand size, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResizeNearestNeighbor create(Scope scope, Operand images, + Operand sizeOutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeNearestNeighbor", scope.makeOpName("ResizeNearestNeighbor")); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { @@ -91,45 +80,77 @@ public static ResizeNearestNeighbor create(Scope scope, O } } } - return new ResizeNearestNeighbor(opBuilder.build()); + return new ResizeNearestNeighbor<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** + * Gets resizedImages. * 4-D with shape - * `[batch, new_height, new_width, channels]`. + * {@code [batch, new_height, new_width, channels]}. + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeNearestNeighbor"; - - private Output resizedImages; - - private ResizeNearestNeighbor(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighbor} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = halfPixelCenters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighborGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighborGrad.java index c3d2dd10e2a..3e25989b8d9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighborGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ResizeNearestNeighborGrad.java @@ -24,61 +24,47 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes the gradient of nearest neighbor interpolation. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class ResizeNearestNeighborGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighborGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are - * aligned. Defaults to false. - */ - public Options alignCorners(Boolean alignCorners) { - this.alignCorners = alignCorners; - return this; - } - - /** - * @param halfPixelCenters - */ - public Options halfPixelCenters(Boolean halfPixelCenters) { - this.halfPixelCenters = halfPixelCenters; - return this; - } - - private Boolean alignCorners; - private Boolean halfPixelCenters; - - private Options() { - } + public static final String OP_NAME = "ResizeNearestNeighborGrad"; + + private Output output; + + private ResizeNearestNeighborGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResizeNearestNeighborGrad operation. - * + * * @param scope current scope - * @param grads 4-D with shape `[batch, height, width, channels]`. - * @param size = A 1-D int32 Tensor of 2 elements: `orig_height, orig_width`. The + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code ResizeNearestNeighborGrad} output and operands * @return a new instance of ResizeNearestNeighborGrad */ - @Endpoint(describeByClass = true) - public static ResizeNearestNeighborGrad create(Scope scope, Operand grads, Operand size, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResizeNearestNeighborGrad create(Scope scope, + Operand grads, Operand sizeOutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeNearestNeighborGrad", scope.makeOpName("ResizeNearestNeighborGrad")); opBuilder.addInput(grads.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { for (Options opts : options) { @@ -90,45 +76,77 @@ public static ResizeNearestNeighborGrad create(Scope scop } } } - return new ResizeNearestNeighborGrad(opBuilder.build()); + return new ResizeNearestNeighborGrad<>(opBuilder.build()); } - + /** + * Sets the alignCorners option. + * * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are * aligned. Defaults to false. + * @return this Options instance. */ public static Options alignCorners(Boolean alignCorners) { return new Options().alignCorners(alignCorners); } - + /** - * @param halfPixelCenters + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. */ public static Options halfPixelCenters(Boolean halfPixelCenters) { return new Options().halfPixelCenters(halfPixelCenters); } - + /** - * 4-D with shape `[batch, orig_height, orig_width, channels]`. Gradients + * Gets output. + * 4-D with shape {@code [batch, orig_height, orig_width, channels]}. Gradients * with respect to the input image. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResizeNearestNeighborGrad"; - - private Output output; - - private ResizeNearestNeighborGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighborGrad} + */ + public static class Options { + private Boolean alignCorners; + + private Boolean halfPixelCenters; + + private Options() { + } + + /** + * Sets the alignCorners option. + * + * @param alignCorners If true, the centers of the 4 corner pixels of the input and grad tensors are + * aligned. Defaults to false. + * @return this Options instance. + */ + public Options alignCorners(Boolean alignCorners) { + this.alignCorners = alignCorners; + return this; + } + + /** + * Sets the halfPixelCenters option. + * + * @param halfPixelCenters the halfPixelCenters option + * @return this Options instance. + */ + public Options halfPixelCenters(Boolean halfPixelCenters) { + this.halfPixelCenters = halfPixelCenters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RgbToHsv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RgbToHsv.java index 2746052a7b0..3c3b3bd0dcf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RgbToHsv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/RgbToHsv.java @@ -29,67 +29,76 @@ /** * 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([ + *

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() + * 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 data type for {@code output} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class RgbToHsv extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new RgbToHsv operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RGBToHSV"; + + private Output output; + + private RgbToHsv(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RGBToHSV operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RgbToHsv create(Scope scope, Operand images) { OperationBuilder opBuilder = scope.env().opBuilder("RGBToHSV", scope.makeOpName("RgbToHsv")); opBuilder.addInput(images.asOutput()); opBuilder = scope.apply(opBuilder); - return new RgbToHsv(opBuilder.build()); + return new RgbToHsv<>(opBuilder.build()); } - + /** - * `images` converted to HSV. + * Gets output. + * {@code images} converted to HSV. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RGBToHSV"; - - private Output output; - - private RgbToHsv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/SampleDistortedBoundingBox.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/SampleDistortedBoundingBox.java index 78a37b37dc2..6f8756492dd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/SampleDistortedBoundingBox.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/SampleDistortedBoundingBox.java @@ -17,6 +17,7 @@ package org.tensorflow.op.image; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -31,137 +32,86 @@ /** * 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),
  *         bounding_boxes=bounding_boxes)
- * 
+ *
  *     # Draw the bounding box in an image summary.
  *     image_with_box = tf.image.draw_bounding_boxes(tf.expand_dims(image, 0),
  *                                                   bbox_for_draw)
  *     tf.summary.image('images_with_box', image_with_box)
- * 
+ *
  *     # 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 data type for {@code begin} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class SampleDistortedBoundingBox extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.SampleDistortedBoundingBox} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to non-zero, the random number - * generator is seeded by the given `seed`. Otherwise, it is seeded by a random - * seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param aspectRatioRange The cropped area of the image must have an aspect ratio = - * width / height within this range. - */ - public Options aspectRatioRange(List aspectRatioRange) { - this.aspectRatioRange = aspectRatioRange; - return this; - } - - /** - * @param areaRange The cropped area of the image must contain a fraction of the - * supplied image within this range. - */ - public Options areaRange(List areaRange) { - this.areaRange = areaRange; - return this; - } - - /** - * @param maxAttempts Number of attempts at generating a cropped region of the image - * of the specified constraints. After `max_attempts` failures, return the entire - * image. - */ - public Options maxAttempts(Long maxAttempts) { - this.maxAttempts = maxAttempts; - return this; - } - - /** - * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. - * If true, assume an implicit bounding box covering the whole input. If false, - * raise an error. - */ - public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { - this.useImageIfNoBoundingBoxes = useImageIfNoBoundingBoxes; - return this; - } - - private Long seed; - private Long seed2; - private List aspectRatioRange; - private List areaRange; - private Long maxAttempts; - private Boolean useImageIfNoBoundingBoxes; - - private Options() { - } + public static final String OP_NAME = "SampleDistortedBoundingBoxV2"; + + private Output begin; + + private Output sizeOutput; + + private Output bboxes; + + private SampleDistortedBoundingBox(Operation operation) { + super(operation); + int outputIdx = 0; + begin = operation.output(outputIdx++); + sizeOutput = operation.output(outputIdx++); + bboxes = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SampleDistortedBoundingBox operation. - * + * Factory method to create a class wrapping a new SampleDistortedBoundingBoxV2 operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static SampleDistortedBoundingBox create(Scope scope, Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SampleDistortedBoundingBox create(Scope scope, + Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SampleDistortedBoundingBoxV2", scope.makeOpName("SampleDistortedBoundingBox")); opBuilder.addInput(imageSize.asOutput()); opBuilder.addInput(boundingBoxes.asOutput()); @@ -177,14 +127,14 @@ public static SampleDistortedBoundingBox create(Scope sco } if (opts.aspectRatioRange != null) { float[] aspectRatioRangeArray = new float[opts.aspectRatioRange.size()]; - for (int i = 0; i < aspectRatioRangeArray.length; ++i) { + for (int i = 0 ; i < aspectRatioRangeArray.length ; i++) { aspectRatioRangeArray[i] = opts.aspectRatioRange.get(i); } opBuilder.setAttr("aspect_ratio_range", aspectRatioRangeArray); } if (opts.areaRange != null) { float[] areaRangeArray = new float[opts.areaRange.size()]; - for (int i = 0; i < areaRangeArray.length; ++i) { + for (int i = 0 ; i < areaRangeArray.length ; i++) { areaRangeArray[i] = opts.areaRange.get(i); } opBuilder.setAttr("area_range", areaRangeArray); @@ -197,95 +147,244 @@ public static SampleDistortedBoundingBox create(Scope sco } } } - return new SampleDistortedBoundingBox(opBuilder.build()); + return new SampleDistortedBoundingBox<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to non-zero, the random number - * generator is seeded by the given `seed`. Otherwise, it is seeded by a random + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to non-zero, the random number + * generator is seeded by the given {@code seed}. Otherwise, it is seeded by a random * seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Sets the aspectRatioRange option. + * * @param aspectRatioRange The cropped area of the image must have an aspect ratio = * width / height within this range. + * @return this Options instance. */ public static Options aspectRatioRange(List aspectRatioRange) { return new Options().aspectRatioRange(aspectRatioRange); } - + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public static Options aspectRatioRange(Float[] aspectRatioRange) { + return new Options().aspectRatioRange(aspectRatioRange); + } + /** + * Sets the areaRange option. + * * @param areaRange The cropped area of the image must contain a fraction of the * supplied image within this range. + * @return this Options instance. */ public static Options areaRange(List areaRange) { return new Options().areaRange(areaRange); } - + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public static Options areaRange(Float[] areaRange) { + return new Options().areaRange(areaRange); + } + + /** + * Sets the maxAttempts option. + * * @param maxAttempts Number of attempts at generating a cropped region of the image - * of the specified constraints. After `max_attempts` failures, return the entire + * of the specified constraints. After {@code max_attempts} failures, return the entire * image. + * @return this Options instance. */ public static Options maxAttempts(Long maxAttempts) { return new Options().maxAttempts(maxAttempts); } - + /** + * Sets the useImageIfNoBoundingBoxes option. + * * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. * If true, assume an implicit bounding box covering the whole input. If false, * raise an error. + * @return this Options instance. */ public static Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { return new Options().useImageIfNoBoundingBoxes(useImageIfNoBoundingBoxes); } - + /** - * 1-D, containing `[offset_height, offset_width, 0]`. Provide as input to - * `tf.slice`. + * Gets begin. + * 1-D, containing {@code [offset_height, offset_width, 0]}. Provide as input to + * {@code tf.slice}. + * @return begin. */ public Output begin() { return begin; } - + /** - * 1-D, containing `[target_height, target_width, -1]`. Provide as input to - * `tf.slice`. + * Gets sizeOutput. + * 1-D, containing {@code [target_height, target_width, -1]}. Provide as input to + * {@code tf.slice}. + * @return sizeOutput. */ - public Output size() { - return size; + public Output sizeOutput() { + return sizeOutput; } - + /** - * 3-D with shape `[1, 1, 4]` containing the distorted bounding box. - * Provide as input to `tf.image.draw_bounding_boxes`. + * Gets bboxes. + * 3-D with shape {@code [1, 1, 4]} containing the distorted bounding box. + * Provide as input to {@code tf.image.draw_bounding_boxes}. + * @return bboxes. */ public Output bboxes() { return bboxes; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SampleDistortedBoundingBoxV2"; - - private Output begin; - private Output size; - private Output bboxes; - - private SampleDistortedBoundingBox(Operation operation) { - super(operation); - int outputIdx = 0; - begin = operation.output(outputIdx++); - size = operation.output(outputIdx++); - bboxes = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.SampleDistortedBoundingBox} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private List aspectRatioRange; + + private List areaRange; + + private Long maxAttempts; + + private Boolean useImageIfNoBoundingBoxes; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to non-zero, the random number + * generator is seeded by the given {@code seed}. Otherwise, it is seeded by a random + * seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public Options aspectRatioRange(List aspectRatioRange) { + this.aspectRatioRange = aspectRatioRange; + return this; + } + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public Options aspectRatioRange(Float... aspectRatioRange) { + this.aspectRatioRange = Arrays.asList(aspectRatioRange); + return this; + } + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public Options areaRange(List areaRange) { + this.areaRange = areaRange; + return this; + } + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public Options areaRange(Float... areaRange) { + this.areaRange = Arrays.asList(areaRange); + return this; + } + + /** + * Sets the maxAttempts option. + * + * @param maxAttempts Number of attempts at generating a cropped region of the image + * of the specified constraints. After {@code max_attempts} failures, return the entire + * image. + * @return this Options instance. + */ + public Options maxAttempts(Long maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + /** + * Sets the useImageIfNoBoundingBoxes option. + * + * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. + * If true, assume an implicit bounding box covering the whole input. If false, + * raise an error. + * @return this Options instance. + */ + public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { + this.useImageIfNoBoundingBoxes = useImageIfNoBoundingBoxes; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslate.java index 7c728f587c4..2e221c62035 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslate.java @@ -30,54 +30,45 @@ import org.tensorflow.types.family.TNumber; /** + * The ScaleAndTranslate operation */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class ScaleAndTranslate extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ScaleAndTranslate} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param kernelType - */ - public Options kernelType(String kernelType) { - this.kernelType = kernelType; - return this; - } - - /** - * @param antialias - */ - public Options antialias(Boolean antialias) { - this.antialias = antialias; - return this; - } - - private String kernelType; - private Boolean antialias; - - private Options() { - } + public static final String OP_NAME = "ScaleAndTranslate"; + + private Output resizedImages; + + private ScaleAndTranslate(Operation operation) { + super(operation); + int outputIdx = 0; + resizedImages = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScaleAndTranslate operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static ScaleAndTranslate create(Scope scope, Operand images, Operand size, Operand scale, Operand translation, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScaleAndTranslate create(Scope scope, Operand images, + Operand sizeOutput, Operand scale, Operand translation, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScaleAndTranslate", scope.makeOpName("ScaleAndTranslate")); opBuilder.addInput(images.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(scale.asOutput()); opBuilder.addInput(translation.asOutput()); opBuilder = scope.apply(opBuilder); @@ -93,40 +84,72 @@ public static ScaleAndTranslate create(Scope scope, Operand i } return new ScaleAndTranslate(opBuilder.build()); } - + /** - * @param kernelType + * Sets the kernelType option. + * + * @param kernelType the kernelType option + * @return this Options instance. */ public static Options kernelType(String kernelType) { return new Options().kernelType(kernelType); } - + /** - * @param antialias + * Sets the antialias option. + * + * @param antialias the antialias option + * @return this Options instance. */ public static Options antialias(Boolean antialias) { return new Options().antialias(antialias); } - + /** + * Gets resizedImages. + * + * @return resizedImages. */ public Output resizedImages() { return resizedImages; } - + @Override public Output asOutput() { return resizedImages; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScaleAndTranslate"; - - private Output resizedImages; - - private ScaleAndTranslate(Operation operation) { - super(operation); - int outputIdx = 0; - resizedImages = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ScaleAndTranslate} + */ + public static class Options { + private String kernelType; + + private Boolean antialias; + + private Options() { + } + + /** + * Sets the kernelType option. + * + * @param kernelType the kernelType option + * @return this Options instance. + */ + public Options kernelType(String kernelType) { + this.kernelType = kernelType; + return this; + } + + /** + * Sets the antialias option. + * + * @param antialias the antialias option + * @return this Options instance. + */ + public Options antialias(Boolean antialias) { + this.antialias = antialias; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslateGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslateGrad.java index b6f55d1d159..7ab3f62e791 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslateGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/ScaleAndTranslateGrad.java @@ -24,56 +24,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The ScaleAndTranslateGrad operation + * + * @param data type for {@code output} output */ public final class ScaleAndTranslateGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.image.ScaleAndTranslateGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param kernelType - */ - public Options kernelType(String kernelType) { - this.kernelType = kernelType; - return this; - } - - /** - * @param antialias - */ - public Options antialias(Boolean antialias) { - this.antialias = antialias; - return this; - } - - private String kernelType; - private Boolean antialias; - - private Options() { - } + public static final String OP_NAME = "ScaleAndTranslateGrad"; + + private Output output; + + private ScaleAndTranslateGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ScaleAndTranslateGrad operation. - * + * * @param scope current scope - * @param grads - * @param originalImage - * @param scale - * @param translation - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static ScaleAndTranslateGrad create(Scope scope, Operand grads, Operand originalImage, Operand scale, Operand translation, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ScaleAndTranslateGrad create(Scope scope, Operand grads, + Operand originalImage, Operand scale, Operand translation, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScaleAndTranslateGrad", scope.makeOpName("ScaleAndTranslateGrad")); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(originalImage.asOutput()); @@ -90,42 +80,74 @@ public static ScaleAndTranslateGrad create(Scope scope, O } } } - return new ScaleAndTranslateGrad(opBuilder.build()); + return new ScaleAndTranslateGrad<>(opBuilder.build()); } - + /** - * @param kernelType + * Sets the kernelType option. + * + * @param kernelType the kernelType option + * @return this Options instance. */ public static Options kernelType(String kernelType) { return new Options().kernelType(kernelType); } - + /** - * @param antialias + * Sets the antialias option. + * + * @param antialias the antialias option + * @return this Options instance. */ public static Options antialias(Boolean antialias) { return new Options().antialias(antialias); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScaleAndTranslateGrad"; - - private Output output; - - private ScaleAndTranslateGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.ScaleAndTranslateGrad} + */ + public static class Options { + private String kernelType; + + private Boolean antialias; + + private Options() { + } + + /** + * Sets the kernelType option. + * + * @param kernelType the kernelType option + * @return this Options instance. + */ + public Options kernelType(String kernelType) { + this.kernelType = kernelType; + return this; + } + + /** + * Sets the antialias option. + * + * @param antialias the antialias option + * @return this Options instance. + */ + public Options antialias(Boolean antialias) { + this.antialias = antialias; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/StatelessSampleDistortedBoundingBox.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/StatelessSampleDistortedBoundingBox.java index 725592351ae..cf5fd9ed0c7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/StatelessSampleDistortedBoundingBox.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/image/StatelessSampleDistortedBoundingBox.java @@ -17,6 +17,7 @@ package org.tensorflow.op.image; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -31,141 +32,113 @@ /** * 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 `seed`, + * 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 `image_size`, `bounding_boxes` and a series of + * 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: `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 + *

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 * the height of the underlying image. - *

- * The output of this Op is guaranteed to be the same given the same `seed` and is + *

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. `tf.random.set_seed`). - *

- * Example usage: - *

- * >>> image = np.array([[[1], [2], [3]], [[4], [5], [6]], [[7], [8], [9]]]) - * >>> bbox = tf.constant( + * 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 = ( + * 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) - * 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( + * [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) - * - *

- * 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 + * [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 data type for {@code begin()} output + * + * @param data type for {@code begin} output */ -@Operator(group = "image") +@Operator( + group = "image" +) public final class StatelessSampleDistortedBoundingBox extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.image.StatelessSampleDistortedBoundingBox} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param aspectRatioRange The cropped area of the image must have an aspect ratio = - * width / height within this range. - */ - public Options aspectRatioRange(List aspectRatioRange) { - this.aspectRatioRange = aspectRatioRange; - return this; - } - - /** - * @param areaRange The cropped area of the image must contain a fraction of the - * supplied image within this range. - */ - public Options areaRange(List areaRange) { - this.areaRange = areaRange; - return this; - } - - /** - * @param maxAttempts Number of attempts at generating a cropped region of the image - * of the specified constraints. After `max_attempts` failures, return the entire - * image. - */ - public Options maxAttempts(Long maxAttempts) { - this.maxAttempts = maxAttempts; - return this; - } - - /** - * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. - * If true, assume an implicit bounding box covering the whole input. If false, - * raise an error. - */ - public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { - this.useImageIfNoBoundingBoxes = useImageIfNoBoundingBoxes; - return this; - } - - private List aspectRatioRange; - private List areaRange; - private Long maxAttempts; - private Boolean useImageIfNoBoundingBoxes; - - private Options() { - } + public static final String OP_NAME = "StatelessSampleDistortedBoundingBox"; + + private Output begin; + + private Output sizeOutput; + + private Output bboxes; + + private StatelessSampleDistortedBoundingBox(Operation operation) { + super(operation); + int outputIdx = 0; + begin = operation.output(outputIdx++); + sizeOutput = operation.output(outputIdx++); + bboxes = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StatelessSampleDistortedBoundingBox operation. - * + * * @param scope current scope - * @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 seed 1-D with shape `[2]`. The seed to the random number generator. Must have dtype - * `int32` or `int64`. (When using XLA, only `int32` is allowed.) - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static StatelessSampleDistortedBoundingBox create(Scope scope, Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, Operand seed, Options... options) { + @Endpoint( + describeByClass = true + ) + public static StatelessSampleDistortedBoundingBox create(Scope scope, + Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, + Operand seed, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessSampleDistortedBoundingBox", scope.makeOpName("StatelessSampleDistortedBoundingBox")); opBuilder.addInput(imageSize.asOutput()); opBuilder.addInput(boundingBoxes.asOutput()); @@ -176,14 +149,14 @@ public static StatelessSampleDistortedBoundingBox create( for (Options opts : options) { if (opts.aspectRatioRange != null) { float[] aspectRatioRangeArray = new float[opts.aspectRatioRange.size()]; - for (int i = 0; i < aspectRatioRangeArray.length; ++i) { + for (int i = 0 ; i < aspectRatioRangeArray.length ; i++) { aspectRatioRangeArray[i] = opts.aspectRatioRange.get(i); } opBuilder.setAttr("aspect_ratio_range", aspectRatioRangeArray); } if (opts.areaRange != null) { float[] areaRangeArray = new float[opts.areaRange.size()]; - for (int i = 0; i < areaRangeArray.length; ++i) { + for (int i = 0 ; i < areaRangeArray.length ; i++) { areaRangeArray[i] = opts.areaRange.get(i); } opBuilder.setAttr("area_range", areaRangeArray); @@ -196,79 +169,194 @@ public static StatelessSampleDistortedBoundingBox create( } } } - return new StatelessSampleDistortedBoundingBox(opBuilder.build()); + return new StatelessSampleDistortedBoundingBox<>(opBuilder.build()); } - + /** + * Sets the aspectRatioRange option. + * * @param aspectRatioRange The cropped area of the image must have an aspect ratio = * width / height within this range. + * @return this Options instance. */ public static Options aspectRatioRange(List aspectRatioRange) { return new Options().aspectRatioRange(aspectRatioRange); } - + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public static Options aspectRatioRange(Float[] aspectRatioRange) { + return new Options().aspectRatioRange(aspectRatioRange); + } + + /** + * Sets the areaRange option. + * * @param areaRange The cropped area of the image must contain a fraction of the * supplied image within this range. + * @return this Options instance. */ public static Options areaRange(List areaRange) { return new Options().areaRange(areaRange); } - + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public static Options areaRange(Float[] areaRange) { + return new Options().areaRange(areaRange); + } + /** + * Sets the maxAttempts option. + * * @param maxAttempts Number of attempts at generating a cropped region of the image - * of the specified constraints. After `max_attempts` failures, return the entire + * of the specified constraints. After {@code max_attempts} failures, return the entire * image. + * @return this Options instance. */ public static Options maxAttempts(Long maxAttempts) { return new Options().maxAttempts(maxAttempts); } - + /** + * Sets the useImageIfNoBoundingBoxes option. + * * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. * If true, assume an implicit bounding box covering the whole input. If false, * raise an error. + * @return this Options instance. */ public static Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { return new Options().useImageIfNoBoundingBoxes(useImageIfNoBoundingBoxes); } - + /** - * 1-D, containing `[offset_height, offset_width, 0]`. Provide as input to - * `tf.slice`. + * Gets begin. + * 1-D, containing {@code [offset_height, offset_width, 0]}. Provide as input to + * {@code tf.slice}. + * @return begin. */ public Output begin() { return begin; } - + /** - * 1-D, containing `[target_height, target_width, -1]`. Provide as input to - * `tf.slice`. + * Gets sizeOutput. + * 1-D, containing {@code [target_height, target_width, -1]}. Provide as input to + * {@code tf.slice}. + * @return sizeOutput. */ - public Output size() { - return size; + public Output sizeOutput() { + return sizeOutput; } - + /** - * 3-D with shape `[1, 1, 4]` containing the distorted bounding box. - * Provide as input to `tf.image.draw_bounding_boxes`. + * Gets bboxes. + * 3-D with shape {@code [1, 1, 4]} containing the distorted bounding box. + * Provide as input to {@code tf.image.draw_bounding_boxes}. + * @return bboxes. */ public Output bboxes() { return bboxes; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessSampleDistortedBoundingBox"; - - private Output begin; - private Output size; - private Output bboxes; - - private StatelessSampleDistortedBoundingBox(Operation operation) { - super(operation); - int outputIdx = 0; - begin = operation.output(outputIdx++); - size = operation.output(outputIdx++); - bboxes = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.image.StatelessSampleDistortedBoundingBox} + */ + public static class Options { + private List aspectRatioRange; + + private List areaRange; + + private Long maxAttempts; + + private Boolean useImageIfNoBoundingBoxes; + + private Options() { + } + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public Options aspectRatioRange(List aspectRatioRange) { + this.aspectRatioRange = aspectRatioRange; + return this; + } + + /** + * Sets the aspectRatioRange option. + * + * @param aspectRatioRange The cropped area of the image must have an aspect ratio = + * width / height within this range. + * @return this Options instance. + */ + public Options aspectRatioRange(Float... aspectRatioRange) { + this.aspectRatioRange = Arrays.asList(aspectRatioRange); + return this; + } + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public Options areaRange(List areaRange) { + this.areaRange = areaRange; + return this; + } + + /** + * Sets the areaRange option. + * + * @param areaRange The cropped area of the image must contain a fraction of the + * supplied image within this range. + * @return this Options instance. + */ + public Options areaRange(Float... areaRange) { + this.areaRange = Arrays.asList(areaRange); + return this; + } + + /** + * Sets the maxAttempts option. + * + * @param maxAttempts Number of attempts at generating a cropped region of the image + * of the specified constraints. After {@code max_attempts} failures, return the entire + * image. + * @return this Options instance. + */ + public Options maxAttempts(Long maxAttempts) { + this.maxAttempts = maxAttempts; + return this; + } + + /** + * Sets the useImageIfNoBoundingBoxes option. + * + * @param useImageIfNoBoundingBoxes Controls behavior if no bounding boxes supplied. + * If true, assume an implicit bounding box covering the whole input. If false, + * raise an error. + * @return this Options instance. + */ + public Options useImageIfNoBoundingBoxes(Boolean useImageIfNoBoundingBoxes) { + this.useImageIfNoBoundingBoxes = useImageIfNoBoundingBoxes; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeBase64.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeBase64.java index f0034bcc93b..38c7a2c1b29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeBase64.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeBase64.java @@ -29,48 +29,54 @@ /** * 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 /. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class DecodeBase64 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DecodeBase64"; + + private Output output; + + private DecodeBase64(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DecodeBase64 operation. - * + * * @param scope current scope * @param input Base64 strings to decode. * @return a new instance of DecodeBase64 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeBase64 create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeBase64", scope.makeOpName("DecodeBase64")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new DecodeBase64(opBuilder.build()); } - + /** + * Gets output. * Decoded strings. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeBase64"; - - private Output output; - - private DecodeBase64(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCompressed.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCompressed.java index 15fc51ba32c..314c1f74b43 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCompressed.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCompressed.java @@ -29,46 +29,40 @@ /** * 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}. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class DecodeCompressed extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.DecodeCompressed} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param compressionType A scalar containing either (i) the empty string (no - * compression), (ii) "ZLIB", or (iii) "GZIP". - */ - public Options compressionType(String compressionType) { - this.compressionType = compressionType; - return this; - } - - private String compressionType; - - private Options() { - } + public static final String OP_NAME = "DecodeCompressed"; + + private Output output; + + private DecodeCompressed(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeCompressed operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeCompressed create(Scope scope, Operand bytes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeCompressed", scope.makeOpName("DecodeCompressed")); opBuilder.addInput(bytes.asOutput()); @@ -82,36 +76,52 @@ public static DecodeCompressed create(Scope scope, Operand bytes, Optio } return new DecodeCompressed(opBuilder.build()); } - + /** + * Sets the compressionType option. + * * @param compressionType A scalar containing either (i) the empty string (no - * compression), (ii) "ZLIB", or (iii) "GZIP". + * compression), (ii) "ZLIB", or (iii) "GZIP". + * @return this Options instance. */ public static Options compressionType(String compressionType) { return new Options().compressionType(compressionType); } - + /** - * A Tensor with the same shape as input `bytes`, uncompressed + * Gets output. + * A Tensor with the same shape as input {@code bytes}, uncompressed * from bytes. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeCompressed"; - - private Output output; - - private DecodeCompressed(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.DecodeCompressed} + */ + public static class Options { + private String compressionType; + + private Options() { + } + + /** + * Sets the compressionType option. + * + * @param compressionType A scalar containing either (i) the empty string (no + * compression), (ii) "ZLIB", or (iii) "GZIP". + * @return this Options instance. + */ + public Options compressionType(String compressionType) { + this.compressionType = compressionType; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCsv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCsv.java index ad79410ddba..bed943c4f66 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCsv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeCsv.java @@ -34,76 +34,47 @@ /** * 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. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class DecodeCsv extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.io.DecodeCsv} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fieldDelim char delimiter to separate fields in a record. - */ - public Options fieldDelim(String fieldDelim) { - this.fieldDelim = fieldDelim; - return this; - } - - /** - * @param useQuoteDelim If false, treats double quotation marks as regular - * characters inside of the string fields (ignoring RFC 4180, Section 2, - * Bullet 5). - */ - public Options useQuoteDelim(Boolean useQuoteDelim) { - this.useQuoteDelim = useQuoteDelim; - return this; - } - - /** - * @param naValue Additional string to recognize as NA/NaN. - */ - public Options naValue(String naValue) { - this.naValue = naValue; - return this; - } - - /** - * @param selectCols - */ - public Options selectCols(List selectCols) { - this.selectCols = selectCols; - return this; - } - - private String fieldDelim; - private Boolean useQuoteDelim; - private String naValue; - private List selectCols; - - private Options() { - } + public static final String OP_NAME = "DecodeCSV"; + + private List> output; + + @SuppressWarnings("unchecked") + private DecodeCsv(Operation operation) { + super(operation); + int outputIdx = 0; + int outputLength = operation.outputListLength("output"); + output = Arrays.asList(operation.outputList(outputIdx, outputLength)); + outputIdx += outputLength; } - + /** - * Factory method to create a class wrapping a new DecodeCsv operation. - * + * Factory method to create a class wrapping a new DecodeCSV operation. + * * @param scope current scope * @param records Each string is a record/row in the csv and all records should have * the same format. * @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 */ - @Endpoint(describeByClass = true) - public static DecodeCsv create(Scope scope, Operand records, Iterable> recordDefaults, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodeCsv create(Scope scope, Operand records, + Iterable> recordDefaults, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeCSV", scope.makeOpName("DecodeCsv")); opBuilder.addInput(records.asOutput()); opBuilder.addInputList(Operands.asOutputs(recordDefaults)); @@ -121,7 +92,7 @@ public static DecodeCsv create(Scope scope, Operand records, Iterable records, Iterable selectCols) { return new Options().selectCols(selectCols); } - + /** + * Sets the selectCols option. + * + * @param selectCols the selectCols option + * @return this Options instance. + */ + public static Options selectCols(Long[] selectCols) { + return new Options().selectCols(selectCols); + } + + /** + * Gets output. * Each tensor will have the same shape as records. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeCSV"; - - private List> output; - - private DecodeCsv(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList(operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.DecodeCsv} + */ + public static class Options { + private String fieldDelim; + + private Boolean useQuoteDelim; + + private String naValue; + + private List selectCols; + + private Options() { + } + + /** + * Sets the fieldDelim option. + * + * @param fieldDelim char delimiter to separate fields in a record. + * @return this Options instance. + */ + public Options fieldDelim(String fieldDelim) { + this.fieldDelim = fieldDelim; + return this; + } + + /** + * Sets the useQuoteDelim option. + * + * @param useQuoteDelim If false, treats double quotation marks as regular + * characters inside of the string fields (ignoring RFC 4180, Section 2, + * Bullet 5). + * @return this Options instance. + */ + public Options useQuoteDelim(Boolean useQuoteDelim) { + this.useQuoteDelim = useQuoteDelim; + return this; + } + + /** + * Sets the naValue option. + * + * @param naValue Additional string to recognize as NA/NaN. + * @return this Options instance. + */ + public Options naValue(String naValue) { + this.naValue = naValue; + return this; + } + + /** + * Sets the selectCols option. + * + * @param selectCols the selectCols option + * @return this Options instance. + */ + public Options selectCols(List selectCols) { + this.selectCols = selectCols; + return this; + } + + /** + * Sets the selectCols option. + * + * @param selectCols the selectCols option + * @return this Options instance. + */ + public Options selectCols(Long... selectCols) { + this.selectCols = Arrays.asList(selectCols); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeJsonExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeJsonExample.java index 7f2292f4c9a..d2cde0a1a6c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeJsonExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeJsonExample.java @@ -29,54 +29,60 @@ /** * 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), + * the standard JSON + * mapping , * 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. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class DecodeJsonExample extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new DecodeJsonExample operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DecodeJSONExample"; + + private Output binaryExamples; + + private DecodeJsonExample(Operation operation) { + super(operation); + int outputIdx = 0; + binaryExamples = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DecodeJSONExample operation. + * * @param scope current scope * @param jsonExamples Each string is a JSON object serialized according to the JSON * mapping of the Example proto. * @return a new instance of DecodeJsonExample */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DecodeJsonExample create(Scope scope, Operand jsonExamples) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeJSONExample", scope.makeOpName("DecodeJsonExample")); opBuilder.addInput(jsonExamples.asOutput()); opBuilder = scope.apply(opBuilder); return new DecodeJsonExample(opBuilder.build()); } - + /** + * Gets binaryExamples. * Each string is a binary Example protocol buffer corresponding - * to the respective element of `json_examples`. + * to the respective element of {@code json_examples}. + * @return binaryExamples. */ public Output binaryExamples() { return binaryExamples; } - + @Override public Output asOutput() { return binaryExamples; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeJSONExample"; - - private Output binaryExamples; - - private DecodeJsonExample(Operation operation) { - super(operation); - int outputIdx = 0; - binaryExamples = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodePaddedRaw.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodePaddedRaw.java index ca41464e1b3..8a50ac7beec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodePaddedRaw.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodePaddedRaw.java @@ -32,45 +32,44 @@ /** * Reinterpret the bytes of a string as a vector of numbers. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class DecodePaddedRaw extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.DecodePaddedRaw} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param littleEndian Whether the input `input_bytes` is in little-endian order. Ignored for - * `out_type` values that are stored in a single byte, like `uint8` - */ - public Options littleEndian(Boolean littleEndian) { - this.littleEndian = littleEndian; - return this; - } - - private Boolean littleEndian; - - private Options() { - } + public static final String OP_NAME = "DecodePaddedRaw"; + + private Output output; + + private DecodePaddedRaw(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodePaddedRaw operation. - * + * * @param scope current scope * @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 property + * @param options carries optional attribute values + * @param data type for {@code DecodePaddedRaw} output and operands * @return a new instance of DecodePaddedRaw */ - @Endpoint(describeByClass = true) - public static DecodePaddedRaw create(Scope scope, Operand inputBytes, Operand fixedLength, Class outType, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodePaddedRaw create(Scope scope, + Operand inputBytes, Operand fixedLength, Class outType, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodePaddedRaw", scope.makeOpName("DecodePaddedRaw")); opBuilder.addInput(inputBytes.asOutput()); opBuilder.addInput(fixedLength.asOutput()); @@ -83,39 +82,55 @@ public static DecodePaddedRaw create(Scope scope, Operand } } } - return new DecodePaddedRaw(opBuilder.build()); + return new DecodePaddedRaw<>(opBuilder.build()); } - + /** - * @param littleEndian Whether the input `input_bytes` is in little-endian order. Ignored for - * `out_type` values that are stored in a single byte, like `uint8` + * Sets the littleEndian option. + * + * @param littleEndian Whether the input {@code input_bytes} is in little-endian order. Ignored for + * {@code out_type} values that are stored in a single byte, like {@code uint8} + * @return this Options instance. */ public static Options littleEndian(Boolean littleEndian) { return new Options().littleEndian(littleEndian); } - + /** - * A Tensor with one more dimension than the input `bytes`. The added dimension - * will have size equal to the length of the elements of `bytes` divided by the - * number of bytes to represent `out_type`. + * Gets output. + * A Tensor with one more dimension than the input {@code bytes}. The added dimension + * will have size equal to the length of the elements of {@code bytes} divided by the + * number of bytes to represent {@code out_type}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodePaddedRaw"; - - private Output output; - - private DecodePaddedRaw(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.DecodePaddedRaw} + */ + public static class Options { + private Boolean littleEndian; + + private Options() { + } + + /** + * Sets the littleEndian option. + * + * @param littleEndian Whether the input {@code input_bytes} is in little-endian order. Ignored for + * {@code out_type} values that are stored in a single byte, like {@code uint8} + * @return this Options instance. + */ + public Options littleEndian(Boolean littleEndian) { + this.littleEndian = littleEndian; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeRaw.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeRaw.java index 5ef7da94d51..654693bfe82 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeRaw.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DecodeRaw.java @@ -31,44 +31,41 @@ /** * Reinterpret the bytes of a string as a vector of numbers. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class DecodeRaw extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.DecodeRaw} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param littleEndian Whether the input `bytes` are in little-endian order. - * Ignored for `out_type` values that are stored in a single byte like - * `uint8`. - */ - public Options littleEndian(Boolean littleEndian) { - this.littleEndian = littleEndian; - return this; - } - - private Boolean littleEndian; - - private Options() { - } + public static final String OP_NAME = "DecodeRaw"; + + private Output output; + + private DecodeRaw(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DecodeRaw operation. - * + * * @param scope current scope * @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 property + * @param options carries optional attribute values + * @param data type for {@code DecodeRaw} output and operands * @return a new instance of DecodeRaw */ - @Endpoint(describeByClass = true) - public static DecodeRaw create(Scope scope, Operand bytes, Class outType, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DecodeRaw create(Scope scope, Operand bytes, + Class outType, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeRaw", scope.makeOpName("DecodeRaw")); opBuilder.addInput(bytes.asOutput()); opBuilder = scope.apply(opBuilder); @@ -80,40 +77,57 @@ public static DecodeRaw create(Scope scope, Operand(opBuilder.build()); + return new DecodeRaw<>(opBuilder.build()); } - + /** - * @param littleEndian Whether the input `bytes` are in little-endian order. - * Ignored for `out_type` values that are stored in a single byte like - * `uint8`. + * Sets the littleEndian option. + * + * @param littleEndian Whether the input {@code bytes} are in little-endian order. + * Ignored for {@code out_type} values that are stored in a single byte like + * {@code uint8}. + * @return this Options instance. */ public static Options littleEndian(Boolean littleEndian) { return new Options().littleEndian(littleEndian); } - + /** - * A Tensor with one more dimension than the input `bytes`. The + * Gets output. + * A Tensor with one more dimension than the input {@code bytes}. The * added dimension will have size equal to the length of the elements - * of `bytes` divided by the number of bytes to represent `out_type`. + * of {@code bytes} divided by the number of bytes to represent {@code out_type}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DecodeRaw"; - - private Output output; - - private DecodeRaw(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.DecodeRaw} + */ + public static class Options { + private Boolean littleEndian; + + private Options() { + } + + /** + * Sets the littleEndian option. + * + * @param littleEndian Whether the input {@code bytes} are in little-endian order. + * Ignored for {@code out_type} values that are stored in a single byte like + * {@code uint8}. + * @return this Options instance. + */ + public Options littleEndian(Boolean littleEndian) { + this.littleEndian = littleEndian; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DeserializeManySparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DeserializeManySparse.java index 9d2e496e50e..7effe9d1e06 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DeserializeManySparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/DeserializeManySparse.java @@ -31,103 +31,118 @@ import org.tensorflow.types.family.TType; /** - * 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] - * - * @param data type for {@code sparseValues()} output + * 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 sparse_values} output */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class DeserializeManySparse extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeserializeManySparse"; + + private Output sparseIndices; + + private Output sparseValues; + + private Output sparseShape; + + private DeserializeManySparse(Operation operation) { + super(operation); + int outputIdx = 0; + sparseIndices = operation.output(outputIdx++); + sparseValues = operation.output(outputIdx++); + sparseShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DeserializeManySparse operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static DeserializeManySparse create(Scope scope, Operand serializedSparse, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static DeserializeManySparse create(Scope scope, + Operand serializedSparse, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("DeserializeManySparse", scope.makeOpName("DeserializeManySparse")); opBuilder.addInput(serializedSparse.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new DeserializeManySparse(opBuilder.build()); + return new DeserializeManySparse<>(opBuilder.build()); } - + /** + * Gets sparseIndices. + * + * @return sparseIndices. */ public Output sparseIndices() { return sparseIndices; } - + /** + * Gets sparseValues. + * + * @return sparseValues. */ public Output sparseValues() { return sparseValues; } - + /** + * Gets sparseShape. + * + * @return sparseShape. */ public Output sparseShape() { return sparseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeserializeManySparse"; - - private Output sparseIndices; - private Output sparseValues; - private Output sparseShape; - - private DeserializeManySparse(Operation operation) { - super(operation); - int outputIdx = 0; - sparseIndices = operation.output(outputIdx++); - sparseValues = operation.output(outputIdx++); - sparseShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/EncodeBase64.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/EncodeBase64.java index 2955fea0773..5fcdb5ee0ff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/EncodeBase64.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/EncodeBase64.java @@ -29,45 +29,40 @@ /** * 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 * 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 /. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class EncodeBase64 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.EncodeBase64} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param pad Bool whether padding is applied at the ends. - */ - public Options pad(Boolean pad) { - this.pad = pad; - return this; - } - - private Boolean pad; - - private Options() { - } + public static final String OP_NAME = "EncodeBase64"; + + private Output output; + + private EncodeBase64(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EncodeBase64 operation. - * + * * @param scope current scope * @param input Strings to be encoded. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EncodeBase64 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static EncodeBase64 create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EncodeBase64", scope.makeOpName("EncodeBase64")); opBuilder.addInput(input.asOutput()); @@ -81,34 +76,49 @@ public static EncodeBase64 create(Scope scope, Operand input, Options.. } return new EncodeBase64(opBuilder.build()); } - + /** + * Sets the pad option. + * * @param pad Bool whether padding is applied at the ends. + * @return this Options instance. */ public static Options pad(Boolean pad) { return new Options().pad(pad); } - + /** + * Gets output. * Input strings encoded in base64. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EncodeBase64"; - - private Output output; - - private EncodeBase64(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.EncodeBase64} + */ + public static class Options { + private Boolean pad; + + private Options() { + } + + /** + * Sets the pad option. + * + * @param pad Bool whether padding is applied at the ends. + * @return this Options instance. + */ + public Options pad(Boolean pad) { + this.pad = pad; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FifoQueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FifoQueue.java index 0559fbddbf1..ebe738189de 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FifoQueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FifoQueue.java @@ -17,6 +17,7 @@ package org.tensorflow.op.io; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -33,71 +34,37 @@ /** * A queue that produces elements in first-in first-out order. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class FifoQueue extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.FifoQueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shapes The shape of each component in a value. The length of this attr must - * 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. - */ - public Options shapes(List shapes) { - this.shapes = shapes; - return this; - } - - /** - * @param capacity The upper bound on the number of elements in this queue. - * Negative numbers mean no limit. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this queue will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private List shapes; - private Long capacity; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "FIFOQueueV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private FifoQueue(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FifoQueue operation. - * + * Factory method to create a class wrapping a new FIFOQueueV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static FifoQueue create(Scope scope, List> componentTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FifoQueue create(Scope scope, List> componentTypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FIFOQueueV2", scope.makeOpName("FifoQueue")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); @@ -105,7 +72,7 @@ public static FifoQueue create(Scope scope, List> compone for (Options opts : options) { if (opts.shapes != null) { Shape[] shapesArray = new Shape[opts.shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = opts.shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -123,62 +90,158 @@ public static FifoQueue create(Scope scope, List> compone } return new FifoQueue(opBuilder.build()); } - + /** + * Sets the shapes option. + * * @param shapes The shape of each component in a value. The length of this attr must * 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. + * @return this Options instance. */ public static Options shapes(List shapes) { return new Options().shapes(shapes); } - + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. The length of this attr must + * 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. + * @return this Options instance. + */ + public static Options shapes(Shape[] shapes) { + return new Options().shapes(shapes); + } + /** + * Sets the capacity option. + * * @param capacity The upper bound on the number of elements in this queue. * Negative numbers mean no limit. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this queue will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the queue. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FIFOQueueV2"; - - private Output handle; - - private FifoQueue(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.FifoQueue} + */ + public static class Options { + private List shapes; + + private Long capacity; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. The length of this attr must + * 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. + * @return this Options instance. + */ + public Options shapes(List shapes) { + this.shapes = shapes; + return this; + } + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. The length of this attr must + * 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. + * @return this Options instance. + */ + public Options shapes(Shape... shapes) { + this.shapes = Arrays.asList(shapes); + return this; + } + + /** + * Sets the capacity option. + * + * @param capacity The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this queue will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FixedLengthRecordReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FixedLengthRecordReader.java index 8859fe0448d..f36890bc20c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FixedLengthRecordReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/FixedLengthRecordReader.java @@ -30,86 +30,35 @@ /** * A Reader that outputs fixed-length records from a file. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class FixedLengthRecordReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.FixedLengthRecordReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param headerBytes Number of bytes in the header, defaults to 0. - */ - public Options headerBytes(Long headerBytes) { - this.headerBytes = headerBytes; - return this; - } - - /** - * @param footerBytes Number of bytes in the footer, defaults to 0. - */ - public Options footerBytes(Long footerBytes) { - this.footerBytes = footerBytes; - return this; - } - - /** - * @param hopBytes Number of bytes to hop before each read. Default of 0 means using - * record_bytes. - */ - public Options hopBytes(Long hopBytes) { - this.hopBytes = hopBytes; - return this; - } - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param encoding The type of encoding for the file. Currently ZLIB and GZIP - * are supported. Defaults to none. - */ - public Options encoding(String encoding) { - this.encoding = encoding; - return this; - } - - private Long headerBytes; - private Long footerBytes; - private Long hopBytes; - private String container; - private String sharedName; - private String encoding; - - private Options() { - } + public static final String OP_NAME = "FixedLengthRecordReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + private FixedLengthRecordReader(Operation operation) { + super(operation); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FixedLengthRecordReader operation. - * + * Factory method to create a class wrapping a new FixedLengthRecordReaderV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FixedLengthRecordReader create(Scope scope, Long recordBytes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FixedLengthRecordReaderV2", scope.makeOpName("FixedLengthRecordReader")); opBuilder = scope.apply(opBuilder); @@ -138,74 +87,173 @@ public static FixedLengthRecordReader create(Scope scope, Long recordBytes, Opti } return new FixedLengthRecordReader(opBuilder.build()); } - + /** + * Sets the headerBytes option. + * * @param headerBytes Number of bytes in the header, defaults to 0. + * @return this Options instance. */ public static Options headerBytes(Long headerBytes) { return new Options().headerBytes(headerBytes); } - + /** + * Sets the footerBytes option. + * * @param footerBytes Number of bytes in the footer, defaults to 0. + * @return this Options instance. */ public static Options footerBytes(Long footerBytes) { return new Options().footerBytes(footerBytes); } - + /** + * Sets the hopBytes option. + * * @param hopBytes Number of bytes to hop before each read. Default of 0 means using * record_bytes. + * @return this Options instance. */ public static Options hopBytes(Long hopBytes) { return new Options().hopBytes(hopBytes); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Sets the encoding option. + * * @param encoding The type of encoding for the file. Currently ZLIB and GZIP * are supported. Defaults to none. + * @return this Options instance. */ public static Options encoding(String encoding) { return new Options().encoding(encoding); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FixedLengthRecordReaderV2"; - - private Output readerHandle; - - private FixedLengthRecordReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.FixedLengthRecordReader} + */ + public static class Options { + private Long headerBytes; + + private Long footerBytes; + + private Long hopBytes; + + private String container; + + private String sharedName; + + private String encoding; + + private Options() { + } + + /** + * Sets the headerBytes option. + * + * @param headerBytes Number of bytes in the header, defaults to 0. + * @return this Options instance. + */ + public Options headerBytes(Long headerBytes) { + this.headerBytes = headerBytes; + return this; + } + + /** + * Sets the footerBytes option. + * + * @param footerBytes Number of bytes in the footer, defaults to 0. + * @return this Options instance. + */ + public Options footerBytes(Long footerBytes) { + this.footerBytes = footerBytes; + return this; + } + + /** + * Sets the hopBytes option. + * + * @param hopBytes Number of bytes to hop before each read. Default of 0 means using + * record_bytes. + * @return this Options instance. + */ + public Options hopBytes(Long hopBytes) { + this.hopBytes = hopBytes; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the encoding option. + * + * @param encoding The type of encoding for the file. Currently ZLIB and GZIP + * are supported. Defaults to none. + * @return this Options instance. + */ + public Options encoding(String encoding) { + this.encoding = encoding; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/IdentityReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/IdentityReader.java index 6426ea2bd43..5e486af8d8c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/IdentityReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/IdentityReader.java @@ -29,51 +29,37 @@ /** * 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). */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class IdentityReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.IdentityReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "IdentityReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + private IdentityReader(Operation operation) { + super(operation); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new IdentityReader operation. - * + * Factory method to create a class wrapping a new IdentityReaderV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of IdentityReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IdentityReader create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("IdentityReaderV2", scope.makeOpName("IdentityReader")); opBuilder = scope.apply(opBuilder); @@ -89,44 +75,77 @@ public static IdentityReader create(Scope scope, Options... options) { } return new IdentityReader(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IdentityReaderV2"; - - private Output readerHandle; - - private IdentityReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.IdentityReader} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/LmdbReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/LmdbReader.java index e37786733e2..809fa21ef06 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/LmdbReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/LmdbReader.java @@ -30,47 +30,33 @@ /** * A Reader that outputs the records from a LMDB file. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class LmdbReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.LmdbReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "LMDBReader"; + + private Output readerHandle; + + private LmdbReader(Operation operation) { + super(operation); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new LmdbReader operation. - * + * Factory method to create a class wrapping a new LMDBReader operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of LmdbReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LmdbReader create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LMDBReader", scope.makeOpName("LmdbReader")); opBuilder = scope.apply(opBuilder); @@ -86,43 +72,76 @@ public static LmdbReader create(Scope scope, Options... options) { } return new LmdbReader(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ public Output readerHandle() { return readerHandle; } - + @Override public Output asOutput() { return readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LMDBReader"; - - private Output readerHandle; - - private LmdbReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.LmdbReader} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/MatchingFiles.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/MatchingFiles.java index 48c19fdc3b0..43d1a16b193 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/MatchingFiles.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/MatchingFiles.java @@ -29,49 +29,55 @@ /** * 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. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class MatchingFiles extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatchingFiles"; + + private Output filenames; + + private MatchingFiles(Operation operation) { + super(operation); + int outputIdx = 0; + filenames = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MatchingFiles operation. - * + * * @param scope current scope * @param pattern Shell wildcard pattern(s). Scalar or vector of type string. * @return a new instance of MatchingFiles */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MatchingFiles create(Scope scope, Operand pattern) { OperationBuilder opBuilder = scope.env().opBuilder("MatchingFiles", scope.makeOpName("MatchingFiles")); opBuilder.addInput(pattern.asOutput()); opBuilder = scope.apply(opBuilder); return new MatchingFiles(opBuilder.build()); } - + /** + * Gets filenames. * A vector of matching filenames. + * @return filenames. */ public Output filenames() { return filenames; } - + @Override public Output asOutput() { return filenames; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatchingFiles"; - - private Output filenames; - - private MatchingFiles(Operation operation) { - super(operation); - int outputIdx = 0; - filenames = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PaddingFifoQueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PaddingFifoQueue.java index 691e35140ca..932a54aa542 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PaddingFifoQueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PaddingFifoQueue.java @@ -17,6 +17,7 @@ package org.tensorflow.op.io; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -32,80 +33,41 @@ /** * 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. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class PaddingFifoQueue extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.PaddingFifoQueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shapes The shape of each component in a value. The length of this attr must - * be either 0 or the same as the length of component_types. - * Shapes of fixed rank but variable size are allowed by setting - * any shape dimension to -1. In this case, the inputs' shape may vary along - * the given dimension, and DequeueMany will pad the given dimension with - * zeros up to the maximum shape of all elements in the given batch. - * If the length of this attr is 0, different queue elements may have - * different ranks and shapes, but only one element may be dequeued at a time. - */ - public Options shapes(List shapes) { - this.shapes = shapes; - return this; - } - - /** - * @param capacity The upper bound on the number of elements in this queue. - * Negative numbers mean no limit. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this queue will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private List shapes; - private Long capacity; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "PaddingFIFOQueueV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private PaddingFifoQueue(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new PaddingFifoQueue operation. - * + * Factory method to create a class wrapping a new PaddingFIFOQueueV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static PaddingFifoQueue create(Scope scope, List> componentTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static PaddingFifoQueue create(Scope scope, List> componentTypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PaddingFIFOQueueV2", scope.makeOpName("PaddingFifoQueue")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); @@ -113,7 +75,7 @@ public static PaddingFifoQueue create(Scope scope, List> for (Options opts : options) { if (opts.shapes != null) { Shape[] shapesArray = new Shape[opts.shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = opts.shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -131,8 +93,10 @@ public static PaddingFifoQueue create(Scope scope, List> } return new PaddingFifoQueue(opBuilder.build()); } - + /** + * Sets the shapes option. + * * @param shapes The shape of each component in a value. The length of this attr must * be either 0 or the same as the length of component_types. * Shapes of fixed rank but variable size are allowed by setting @@ -141,56 +105,162 @@ public static PaddingFifoQueue create(Scope scope, List> * zeros up to the maximum shape of all elements in the given batch. * If the length of this attr is 0, different queue elements may have * different ranks and shapes, but only one element may be dequeued at a time. + * @return this Options instance. */ public static Options shapes(List shapes) { return new Options().shapes(shapes); } - + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. The length of this attr must + * be either 0 or the same as the length of component_types. + * Shapes of fixed rank but variable size are allowed by setting + * any shape dimension to -1. In this case, the inputs' shape may vary along + * the given dimension, and DequeueMany will pad the given dimension with + * zeros up to the maximum shape of all elements in the given batch. + * If the length of this attr is 0, different queue elements may have + * different ranks and shapes, but only one element may be dequeued at a time. + * @return this Options instance. + */ + public static Options shapes(Shape[] shapes) { + return new Options().shapes(shapes); + } + + /** + * Sets the capacity option. + * * @param capacity The upper bound on the number of elements in this queue. * Negative numbers mean no limit. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this queue will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the queue. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PaddingFIFOQueueV2"; - - private Output handle; - - private PaddingFifoQueue(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.PaddingFifoQueue} + */ + public static class Options { + private List shapes; + + private Long capacity; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. The length of this attr must + * be either 0 or the same as the length of component_types. + * Shapes of fixed rank but variable size are allowed by setting + * any shape dimension to -1. In this case, the inputs' shape may vary along + * the given dimension, and DequeueMany will pad the given dimension with + * zeros up to the maximum shape of all elements in the given batch. + * If the length of this attr is 0, different queue elements may have + * different ranks and shapes, but only one element may be dequeued at a time. + * @return this Options instance. + */ + public Options shapes(List shapes) { + this.shapes = shapes; + return this; + } + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. The length of this attr must + * be either 0 or the same as the length of component_types. + * Shapes of fixed rank but variable size are allowed by setting + * any shape dimension to -1. In this case, the inputs' shape may vary along + * the given dimension, and DequeueMany will pad the given dimension with + * zeros up to the maximum shape of all elements in the given batch. + * If the length of this attr is 0, different queue elements may have + * different ranks and shapes, but only one element may be dequeued at a time. + * @return this Options instance. + */ + public Options shapes(Shape... shapes) { + this.shapes = Arrays.asList(shapes); + return this; + } + + /** + * Sets the capacity option. + * + * @param capacity The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this queue will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseExample.java index bdd66a0a62a..bd9226c2007 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseExample.java @@ -37,28 +37,70 @@ /** * Transforms a vector of tf.Example protos (as strings) into typed tensors. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ParseExample extends RawOp { - /** - * Factory method to create a class wrapping a new ParseExample operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParseExampleV2"; + + private List> sparseIndices; + + private List> sparseValues; + + private List> sparseShapes; + + private List> denseValues; + + private List> raggedValues; + + private List> raggedRowSplits; + + @SuppressWarnings("unchecked") + private ParseExample(Operation operation) { + super(operation); + int outputIdx = 0; + int sparseIndicesLength = operation.outputListLength("sparse_indices"); + sparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, sparseIndicesLength)); + outputIdx += sparseIndicesLength; + int sparseValuesLength = operation.outputListLength("sparse_values"); + sparseValues = Arrays.asList(operation.outputList(outputIdx, sparseValuesLength)); + outputIdx += sparseValuesLength; + int sparseShapesLength = operation.outputListLength("sparse_shapes"); + sparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, sparseShapesLength)); + outputIdx += sparseShapesLength; + int denseValuesLength = operation.outputListLength("dense_values"); + denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength)); + outputIdx += denseValuesLength; + int raggedValuesLength = operation.outputListLength("ragged_values"); + raggedValues = Arrays.asList(operation.outputList(outputIdx, raggedValuesLength)); + outputIdx += raggedValuesLength; + int raggedRowSplitsLength = operation.outputListLength("ragged_row_splits"); + raggedRowSplits = Arrays.asList(operation.outputList(outputIdx, raggedRowSplitsLength)); + outputIdx += raggedRowSplitsLength; + } + + /** + * Factory method to create a class wrapping a new ParseExampleV2 operation. + * * @param scope current scope * @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. @@ -69,19 +111,19 @@ public final class ParseExample extends RawOp { * 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 @@ -96,8 +138,14 @@ public final class ParseExample extends RawOp { * scalar element along the second dimension. * @return a new instance of ParseExample */ - @Endpoint(describeByClass = true) - public static ParseExample create(Scope scope, Operand serialized, Operand names, Operand sparseKeys, Operand denseKeys, Operand raggedKeys, Iterable> denseDefaults, Long numSparse, List> sparseTypes, List> raggedValueTypes, List> raggedSplitTypes, List denseShapes) { + @Endpoint( + describeByClass = true + ) + public static ParseExample create(Scope scope, Operand serialized, + Operand names, Operand sparseKeys, Operand denseKeys, + Operand raggedKeys, Iterable> denseDefaults, Long numSparse, + List> sparseTypes, List> raggedValueTypes, + List> raggedSplitTypes, List denseShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ParseExampleV2", scope.makeOpName("ParseExample")); opBuilder.addInput(serialized.asOutput()); opBuilder.addInput(names.asOutput()); @@ -111,80 +159,64 @@ public static ParseExample create(Scope scope, Operand serialized, Oper opBuilder.setAttr("ragged_value_types", Operands.toDataTypes(raggedValueTypes)); opBuilder.setAttr("ragged_split_types", Operands.toDataTypes(raggedSplitTypes)); Shape[] denseShapesArray = new Shape[denseShapes.size()]; - for (int i = 0; i < denseShapesArray.length; ++i) { + for (int i = 0 ; i < denseShapesArray.length ; i++) { denseShapesArray[i] = denseShapes.get(i); } opBuilder.setAttr("dense_shapes", denseShapesArray); return new ParseExample(opBuilder.build()); } - + /** + * Gets sparseIndices. + * + * @return sparseIndices. */ public List> sparseIndices() { return sparseIndices; } - + /** + * Gets sparseValues. + * + * @return sparseValues. */ public List> sparseValues() { return sparseValues; } - + /** + * Gets sparseShapes. + * + * @return sparseShapes. */ public List> sparseShapes() { return sparseShapes; } - + /** + * Gets denseValues. + * + * @return denseValues. */ public List> denseValues() { return denseValues; } - + /** + * Gets raggedValues. + * + * @return raggedValues. */ public List> raggedValues() { return raggedValues; } - + /** + * Gets raggedRowSplits. + * + * @return raggedRowSplits. */ public List> raggedRowSplits() { return raggedRowSplits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseExampleV2"; - - private List> sparseIndices; - private List> sparseValues; - private List> sparseShapes; - private List> denseValues; - private List> raggedValues; - private List> raggedRowSplits; - - @SuppressWarnings("unchecked") - private ParseExample(Operation operation) { - super(operation); - int outputIdx = 0; - int sparseIndicesLength = operation.outputListLength("sparse_indices"); - sparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, sparseIndicesLength)); - outputIdx += sparseIndicesLength; - int sparseValuesLength = operation.outputListLength("sparse_values"); - sparseValues = Arrays.asList(operation.outputList(outputIdx, sparseValuesLength)); - outputIdx += sparseValuesLength; - int sparseShapesLength = operation.outputListLength("sparse_shapes"); - sparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, sparseShapesLength)); - outputIdx += sparseShapesLength; - int denseValuesLength = operation.outputListLength("dense_values"); - denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength)); - outputIdx += denseValuesLength; - int raggedValuesLength = operation.outputListLength("ragged_values"); - raggedValues = Arrays.asList(operation.outputList(outputIdx, raggedValuesLength)); - outputIdx += raggedValuesLength; - int raggedRowSplitsLength = operation.outputListLength("ragged_row_splits"); - raggedRowSplits = Arrays.asList(operation.outputList(outputIdx, raggedRowSplitsLength)); - outputIdx += raggedRowSplitsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSequenceExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSequenceExample.java index b4c9479d7c7..7dba9d90ce1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSequenceExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSequenceExample.java @@ -39,75 +39,94 @@ * Transforms a vector of tf.io.SequenceExample protos (as strings) into * typed tensors. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ParseSequenceExample extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.ParseSequenceExample} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param NcontextSparse - */ - public Options NcontextSparse(Long NcontextSparse) { - this.NcontextSparse = NcontextSparse; - return this; - } - - /** - * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in - * each context Feature given in context_dense_keys. - * The number of elements in the Feature corresponding to context_dense_key[j] - * must always equal context_dense_shapes[j].NumEntries(). - * The shape of context_dense_values[j] will match context_dense_shapes[j]. - */ - public Options contextDenseShapes(List contextDenseShapes) { - this.contextDenseShapes = contextDenseShapes; - return this; - } - - /** - * @param NfeatureListSparse - */ - public Options NfeatureListSparse(Long NfeatureListSparse) { - this.NfeatureListSparse = NfeatureListSparse; - return this; - } - - /** - * @param NfeatureListDense - */ - public Options NfeatureListDense(Long NfeatureListDense) { - this.NfeatureListDense = NfeatureListDense; - return this; - } - - /** - * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of - * data in each FeatureList given in feature_list_dense_keys. - * The shape of each Feature in the FeatureList corresponding to - * feature_list_dense_key[j] must always equal - * feature_list_dense_shapes[j].NumEntries(). - */ - public Options featureListDenseShapes(List featureListDenseShapes) { - this.featureListDenseShapes = featureListDenseShapes; - return this; - } - - private Long NcontextSparse; - private List contextDenseShapes; - private Long NfeatureListSparse; - private Long NfeatureListDense; - private List featureListDenseShapes; - - private Options() { - } + public static final String OP_NAME = "ParseSequenceExampleV2"; + + private List> contextSparseIndices; + + private List> contextSparseValues; + + private List> contextSparseShapes; + + private List> contextDenseValues; + + private List> contextRaggedValues; + + private List> contextRaggedRowSplits; + + private List> featureListSparseIndices; + + private List> featureListSparseValues; + + private List> featureListSparseShapes; + + private List> featureListDenseValues; + + private List> featureListDenseLengths; + + private List> featureListRaggedValues; + + private List> featureListRaggedOuterSplits; + + private List> featureListRaggedInnerSplits; + + @SuppressWarnings("unchecked") + private ParseSequenceExample(Operation operation) { + super(operation); + int outputIdx = 0; + int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices"); + contextSparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, contextSparseIndicesLength)); + outputIdx += contextSparseIndicesLength; + int contextSparseValuesLength = operation.outputListLength("context_sparse_values"); + contextSparseValues = Arrays.asList(operation.outputList(outputIdx, contextSparseValuesLength)); + outputIdx += contextSparseValuesLength; + int contextSparseShapesLength = operation.outputListLength("context_sparse_shapes"); + contextSparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, contextSparseShapesLength)); + outputIdx += contextSparseShapesLength; + int contextDenseValuesLength = operation.outputListLength("context_dense_values"); + contextDenseValues = Arrays.asList(operation.outputList(outputIdx, contextDenseValuesLength)); + outputIdx += contextDenseValuesLength; + int contextRaggedValuesLength = operation.outputListLength("context_ragged_values"); + contextRaggedValues = Arrays.asList(operation.outputList(outputIdx, contextRaggedValuesLength)); + outputIdx += contextRaggedValuesLength; + int contextRaggedRowSplitsLength = operation.outputListLength("context_ragged_row_splits"); + contextRaggedRowSplits = Arrays.asList(operation.outputList(outputIdx, contextRaggedRowSplitsLength)); + outputIdx += contextRaggedRowSplitsLength; + int featureListSparseIndicesLength = operation.outputListLength("feature_list_sparse_indices"); + featureListSparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListSparseIndicesLength)); + outputIdx += featureListSparseIndicesLength; + int featureListSparseValuesLength = operation.outputListLength("feature_list_sparse_values"); + featureListSparseValues = Arrays.asList(operation.outputList(outputIdx, featureListSparseValuesLength)); + outputIdx += featureListSparseValuesLength; + int featureListSparseShapesLength = operation.outputListLength("feature_list_sparse_shapes"); + featureListSparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListSparseShapesLength)); + outputIdx += featureListSparseShapesLength; + int featureListDenseValuesLength = operation.outputListLength("feature_list_dense_values"); + featureListDenseValues = Arrays.asList(operation.outputList(outputIdx, featureListDenseValuesLength)); + outputIdx += featureListDenseValuesLength; + int featureListDenseLengthsLength = operation.outputListLength("feature_list_dense_lengths"); + featureListDenseLengths = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListDenseLengthsLength)); + outputIdx += featureListDenseLengthsLength; + int featureListRaggedValuesLength = operation.outputListLength("feature_list_ragged_values"); + featureListRaggedValues = Arrays.asList(operation.outputList(outputIdx, featureListRaggedValuesLength)); + outputIdx += featureListRaggedValuesLength; + int featureListRaggedOuterSplitsLength = operation.outputListLength("feature_list_ragged_outer_splits"); + featureListRaggedOuterSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedOuterSplitsLength)); + outputIdx += featureListRaggedOuterSplitsLength; + int featureListRaggedInnerSplitsLength = operation.outputListLength("feature_list_ragged_inner_splits"); + featureListRaggedInnerSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedInnerSplitsLength)); + outputIdx += featureListRaggedInnerSplitsLength; } - + /** - * Factory method to create a class wrapping a new ParseSequenceExample operation. - * + * Factory method to create a class wrapping a new ParseSequenceExampleV2 operation. + * * @param scope current scope * @param serialized A scalar or vector containing binary serialized SequenceExample protos. * @param debugName A scalar or vector containing the names of the serialized protos. @@ -142,18 +161,31 @@ private Options() { * 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 property * @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 */ - @Endpoint(describeByClass = true) - public static ParseSequenceExample create(Scope scope, Operand serialized, Operand debugName, Operand contextSparseKeys, 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, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ParseSequenceExample create(Scope scope, Operand serialized, + Operand debugName, Operand contextSparseKeys, + 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, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ParseSequenceExampleV2", scope.makeOpName("ParseSequenceExample")); opBuilder.addInput(serialized.asOutput()); opBuilder.addInput(debugName.asOutput()); @@ -180,7 +212,7 @@ public static ParseSequenceExample create(Scope scope, Operand serializ } if (opts.contextDenseShapes != null) { Shape[] contextDenseShapesArray = new Shape[opts.contextDenseShapes.size()]; - for (int i = 0; i < contextDenseShapesArray.length; ++i) { + for (int i = 0 ; i < contextDenseShapesArray.length ; i++) { contextDenseShapesArray[i] = opts.contextDenseShapes.get(i); } opBuilder.setAttr("context_dense_shapes", contextDenseShapesArray); @@ -193,7 +225,7 @@ public static ParseSequenceExample create(Scope scope, Operand serializ } if (opts.featureListDenseShapes != null) { Shape[] featureListDenseShapesArray = new Shape[opts.featureListDenseShapes.size()]; - for (int i = 0; i < featureListDenseShapesArray.length; ++i) { + for (int i = 0 ; i < featureListDenseShapesArray.length ; i++) { featureListDenseShapesArray[i] = opts.featureListDenseShapes.get(i); } opBuilder.setAttr("feature_list_dense_shapes", featureListDenseShapesArray); @@ -202,197 +234,327 @@ public static ParseSequenceExample create(Scope scope, Operand serializ } return new ParseSequenceExample(opBuilder.build()); } - + /** - * @param NcontextSparse + * Sets the NcontextSparse option. + * + * @param NcontextSparse the NcontextSparse option + * @return this Options instance. */ public static Options NcontextSparse(Long NcontextSparse) { return new Options().NcontextSparse(NcontextSparse); } - + /** + * Sets the contextDenseShapes option. + * * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in * each context Feature given in context_dense_keys. * The number of elements in the Feature corresponding to context_dense_key[j] * must always equal context_dense_shapes[j].NumEntries(). * The shape of context_dense_values[j] will match context_dense_shapes[j]. + * @return this Options instance. */ public static Options contextDenseShapes(List contextDenseShapes) { return new Options().contextDenseShapes(contextDenseShapes); } - + /** - * @param NfeatureListSparse + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in + * each context Feature given in context_dense_keys. + * The number of elements in the Feature corresponding to context_dense_key[j] + * must always equal context_dense_shapes[j].NumEntries(). + * The shape of context_dense_values[j] will match context_dense_shapes[j]. + * @return this Options instance. + */ + public static Options contextDenseShapes(Shape[] contextDenseShapes) { + return new Options().contextDenseShapes(contextDenseShapes); + } + + /** + * Sets the NfeatureListSparse option. + * + * @param NfeatureListSparse the NfeatureListSparse option + * @return this Options instance. */ public static Options NfeatureListSparse(Long NfeatureListSparse) { return new Options().NfeatureListSparse(NfeatureListSparse); } - + /** - * @param NfeatureListDense + * Sets the NfeatureListDense option. + * + * @param NfeatureListDense the NfeatureListDense option + * @return this Options instance. */ public static Options NfeatureListDense(Long NfeatureListDense) { return new Options().NfeatureListDense(NfeatureListDense); } - + /** + * Sets the featureListDenseShapes option. + * * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of * data in each FeatureList given in feature_list_dense_keys. * The shape of each Feature in the FeatureList corresponding to * feature_list_dense_key[j] must always equal * feature_list_dense_shapes[j].NumEntries(). + * @return this Options instance. */ public static Options featureListDenseShapes(List featureListDenseShapes) { return new Options().featureListDenseShapes(featureListDenseShapes); } - + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of + * data in each FeatureList given in feature_list_dense_keys. + * The shape of each Feature in the FeatureList corresponding to + * feature_list_dense_key[j] must always equal + * feature_list_dense_shapes[j].NumEntries(). + * @return this Options instance. + */ + public static Options featureListDenseShapes(Shape[] featureListDenseShapes) { + return new Options().featureListDenseShapes(featureListDenseShapes); + } + /** + * Gets contextSparseIndices. + * + * @return contextSparseIndices. */ public List> contextSparseIndices() { return contextSparseIndices; } - + /** + * Gets contextSparseValues. + * + * @return contextSparseValues. */ public List> contextSparseValues() { return contextSparseValues; } - + /** + * Gets contextSparseShapes. + * + * @return contextSparseShapes. */ public List> contextSparseShapes() { return contextSparseShapes; } - + /** + * Gets contextDenseValues. + * + * @return contextDenseValues. */ public List> contextDenseValues() { return contextDenseValues; } - + /** + * Gets contextRaggedValues. + * + * @return contextRaggedValues. */ public List> contextRaggedValues() { return contextRaggedValues; } - + /** + * Gets contextRaggedRowSplits. + * + * @return contextRaggedRowSplits. */ public List> contextRaggedRowSplits() { return contextRaggedRowSplits; } - + /** + * Gets featureListSparseIndices. + * + * @return featureListSparseIndices. */ public List> featureListSparseIndices() { return featureListSparseIndices; } - + /** + * Gets featureListSparseValues. + * + * @return featureListSparseValues. */ public List> featureListSparseValues() { return featureListSparseValues; } - + /** + * Gets featureListSparseShapes. + * + * @return featureListSparseShapes. */ public List> featureListSparseShapes() { return featureListSparseShapes; } - + /** + * Gets featureListDenseValues. + * + * @return featureListDenseValues. */ public List> featureListDenseValues() { return featureListDenseValues; } - + /** + * Gets featureListDenseLengths. + * + * @return featureListDenseLengths. */ public List> featureListDenseLengths() { return featureListDenseLengths; } - + /** + * Gets featureListRaggedValues. + * + * @return featureListRaggedValues. */ public List> featureListRaggedValues() { return featureListRaggedValues; } - + /** + * Gets featureListRaggedOuterSplits. + * + * @return featureListRaggedOuterSplits. */ public List> featureListRaggedOuterSplits() { return featureListRaggedOuterSplits; } - + /** + * Gets featureListRaggedInnerSplits. + * + * @return featureListRaggedInnerSplits. */ public List> featureListRaggedInnerSplits() { return featureListRaggedInnerSplits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseSequenceExampleV2"; - - private List> contextSparseIndices; - private List> contextSparseValues; - private List> contextSparseShapes; - private List> contextDenseValues; - private List> contextRaggedValues; - private List> contextRaggedRowSplits; - private List> featureListSparseIndices; - private List> featureListSparseValues; - private List> featureListSparseShapes; - private List> featureListDenseValues; - private List> featureListDenseLengths; - private List> featureListRaggedValues; - private List> featureListRaggedOuterSplits; - private List> featureListRaggedInnerSplits; - - @SuppressWarnings("unchecked") - private ParseSequenceExample(Operation operation) { - super(operation); - int outputIdx = 0; - int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices"); - contextSparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, contextSparseIndicesLength)); - outputIdx += contextSparseIndicesLength; - int contextSparseValuesLength = operation.outputListLength("context_sparse_values"); - contextSparseValues = Arrays.asList(operation.outputList(outputIdx, contextSparseValuesLength)); - outputIdx += contextSparseValuesLength; - int contextSparseShapesLength = operation.outputListLength("context_sparse_shapes"); - contextSparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, contextSparseShapesLength)); - outputIdx += contextSparseShapesLength; - int contextDenseValuesLength = operation.outputListLength("context_dense_values"); - contextDenseValues = Arrays.asList(operation.outputList(outputIdx, contextDenseValuesLength)); - outputIdx += contextDenseValuesLength; - int contextRaggedValuesLength = operation.outputListLength("context_ragged_values"); - contextRaggedValues = Arrays.asList(operation.outputList(outputIdx, contextRaggedValuesLength)); - outputIdx += contextRaggedValuesLength; - int contextRaggedRowSplitsLength = operation.outputListLength("context_ragged_row_splits"); - contextRaggedRowSplits = Arrays.asList(operation.outputList(outputIdx, contextRaggedRowSplitsLength)); - outputIdx += contextRaggedRowSplitsLength; - int featureListSparseIndicesLength = operation.outputListLength("feature_list_sparse_indices"); - featureListSparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, featureListSparseIndicesLength)); - outputIdx += featureListSparseIndicesLength; - int featureListSparseValuesLength = operation.outputListLength("feature_list_sparse_values"); - featureListSparseValues = Arrays.asList(operation.outputList(outputIdx, featureListSparseValuesLength)); - outputIdx += featureListSparseValuesLength; - int featureListSparseShapesLength = operation.outputListLength("feature_list_sparse_shapes"); - featureListSparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, featureListSparseShapesLength)); - outputIdx += featureListSparseShapesLength; - int featureListDenseValuesLength = operation.outputListLength("feature_list_dense_values"); - featureListDenseValues = Arrays.asList(operation.outputList(outputIdx, featureListDenseValuesLength)); - outputIdx += featureListDenseValuesLength; - int featureListDenseLengthsLength = operation.outputListLength("feature_list_dense_lengths"); - featureListDenseLengths = Arrays.asList((Output[])operation.outputList(outputIdx, featureListDenseLengthsLength)); - outputIdx += featureListDenseLengthsLength; - int featureListRaggedValuesLength = operation.outputListLength("feature_list_ragged_values"); - featureListRaggedValues = Arrays.asList(operation.outputList(outputIdx, featureListRaggedValuesLength)); - outputIdx += featureListRaggedValuesLength; - int featureListRaggedOuterSplitsLength = operation.outputListLength("feature_list_ragged_outer_splits"); - featureListRaggedOuterSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedOuterSplitsLength)); - outputIdx += featureListRaggedOuterSplitsLength; - int featureListRaggedInnerSplitsLength = operation.outputListLength("feature_list_ragged_inner_splits"); - featureListRaggedInnerSplits = Arrays.asList(operation.outputList(outputIdx, featureListRaggedInnerSplitsLength)); - outputIdx += featureListRaggedInnerSplitsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.ParseSequenceExample} + */ + public static class Options { + private Long NcontextSparse; + + private List contextDenseShapes; + + private Long NfeatureListSparse; + + private Long NfeatureListDense; + + private List featureListDenseShapes; + + private Options() { + } + + /** + * Sets the NcontextSparse option. + * + * @param NcontextSparse the NcontextSparse option + * @return this Options instance. + */ + public Options NcontextSparse(Long NcontextSparse) { + this.NcontextSparse = NcontextSparse; + return this; + } + + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in + * each context Feature given in context_dense_keys. + * The number of elements in the Feature corresponding to context_dense_key[j] + * must always equal context_dense_shapes[j].NumEntries(). + * The shape of context_dense_values[j] will match context_dense_shapes[j]. + * @return this Options instance. + */ + public Options contextDenseShapes(List contextDenseShapes) { + this.contextDenseShapes = contextDenseShapes; + return this; + } + + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in + * each context Feature given in context_dense_keys. + * The number of elements in the Feature corresponding to context_dense_key[j] + * must always equal context_dense_shapes[j].NumEntries(). + * The shape of context_dense_values[j] will match context_dense_shapes[j]. + * @return this Options instance. + */ + public Options contextDenseShapes(Shape... contextDenseShapes) { + this.contextDenseShapes = Arrays.asList(contextDenseShapes); + return this; + } + + /** + * Sets the NfeatureListSparse option. + * + * @param NfeatureListSparse the NfeatureListSparse option + * @return this Options instance. + */ + public Options NfeatureListSparse(Long NfeatureListSparse) { + this.NfeatureListSparse = NfeatureListSparse; + return this; + } + + /** + * Sets the NfeatureListDense option. + * + * @param NfeatureListDense the NfeatureListDense option + * @return this Options instance. + */ + public Options NfeatureListDense(Long NfeatureListDense) { + this.NfeatureListDense = NfeatureListDense; + return this; + } + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of + * data in each FeatureList given in feature_list_dense_keys. + * The shape of each Feature in the FeatureList corresponding to + * feature_list_dense_key[j] must always equal + * feature_list_dense_shapes[j].NumEntries(). + * @return this Options instance. + */ + public Options featureListDenseShapes(List featureListDenseShapes) { + this.featureListDenseShapes = featureListDenseShapes; + return this; + } + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of + * data in each FeatureList given in feature_list_dense_keys. + * The shape of each Feature in the FeatureList corresponding to + * feature_list_dense_key[j] must always equal + * feature_list_dense_shapes[j].NumEntries(). + * @return this Options instance. + */ + public Options featureListDenseShapes(Shape... featureListDenseShapes) { + this.featureListDenseShapes = Arrays.asList(featureListDenseShapes); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleExample.java index f860fec4dc4..ecb09fca4a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleExample.java @@ -36,16 +36,48 @@ /** * Transforms a tf.Example proto (as a string) into typed tensors. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ParseSingleExample extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParseSingleExample"; + + private List> sparseIndices; + + private List> sparseValues; + + private List> sparseShapes; + + private List> denseValues; + + @SuppressWarnings("unchecked") + private ParseSingleExample(Operation operation) { + super(operation); + int outputIdx = 0; + int sparseIndicesLength = operation.outputListLength("sparse_indices"); + sparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, sparseIndicesLength)); + outputIdx += sparseIndicesLength; + int sparseValuesLength = operation.outputListLength("sparse_values"); + sparseValues = Arrays.asList(operation.outputList(outputIdx, sparseValuesLength)); + outputIdx += sparseValuesLength; + int sparseShapesLength = operation.outputListLength("sparse_shapes"); + sparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, sparseShapesLength)); + outputIdx += sparseShapesLength; + int denseValuesLength = operation.outputListLength("dense_values"); + denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength)); + outputIdx += denseValuesLength; + } + /** * Factory method to create a class wrapping a new ParseSingleExample operation. - * + * * @param scope current scope * @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. @@ -55,17 +87,17 @@ public final class ParseSingleExample extends RawOp { * 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] @@ -75,79 +107,69 @@ public final class ParseSingleExample extends RawOp { * D1 * .... * DN, in the input. * @return a new instance of ParseSingleExample */ - @Endpoint(describeByClass = true) - public static ParseSingleExample create(Scope scope, Operand serialized, Iterable> denseDefaults, Long numSparse, List sparseKeys, List denseKeys, List> sparseTypes, List denseShapes) { + @Endpoint( + describeByClass = true + ) + public static ParseSingleExample create(Scope scope, Operand serialized, + Iterable> denseDefaults, Long numSparse, List sparseKeys, + List denseKeys, List> sparseTypes, List denseShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ParseSingleExample", scope.makeOpName("ParseSingleExample")); opBuilder.addInput(serialized.asOutput()); opBuilder.addInputList(Operands.asOutputs(denseDefaults)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_sparse", numSparse); String[] sparseKeysArray = new String[sparseKeys.size()]; - for (int i = 0; i < sparseKeysArray.length; ++i) { + for (int i = 0 ; i < sparseKeysArray.length ; i++) { sparseKeysArray[i] = sparseKeys.get(i); } opBuilder.setAttr("sparse_keys", sparseKeysArray); String[] denseKeysArray = new String[denseKeys.size()]; - for (int i = 0; i < denseKeysArray.length; ++i) { + for (int i = 0 ; i < denseKeysArray.length ; i++) { denseKeysArray[i] = denseKeys.get(i); } opBuilder.setAttr("dense_keys", denseKeysArray); opBuilder.setAttr("sparse_types", Operands.toDataTypes(sparseTypes)); Shape[] denseShapesArray = new Shape[denseShapes.size()]; - for (int i = 0; i < denseShapesArray.length; ++i) { + for (int i = 0 ; i < denseShapesArray.length ; i++) { denseShapesArray[i] = denseShapes.get(i); } opBuilder.setAttr("dense_shapes", denseShapesArray); return new ParseSingleExample(opBuilder.build()); } - + /** + * Gets sparseIndices. + * + * @return sparseIndices. */ public List> sparseIndices() { return sparseIndices; } - + /** + * Gets sparseValues. + * + * @return sparseValues. */ public List> sparseValues() { return sparseValues; } - + /** + * Gets sparseShapes. + * + * @return sparseShapes. */ public List> sparseShapes() { return sparseShapes; } - + /** + * Gets denseValues. + * + * @return denseValues. */ public List> denseValues() { return denseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseSingleExample"; - - private List> sparseIndices; - private List> sparseValues; - private List> sparseShapes; - private List> denseValues; - - @SuppressWarnings("unchecked") - private ParseSingleExample(Operation operation) { - super(operation); - int outputIdx = 0; - int sparseIndicesLength = operation.outputListLength("sparse_indices"); - sparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, sparseIndicesLength)); - outputIdx += sparseIndicesLength; - int sparseValuesLength = operation.outputListLength("sparse_values"); - sparseValues = Arrays.asList(operation.outputList(outputIdx, sparseValuesLength)); - outputIdx += sparseValuesLength; - int sparseShapesLength = operation.outputListLength("sparse_shapes"); - sparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, sparseShapesLength)); - outputIdx += sparseShapesLength; - int denseValuesLength = operation.outputListLength("dense_values"); - denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength)); - outputIdx += denseValuesLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleSequenceExample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleSequenceExample.java index b54be0324b9..34347ecaf9d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleSequenceExample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseSingleSequenceExample.java @@ -36,48 +36,64 @@ /** * Transforms a scalar brain.SequenceExample proto (as strings) into typed tensors. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ParseSingleSequenceExample extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.ParseSingleSequenceExample} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in - * each context Feature given in context_dense_keys. - * The number of elements in the Feature corresponding to context_dense_key[j] - * must always equal context_dense_shapes[j].NumEntries(). - * The shape of context_dense_values[j] will match context_dense_shapes[j]. - */ - public Options contextDenseShapes(List contextDenseShapes) { - this.contextDenseShapes = contextDenseShapes; - return this; - } - - /** - * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of - * data in each FeatureList given in feature_list_dense_keys. - * The shape of each Feature in the FeatureList corresponding to - * feature_list_dense_key[j] must always equal - * feature_list_dense_shapes[j].NumEntries(). - */ - public Options featureListDenseShapes(List featureListDenseShapes) { - this.featureListDenseShapes = featureListDenseShapes; - return this; - } - - private List contextDenseShapes; - private List featureListDenseShapes; - - private Options() { - } + public static final String OP_NAME = "ParseSingleSequenceExample"; + + private List> contextSparseIndices; + + private List> contextSparseValues; + + private List> contextSparseShapes; + + private List> contextDenseValues; + + private List> featureListSparseIndices; + + private List> featureListSparseValues; + + private List> featureListSparseShapes; + + private List> featureListDenseValues; + + @SuppressWarnings("unchecked") + private ParseSingleSequenceExample(Operation operation) { + super(operation); + int outputIdx = 0; + int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices"); + contextSparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, contextSparseIndicesLength)); + outputIdx += contextSparseIndicesLength; + int contextSparseValuesLength = operation.outputListLength("context_sparse_values"); + contextSparseValues = Arrays.asList(operation.outputList(outputIdx, contextSparseValuesLength)); + outputIdx += contextSparseValuesLength; + int contextSparseShapesLength = operation.outputListLength("context_sparse_shapes"); + contextSparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, contextSparseShapesLength)); + outputIdx += contextSparseShapesLength; + int contextDenseValuesLength = operation.outputListLength("context_dense_values"); + contextDenseValues = Arrays.asList(operation.outputList(outputIdx, contextDenseValuesLength)); + outputIdx += contextDenseValuesLength; + int featureListSparseIndicesLength = operation.outputListLength("feature_list_sparse_indices"); + featureListSparseIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListSparseIndicesLength)); + outputIdx += featureListSparseIndicesLength; + int featureListSparseValuesLength = operation.outputListLength("feature_list_sparse_values"); + featureListSparseValues = Arrays.asList(operation.outputList(outputIdx, featureListSparseValuesLength)); + outputIdx += featureListSparseValuesLength; + int featureListSparseShapesLength = operation.outputListLength("feature_list_sparse_shapes"); + featureListSparseShapes = Arrays.asList((Output[]) operation.outputList(outputIdx, featureListSparseShapesLength)); + outputIdx += featureListSparseShapesLength; + int featureListDenseValuesLength = operation.outputListLength("feature_list_dense_values"); + featureListDenseValues = Arrays.asList(operation.outputList(outputIdx, featureListDenseValuesLength)); + outputIdx += featureListDenseValuesLength; } - + /** * Factory method to create a class wrapping a new ParseSingleSequenceExample operation. - * + * * @param scope current scope * @param serialized A scalar containing a binary serialized SequenceExample proto. * @param featureListDenseMissingAssumedEmpty A vector listing the @@ -113,16 +129,25 @@ private Options() { * 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 property * @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 */ - @Endpoint(describeByClass = true) - public static ParseSingleSequenceExample create(Scope scope, Operand serialized, Operand featureListDenseMissingAssumedEmpty, Iterable> contextSparseKeys, Iterable> contextDenseKeys, Iterable> featureListSparseKeys, Iterable> featureListDenseKeys, Iterable> contextDenseDefaults, Operand debugName, List> contextSparseTypes, List> featureListDenseTypes, List> featureListSparseTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ParseSingleSequenceExample create(Scope scope, Operand serialized, + Operand featureListDenseMissingAssumedEmpty, + Iterable> contextSparseKeys, Iterable> contextDenseKeys, + Iterable> featureListSparseKeys, + Iterable> featureListDenseKeys, Iterable> contextDenseDefaults, + Operand debugName, List> contextSparseTypes, + List> featureListDenseTypes, + List> featureListSparseTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ParseSingleSequenceExample", scope.makeOpName("ParseSingleSequenceExample")); opBuilder.addInput(serialized.asOutput()); opBuilder.addInput(featureListDenseMissingAssumedEmpty.asOutput()); @@ -138,16 +163,28 @@ public static ParseSingleSequenceExample create(Scope scope, Operand se opBuilder.setAttr("feature_list_sparse_types", Operands.toDataTypes(featureListSparseTypes)); if (options != null) { for (Options opts : options) { + if (opts.NcontextSparse != null) { + opBuilder.setAttr("Ncontext_sparse", opts.NcontextSparse); + } + if (opts.NcontextDense != null) { + opBuilder.setAttr("Ncontext_dense", opts.NcontextDense); + } + if (opts.NfeatureListSparse != null) { + opBuilder.setAttr("Nfeature_list_sparse", opts.NfeatureListSparse); + } + if (opts.NfeatureListDense != null) { + opBuilder.setAttr("Nfeature_list_dense", opts.NfeatureListDense); + } if (opts.contextDenseShapes != null) { Shape[] contextDenseShapesArray = new Shape[opts.contextDenseShapes.size()]; - for (int i = 0; i < contextDenseShapesArray.length; ++i) { + for (int i = 0 ; i < contextDenseShapesArray.length ; i++) { contextDenseShapesArray[i] = opts.contextDenseShapes.get(i); } opBuilder.setAttr("context_dense_shapes", contextDenseShapesArray); } if (opts.featureListDenseShapes != null) { Shape[] featureListDenseShapesArray = new Shape[opts.featureListDenseShapes.size()]; - for (int i = 0; i < featureListDenseShapesArray.length; ++i) { + for (int i = 0 ; i < featureListDenseShapesArray.length ; i++) { featureListDenseShapesArray[i] = opts.featureListDenseShapes.get(i); } opBuilder.setAttr("feature_list_dense_shapes", featureListDenseShapesArray); @@ -156,116 +193,296 @@ public static ParseSingleSequenceExample create(Scope scope, Operand se } return new ParseSingleSequenceExample(opBuilder.build()); } - + + /** + * Sets the NcontextSparse option. + * + * @param NcontextSparse the NcontextSparse option + * @return this Options instance. + */ + public static Options NcontextSparse(Long NcontextSparse) { + return new Options().NcontextSparse(NcontextSparse); + } + + /** + * Sets the NcontextDense option. + * + * @param NcontextDense the NcontextDense option + * @return this Options instance. + */ + public static Options NcontextDense(Long NcontextDense) { + return new Options().NcontextDense(NcontextDense); + } + + /** + * Sets the NfeatureListSparse option. + * + * @param NfeatureListSparse the NfeatureListSparse option + * @return this Options instance. + */ + public static Options NfeatureListSparse(Long NfeatureListSparse) { + return new Options().NfeatureListSparse(NfeatureListSparse); + } + + /** + * Sets the NfeatureListDense option. + * + * @param NfeatureListDense the NfeatureListDense option + * @return this Options instance. + */ + public static Options NfeatureListDense(Long NfeatureListDense) { + return new Options().NfeatureListDense(NfeatureListDense); + } + /** + * Sets the contextDenseShapes option. + * * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in * each context Feature given in context_dense_keys. * The number of elements in the Feature corresponding to context_dense_key[j] * must always equal context_dense_shapes[j].NumEntries(). * The shape of context_dense_values[j] will match context_dense_shapes[j]. + * @return this Options instance. */ public static Options contextDenseShapes(List contextDenseShapes) { return new Options().contextDenseShapes(contextDenseShapes); } - + + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in + * each context Feature given in context_dense_keys. + * The number of elements in the Feature corresponding to context_dense_key[j] + * must always equal context_dense_shapes[j].NumEntries(). + * The shape of context_dense_values[j] will match context_dense_shapes[j]. + * @return this Options instance. + */ + public static Options contextDenseShapes(Shape[] contextDenseShapes) { + return new Options().contextDenseShapes(contextDenseShapes); + } + /** + * Sets the featureListDenseShapes option. + * * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of * data in each FeatureList given in feature_list_dense_keys. * The shape of each Feature in the FeatureList corresponding to * feature_list_dense_key[j] must always equal * feature_list_dense_shapes[j].NumEntries(). + * @return this Options instance. */ public static Options featureListDenseShapes(List featureListDenseShapes) { return new Options().featureListDenseShapes(featureListDenseShapes); } - + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of + * data in each FeatureList given in feature_list_dense_keys. + * The shape of each Feature in the FeatureList corresponding to + * feature_list_dense_key[j] must always equal + * feature_list_dense_shapes[j].NumEntries(). + * @return this Options instance. + */ + public static Options featureListDenseShapes(Shape[] featureListDenseShapes) { + return new Options().featureListDenseShapes(featureListDenseShapes); + } + /** + * Gets contextSparseIndices. + * + * @return contextSparseIndices. */ public List> contextSparseIndices() { return contextSparseIndices; } - + /** + * Gets contextSparseValues. + * + * @return contextSparseValues. */ public List> contextSparseValues() { return contextSparseValues; } - + /** + * Gets contextSparseShapes. + * + * @return contextSparseShapes. */ public List> contextSparseShapes() { return contextSparseShapes; } - + /** + * Gets contextDenseValues. + * + * @return contextDenseValues. */ public List> contextDenseValues() { return contextDenseValues; } - + /** + * Gets featureListSparseIndices. + * + * @return featureListSparseIndices. */ public List> featureListSparseIndices() { return featureListSparseIndices; } - + /** + * Gets featureListSparseValues. + * + * @return featureListSparseValues. */ public List> featureListSparseValues() { return featureListSparseValues; } - + /** + * Gets featureListSparseShapes. + * + * @return featureListSparseShapes. */ public List> featureListSparseShapes() { return featureListSparseShapes; } - + /** + * Gets featureListDenseValues. + * + * @return featureListDenseValues. */ public List> featureListDenseValues() { return featureListDenseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseSingleSequenceExample"; - - private List> contextSparseIndices; - private List> contextSparseValues; - private List> contextSparseShapes; - private List> contextDenseValues; - private List> featureListSparseIndices; - private List> featureListSparseValues; - private List> featureListSparseShapes; - private List> featureListDenseValues; - - @SuppressWarnings("unchecked") - private ParseSingleSequenceExample(Operation operation) { - super(operation); - int outputIdx = 0; - int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices"); - contextSparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, contextSparseIndicesLength)); - outputIdx += contextSparseIndicesLength; - int contextSparseValuesLength = operation.outputListLength("context_sparse_values"); - contextSparseValues = Arrays.asList(operation.outputList(outputIdx, contextSparseValuesLength)); - outputIdx += contextSparseValuesLength; - int contextSparseShapesLength = operation.outputListLength("context_sparse_shapes"); - contextSparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, contextSparseShapesLength)); - outputIdx += contextSparseShapesLength; - int contextDenseValuesLength = operation.outputListLength("context_dense_values"); - contextDenseValues = Arrays.asList(operation.outputList(outputIdx, contextDenseValuesLength)); - outputIdx += contextDenseValuesLength; - int featureListSparseIndicesLength = operation.outputListLength("feature_list_sparse_indices"); - featureListSparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, featureListSparseIndicesLength)); - outputIdx += featureListSparseIndicesLength; - int featureListSparseValuesLength = operation.outputListLength("feature_list_sparse_values"); - featureListSparseValues = Arrays.asList(operation.outputList(outputIdx, featureListSparseValuesLength)); - outputIdx += featureListSparseValuesLength; - int featureListSparseShapesLength = operation.outputListLength("feature_list_sparse_shapes"); - featureListSparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, featureListSparseShapesLength)); - outputIdx += featureListSparseShapesLength; - int featureListDenseValuesLength = operation.outputListLength("feature_list_dense_values"); - featureListDenseValues = Arrays.asList(operation.outputList(outputIdx, featureListDenseValuesLength)); - outputIdx += featureListDenseValuesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.ParseSingleSequenceExample} + */ + public static class Options { + private Long NcontextSparse; + + private Long NcontextDense; + + private Long NfeatureListSparse; + + private Long NfeatureListDense; + + private List contextDenseShapes; + + private List featureListDenseShapes; + + private Options() { + } + + /** + * Sets the NcontextSparse option. + * + * @param NcontextSparse the NcontextSparse option + * @return this Options instance. + */ + public Options NcontextSparse(Long NcontextSparse) { + this.NcontextSparse = NcontextSparse; + return this; + } + + /** + * Sets the NcontextDense option. + * + * @param NcontextDense the NcontextDense option + * @return this Options instance. + */ + public Options NcontextDense(Long NcontextDense) { + this.NcontextDense = NcontextDense; + return this; + } + + /** + * Sets the NfeatureListSparse option. + * + * @param NfeatureListSparse the NfeatureListSparse option + * @return this Options instance. + */ + public Options NfeatureListSparse(Long NfeatureListSparse) { + this.NfeatureListSparse = NfeatureListSparse; + return this; + } + + /** + * Sets the NfeatureListDense option. + * + * @param NfeatureListDense the NfeatureListDense option + * @return this Options instance. + */ + public Options NfeatureListDense(Long NfeatureListDense) { + this.NfeatureListDense = NfeatureListDense; + return this; + } + + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in + * each context Feature given in context_dense_keys. + * The number of elements in the Feature corresponding to context_dense_key[j] + * must always equal context_dense_shapes[j].NumEntries(). + * The shape of context_dense_values[j] will match context_dense_shapes[j]. + * @return this Options instance. + */ + public Options contextDenseShapes(List contextDenseShapes) { + this.contextDenseShapes = contextDenseShapes; + return this; + } + + /** + * Sets the contextDenseShapes option. + * + * @param contextDenseShapes A list of Ncontext_dense shapes; the shapes of data in + * each context Feature given in context_dense_keys. + * The number of elements in the Feature corresponding to context_dense_key[j] + * must always equal context_dense_shapes[j].NumEntries(). + * The shape of context_dense_values[j] will match context_dense_shapes[j]. + * @return this Options instance. + */ + public Options contextDenseShapes(Shape... contextDenseShapes) { + this.contextDenseShapes = Arrays.asList(contextDenseShapes); + return this; + } + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of + * data in each FeatureList given in feature_list_dense_keys. + * The shape of each Feature in the FeatureList corresponding to + * feature_list_dense_key[j] must always equal + * feature_list_dense_shapes[j].NumEntries(). + * @return this Options instance. + */ + public Options featureListDenseShapes(List featureListDenseShapes) { + this.featureListDenseShapes = featureListDenseShapes; + return this; + } + + /** + * Sets the featureListDenseShapes option. + * + * @param featureListDenseShapes A list of Nfeature_list_dense shapes; the shapes of + * data in each FeatureList given in feature_list_dense_keys. + * The shape of each Feature in the FeatureList corresponding to + * feature_list_dense_key[j] must always equal + * feature_list_dense_shapes[j].NumEntries(). + * @return this Options instance. + */ + public Options featureListDenseShapes(Shape... featureListDenseShapes) { + this.featureListDenseShapes = Arrays.asList(featureListDenseShapes); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseTensor.java index 9af89bdcd2d..52a94630841 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ParseTensor.java @@ -31,50 +31,59 @@ /** * Transforms a serialized tensorflow.TensorProto proto into a Tensor. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ParseTensor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ParseTensor"; + + private Output output; + + private ParseTensor(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ParseTensor operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static ParseTensor create(Scope scope, Operand serialized, Class outType) { + @Endpoint( + describeByClass = true + ) + public static ParseTensor create(Scope scope, Operand serialized, + Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("ParseTensor", scope.makeOpName("ParseTensor")); opBuilder.addInput(serialized.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new ParseTensor(opBuilder.build()); + return new ParseTensor<>(opBuilder.build()); } - + /** - * A Tensor of type `out_type`. + * Gets output. + * A Tensor of type {@code out_type}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParseTensor"; - - private Output output; - - private ParseTensor(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PriorityQueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PriorityQueue.java index 9decf07b572..50f19104033 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PriorityQueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/PriorityQueue.java @@ -32,75 +32,52 @@ /** * 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 * and DequeueMany) on a PriorityQueue will all require (resp. output) one extra * entry in their input (resp. output) lists. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class PriorityQueue extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.PriorityQueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param capacity The upper bound on the number of elements in this queue. - * Negative numbers mean no limit. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this queue will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long capacity; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "PriorityQueueV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private PriorityQueue(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new PriorityQueue operation. - * + * Factory method to create a class wrapping a new PriorityQueueV2 operation. + * * @param scope current scope * @param componentTypes The type of each component in a value. * @param shapes The shape of each component in a value. The length of this attr must * 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 */ - @Endpoint(describeByClass = true) - public static PriorityQueue create(Scope scope, List> componentTypes, List shapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static PriorityQueue create(Scope scope, List> componentTypes, + List shapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PriorityQueueV2", scope.makeOpName("PriorityQueue")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -119,52 +96,102 @@ public static PriorityQueue create(Scope scope, List> com } return new PriorityQueue(opBuilder.build()); } - + /** + * Sets the capacity option. + * * @param capacity The upper bound on the number of elements in this queue. * Negative numbers mean no limit. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this queue will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the queue. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PriorityQueueV2"; - - private Output handle; - - private PriorityQueue(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.PriorityQueue} + */ + public static class Options { + private Long capacity; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the capacity option. + * + * @param capacity The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this queue will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueClose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueClose.java index a21003d455e..6b8f52aa55f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueClose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueClose.java @@ -24,49 +24,42 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * 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 * sufficient elements remain in the queue. Subsequent Dequeue(Many) * operations that would block will fail immediately. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class QueueClose extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueClose} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param cancelPendingEnqueues If true, all pending enqueue requests that are - * blocked on the given queue will be canceled. - */ - public Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { - this.cancelPendingEnqueues = cancelPendingEnqueues; - return this; - } - - private Boolean cancelPendingEnqueues; - - private Options() { - } + public static final String OP_NAME = "QueueCloseV2"; + + private QueueClose(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new QueueClose operation. - * + * Factory method to create a class wrapping a new QueueCloseV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static QueueClose create(Scope scope, Operand handle, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QueueClose create(Scope scope, Operand handle, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QueueCloseV2", scope.makeOpName("QueueClose")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); @@ -79,19 +72,37 @@ public static QueueClose create(Scope scope, Operand handle, Options... optio } return new QueueClose(opBuilder.build()); } - + /** + * Sets the cancelPendingEnqueues option. + * * @param cancelPendingEnqueues If true, all pending enqueue requests that are * blocked on the given queue will be canceled. + * @return this Options instance. */ public static Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { return new Options().cancelPendingEnqueues(cancelPendingEnqueues); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueCloseV2"; - - private QueueClose(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.io.QueueClose} + */ + public static class Options { + private Boolean cancelPendingEnqueues; + + private Options() { + } + + /** + * Sets the cancelPendingEnqueues option. + * + * @param cancelPendingEnqueues If true, all pending enqueue requests that are + * blocked on the given queue will be canceled. + * @return this Options instance. + */ + public Options cancelPendingEnqueues(Boolean cancelPendingEnqueues) { + this.cancelPendingEnqueues = cancelPendingEnqueues; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeue.java index b4d4bb71aaf..58d59e2cd83 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeue.java @@ -33,49 +33,46 @@ /** * 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). */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class QueueDequeue extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueDequeue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs If the queue is empty, this operation will block for up to - * timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueDequeueV2"; + + private List> components; + + @SuppressWarnings("unchecked") + private QueueDequeue(Operation operation) { + super(operation); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; } - + /** - * Factory method to create a class wrapping a new QueueDequeue operation. - * + * Factory method to create a class wrapping a new QueueDequeueV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static QueueDequeue create(Scope scope, Operand handle, List> componentTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QueueDequeue create(Scope scope, Operand handle, + List> componentTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QueueDequeueV2", scope.makeOpName("QueueDequeue")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); @@ -89,39 +86,54 @@ public static QueueDequeue create(Scope scope, Operand handle, List> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueDequeueV2"; - - private List> components; - - private QueueDequeue(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.QueueDequeue} + */ + public static class Options { + private Long timeoutMs; + + private Options() { + } + + /** + * Sets the timeoutMs option. + * + * @param timeoutMs If the queue is empty, this operation will block for up to + * timeout_ms milliseconds. + * Note: This option is not supported yet. + * @return this Options instance. + */ + public Options timeoutMs(Long timeoutMs) { + this.timeoutMs = timeoutMs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueMany.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueMany.java index 1ef3426f354..1e9f70e4cbf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueMany.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueMany.java @@ -33,58 +33,53 @@ import org.tensorflow.types.family.TType; /** - * 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). */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class QueueDequeueMany extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueMany} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs If the queue has fewer than n elements, this operation - * will block for up to timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueDequeueManyV2"; + + private List> components; + + @SuppressWarnings("unchecked") + private QueueDequeueMany(Operation operation) { + super(operation); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; } - + /** - * Factory method to create a class wrapping a new QueueDequeueMany operation. - * + * Factory method to create a class wrapping a new QueueDequeueManyV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static QueueDequeueMany create(Scope scope, Operand handle, Operand n, List> componentTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QueueDequeueMany create(Scope scope, Operand handle, + Operand n, List> componentTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QueueDequeueManyV2", scope.makeOpName("QueueDequeueMany")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(n.asOutput()); @@ -99,39 +94,54 @@ public static QueueDequeueMany create(Scope scope, Operand handle, Operand> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueDequeueManyV2"; - - private List> components; - - private QueueDequeueMany(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueMany} + */ + public static class Options { + private Long timeoutMs; + + private Options() { + } + + /** + * Sets the timeoutMs option. + * + * @param timeoutMs If the queue has fewer than n elements, this operation + * will block for up to timeout_ms milliseconds. + * Note: This option is not supported yet. + * @return this Options instance. + */ + public Options timeoutMs(Long timeoutMs) { + this.timeoutMs = timeoutMs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueUpTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueUpTo.java index 53516d87ed5..55481610ae9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueUpTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueDequeueUpTo.java @@ -33,62 +33,57 @@ import org.tensorflow.types.family.TType; /** - * 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. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class QueueDequeueUpTo extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueUpTo} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs If the queue has fewer than n elements, this operation - * will block for up to timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueDequeueUpToV2"; + + private List> components; + + @SuppressWarnings("unchecked") + private QueueDequeueUpTo(Operation operation) { + super(operation); + int outputIdx = 0; + int componentsLength = operation.outputListLength("components"); + components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); + outputIdx += componentsLength; } - + /** - * Factory method to create a class wrapping a new QueueDequeueUpTo operation. - * + * Factory method to create a class wrapping a new QueueDequeueUpToV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static QueueDequeueUpTo create(Scope scope, Operand handle, Operand n, List> componentTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QueueDequeueUpTo create(Scope scope, Operand handle, + Operand n, List> componentTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QueueDequeueUpToV2", scope.makeOpName("QueueDequeueUpTo")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(n.asOutput()); @@ -103,39 +98,54 @@ public static QueueDequeueUpTo create(Scope scope, Operand handle, Operand> components() { return components; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) components.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueDequeueUpToV2"; - - private List> components; - - private QueueDequeueUpTo(Operation operation) { - super(operation); - int outputIdx = 0; - int componentsLength = operation.outputListLength("components"); - components = Arrays.asList(operation.outputList(outputIdx, componentsLength)); - outputIdx += componentsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueUpTo} + */ + public static class Options { + private Long timeoutMs; + + private Options() { + } + + /** + * Sets the timeoutMs option. + * + * @param timeoutMs If the queue has fewer than n elements, this operation + * will block for up to timeout_ms milliseconds. + * Note: This option is not supported yet. + * @return this Options instance. + */ + public Options timeoutMs(Long timeoutMs) { + this.timeoutMs = timeoutMs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueue.java index 8a8648d69fe..69d45c14e4d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueEnqueue.java @@ -25,51 +25,42 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * 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). */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class QueueEnqueue extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueEnqueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs If the queue is full, this operation will block for up to - * timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueEnqueueV2"; + + private QueueEnqueue(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new QueueEnqueue operation. - * + * Factory method to create a class wrapping a new QueueEnqueueV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static QueueEnqueue create(Scope scope, Operand handle, Iterable> components, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QueueEnqueue create(Scope scope, Operand handle, + Iterable> components, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QueueEnqueueV2", scope.makeOpName("QueueEnqueue")); opBuilder.addInput(handle.asOutput()); opBuilder.addInputList(Operands.asOutputs(components)); @@ -83,20 +74,39 @@ public static QueueEnqueue create(Scope scope, Operand handle, Iterable * 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). */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class QueueEnqueueMany extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.io.QueueEnqueueMany} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param timeoutMs If the queue is too full, this operation will block for up - * to timeout_ms milliseconds. - * Note: This option is not supported yet. - */ - public Options timeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - private Long timeoutMs; - - private Options() { - } + public static final String OP_NAME = "QueueEnqueueManyV2"; + + private QueueEnqueueMany(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new QueueEnqueueMany operation. - * + * Factory method to create a class wrapping a new QueueEnqueueManyV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static QueueEnqueueMany create(Scope scope, Operand handle, Iterable> components, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QueueEnqueueMany create(Scope scope, Operand handle, + Iterable> components, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QueueEnqueueManyV2", scope.makeOpName("QueueEnqueueMany")); opBuilder.addInput(handle.asOutput()); opBuilder.addInputList(Operands.asOutputs(components)); @@ -88,20 +78,39 @@ public static QueueEnqueueMany create(Scope scope, Operand handle, Iterable * This operation returns true if the queue is closed and false if the queue * is open. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class QueueIsClosed extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new QueueIsClosed operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QueueIsClosedV2"; + + private Output isClosed; + + private QueueIsClosed(Operation operation) { + super(operation); + int outputIdx = 0; + isClosed = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new QueueIsClosedV2 operation. + * * @param scope current scope * @param handle The handle to a queue. * @return a new instance of QueueIsClosed */ - @Endpoint(describeByClass = true) - public static QueueIsClosed create(Scope scope, Operand handle) { + @Endpoint( + describeByClass = true + ) + public static QueueIsClosed create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("QueueIsClosedV2", scope.makeOpName("QueueIsClosed")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); return new QueueIsClosed(opBuilder.build()); } - + /** + * Gets isClosed. + * + * @return isClosed. */ public Output isClosed() { return isClosed; } - + @Override public Output asOutput() { return isClosed; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueIsClosedV2"; - - private Output isClosed; - - private QueueIsClosed(Operation operation) { - super(operation); - int outputIdx = 0; - isClosed = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueSize.java index 99982e6acf7..660f30af385 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueSize.java @@ -26,48 +26,56 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Computes the number of elements in the given queue. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class QueueSize extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new QueueSize operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QueueSizeV2"; + + private Output output; + + private QueueSize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new QueueSizeV2 operation. + * * @param scope current scope * @param handle The handle to a queue. * @return a new instance of QueueSize */ - @Endpoint(describeByClass = true) - public static QueueSize create(Scope scope, Operand handle) { + @Endpoint( + describeByClass = true + ) + public static QueueSize create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("QueueSizeV2", scope.makeOpName("QueueSize")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); return new QueueSize(opBuilder.build()); } - + /** + * Gets output. * The number of elements in the given queue. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QueueSizeV2"; - - private Output output; - - private QueueSize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/RandomShuffleQueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/RandomShuffleQueue.java index 9ce330cb960..0cfb155868a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/RandomShuffleQueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/RandomShuffleQueue.java @@ -17,6 +17,7 @@ package org.tensorflow.op.io; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -33,101 +34,37 @@ /** * A queue that randomizes the order of elements. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class RandomShuffleQueue extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.RandomShuffleQueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shapes The shape of each component in a value. The length of this attr must - * 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. - */ - public Options shapes(List shapes) { - this.shapes = shapes; - return this; - } - - /** - * @param capacity The upper bound on the number of elements in this queue. - * Negative numbers mean no limit. - */ - public Options capacity(Long capacity) { - this.capacity = capacity; - return this; - } - - /** - * @param minAfterDequeue Dequeue will block unless there would be this - * many elements after the dequeue or the queue is closed. This - * ensures a minimum level of mixing of elements. - */ - public Options minAfterDequeue(Long minAfterDequeue) { - this.minAfterDequeue = minAfterDequeue; - return this; - } - - /** - * @param seed 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. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param container If non-empty, this queue is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this queue will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private List shapes; - private Long capacity; - private Long minAfterDequeue; - private Long seed; - private Long seed2; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "RandomShuffleQueueV2"; + + private Output handle; + + @SuppressWarnings("unchecked") + private RandomShuffleQueue(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new RandomShuffleQueue operation. - * + * Factory method to create a class wrapping a new RandomShuffleQueueV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static RandomShuffleQueue create(Scope scope, List> componentTypes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomShuffleQueue create(Scope scope, List> componentTypes, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomShuffleQueueV2", scope.makeOpName("RandomShuffleQueue")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("component_types", Operands.toDataTypes(componentTypes)); @@ -135,7 +72,7 @@ public static RandomShuffleQueue create(Scope scope, List for (Options opts : options) { if (opts.shapes != null) { Shape[] shapesArray = new Shape[opts.shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = opts.shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -162,86 +99,233 @@ public static RandomShuffleQueue create(Scope scope, List } return new RandomShuffleQueue(opBuilder.build()); } - + /** + * Sets the shapes option. + * * @param shapes The shape of each component in a value. The length of this attr must * 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. + * @return this Options instance. */ public static Options shapes(List shapes) { return new Options().shapes(shapes); } - + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. The length of this attr must + * 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. + * @return this Options instance. + */ + public static Options shapes(Shape[] shapes) { + return new Options().shapes(shapes); + } + /** + * Sets the capacity option. + * * @param capacity The upper bound on the number of elements in this queue. * Negative numbers mean no limit. + * @return this Options instance. */ public static Options capacity(Long capacity) { return new Options().capacity(capacity); } - + /** + * Sets the minAfterDequeue option. + * * @param minAfterDequeue Dequeue will block unless there would be this * many elements after the dequeue or the queue is closed. This * ensures a minimum level of mixing of elements. + * @return this Options instance. */ public static Options minAfterDequeue(Long minAfterDequeue) { return new Options().minAfterDequeue(minAfterDequeue); } - + /** + * Sets the seed option. + * * @param seed 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. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Sets the container option. + * * @param container If non-empty, this queue is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this queue will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets handle. * The handle to the queue. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomShuffleQueueV2"; - - private Output handle; - - private RandomShuffleQueue(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.RandomShuffleQueue} + */ + public static class Options { + private List shapes; + + private Long capacity; + + private Long minAfterDequeue; + + private Long seed; + + private Long seed2; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. The length of this attr must + * 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. + * @return this Options instance. + */ + public Options shapes(List shapes) { + this.shapes = shapes; + return this; + } + + /** + * Sets the shapes option. + * + * @param shapes The shape of each component in a value. The length of this attr must + * 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. + * @return this Options instance. + */ + public Options shapes(Shape... shapes) { + this.shapes = Arrays.asList(shapes); + return this; + } + + /** + * Sets the capacity option. + * + * @param capacity The upper bound on the number of elements in this queue. + * Negative numbers mean no limit. + * @return this Options instance. + */ + public Options capacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Sets the minAfterDequeue option. + * + * @param minAfterDequeue Dequeue will block unless there would be this + * many elements after the dequeue or the queue is closed. This + * ensures a minimum level of mixing of elements. + * @return this Options instance. + */ + public Options minAfterDequeue(Long minAfterDequeue) { + this.minAfterDequeue = minAfterDequeue; + return this; + } + + /** + * Sets the seed option. + * + * @param seed 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. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this queue is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this queue will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReadFile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReadFile.java index c908b2e2732..15ea7421431 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReadFile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReadFile.java @@ -30,43 +30,51 @@ /** * Reads and outputs the entire contents of the input filename. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ReadFile extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReadFile"; + + private Output contents; + + private ReadFile(Operation operation) { + super(operation); + int outputIdx = 0; + contents = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ReadFile operation. - * + * * @param scope current scope - * @param filename + * @param filename the filename value * @return a new instance of ReadFile */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ReadFile create(Scope scope, Operand filename) { OperationBuilder opBuilder = scope.env().opBuilder("ReadFile", scope.makeOpName("ReadFile")); opBuilder.addInput(filename.asOutput()); opBuilder = scope.apply(opBuilder); return new ReadFile(opBuilder.build()); } - + /** + * Gets contents. + * + * @return contents. */ public Output contents() { return contents; } - + @Override public Output asOutput() { return contents; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReadFile"; - - private Output contents; - - private ReadFile(Operation operation) { - super(operation); - int outputIdx = 0; - contents = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumRecordsProduced.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumRecordsProduced.java index 88821648f1a..6f59aa79e82 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumRecordsProduced.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumRecordsProduced.java @@ -26,50 +26,59 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Returns the number of records this Reader has produced. - *

* This is the same as the number of ReaderRead executions that have * succeeded. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ReaderNumRecordsProduced extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ReaderNumRecordsProduced operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderNumRecordsProducedV2"; + + private Output recordsProduced; + + private ReaderNumRecordsProduced(Operation operation) { + super(operation); + int outputIdx = 0; + recordsProduced = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderNumRecordsProducedV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @return a new instance of ReaderNumRecordsProduced */ - @Endpoint(describeByClass = true) - public static ReaderNumRecordsProduced create(Scope scope, Operand readerHandle) { + @Endpoint( + describeByClass = true + ) + public static ReaderNumRecordsProduced create(Scope scope, + Operand readerHandle) { OperationBuilder opBuilder = scope.env().opBuilder("ReaderNumRecordsProducedV2", scope.makeOpName("ReaderNumRecordsProduced")); opBuilder.addInput(readerHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new ReaderNumRecordsProduced(opBuilder.build()); } - + /** + * Gets recordsProduced. + * + * @return recordsProduced. */ public Output recordsProduced() { return recordsProduced; } - + @Override public Output asOutput() { return recordsProduced; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderNumRecordsProducedV2"; - - private Output recordsProduced; - - private ReaderNumRecordsProduced(Operation operation) { - super(operation); - int outputIdx = 0; - recordsProduced = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumWorkUnitsCompleted.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumWorkUnitsCompleted.java index 6830d06fac9..e2a9d63cf6f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumWorkUnitsCompleted.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderNumWorkUnitsCompleted.java @@ -26,47 +26,57 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Returns the number of work units this Reader has finished processing. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ReaderNumWorkUnitsCompleted extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ReaderNumWorkUnitsCompleted operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderNumWorkUnitsCompletedV2"; + + private Output unitsCompleted; + + private ReaderNumWorkUnitsCompleted(Operation operation) { + super(operation); + int outputIdx = 0; + unitsCompleted = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderNumWorkUnitsCompletedV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @return a new instance of ReaderNumWorkUnitsCompleted */ - @Endpoint(describeByClass = true) - public static ReaderNumWorkUnitsCompleted create(Scope scope, Operand readerHandle) { + @Endpoint( + describeByClass = true + ) + public static ReaderNumWorkUnitsCompleted create(Scope scope, + Operand readerHandle) { OperationBuilder opBuilder = scope.env().opBuilder("ReaderNumWorkUnitsCompletedV2", scope.makeOpName("ReaderNumWorkUnitsCompleted")); opBuilder.addInput(readerHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new ReaderNumWorkUnitsCompleted(opBuilder.build()); } - + /** + * Gets unitsCompleted. + * + * @return unitsCompleted. */ public Output unitsCompleted() { return unitsCompleted; } - + @Override public Output asOutput() { return unitsCompleted; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderNumWorkUnitsCompletedV2"; - - private Output unitsCompleted; - - private ReaderNumWorkUnitsCompleted(Operation operation) { - super(operation); - int outputIdx = 0; - unitsCompleted = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRead.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRead.java index fbb416f3e19..4d93e58b2af 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRead.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRead.java @@ -26,58 +26,69 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * 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). */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ReaderRead extends RawOp { - /** - * Factory method to create a class wrapping a new ReaderRead operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderReadV2"; + + private Output key; + + private Output value; + + private ReaderRead(Operation operation) { + super(operation); + int outputIdx = 0; + key = operation.output(outputIdx++); + value = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderReadV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @param queueHandle Handle to a Queue, with string work items. * @return a new instance of ReaderRead */ - @Endpoint(describeByClass = true) - public static ReaderRead create(Scope scope, Operand readerHandle, Operand queueHandle) { + @Endpoint( + describeByClass = true + ) + public static ReaderRead create(Scope scope, Operand readerHandle, + Operand queueHandle) { OperationBuilder opBuilder = scope.env().opBuilder("ReaderReadV2", scope.makeOpName("ReaderRead")); opBuilder.addInput(readerHandle.asOutput()); opBuilder.addInput(queueHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new ReaderRead(opBuilder.build()); } - + /** + * Gets key. * A scalar. + * @return key. */ public Output key() { return key; } - + /** + * Gets value. * A scalar. + * @return value. */ public Output value() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderReadV2"; - - private Output key; - private Output value; - - private ReaderRead(Operation operation) { - super(operation); - int outputIdx = 0; - key = operation.output(outputIdx++); - value = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReadUpTo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReadUpTo.java index af7dd21f04a..6ad36598c35 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReadUpTo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReadUpTo.java @@ -27,29 +27,49 @@ import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** - * 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. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ReaderReadUpTo extends RawOp { - /** - * Factory method to create a class wrapping a new ReaderReadUpTo operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderReadUpToV2"; + + private Output keys; + + private Output values; + + private ReaderReadUpTo(Operation operation) { + super(operation); + int outputIdx = 0; + keys = operation.output(outputIdx++); + values = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderReadUpToV2 operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static ReaderReadUpTo create(Scope scope, Operand readerHandle, Operand queueHandle, Operand numRecords) { + @Endpoint( + describeByClass = true + ) + public static ReaderReadUpTo create(Scope scope, Operand readerHandle, + Operand queueHandle, Operand numRecords) { OperationBuilder opBuilder = scope.env().opBuilder("ReaderReadUpToV2", scope.makeOpName("ReaderReadUpTo")); opBuilder.addInput(readerHandle.asOutput()); opBuilder.addInput(queueHandle.asOutput()); @@ -57,31 +77,22 @@ public static ReaderReadUpTo create(Scope scope, Operand readerHandle, Operan opBuilder = scope.apply(opBuilder); return new ReaderReadUpTo(opBuilder.build()); } - + /** + * Gets keys. * A 1-D tensor. + * @return keys. */ public Output keys() { return keys; } - + /** + * Gets values. * A 1-D tensor. + * @return values. */ public Output values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderReadUpToV2"; - - private Output keys; - private Output values; - - private ReaderReadUpTo(Operation operation) { - super(operation); - int outputIdx = 0; - keys = operation.output(outputIdx++); - values = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReset.java index d8ef0859679..fb4760c29c3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderReset.java @@ -24,32 +24,38 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Restore a Reader to its initial clean state. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ReaderReset extends RawOp { - /** - * Factory method to create a class wrapping a new ReaderReset operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderResetV2"; + + private ReaderReset(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new ReaderResetV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @return a new instance of ReaderReset */ - @Endpoint(describeByClass = true) - public static ReaderReset create(Scope scope, Operand readerHandle) { + @Endpoint( + describeByClass = true + ) + public static ReaderReset create(Scope scope, Operand readerHandle) { OperationBuilder opBuilder = scope.env().opBuilder("ReaderResetV2", scope.makeOpName("ReaderReset")); opBuilder.addInput(readerHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new ReaderReset(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderResetV2"; - - private ReaderReset(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRestoreState.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRestoreState.java index 93fee46a5e8..3bd856a0ea9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRestoreState.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderRestoreState.java @@ -25,38 +25,44 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Restore a reader to a previously saved state. - *

* Not all Readers support being restored, so this can produce an * Unimplemented error. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ReaderRestoreState extends RawOp { - /** - * Factory method to create a class wrapping a new ReaderRestoreState operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderRestoreStateV2"; + + private ReaderRestoreState(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new ReaderRestoreStateV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @param state Result of a ReaderSerializeState of a Reader with type * matching reader_handle. * @return a new instance of ReaderRestoreState */ - @Endpoint(describeByClass = true) - public static ReaderRestoreState create(Scope scope, Operand readerHandle, Operand state) { + @Endpoint( + describeByClass = true + ) + public static ReaderRestoreState create(Scope scope, Operand readerHandle, + Operand state) { OperationBuilder opBuilder = scope.env().opBuilder("ReaderRestoreStateV2", scope.makeOpName("ReaderRestoreState")); opBuilder.addInput(readerHandle.asOutput()); opBuilder.addInput(state.asOutput()); opBuilder = scope.apply(opBuilder); return new ReaderRestoreState(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderRestoreStateV2"; - - private ReaderRestoreState(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderSerializeState.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderSerializeState.java index c70831e6e03..9f430108cee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderSerializeState.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ReaderSerializeState.java @@ -26,50 +26,58 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Produce a string tensor that encodes the state of a Reader. - *

* Not all Readers support being serialized, so this can produce an * Unimplemented error. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ReaderSerializeState extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ReaderSerializeState operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReaderSerializeStateV2"; + + private Output state; + + private ReaderSerializeState(Operation operation) { + super(operation); + int outputIdx = 0; + state = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new ReaderSerializeStateV2 operation. + * * @param scope current scope * @param readerHandle Handle to a Reader. * @return a new instance of ReaderSerializeState */ - @Endpoint(describeByClass = true) - public static ReaderSerializeState create(Scope scope, Operand readerHandle) { + @Endpoint( + describeByClass = true + ) + public static ReaderSerializeState create(Scope scope, Operand readerHandle) { OperationBuilder opBuilder = scope.env().opBuilder("ReaderSerializeStateV2", scope.makeOpName("ReaderSerializeState")); opBuilder.addInput(readerHandle.asOutput()); opBuilder = scope.apply(opBuilder); return new ReaderSerializeState(opBuilder.build()); } - + /** + * Gets state. + * + * @return state. */ public Output state() { return state; } - + @Override public Output asOutput() { return state; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReaderSerializeStateV2"; - - private Output state; - - private ReaderSerializeState(Operation operation) { - super(operation); - int outputIdx = 0; - state = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeManySparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeManySparse.java index 1d839e16c3e..e0c0e3224e6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeManySparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeManySparse.java @@ -31,76 +31,88 @@ import org.tensorflow.types.family.TType; /** - * 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]`. - * - * @param data type for {@code serializedSparse()} output + * {@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 serialized_sparse} output */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class SerializeManySparse extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SerializeManySparse"; + + private Output serializedSparse; + + private SerializeManySparse(Operation operation) { + super(operation); + int outputIdx = 0; + serializedSparse = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SerializeManySparse operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static SerializeManySparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Class outType) { + @Endpoint( + describeByClass = true + ) + public static SerializeManySparse create(Scope scope, + Operand sparseIndices, Operand sparseValues, + Operand sparseShape, Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("SerializeManySparse", scope.makeOpName("SerializeManySparse")); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); opBuilder.addInput(sparseShape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new SerializeManySparse(opBuilder.build()); + return new SerializeManySparse<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new SerializeManySparse operation using default output types. - * + * Factory method to create a class wrapping a new SerializeManySparse operation, with the default output types. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static SerializeManySparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape) { + @Endpoint( + describeByClass = true + ) + public static SerializeManySparse create(Scope scope, Operand sparseIndices, + Operand sparseValues, Operand sparseShape) { return create(scope, sparseIndices, sparseValues, sparseShape, TString.class); } - + /** + * Gets serializedSparse. + * + * @return serializedSparse. */ public Output serializedSparse() { return serializedSparse; } - + @Override public Output asOutput() { return serializedSparse; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SerializeManySparse"; - - private Output serializedSparse; - - private SerializeManySparse(Operation operation) { - super(operation); - int outputIdx = 0; - serializedSparse = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeSparse.java index fea3e5c424e..a69add77a64 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeSparse.java @@ -31,68 +31,82 @@ import org.tensorflow.types.family.TType; /** - * Serialize a `SparseTensor` into a `[3]` `Tensor` object. - * - * @param data type for {@code serializedSparse()} output + * Serialize a {@code SparseTensor} into a {@code [3]} {@code Tensor} object. + * + * @param data type for {@code serialized_sparse} output */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class SerializeSparse extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SerializeSparse"; + + private Output serializedSparse; + + private SerializeSparse(Operation operation) { + super(operation); + int outputIdx = 0; + serializedSparse = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SerializeSparse operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static SerializeSparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Class outType) { + @Endpoint( + describeByClass = true + ) + public static SerializeSparse create(Scope scope, + Operand sparseIndices, Operand sparseValues, + Operand sparseShape, Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("SerializeSparse", scope.makeOpName("SerializeSparse")); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); opBuilder.addInput(sparseShape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new SerializeSparse(opBuilder.build()); + return new SerializeSparse<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new SerializeSparse operation using default output types. - * + * Factory method to create a class wrapping a new SerializeSparse operation, with the default output types. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static SerializeSparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape) { + @Endpoint( + describeByClass = true + ) + public static SerializeSparse create(Scope scope, Operand sparseIndices, + Operand sparseValues, Operand sparseShape) { return create(scope, sparseIndices, sparseValues, sparseShape, TString.class); } - + /** + * Gets serializedSparse. + * + * @return serializedSparse. */ public Output serializedSparse() { return serializedSparse; } - + @Override public Output asOutput() { return serializedSparse; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SerializeSparse"; - - private Output serializedSparse; - - private SerializeSparse(Operation operation) { - super(operation); - int outputIdx = 0; - serializedSparse = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeTensor.java index 809b16786e4..85f7452f213 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/SerializeTensor.java @@ -31,44 +31,51 @@ /** * Transforms a Tensor into a serialized TensorProto proto. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class SerializeTensor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SerializeTensor"; + + private Output serialized; + + private SerializeTensor(Operation operation) { + super(operation); + int outputIdx = 0; + serialized = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SerializeTensor operation. - * + * * @param scope current scope - * @param tensor A Tensor of type `T`. + * @param tensor A Tensor of type {@code T}. * @return a new instance of SerializeTensor */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SerializeTensor create(Scope scope, Operand tensor) { OperationBuilder opBuilder = scope.env().opBuilder("SerializeTensor", scope.makeOpName("SerializeTensor")); opBuilder.addInput(tensor.asOutput()); opBuilder = scope.apply(opBuilder); return new SerializeTensor(opBuilder.build()); } - + /** + * Gets serialized. * A serialized TensorProto proto of the input tensor. + * @return serialized. */ public Output serialized() { return serialized; } - + @Override public Output asOutput() { return serialized; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SerializeTensor"; - - private Output serialized; - - private SerializeTensor(Operation operation) { - super(operation); - int outputIdx = 0; - serialized = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilename.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilename.java index e4035335864..912f27b7bc3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilename.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilename.java @@ -30,23 +30,39 @@ /** * 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. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ShardedFilename extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ShardedFilename"; + + private Output filename; + + private ShardedFilename(Operation operation) { + super(operation); + int outputIdx = 0; + filename = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ShardedFilename operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static ShardedFilename create(Scope scope, Operand basename, Operand shard, Operand numShards) { + @Endpoint( + describeByClass = true + ) + public static ShardedFilename create(Scope scope, Operand basename, + Operand shard, Operand numShards) { OperationBuilder opBuilder = scope.env().opBuilder("ShardedFilename", scope.makeOpName("ShardedFilename")); opBuilder.addInput(basename.asOutput()); opBuilder.addInput(shard.asOutput()); @@ -54,26 +70,18 @@ public static ShardedFilename create(Scope scope, Operand basename, Ope opBuilder = scope.apply(opBuilder); return new ShardedFilename(opBuilder.build()); } - + /** + * Gets filename. + * + * @return filename. */ public Output filename() { return filename; } - + @Override public Output asOutput() { return filename; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShardedFilename"; - - private Output filename; - - private ShardedFilename(Operation operation) { - super(operation); - int outputIdx = 0; - filename = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilespec.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilespec.java index 3bb96e78030..e164304a889 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilespec.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/ShardedFilespec.java @@ -31,45 +31,54 @@ /** * Generate a glob pattern matching all sharded file names. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class ShardedFilespec extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ShardedFilespec"; + + private Output filename; + + private ShardedFilespec(Operation operation) { + super(operation); + int outputIdx = 0; + filename = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ShardedFilespec operation. - * + * * @param scope current scope - * @param basename - * @param numShards + * @param basename the basename value + * @param numShards the numShards value * @return a new instance of ShardedFilespec */ - @Endpoint(describeByClass = true) - public static ShardedFilespec create(Scope scope, Operand basename, Operand numShards) { + @Endpoint( + describeByClass = true + ) + public static ShardedFilespec create(Scope scope, Operand basename, + Operand numShards) { OperationBuilder opBuilder = scope.env().opBuilder("ShardedFilespec", scope.makeOpName("ShardedFilespec")); opBuilder.addInput(basename.asOutput()); opBuilder.addInput(numShards.asOutput()); opBuilder = scope.apply(opBuilder); return new ShardedFilespec(opBuilder.build()); } - + /** + * Gets filename. + * + * @return filename. */ public Output filename() { return filename; } - + @Override public Output asOutput() { return filename; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShardedFilespec"; - - private Output filename; - - private ShardedFilespec(Operation operation) { - super(operation); - int outputIdx = 0; - filename = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TextLineReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TextLineReader.java index 1031adcae92..61d2afa4869 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TextLineReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TextLineReader.java @@ -30,56 +30,34 @@ /** * A Reader that outputs the lines of a file delimited by '\n'. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class TextLineReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.TextLineReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param skipHeaderLines Number of lines to skip from the beginning of every file. - */ - public Options skipHeaderLines(Long skipHeaderLines) { - this.skipHeaderLines = skipHeaderLines; - return this; - } - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private Long skipHeaderLines; - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "TextLineReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + private TextLineReader(Operation operation) { + super(operation); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TextLineReader operation. - * + * Factory method to create a class wrapping a new TextLineReaderV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of TextLineReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TextLineReader create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TextLineReaderV2", scope.makeOpName("TextLineReader")); opBuilder = scope.apply(opBuilder); @@ -98,51 +76,100 @@ public static TextLineReader create(Scope scope, Options... options) { } return new TextLineReader(opBuilder.build()); } - + /** + * Sets the skipHeaderLines option. + * * @param skipHeaderLines Number of lines to skip from the beginning of every file. + * @return this Options instance. */ public static Options skipHeaderLines(Long skipHeaderLines) { return new Options().skipHeaderLines(skipHeaderLines); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TextLineReaderV2"; - - private Output readerHandle; - - private TextLineReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.TextLineReader} + */ + public static class Options { + private Long skipHeaderLines; + + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the skipHeaderLines option. + * + * @param skipHeaderLines Number of lines to skip from the beginning of every file. + * @return this Options instance. + */ + public Options skipHeaderLines(Long skipHeaderLines) { + this.skipHeaderLines = skipHeaderLines; + return this; + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TfRecordReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TfRecordReader.java index d78e7e2f599..8d2c43efb03 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TfRecordReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/TfRecordReader.java @@ -30,56 +30,34 @@ /** * A Reader that outputs the records from a TensorFlow Records file. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class TfRecordReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.TfRecordReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param compressionType - */ - public Options compressionType(String compressionType) { - this.compressionType = compressionType; - return this; - } - - private String container; - private String sharedName; - private String compressionType; - - private Options() { - } + public static final String OP_NAME = "TFRecordReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + private TfRecordReader(Operation operation) { + super(operation); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TfRecordReader operation. - * + * Factory method to create a class wrapping a new TFRecordReaderV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of TfRecordReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TfRecordReader create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TFRecordReaderV2", scope.makeOpName("TfRecordReader")); opBuilder = scope.apply(opBuilder); @@ -98,51 +76,100 @@ public static TfRecordReader create(Scope scope, Options... options) { } return new TfRecordReader(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param compressionType + * Sets the compressionType option. + * + * @param compressionType the compressionType option + * @return this Options instance. */ public static Options compressionType(String compressionType) { return new Options().compressionType(compressionType); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TFRecordReaderV2"; - - private Output readerHandle; - - private TfRecordReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.TfRecordReader} + */ + public static class Options { + private String container; + + private String sharedName; + + private String compressionType; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the compressionType option. + * + * @param compressionType the compressionType option + * @return this Options instance. + */ + public Options compressionType(String compressionType) { + this.compressionType = compressionType; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WholeFileReader.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WholeFileReader.java index 0b93e777478..d40b25906dd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WholeFileReader.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WholeFileReader.java @@ -29,51 +29,37 @@ /** * A Reader that outputs the entire contents of a file as a value. - *

* To use, enqueue filenames in a Queue. The output of ReaderRead will * be a filename (key) and the contents of that file (value). */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class WholeFileReader extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.io.WholeFileReader} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this reader is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this reader is named in the given bucket - * with this shared_name. Otherwise, the node name is used instead. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "WholeFileReaderV2"; + + private Output readerHandle; + + @SuppressWarnings("unchecked") + private WholeFileReader(Operation operation) { + super(operation); + int outputIdx = 0; + readerHandle = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new WholeFileReader operation. - * + * Factory method to create a class wrapping a new WholeFileReaderV2 operation. + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of WholeFileReader */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static WholeFileReader create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("WholeFileReaderV2", scope.makeOpName("WholeFileReader")); opBuilder = scope.apply(opBuilder); @@ -89,44 +75,77 @@ public static WholeFileReader create(Scope scope, Options... options) { } return new WholeFileReader(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this reader is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this reader is named in the given bucket * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** + * Gets readerHandle. * The handle to reference the Reader. + * @return readerHandle. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) readerHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WholeFileReaderV2"; - - private Output readerHandle; - - private WholeFileReader(Operation operation) { - super(operation); - int outputIdx = 0; - readerHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.io.WholeFileReader} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this reader is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this reader is named in the given bucket + * with this shared_name. Otherwise, the node name is used instead. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WriteFile.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WriteFile.java index 4d8bbd389ff..4397e567d90 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WriteFile.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/WriteFile.java @@ -28,33 +28,38 @@ /** * Writes contents to the file at input filename. Creates file and recursively - *

* creates directory if not existing. */ -@Operator(group = "io") +@Operator( + group = "io" +) public final class WriteFile extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WriteFile"; + + private WriteFile(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new WriteFile operation. - * + * * @param scope current scope * @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. * @return a new instance of WriteFile */ - @Endpoint(describeByClass = true) - public static WriteFile create(Scope scope, Operand filename, Operand contents) { + @Endpoint( + describeByClass = true + ) + public static WriteFile create(Scope scope, Operand filename, + Operand contents) { OperationBuilder opBuilder = scope.env().opBuilder("WriteFile", scope.makeOpName("WriteFile")); opBuilder.addInput(filename.asOutput()); opBuilder.addInput(contents.asOutput()); opBuilder = scope.apply(opBuilder); return new WriteFile(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteFile"; - - private WriteFile(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandPart.java index a1fcc18c2c1..24c1d6334aa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandPart.java @@ -30,89 +30,92 @@ /** * 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 + * 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]],
- * 
- * tf.matrix_band_part(input, 1, -1) ==> [[ 0,  1,  2, 3]
+ *
+ * tf.matrix_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.matrix_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 + *
+ *

Useful special cases: + *

+ *  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 */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BandPart extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BandPart operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixBandPart"; + + private Output band; + + private BandPart(Operation operation) { + super(operation); + int outputIdx = 0; + band = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixBandPart operation. + * * @param scope current scope - * @param input Rank `k` tensor. + * @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 */ - @Endpoint(describeByClass = true) - public static BandPart create(Scope scope, Operand input, Operand numLower, Operand numUpper) { + @Endpoint( + describeByClass = true + ) + public static BandPart create(Scope scope, + Operand input, Operand numLower, Operand numUpper) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixBandPart", scope.makeOpName("BandPart")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(numLower.asOutput()); opBuilder.addInput(numUpper.asOutput()); opBuilder = scope.apply(opBuilder); - return new BandPart(opBuilder.build()); + return new BandPart<>(opBuilder.build()); } - + /** - * Rank `k` tensor of the same shape as input. The extracted banded tensor. + * Gets band. + * Rank {@code k} tensor of the same shape as input. The extracted banded tensor. + * @return band. */ public Output band() { return band; } - + @Override public Output asOutput() { return band; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixBandPart"; - - private Output band; - - private BandPart(Operation operation) { - super(operation); - int outputIdx = 0; - band = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandedTriangularSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandedTriangularSolve.java index 314d184c472..cc7df0281c9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandedTriangularSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BandedTriangularSolve.java @@ -24,53 +24,42 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * @param data type for {@code output()} output + * The BandedTriangularSolve operation + * + * @param data type for {@code output} output */ public final class BandedTriangularSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BandedTriangularSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param lower - */ - public Options lower(Boolean lower) { - this.lower = lower; - return this; - } - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean lower; - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "BandedTriangularSolve"; + + private Output output; + + private BandedTriangularSolve(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BandedTriangularSolve operation. - * + * * @param scope current scope - * @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 BandedTriangularSolve} output and operands * @return a new instance of BandedTriangularSolve */ - @Endpoint(describeByClass = true) - public static BandedTriangularSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BandedTriangularSolve create(Scope scope, Operand matrix, + Operand rhs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BandedTriangularSolve", scope.makeOpName("BandedTriangularSolve")); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); @@ -85,42 +74,74 @@ public static BandedTriangularSolve create(Scope scope, Ope } } } - return new BandedTriangularSolve(opBuilder.build()); + return new BandedTriangularSolve<>(opBuilder.build()); } - + /** - * @param lower + * Sets the lower option. + * + * @param lower the lower option + * @return this Options instance. */ public static Options lower(Boolean lower) { return new Options().lower(lower); } - + /** - * @param adjoint + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BandedTriangularSolve"; - - private Output output; - - private BandedTriangularSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BandedTriangularSolve} + */ + public static class Options { + private Boolean lower; + + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the lower option. + * + * @param lower the lower option + * @return this Options instance. + */ + public Options lower(Boolean lower) { + this.lower = lower; + return this; + } + + /** + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = adjoint; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholesky.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholesky.java index a7ba5c36639..af22fb9c574 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholesky.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholesky.java @@ -28,45 +28,56 @@ import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The BatchCholesky operation + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchCholesky extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchCholesky"; + + private Output output; + + private BatchCholesky(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchCholesky operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code BatchCholesky} output and operands * @return a new instance of BatchCholesky */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BatchCholesky create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchCholesky", scope.makeOpName("BatchCholesky")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new BatchCholesky(opBuilder.build()); + return new BatchCholesky<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchCholesky"; - - private Output output; - - private BatchCholesky(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholeskyGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholeskyGrad.java index 515e582f254..50ad2bae38a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholeskyGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchCholeskyGrad.java @@ -28,47 +28,59 @@ import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The BatchCholeskyGrad operation + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchCholeskyGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchCholeskyGrad"; + + private Output output; + + private BatchCholeskyGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchCholeskyGrad operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchCholeskyGrad create(Scope scope, Operand l, Operand grad) { + @Endpoint( + describeByClass = true + ) + public static BatchCholeskyGrad create(Scope scope, Operand l, + Operand grad) { OperationBuilder opBuilder = scope.env().opBuilder("BatchCholeskyGrad", scope.makeOpName("BatchCholeskyGrad")); opBuilder.addInput(l.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder = scope.apply(opBuilder); - return new BatchCholeskyGrad(opBuilder.build()); + return new BatchCholeskyGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchCholeskyGrad"; - - private Output output; - - private BatchCholeskyGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixBandPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixBandPart.java index 73781a58062..4fc2f6f262a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixBandPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixBandPart.java @@ -29,49 +29,61 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code band()} output + * The BatchMatrixBandPart operation + * + * @param data type for {@code band} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchMatrixBandPart extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixBandPart"; + + private Output band; + + private BatchMatrixBandPart(Operation operation) { + super(operation); + int outputIdx = 0; + band = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixBandPart operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixBandPart create(Scope scope, Operand input, Operand numLower, Operand numUpper) { + @Endpoint( + describeByClass = true + ) + public static BatchMatrixBandPart create(Scope scope, Operand input, + Operand numLower, Operand numUpper) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixBandPart", scope.makeOpName("BatchMatrixBandPart")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(numLower.asOutput()); opBuilder.addInput(numUpper.asOutput()); opBuilder = scope.apply(opBuilder); - return new BatchMatrixBandPart(opBuilder.build()); + return new BatchMatrixBandPart<>(opBuilder.build()); } - + /** + * Gets band. + * + * @return band. */ public Output band() { return band; } - + @Override public Output asOutput() { return band; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixBandPart"; - - private Output band; - - private BatchMatrixBandPart(Operation operation) { - super(operation); - int outputIdx = 0; - band = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDeterminant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDeterminant.java index a05950bf04a..72ff4326b11 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDeterminant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDeterminant.java @@ -28,45 +28,56 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code output()} output + * The BatchMatrixDeterminant operation + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchMatrixDeterminant extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixDeterminant"; + + private Output output; + + private BatchMatrixDeterminant(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixDeterminant operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code BatchMatrixDeterminant} output and operands * @return a new instance of BatchMatrixDeterminant */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BatchMatrixDeterminant create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixDeterminant", scope.makeOpName("BatchMatrixDeterminant")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new BatchMatrixDeterminant(opBuilder.build()); + return new BatchMatrixDeterminant<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixDeterminant"; - - private Output output; - - private BatchMatrixDeterminant(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiag.java index 9cfc0f9d177..09395a2925a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiag.java @@ -28,45 +28,56 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code output()} output + * The BatchMatrixDiag operation + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchMatrixDiag extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixDiag"; + + private Output output; + + private BatchMatrixDiag(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixDiag operation. - * + * * @param scope current scope - * @param diagonal + * @param diagonal the diagonal value + * @param data type for {@code BatchMatrixDiag} output and operands * @return a new instance of BatchMatrixDiag */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BatchMatrixDiag create(Scope scope, Operand diagonal) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixDiag", scope.makeOpName("BatchMatrixDiag")); opBuilder.addInput(diagonal.asOutput()); opBuilder = scope.apply(opBuilder); - return new BatchMatrixDiag(opBuilder.build()); + return new BatchMatrixDiag<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixDiag"; - - private Output output; - - private BatchMatrixDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiagPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiagPart.java index 6e3a206226e..f438faf728e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiagPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixDiagPart.java @@ -28,45 +28,56 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code diagonal()} output + * The BatchMatrixDiagPart operation + * + * @param data type for {@code diagonal} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchMatrixDiagPart extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixDiagPart"; + + private Output diagonal; + + private BatchMatrixDiagPart(Operation operation) { + super(operation); + int outputIdx = 0; + diagonal = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixDiagPart operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code BatchMatrixDiagPart} output and operands * @return a new instance of BatchMatrixDiagPart */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BatchMatrixDiagPart create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixDiagPart", scope.makeOpName("BatchMatrixDiagPart")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new BatchMatrixDiagPart(opBuilder.build()); + return new BatchMatrixDiagPart<>(opBuilder.build()); } - + /** + * Gets diagonal. + * + * @return diagonal. */ public Output diagonal() { return diagonal; } - + @Override public Output asOutput() { return diagonal; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixDiagPart"; - - private Output diagonal; - - private BatchMatrixDiagPart(Operation operation) { - super(operation); - int outputIdx = 0; - diagonal = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixInverse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixInverse.java index 709a59404b9..6e99d4a575b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixInverse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixInverse.java @@ -28,40 +28,41 @@ import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The BatchMatrixInverse operation + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchMatrixInverse extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixInverse} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "BatchMatrixInverse"; + + private Output output; + + private BatchMatrixInverse(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchMatrixInverse operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixInverse create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BatchMatrixInverse create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixInverse", scope.makeOpName("BatchMatrixInverse")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -72,35 +73,51 @@ public static BatchMatrixInverse create(Scope scope, Oper } } } - return new BatchMatrixInverse(opBuilder.build()); + return new BatchMatrixInverse<>(opBuilder.build()); } - + /** - * @param adjoint + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixInverse"; - - private Output output; - - private BatchMatrixInverse(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixInverse} + */ + public static class Options { + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = adjoint; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSetDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSetDiag.java index 07f59f50c5d..87a80dddc78 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSetDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSetDiag.java @@ -28,47 +28,59 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code output()} output + * The BatchMatrixSetDiag operation + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchMatrixSetDiag extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchMatrixSetDiag"; + + private Output output; + + private BatchMatrixSetDiag(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchMatrixSetDiag operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixSetDiag create(Scope scope, Operand input, Operand diagonal) { + @Endpoint( + describeByClass = true + ) + public static BatchMatrixSetDiag create(Scope scope, Operand input, + Operand diagonal) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixSetDiag", scope.makeOpName("BatchMatrixSetDiag")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(diagonal.asOutput()); opBuilder = scope.apply(opBuilder); - return new BatchMatrixSetDiag(opBuilder.build()); + return new BatchMatrixSetDiag<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixSetDiag"; - - private Output output; - - private BatchMatrixSetDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolve.java index 64559a23676..fc9ea69fc10 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolve.java @@ -28,41 +28,42 @@ import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The BatchMatrixSolve operation + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchMatrixSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "BatchMatrixSolve"; + + private Output output; + + private BatchMatrixSolve(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchMatrixSolve operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BatchMatrixSolve create(Scope scope, Operand matrix, + Operand rhs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixSolve", scope.makeOpName("BatchMatrixSolve")); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); @@ -74,35 +75,51 @@ public static BatchMatrixSolve create(Scope scope, Operan } } } - return new BatchMatrixSolve(opBuilder.build()); + return new BatchMatrixSolve<>(opBuilder.build()); } - + /** - * @param adjoint + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixSolve"; - - private Output output; - - private BatchMatrixSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolve} + */ + public static class Options { + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = adjoint; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolveLs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolveLs.java index 71490a6b153..a88d9999dd6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolveLs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixSolveLs.java @@ -29,42 +29,43 @@ import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The BatchMatrixSolveLs operation + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchMatrixSolveLs extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolveLs} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fast - */ - public Options fast(Boolean fast) { - this.fast = fast; - return this; - } - - private Boolean fast; - - private Options() { - } + public static final String OP_NAME = "BatchMatrixSolveLs"; + + private Output output; + + private BatchMatrixSolveLs(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchMatrixSolveLs operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixSolveLs create(Scope scope, Operand matrix, Operand rhs, Operand l2Regularizer, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BatchMatrixSolveLs create(Scope scope, Operand matrix, + Operand rhs, Operand l2Regularizer, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixSolveLs", scope.makeOpName("BatchMatrixSolveLs")); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); @@ -77,35 +78,51 @@ public static BatchMatrixSolveLs create(Scope scope, Oper } } } - return new BatchMatrixSolveLs(opBuilder.build()); + return new BatchMatrixSolveLs<>(opBuilder.build()); } - + /** - * @param fast + * Sets the fast option. + * + * @param fast the fast option + * @return this Options instance. */ public static Options fast(Boolean fast) { return new Options().fast(fast); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixSolveLs"; - - private Output output; - - private BatchMatrixSolveLs(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolveLs} + */ + public static class Options { + private Boolean fast; + + private Options() { + } + + /** + * Sets the fast option. + * + * @param fast the fast option + * @return this Options instance. + */ + public Options fast(Boolean fast) { + this.fast = fast; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixTriangularSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixTriangularSolve.java index 7bccee674a9..beca75fc48c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixTriangularSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatrixTriangularSolve.java @@ -28,50 +28,42 @@ import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The BatchMatrixTriangularSolve operation + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchMatrixTriangularSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixTriangularSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param lower - */ - public Options lower(Boolean lower) { - this.lower = lower; - return this; - } - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean lower; - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "BatchMatrixTriangularSolve"; + + private Output output; + + private BatchMatrixTriangularSolve(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchMatrixTriangularSolve operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchMatrixTriangularSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BatchMatrixTriangularSolve create(Scope scope, + Operand matrix, Operand rhs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixTriangularSolve", scope.makeOpName("BatchMatrixTriangularSolve")); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); @@ -86,42 +78,74 @@ public static BatchMatrixTriangularSolve create(Scope sco } } } - return new BatchMatrixTriangularSolve(opBuilder.build()); + return new BatchMatrixTriangularSolve<>(opBuilder.build()); } - + /** - * @param lower + * Sets the lower option. + * + * @param lower the lower option + * @return this Options instance. */ public static Options lower(Boolean lower) { return new Options().lower(lower); } - + /** - * @param adjoint + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatrixTriangularSolve"; - - private Output output; - - private BatchMatrixTriangularSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixTriangularSolve} + */ + public static class Options { + private Boolean lower; + + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the lower option. + * + * @param lower the lower option + * @return this Options instance. + */ + public Options lower(Boolean lower) { + this.lower = lower; + return this; + } + + /** + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = adjoint; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSelfAdjointEig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSelfAdjointEig.java index 450a7ee419d..16b2f162576 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSelfAdjointEig.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSelfAdjointEig.java @@ -28,40 +28,44 @@ import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code e()} output + * The BatchSelfAdjointEigV2 operation + * + * @param data type for {@code e} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchSelfAdjointEig extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchSelfAdjointEig} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeV - */ - public Options computeV(Boolean computeV) { - this.computeV = computeV; - return this; - } - - private Boolean computeV; - - private Options() { - } + public static final String OP_NAME = "BatchSelfAdjointEigV2"; + + private Output e; + + private Output v; + + private BatchSelfAdjointEig(Operation operation) { + super(operation); + int outputIdx = 0; + e = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BatchSelfAdjointEig operation. - * + * Factory method to create a class wrapping a new BatchSelfAdjointEigV2 operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchSelfAdjointEig create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BatchSelfAdjointEig create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchSelfAdjointEigV2", scope.makeOpName("BatchSelfAdjointEig")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -72,38 +76,55 @@ public static BatchSelfAdjointEig create(Scope scope, Ope } } } - return new BatchSelfAdjointEig(opBuilder.build()); + return new BatchSelfAdjointEig<>(opBuilder.build()); } - + /** - * @param computeV + * Sets the computeV option. + * + * @param computeV the computeV option + * @return this Options instance. */ public static Options computeV(Boolean computeV) { return new Options().computeV(computeV); } - + /** + * Gets e. + * + * @return e. */ public Output e() { return e; } - + /** + * Gets v. + * + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchSelfAdjointEigV2"; - - private Output e; - private Output v; - - private BatchSelfAdjointEig(Operation operation) { - super(operation); - int outputIdx = 0; - e = operation.output(outputIdx++); - v = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchSelfAdjointEig} + */ + public static class Options { + private Boolean computeV; + + private Options() { + } + + /** + * Sets the computeV option. + * + * @param computeV the computeV option + * @return this Options instance. + */ + public Options computeV(Boolean computeV) { + this.computeV = computeV; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSvd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSvd.java index a5dc1bf050a..95600f6f7e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSvd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchSvd.java @@ -28,49 +28,47 @@ import org.tensorflow.types.family.TType; /** - * @param data type for {@code s()} output + * The BatchSvd operation + * + * @param data type for {@code s} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class BatchSvd extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.BatchSvd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeUv - */ - public Options computeUv(Boolean computeUv) { - this.computeUv = computeUv; - return this; - } - - /** - * @param fullMatrices - */ - public Options fullMatrices(Boolean fullMatrices) { - this.fullMatrices = fullMatrices; - return this; - } - - private Boolean computeUv; - private Boolean fullMatrices; - - private Options() { - } + public static final String OP_NAME = "BatchSvd"; + + private Output s; + + private Output u; + + private Output v; + + private BatchSvd(Operation operation) { + super(operation); + int outputIdx = 0; + s = operation.output(outputIdx++); + u = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BatchSvd operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static BatchSvd create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BatchSvd create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchSvd", scope.makeOpName("BatchSvd")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -84,53 +82,87 @@ public static BatchSvd create(Scope scope, Operand input } } } - return new BatchSvd(opBuilder.build()); + return new BatchSvd<>(opBuilder.build()); } - + /** - * @param computeUv + * Sets the computeUv option. + * + * @param computeUv the computeUv option + * @return this Options instance. */ public static Options computeUv(Boolean computeUv) { return new Options().computeUv(computeUv); } - + /** - * @param fullMatrices + * Sets the fullMatrices option. + * + * @param fullMatrices the fullMatrices option + * @return this Options instance. */ public static Options fullMatrices(Boolean fullMatrices) { return new Options().fullMatrices(fullMatrices); } - + /** + * Gets s. + * + * @return s. */ public Output s() { return s; } - + /** + * Gets u. + * + * @return u. */ public Output u() { return u; } - + /** + * Gets v. + * + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchSvd"; - - private Output s; - private Output u; - private Output v; - - private BatchSvd(Operation operation) { - super(operation); - int outputIdx = 0; - s = operation.output(outputIdx++); - u = operation.output(outputIdx++); - v = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.BatchSvd} + */ + public static class Options { + private Boolean computeUv; + + private Boolean fullMatrices; + + private Options() { + } + + /** + * Sets the computeUv option. + * + * @param computeUv the computeUv option + * @return this Options instance. + */ + public Options computeUv(Boolean computeUv) { + this.computeUv = computeUv; + return this; + } + + /** + * Sets the fullMatrices option. + * + * @param fullMatrices the fullMatrices option + * @return this Options instance. + */ + public Options fullMatrices(Boolean fullMatrices) { + this.fullMatrices = fullMatrices; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cholesky.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cholesky.java index a63337aeacf..09ac253370d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cholesky.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cholesky.java @@ -29,61 +29,65 @@ /** * 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 data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Cholesky extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Cholesky"; + + private Output output; + + private Cholesky(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Cholesky operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Cholesky create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Cholesky", scope.makeOpName("Cholesky")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Cholesky(opBuilder.build()); + return new Cholesky<>(opBuilder.build()); } - + /** - * Shape is `[..., M, M]`. + * Gets output. + * Shape is {@code [..., M, M]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cholesky"; - - private Output output; - - private Cholesky(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/CholeskyGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/CholeskyGrad.java index 5a623ebd876..be0fcc6fe71 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/CholeskyGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/CholeskyGrad.java @@ -29,56 +29,64 @@ /** * 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 data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class CholeskyGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CholeskyGrad"; + + private Output output; + + private CholeskyGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CholeskyGrad operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static CholeskyGrad create(Scope scope, Operand l, Operand grad) { + @Endpoint( + describeByClass = true + ) + public static CholeskyGrad create(Scope scope, Operand l, + Operand grad) { OperationBuilder opBuilder = scope.env().opBuilder("CholeskyGrad", scope.makeOpName("CholeskyGrad")); opBuilder.addInput(l.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder = scope.apply(opBuilder); - return new CholeskyGrad(opBuilder.build()); + return new CholeskyGrad<>(opBuilder.build()); } - + /** - * Symmetrized version of df/dA . Shape is `[..., M, M]` + * Gets output. + * Symmetrized version of df/dA . Shape is {@code [..., M, M]} + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CholeskyGrad"; - - private Output output; - - private CholeskyGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/ConjugateTranspose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/ConjugateTranspose.java index 12bfdcc5e8a..622f1e2469e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/ConjugateTranspose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/ConjugateTranspose.java @@ -30,52 +30,61 @@ /** * 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 + * 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 data type for {@code y} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class ConjugateTranspose extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConjugateTranspose"; + + private Output y; + + private ConjugateTranspose(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ConjugateTranspose operation. - * + * * @param scope current scope - * @param x - * @param perm + * @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 */ - @Endpoint(describeByClass = true) - public static ConjugateTranspose create(Scope scope, Operand x, Operand perm) { + @Endpoint( + describeByClass = true + ) + public static ConjugateTranspose create(Scope scope, Operand x, + Operand perm) { OperationBuilder opBuilder = scope.env().opBuilder("ConjugateTranspose", scope.makeOpName("ConjugateTranspose")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(perm.asOutput()); opBuilder = scope.apply(opBuilder); - return new ConjugateTranspose(opBuilder.build()); + return new ConjugateTranspose<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConjugateTranspose"; - - private Output y; - - private ConjugateTranspose(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cross.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cross.java index b62fcbf512c..004c88358fd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cross.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Cross.java @@ -29,53 +29,60 @@ /** * 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 data type for {@code product} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Cross extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Cross"; + + private Output product; + + private Cross(Operation operation) { + super(operation); + int outputIdx = 0; + product = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Cross operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Cross create(Scope scope, Operand a, Operand b) { OperationBuilder opBuilder = scope.env().opBuilder("Cross", scope.makeOpName("Cross")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder = scope.apply(opBuilder); - return new Cross(opBuilder.build()); + return new Cross<>(opBuilder.build()); } - + /** - * Pairwise cross product of the vectors in `a` and `b`. + * Gets product. + * Pairwise cross product of the vectors in {@code a} and {@code b}. + * @return product. */ public Output product() { return product; } - + @Override public Output asOutput() { return product; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cross"; - - private Output product; - - private Cross(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Det.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Det.java index c207d6093c7..36f48f9383b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Det.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Det.java @@ -29,51 +29,58 @@ /** * 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 `[..., :, :]`. - * - * @param data type for {@code output()} output + * for all input submatrices {@code [..., :, :]}. + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Det extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Det operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixDeterminant"; + + private Output output; + + private Det(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixDeterminant operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Det create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDeterminant", scope.makeOpName("Det")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Det(opBuilder.build()); + return new Det<>(opBuilder.build()); } - + /** - * Shape is `[...]`. + * Gets output. + * Shape is {@code [...]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDeterminant"; - - private Output output; - - private Det(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Eig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Eig.java index c295f5bb081..bb7ab87c4a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Eig.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Eig.java @@ -30,55 +30,54 @@ /** * 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 data type for {@code e} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Eig extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Eig} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeV If `True` then eigenvectors will be computed and returned in `v`. - * Otherwise, only the eigenvalues will be computed. - */ - public Options computeV(Boolean computeV) { - this.computeV = computeV; - return this; - } - - private Boolean computeV; - - private Options() { - } + public static final String OP_NAME = "Eig"; + + private Output e; + + private Output v; + + private Eig(Operation operation) { + super(operation); + int outputIdx = 0; + e = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Eig operation. - * + * * @param scope current scope - * @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 property + * @param options carries optional attribute values + * @param data type for {@code Eig} output and operands * @return a new instance of Eig */ - @Endpoint(describeByClass = true) - public static Eig create(Scope scope, Operand input, Class Tout, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Eig create(Scope scope, Operand input, + Class Tout, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Eig", scope.makeOpName("Eig")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -90,41 +89,57 @@ public static Eig create(Scope scope, Operand(opBuilder.build()); + return new Eig<>(opBuilder.build()); } - + /** - * @param computeV If `True` then eigenvectors will be computed and returned in `v`. + * Sets the computeV option. + * + * @param computeV If {@code True} then eigenvectors will be computed and returned in {@code v}. * Otherwise, only the eigenvalues will be computed. + * @return this Options instance. */ public static Options computeV(Boolean computeV) { return new Options().computeV(computeV); } - + /** - * Eigenvalues. Shape is `[N]`. + * Gets e. + * Eigenvalues. Shape is {@code [N]}. + * @return e. */ public Output e() { return e; } - + /** - * Eigenvectors. Shape is `[N, N]`. + * Gets v. + * Eigenvectors. Shape is {@code [N, N]}. + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Eig"; - - private Output e; - private Output v; - - private Eig(Operation operation) { - super(operation); - int outputIdx = 0; - e = operation.output(outputIdx++); - v = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Eig} + */ + public static class Options { + private Boolean computeV; + + private Options() { + } + + /** + * Sets the computeV option. + * + * @param computeV If {@code True} then eigenvectors will be computed and returned in {@code v}. + * Otherwise, only the eigenvalues will be computed. + * @return this Options instance. + */ + public Options computeV(Boolean computeV) { + this.computeV = computeV; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Einsum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Einsum.java index fca8d751c75..b9b334441ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Einsum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Einsum.java @@ -30,126 +30,121 @@ /** * 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 subscripts 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 subscripts 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 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 data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Einsum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Einsum"; + + private Output output; + + private Einsum(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Einsum operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static Einsum create(Scope scope, Iterable> inputs, String equation) { + @Endpoint( + describeByClass = true + ) + public static Einsum create(Scope scope, Iterable> inputs, + String equation) { OperationBuilder opBuilder = scope.env().opBuilder("Einsum", scope.makeOpName("Einsum")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("equation", equation); - return new Einsum(opBuilder.build()); + return new Einsum<>(opBuilder.build()); } - + /** - * Output Tensor with shape depending upon `equation`. + * Gets output. + * Output Tensor with shape depending upon {@code equation}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Einsum"; - - private Output output; - - private Einsum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/EuclideanNorm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/EuclideanNorm.java index 2a30dd97d5d..befba75f3c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/EuclideanNorm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/EuclideanNorm.java @@ -30,48 +30,46 @@ /** * 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 data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class EuclideanNorm extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.EuclideanNorm} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "EuclideanNorm"; + + private Output output; + + private EuclideanNorm(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new EuclideanNorm operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static EuclideanNorm create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static EuclideanNorm create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EuclideanNorm", scope.makeOpName("EuclideanNorm")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +81,51 @@ public static EuclideanNorm create(Scope scope, Operand } } } - return new EuclideanNorm(opBuilder.build()); + return new EuclideanNorm<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EuclideanNorm"; - - private Output output; - - private EuclideanNorm(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.EuclideanNorm} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Inv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Inv.java index 7152fceefe8..ca8f65ed27f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Inv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Inv.java @@ -29,51 +29,45 @@ /** * 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 + * 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 data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Inv extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Inv} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjoint - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "MatrixInverse"; + + private Output output; + + private Inv(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Inv operation. - * + * Factory method to create a class wrapping a new MatrixInverse operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Inv create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixInverse", scope.makeOpName("Inv")); opBuilder.addInput(input.asOutput()); @@ -85,40 +79,54 @@ public static Inv create(Scope scope, Operand input, Opt } } } - return new Inv(opBuilder.build()); + return new Inv<>(opBuilder.build()); } - + /** - * @param adjoint + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** - * Shape is `[..., M, M]`. - *

- * @compatibility(numpy) + * Gets output. + * Shape is {@code [..., M, M]}. + *

{@literal @}compatibility(numpy)
* Equivalent to np.linalg.inv - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixInverse"; - - private Output output; - - private Inv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Inv} + */ + public static class Options { + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the adjoint option. + * + * @param adjoint the adjoint option + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = adjoint; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LoadAndRemapMatrix.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LoadAndRemapMatrix.java index 936b81a75bb..854ea4b2e51 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LoadAndRemapMatrix.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LoadAndRemapMatrix.java @@ -30,97 +30,82 @@ import org.tensorflow.types.TString; /** - * 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]] + *

[[w(1, 0), w(1, 2), 0.5], + * [w(0, 0), w(0, 2), -0.5], + * [0.25, -0.25, 42]] */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class LoadAndRemapMatrix extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.LoadAndRemapMatrix} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxRowsInMemory The maximum number of rows to load from the checkpoint at - * once. If less than or equal to 0, the entire matrix will be loaded into - * memory. Setting this arg trades increased disk reads for lower memory usage. - */ - public Options maxRowsInMemory(Long maxRowsInMemory) { - this.maxRowsInMemory = maxRowsInMemory; - return this; - } - - private Long maxRowsInMemory; - - private Options() { - } + public static final String OP_NAME = "LoadAndRemapMatrix"; + + private Output outputMatrix; + + private LoadAndRemapMatrix(Operation operation) { + super(operation); + int outputIdx = 0; + outputMatrix = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LoadAndRemapMatrix operation. - * + * * @param scope current scope - * @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 + * @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 */ - @Endpoint(describeByClass = true) - public static LoadAndRemapMatrix create(Scope scope, Operand ckptPath, Operand oldTensorName, Operand rowRemapping, Operand colRemapping, Operand initializingValues, Long numRows, Long numCols, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadAndRemapMatrix create(Scope scope, Operand ckptPath, + Operand oldTensorName, Operand rowRemapping, Operand colRemapping, + Operand initializingValues, Long numRows, Long numCols, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadAndRemapMatrix", scope.makeOpName("LoadAndRemapMatrix")); opBuilder.addInput(ckptPath.asOutput()); opBuilder.addInput(oldTensorName.asOutput()); @@ -139,37 +124,54 @@ public static LoadAndRemapMatrix create(Scope scope, Operand ckptPath, } return new LoadAndRemapMatrix(opBuilder.build()); } - + /** + * Sets the maxRowsInMemory option. + * * @param maxRowsInMemory The maximum number of rows to load from the checkpoint at * once. If less than or equal to 0, the entire matrix will be loaded into * memory. Setting this arg trades increased disk reads for lower memory usage. + * @return this Options instance. */ public static Options maxRowsInMemory(Long maxRowsInMemory) { return new Options().maxRowsInMemory(maxRowsInMemory); } - + /** + * Gets outputMatrix. * Output matrix containing existing values loaded from the * checkpoint, and with any missing values filled in from initializing_values. + * @return outputMatrix. */ public Output outputMatrix() { return outputMatrix; } - + @Override public Output asOutput() { return outputMatrix; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadAndRemapMatrix"; - - private Output outputMatrix; - - private LoadAndRemapMatrix(Operation operation) { - super(operation); - int outputIdx = 0; - outputMatrix = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.LoadAndRemapMatrix} + */ + public static class Options { + private Long maxRowsInMemory; + + private Options() { + } + + /** + * Sets the maxRowsInMemory option. + * + * @param maxRowsInMemory The maximum number of rows to load from the checkpoint at + * once. If less than or equal to 0, the entire matrix will be loaded into + * memory. Setting this arg trades increased disk reads for lower memory usage. + * @return this Options instance. + */ + public Options maxRowsInMemory(Long maxRowsInMemory) { + this.maxRowsInMemory = maxRowsInMemory; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LogMatrixDeterminant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LogMatrixDeterminant.java index 082d8c96fb7..26efa559281 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LogMatrixDeterminant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/LogMatrixDeterminant.java @@ -29,62 +29,71 @@ /** * 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 `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 data type for {@code sign} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class LogMatrixDeterminant extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogMatrixDeterminant"; + + private Output sign; + + private Output logAbsDeterminant; + + private LogMatrixDeterminant(Operation operation) { + super(operation); + int outputIdx = 0; + sign = operation.output(outputIdx++); + logAbsDeterminant = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogMatrixDeterminant operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogMatrixDeterminant create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("LogMatrixDeterminant", scope.makeOpName("LogMatrixDeterminant")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new LogMatrixDeterminant(opBuilder.build()); + return new LogMatrixDeterminant<>(opBuilder.build()); } - + /** - * The signs of the log determinants of the inputs. Shape is `[N]`. + * Gets sign. + * The signs of the log determinants of the inputs. Shape is {@code [N]}. + * @return sign. */ public Output sign() { return sign; } - + /** + * Gets logAbsDeterminant. * The logs of the absolute values of the determinants - * of the N input matrices. Shape is `[N]`. + * of the N input matrices. Shape is {@code [N]}. + * @return logAbsDeterminant. */ public Output logAbsDeterminant() { return logAbsDeterminant; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogMatrixDeterminant"; - - private Output sign; - private Output logAbsDeterminant; - - private LogMatrixDeterminant(Operation operation) { - super(operation); - int outputIdx = 0; - sign = operation.output(outputIdx++); - logAbsDeterminant = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Lu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Lu.java index 3edb62f927a..cc6adce3d1c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Lu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Lu.java @@ -32,95 +32,107 @@ /** * 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 data type for {@code lu} output + * + * @param data type for {@code p} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Lu extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Lu"; + + private Output lu; + + private Output p; + + private Lu(Operation operation) { + super(operation); + int outputIdx = 0; + lu = operation.output(outputIdx++); + p = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Lu operation. - * + * * @param scope current scope - * @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 property + * @param data type for {@code Lu} output and operands + * @param data type for {@code Lu} output and operands * @return a new instance of Lu */ - @Endpoint(describeByClass = true) - public static Lu create(Scope scope, Operand input, Class outputIdxType) { + @Endpoint( + describeByClass = true + ) + public static Lu create(Scope scope, Operand input, + Class outputIdxType) { OperationBuilder opBuilder = scope.env().opBuilder("Lu", scope.makeOpName("Lu")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_idx_type", Operands.toDataType(outputIdxType)); - return new Lu(opBuilder.build()); + return new Lu<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Lu operation using default output types. - * + * Factory method to create a class wrapping a new Lu operation, with the default output types. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Lu create(Scope scope, Operand input) { return create(scope, input, TInt32.class); } - + /** - * A tensor of shape `[..., M, M]` whose strictly lower triangular part denotes the - * lower triangular factor `L` with unit diagonal, and whose upper triangular part - * denotes the upper triangular factor `U`. + * Gets lu. + * A tensor of shape {@code [..., M, M]} whose strictly lower triangular part denotes the + * lower triangular factor {@code L} with unit diagonal, and whose upper triangular part + * denotes the upper triangular factor {@code U}. + * @return lu. */ public Output lu() { return lu; } - + /** - * Permutation of the rows encoded as a list of indices in `0..M-1`. Shape is - * `[..., M]`. - * @compatibility(scipy) - * Similar to `scipy.linalg.lu`, except the triangular factors `L` and `U` are - * packed into a single tensor, the permutation is applied to `input` instead of - * the right hand side and the permutation `P` is returned as a list of indices + * Gets p. + * Permutation of the rows encoded as a list of indices in {@code 0..M-1}. Shape is + * {@code [..., M]}. + * {@literal @}compatibility(scipy)
+ * Similar to {@code scipy.linalg.lu}, except the triangular factors {@code L} and {@code U} are + * packed into a single tensor, the permutation is applied to {@code input} instead of + * the right hand side and the permutation {@code P} is returned as a list of indices * instead of a permutation matrix. - * @end_compatibility + *
{@literal @}end_compatibility + * @return p. */ public Output p() { return p; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Lu"; - - private Output lu; - private Output p; - - private Lu(Operation operation) { - super(operation); - int outputIdx = 0; - lu = operation.output(outputIdx++); - p = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatMul.java index 5e5b010baec..a82e456fa7c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatMul.java @@ -28,60 +28,48 @@ import org.tensorflow.types.family.TType; /** - * 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 data type for {@code product} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class MatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, "a" is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, "b" is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - - private Options() { - } + public static final String OP_NAME = "MatMul"; + + private Output product; + + private MatMul(Operation operation) { + super(operation); + int outputIdx = 0; + product = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MatMul operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static MatMul create(Scope scope, Operand a, Operand b, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MatMul create(Scope scope, Operand a, Operand b, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MatMul", scope.makeOpName("MatMul")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -96,42 +84,74 @@ public static MatMul create(Scope scope, Operand a, Oper } } } - return new MatMul(opBuilder.build()); + return new MatMul<>(opBuilder.build()); } - + /** - * @param transposeA If true, "a" is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, "a" is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, "b" is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, "b" is transposed before multiplication. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** + * Gets product. + * + * @return product. */ public Output product() { return product; } - + @Override public Output asOutput() { return product; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatMul"; - - private Output product; - - private MatMul(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, "a" is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, "b" is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiag.java index 1187bf3d865..b435a8f3ee3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiag.java @@ -30,43 +30,39 @@ /** * 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]],
@@ -74,12 +70,12 @@
  *                                [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, 1, 0, 0],  # Output shape: (2, 4, 4)
  *         [0, 0, 2, 0],
  *         [0, 0, 0, 3],
  *         [0, 0, 0, 0]],
@@ -87,61 +83,79 @@
  *         [0, 0, 5, 0],
  *         [0, 0, 0, 6],
  *         [0, 0, 0, 0]]]
- * 
+ *
  * # A band of diagonals.
  * diagonals = np.array([[[1, 2, 3],  # Input shape: (2, 2, 3)
  *                        [4, 5, 0]],
  *                       [[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],
  *         [9, 7, 0],
  *         [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)
+ *   ==> [[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 data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class MatrixDiag extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new MatrixDiag operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixDiagV2"; + + private Output output; + + private MatrixDiag(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixDiagV2 operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static MatrixDiag create(Scope scope, Operand diagonal, Operand k, Operand numRows, Operand numCols, Operand paddingValue) { + @Endpoint( + describeByClass = true + ) + public static MatrixDiag create(Scope scope, Operand diagonal, + Operand k, Operand numRows, Operand numCols, + Operand paddingValue) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagV2", scope.makeOpName("MatrixDiag")); opBuilder.addInput(diagonal.asOutput()); opBuilder.addInput(k.asOutput()); @@ -149,29 +163,20 @@ public static MatrixDiag create(Scope scope, Operand dia opBuilder.addInput(numCols.asOutput()); opBuilder.addInput(paddingValue.asOutput()); opBuilder = scope.apply(opBuilder); - return new MatrixDiag(opBuilder.build()); + return new MatrixDiag<>(opBuilder.build()); } - + /** - * Has rank `r+1` when `k` is an integer or `k[0] == k[1]`, rank `r` otherwise. + * Gets output. + * Has rank {@code r+1} when {@code k} is an integer or {@code k[0] == k[1]}, rank {@code r} otherwise. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDiagV2"; - - private Output output; - - private MatrixDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPart.java index c56d2557755..7b05239e769 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPart.java @@ -30,122 +30,124 @@ /** * Returns the batched diagonal part of a batched tensor. - *

- * 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]],
  *                   [[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)
+ * 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],
  *         [5, 2, 7],
  *         [1, 6, 0]]]
- * 
+ *
  * # Padding value = 9
  * tf.matrix_diag_part(input, k = (1, 3), padding_value = 9)
- *   ==> [[[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 data type for {@code diagonal} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class MatrixDiagPart extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new MatrixDiagPart operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixDiagPartV2"; + + private Output diagonal; + + private MatrixDiagPart(Operation operation) { + super(operation); + int outputIdx = 0; + diagonal = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixDiagPartV2 operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static MatrixDiagPart create(Scope scope, Operand input, Operand k, Operand paddingValue) { + @Endpoint( + describeByClass = true + ) + public static MatrixDiagPart create(Scope scope, Operand input, + Operand k, Operand paddingValue) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagPartV2", scope.makeOpName("MatrixDiagPart")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(k.asOutput()); opBuilder.addInput(paddingValue.asOutput()); opBuilder = scope.apply(opBuilder); - return new MatrixDiagPart(opBuilder.build()); + return new MatrixDiagPart<>(opBuilder.build()); } - + /** + * Gets diagonal. * The extracted diagonal(s). + * @return diagonal. */ public Output diagonal() { return diagonal; } - + @Override public Output asOutput() { return diagonal; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDiagPartV2"; - - private Output diagonal; - - private MatrixDiagPart(Operation operation) { - super(operation); - int outputIdx = 0; - diagonal = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPartV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPartV3.java index 04cb6fc3b17..fdf06598984 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPartV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagPartV3.java @@ -30,67 +30,60 @@ /** * Returns the batched diagonal part of a batched tensor. - *

- * 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) - offset`, and `x = max(d, 0) - offset`. - *

- * `offset` is zero except when the alignment of the diagonal is to the right. - *

{@code
+ * 
+ *

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
+ *                                            and `d >= 0`) or
  *                                          (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
- *                                            and `d <= 0`)
+ *                                            and `d <= 0`)
  *          0                          ; otherwise
- * }
- * where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`. - *

- * The input must be at least a matrix. - *

- * For example: - *

{@code
+ * 
+ *

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)
+ * 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 band from each batch.
  * tf.matrix_diag_part(input, k = (-1, 2))
- *   ==> [[[0, 3, 8],  # Output shape: (2, 4, 3)
+ *   ==> [[[0, 3, 8],  # Output shape: (2, 4, 3)
  *         [2, 7, 6],
  *         [1, 6, 7],
  *         [5, 8, 0]],
@@ -98,10 +91,10 @@
  *         [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)
+ * 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]],
@@ -109,72 +102,64 @@
  *         [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],
+ *   ==> [[[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, 9, 4],  # Output shape: (2, 3, 3)
  *         [9, 3, 8],
  *         [2, 7, 6]],
  *        [[9, 9, 2],
  *         [9, 3, 4],
  *         [4, 3, 8]]]
- * 
- * }
- * - * - * @param data type for {@code diagonal()} output + * + *
+ * + * @param data type for {@code diagonal} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class MatrixDiagPartV3 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatrixDiagPartV3} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is - * a string specifying how superdiagonals and subdiagonals should be aligned, - * respectively. There are four possible alignments: "RIGHT_LEFT" (default), - * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals - * to the right (left-pads the row) and subdiagonals to the left (right-pads the - * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is - * the opposite alignment. - */ - public Options align(String align) { - this.align = align; - return this; - } - - private String align; - - private Options() { - } + public static final String OP_NAME = "MatrixDiagPartV3"; + + private Output diagonal; + + private MatrixDiagPartV3(Operation operation) { + super(operation); + int outputIdx = 0; + diagonal = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MatrixDiagPartV3 operation. - * + * * @param scope current scope - * @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 options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MatrixDiagPartV3} output and operands * @return a new instance of MatrixDiagPartV3 */ - @Endpoint(describeByClass = true) - public static MatrixDiagPartV3 create(Scope scope, Operand input, Operand k, Operand paddingValue, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MatrixDiagPartV3 create(Scope scope, Operand input, + Operand k, Operand paddingValue, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagPartV3", scope.makeOpName("MatrixDiagPartV3")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(k.asOutput()); @@ -187,42 +172,63 @@ public static MatrixDiagPartV3 create(Scope scope, Operand< } } } - return new MatrixDiagPartV3(opBuilder.build()); + return new MatrixDiagPartV3<>(opBuilder.build()); } - + /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is + * Sets the align option. + * + * @param align Some diagonals are shorter than {@code max_diag_len} and need to be padded. {@code align} is * a string specifying how superdiagonals and subdiagonals should be aligned, - * respectively. There are four possible alignments: "RIGHT_LEFT" (default), - * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals + * respectively. There are four possible alignments: "RIGHT_LEFT" (default), + * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals * to the right (left-pads the row) and subdiagonals to the left (right-pads the - * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is * the opposite alignment. + * @return this Options instance. */ public static Options align(String align) { return new Options().align(align); } - + /** + * Gets diagonal. * The extracted diagonal(s). + * @return diagonal. */ public Output diagonal() { return diagonal; } - + @Override public Output asOutput() { return diagonal; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDiagPartV3"; - - private Output diagonal; - - private MatrixDiagPartV3(Operation operation) { - super(operation); - int outputIdx = 0; - diagonal = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatrixDiagPartV3} + */ + public static class Options { + private String align; + + private Options() { + } + + /** + * Sets the align option. + * + * @param align Some diagonals are shorter than {@code max_diag_len} and need to be padded. {@code align} is + * a string specifying how superdiagonals and subdiagonals should be aligned, + * respectively. There are four possible alignments: "RIGHT_LEFT" (default), + * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals + * to the right (left-pads the row) and subdiagonals to the left (right-pads the + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is + * the opposite alignment. + * @return this Options instance. + */ + public Options align(String align) { + this.align = align; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagV3.java index dab7e78c7ec..3a118c142d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixDiagV3.java @@ -30,54 +30,49 @@ /** * 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] - d`, and - * `index_in_diag = n - max(d, 0) + offset`. - *

- * `offset` is zero except when the alignment of the diagonal is to the right. - *

{@code
+ * 
+ *

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
+ *                                            and `d >= 0`) or
  *                                          (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
- *                                            and `d <= 0`)
+ *                                            and `d <= 0`)
  *          0                          ; otherwise
- * }
- * where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`. - *

- * For example: - *

{@code
+ * 
+ *

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)
+ * 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]],
@@ -85,12 +80,12 @@
  *                                [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, 1, 0, 0],  # Output shape: (2, 4, 4)
  *         [0, 0, 2, 0],
  *         [0, 0, 0, 3],
  *         [0, 0, 0, 0]],
@@ -98,7 +93,7 @@
  *         [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],
@@ -107,13 +102,13 @@
  *                        [6, 7, 9],
  *                        [9, 1, 0]]])
  * tf.matrix_diag(diagonals, k = (-1, 1))
- *   ==> [[[1, 8, 0],  # Output shape: (2, 3, 3)
+ *   ==> [[[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],
@@ -121,82 +116,75 @@
  *                       [[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)
+ * 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)
+ *   ==> [[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 data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class MatrixDiagV3 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatrixDiagV3} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is - * a string specifying how superdiagonals and subdiagonals should be aligned, - * respectively. There are four possible alignments: "RIGHT_LEFT" (default), - * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals - * to the right (left-pads the row) and subdiagonals to the left (right-pads the - * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is - * the opposite alignment. - */ - public Options align(String align) { - this.align = align; - return this; - } - - private String align; - - private Options() { - } + public static final String OP_NAME = "MatrixDiagV3"; + + private Output output; + + private MatrixDiagV3(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MatrixDiagV3 operation. - * + * * @param scope current scope - * @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 options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code MatrixDiagV3} output and operands * @return a new instance of MatrixDiagV3 */ - @Endpoint(describeByClass = true) - public static MatrixDiagV3 create(Scope scope, Operand diagonal, Operand k, Operand numRows, Operand numCols, Operand paddingValue, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MatrixDiagV3 create(Scope scope, Operand diagonal, + Operand k, Operand numRows, Operand numCols, Operand paddingValue, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagV3", scope.makeOpName("MatrixDiagV3")); opBuilder.addInput(diagonal.asOutput()); opBuilder.addInput(k.asOutput()); @@ -211,42 +199,63 @@ public static MatrixDiagV3 create(Scope scope, Operand d } } } - return new MatrixDiagV3(opBuilder.build()); + return new MatrixDiagV3<>(opBuilder.build()); } - + /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is + * Sets the align option. + * + * @param align Some diagonals are shorter than {@code max_diag_len} and need to be padded. {@code align} is * a string specifying how superdiagonals and subdiagonals should be aligned, - * respectively. There are four possible alignments: "RIGHT_LEFT" (default), - * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals + * respectively. There are four possible alignments: "RIGHT_LEFT" (default), + * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals * to the right (left-pads the row) and subdiagonals to the left (right-pads the - * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is * the opposite alignment. + * @return this Options instance. */ public static Options align(String align) { return new Options().align(align); } - + /** - * Has rank `r+1` when `k` is an integer or `k[0] == k[1]`, rank `r` otherwise. + * Gets output. + * Has rank {@code r+1} when {@code k} is an integer or {@code k[0] == k[1]}, rank {@code r} otherwise. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixDiagV3"; - - private Output output; - - private MatrixDiagV3(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatrixDiagV3} + */ + public static class Options { + private String align; + + private Options() { + } + + /** + * Sets the align option. + * + * @param align Some diagonals are shorter than {@code max_diag_len} and need to be padded. {@code align} is + * a string specifying how superdiagonals and subdiagonals should be aligned, + * respectively. There are four possible alignments: "RIGHT_LEFT" (default), + * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals + * to the right (left-pads the row) and subdiagonals to the left (right-pads the + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is + * the opposite alignment. + * @return this Options instance. + */ + public Options align(String align) { + this.align = align; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixLogarithm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixLogarithm.java index 64b55cf2662..bcc4f514762 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixLogarithm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixLogarithm.java @@ -24,71 +24,70 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * 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 + * \(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. + *

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 `[..., 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 of the same shape as the input - * containing the exponential for all input submatrices `[..., :, :]`. - * - * @param data type for {@code output()} output + * containing the exponential for all input submatrices {@code [..., :, :]}. + * + * @param data type for {@code output} output */ public final class MatrixLogarithm extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixLogarithm"; + + private Output output; + + private MatrixLogarithm(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MatrixLogarithm operation. - * + * * @param scope current scope - * @param input Shape is `[..., M, M]`. + * @param input Shape is {@code [..., M, M]}. + * @param data type for {@code MatrixLogarithm} output and operands * @return a new instance of MatrixLogarithm */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MatrixLogarithm create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixLogarithm", scope.makeOpName("MatrixLogarithm")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new MatrixLogarithm(opBuilder.build()); + return new MatrixLogarithm<>(opBuilder.build()); } - + /** - * Shape is `[..., M, M]`. - *

- * @compatibility(scipy) + * Gets output. + * Shape is {@code [..., M, M]}. + *

{@literal @}compatibility(scipy)
* Equivalent to scipy.linalg.logm - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixLogarithm"; - - private Output output; - - private MatrixLogarithm(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSetDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSetDiag.java index 9b1edba5615..61142a0228a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSetDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSetDiag.java @@ -30,46 +30,41 @@ /** * 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) + offset`. - *

- * `offset` is zero except when the alignment of the diagonal is to the right. - *

{@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
+ *                                            and `d >= 0`) or
  *                                          (`align` in {LEFT_RIGHT, RIGHT_RIGHT}
- *                                            and `d <= 0`)
+ *                                            and `d <= 0`)
  *          0                          ; otherwise
- * }
- * where `diag_len(d) = min(cols - max(d, 0), rows + min(d, 0))`. - *

- * For example: - *

{@code
+ * 
+ *

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],
@@ -80,22 +75,22 @@
  * diagonal = np.array([[1, 2, 3],               # Diagonal shape: (2, 3)
  *                      [4, 5, 6]])
  * tf.matrix_set_diag(input, diagonal)
- *   ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
+ *   ==> [[[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(input, diagonal, k = 1)
- *   ==> [[[7, 1, 7, 7],  # Output shape: (2, 3, 4)
+ *   ==> [[[7, 1, 7, 7],  # Output shape: (2, 3, 4)
  *         [7, 7, 2, 7],
  *         [7, 7, 7, 3]],
  *        [[7, 4, 7, 7],
  *         [7, 7, 5, 7],
  *         [7, 7, 7, 6]]]
- * 
+ *
  * # A band of diagonals.
  * diagonals = np.array([[[0, 9, 1],  # Diagonal shape: (2, 4, 3)
  *                        [6, 5, 8],
@@ -106,13 +101,13 @@
  *                        [6, 1, 2],
  *                        [3, 4, 0]]])
  * tf.matrix_set_diag(input, diagonals, k = (-1, 2))
- *   ==> [[[1, 6, 9, 7],  # Output shape: (2, 3, 4)
+ *   ==> [[[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],
@@ -122,63 +117,55 @@
  *                        [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)
+ * 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 data type for {@code output()} output + * + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class MatrixSetDiag extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatrixSetDiag} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is - * a string specifying how superdiagonals and subdiagonals should be aligned, - * respectively. There are four possible alignments: "RIGHT_LEFT" (default), - * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals - * to the right (left-pads the row) and subdiagonals to the left (right-pads the - * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is - * the opposite alignment. - */ - public Options align(String align) { - this.align = align; - return this; - } - - private String align; - - private Options() { - } + public static final String OP_NAME = "MatrixSetDiagV3"; + + private Output output; + + private MatrixSetDiag(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MatrixSetDiag operation. - * + * Factory method to create a class wrapping a new MatrixSetDiagV3 operation. + * * @param scope current scope - * @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`. + * @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]`. - * @param options carries optional attributes values + * 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 */ - @Endpoint(describeByClass = true) - public static MatrixSetDiag create(Scope scope, Operand input, Operand diagonal, Operand k, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MatrixSetDiag create(Scope scope, Operand input, + Operand diagonal, Operand k, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixSetDiagV3", scope.makeOpName("MatrixSetDiag")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(diagonal.asOutput()); @@ -191,42 +178,63 @@ public static MatrixSetDiag create(Scope scope, Operand } } } - return new MatrixSetDiag(opBuilder.build()); + return new MatrixSetDiag<>(opBuilder.build()); } - + /** - * @param align Some diagonals are shorter than `max_diag_len` and need to be padded. `align` is + * Sets the align option. + * + * @param align Some diagonals are shorter than {@code max_diag_len} and need to be padded. {@code align} is * a string specifying how superdiagonals and subdiagonals should be aligned, - * respectively. There are four possible alignments: "RIGHT_LEFT" (default), - * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals + * respectively. There are four possible alignments: "RIGHT_LEFT" (default), + * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals * to the right (left-pads the row) and subdiagonals to the left (right-pads the - * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is * the opposite alignment. + * @return this Options instance. */ public static Options align(String align) { return new Options().align(align); } - + /** - * Rank `r+1`, with `output.shape = input.shape`. + * Gets output. + * Rank {@code r+1}, with {@code output.shape = input.shape}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixSetDiagV3"; - - private Output output; - - private MatrixSetDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatrixSetDiag} + */ + public static class Options { + private String align; + + private Options() { + } + + /** + * Sets the align option. + * + * @param align Some diagonals are shorter than {@code max_diag_len} and need to be padded. {@code align} is + * a string specifying how superdiagonals and subdiagonals should be aligned, + * respectively. There are four possible alignments: "RIGHT_LEFT" (default), + * "LEFT_RIGHT", "LEFT_LEFT", and "RIGHT_RIGHT". "RIGHT_LEFT" aligns superdiagonals + * to the right (left-pads the row) and subdiagonals to the left (right-pads the + * row). It is the packing format LAPACK uses. cuSPARSE uses "LEFT_RIGHT", which is + * the opposite alignment. + * @return this Options instance. + */ + public Options align(String align) { + this.align = align; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSolveLs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSolveLs.java index 9d0841e6c4b..c68a78bd3ee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSolveLs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/MatrixSolveLs.java @@ -30,82 +30,75 @@ /** * 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. - * - * @param data type for {@code output()} output + * 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 */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class MatrixSolveLs extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.MatrixSolveLs} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fast - */ - public Options fast(Boolean fast) { - this.fast = fast; - return this; - } - - private Boolean fast; - - private Options() { - } + public static final String OP_NAME = "MatrixSolveLs"; + + private Output output; + + private MatrixSolveLs(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MatrixSolveLs operation. - * + * * @param scope current scope - * @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) + *

{@literal @}compatibility(numpy)
* Equivalent to np.linalg.lstsq - * @end_compatibility - * @param options carries optional attributes values + *
{@literal @}end_compatibility + * @param options carries optional attribute values + * @param data type for {@code MatrixSolveLs} output and operands * @return a new instance of MatrixSolveLs */ - @Endpoint(describeByClass = true) - public static MatrixSolveLs create(Scope scope, Operand matrix, Operand rhs, Operand l2Regularizer, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MatrixSolveLs create(Scope scope, Operand matrix, + Operand rhs, Operand l2Regularizer, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixSolveLs", scope.makeOpName("MatrixSolveLs")); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); @@ -118,36 +111,51 @@ public static MatrixSolveLs create(Scope scope, Operand } } } - return new MatrixSolveLs(opBuilder.build()); + return new MatrixSolveLs<>(opBuilder.build()); } - + /** - * @param fast + * Sets the fast option. + * + * @param fast the fast option + * @return this Options instance. */ public static Options fast(Boolean fast) { return new Options().fast(fast); } - + /** - * Shape is `[..., N, K]`. + * Gets output. + * Shape is {@code [..., N, K]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixSolveLs"; - - private Output output; - - private MatrixSolveLs(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.MatrixSolveLs} + */ + public static class Options { + private Boolean fast; + + private Options() { + } + + /** + * Sets the fast option. + * + * @param fast the fast option + * @return this Options instance. + */ + public Options fast(Boolean fast) { + this.fast = fast; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Qr.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Qr.java index 9335adb16c9..513f2d3baef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Qr.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Qr.java @@ -29,57 +29,54 @@ /** * Computes the QR decompositions of one or more matrices. - *

- * Computes the QR decomposition of each inner matrix in `tensor` such that - * `tensor[..., :, :] = q[..., :, :] * r[..., :,:])` - *

- * Currently, the gradient for the QR decomposition is well-defined only when - * the first `P` columns of the inner matrix are linearly independent, where - * `P` is the minimum of `M` and `N`, the 2 inner-most dimmensions of `tensor`. - *

{@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 data type for {@code q} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Qr extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Qr} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fullMatrices If true, compute full-sized `q` and `r`. If false - * (the default), compute only the leading `P` columns of `q`. - */ - public Options fullMatrices(Boolean fullMatrices) { - this.fullMatrices = fullMatrices; - return this; - } - - private Boolean fullMatrices; - - private Options() { - } + public static final String OP_NAME = "Qr"; + + private Output q; + + private Output r; + + private Qr(Operation operation) { + super(operation); + int outputIdx = 0; + q = operation.output(outputIdx++); + r = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Qr operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Qr create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Qr", scope.makeOpName("Qr")); opBuilder.addInput(input.asOutput()); @@ -91,44 +88,60 @@ public static Qr create(Scope scope, Operand input, Opti } } } - return new Qr(opBuilder.build()); + return new Qr<>(opBuilder.build()); } - + /** - * @param fullMatrices If true, compute full-sized `q` and `r`. If false - * (the default), compute only the leading `P` columns of `q`. + * Sets the fullMatrices option. + * + * @param fullMatrices If true, compute full-sized {@code q} and {@code r}. If false + * (the default), compute only the leading {@code P} columns of {@code q}. + * @return this Options instance. */ public static Options fullMatrices(Boolean fullMatrices) { return new Options().fullMatrices(fullMatrices); } - + /** - * Orthonormal basis for range of `a`. If `full_matrices` is `False` then - * shape is `[..., M, P]`; if `full_matrices` is `True` then shape is - * `[..., M, M]`. + * Gets q. + * Orthonormal basis for range of {@code a}. If {@code full_matrices} is {@code False} then + * shape is {@code [..., M, P]}; if {@code full_matrices} is {@code True} then shape is + * {@code [..., M, M]}. + * @return q. */ public Output q() { return q; } - + /** - * Triangular factor. If `full_matrices` is `False` then shape is - * `[..., P, N]`. If `full_matrices` is `True` then shape is `[..., M, N]`. + * Gets r. + * Triangular factor. If {@code full_matrices} is {@code False} then shape is + * {@code [..., P, N]}. If {@code full_matrices} is {@code True} then shape is {@code [..., M, N]}. + * @return r. */ public Output r() { return r; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Qr"; - - private Output q; - private Output r; - - private Qr(Operation operation) { - super(operation); - int outputIdx = 0; - q = operation.output(outputIdx++); - r = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Qr} + */ + public static class Options { + private Boolean fullMatrices; + + private Options() { + } + + /** + * Sets the fullMatrices option. + * + * @param fullMatrices If true, compute full-sized {@code q} and {@code r}. If false + * (the default), compute only the leading {@code P} columns of {@code q}. + * @return this Options instance. + */ + public Options fullMatrices(Boolean fullMatrices) { + this.fullMatrices = fullMatrices; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMul.java index 28e9c3ae7c4..30b464c48b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMul.java @@ -27,67 +27,65 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * 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 data type for {@code out} output */ -@Operator(group = "linalg") -public final class QuantizedMatMul extends RawOp { - +@Operator( + group = "linalg" +) +public final class QuantizedMatMul extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, `a` is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, `b` is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMul"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + private QuantizedMatMul(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMul operation. - * + * * @param scope current scope * @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 property * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedMatMul create(Scope scope, Operand a, Operand b, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Class Tactivation, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMul create(Scope scope, + Operand a, Operand b, Operand minA, + Operand maxA, Operand minB, Operand maxB, Class Toutput, + Class Tactivation, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMul", scope.makeOpName("QuantizedMatMul")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -108,55 +106,87 @@ public static QuantizedMatMul create(Scope } } } - return new QuantizedMatMul(opBuilder.build()); + return new QuantizedMatMul<>(opBuilder.build()); } - + /** - * @param transposeA If true, `a` is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, `b` is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMul"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBias.java index fd85581fbc9..b781b62d915 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBias.java @@ -25,79 +25,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * Performs a quantized matrix multiplication of `a` by the matrix `b` with bias + * 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 `a` (after being transposed if `transpose_a` is non-zero) must - * match the outer dimension of `b` (after being transposed if `transposed_b` is + * 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 `b`. - * - * @param data type for {@code out()} output + * multiplication result. The bias size must match inner dimension of {@code b}. + * + * @param data type for {@code out} output */ -public final class QuantizedMatMulWithBias extends RawOp { - +public final class QuantizedMatMulWithBias extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBias} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, `a` is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, `b` is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBias"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + private QuantizedMatMulWithBias(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBias operation. - * + * * @param scope current scope - * @param a A matrix to be multiplied. Must be a two-dimensional tensor of type `quint8`. - * @param b A matrix to be multiplied and must be a two-dimensional tensor of type `qint8`. - * @param bias A 1D bias tensor with size matching inner dimension of `b` (after being - * transposed if `transposed_b` is non-zero). - * @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 options carries optional attributes values + * @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 property + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBias} output and operands * @return a new instance of QuantizedMatMulWithBias */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBias create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBias create(Scope scope, + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Class Toutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBias", scope.makeOpName("QuantizedMatMulWithBias")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -121,62 +106,110 @@ public static QuantizedMatMulWithBias create(Scope scope, O } } } - return new QuantizedMatMulWithBias(opBuilder.build()); + return new QuantizedMatMulWithBias<>(opBuilder.build()); } - + /** - * @param transposeA If true, `a` is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, `b` is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** + * Sets the inputQuantMode option. + * * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBias"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMulWithBias(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBias} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = inputQuantMode; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndRelu.java index ddf4f44b6d2..8a45662ec0a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndRelu.java @@ -25,80 +25,65 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * Perform a quantized matrix multiplication of `a` by the matrix `b` with bias + * 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 `a` (after being transposed if `transpose_a` is non-zero) must - * match the outer dimension of `b` (after being transposed if `transposed_b` is + * 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 `b`. Then do + * multiplication result. The bias size must match inner dimension of {@code b}. Then do * relu activation to get non-negative result. - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -public final class QuantizedMatMulWithBiasAndRelu extends RawOp { - +public final class QuantizedMatMulWithBiasAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, `a` is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, `b` is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBiasAndRelu"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + private QuantizedMatMulWithBiasAndRelu(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndRelu operation. - * + * * @param scope current scope - * @param a A matrix to be multiplied. Must be a two-dimensional tensor of type `quint8`. - * @param b A matrix to be multiplied and must be a two-dimensional tensor of type `qint8`. - * @param bias A 1D bias tensor with size matching with inner dimension of `b` (after being - * transposed if `transposed_b` is non-zero). - * @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 options carries optional attributes values + * @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 property + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBiasAndRelu} output and operands * @return a new instance of QuantizedMatMulWithBiasAndRelu */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBiasAndRelu create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBiasAndRelu create(Scope scope, + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Class Toutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndRelu", scope.makeOpName("QuantizedMatMulWithBiasAndRelu")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -122,62 +107,110 @@ public static QuantizedMatMulWithBiasAndRelu create(Scope s } } } - return new QuantizedMatMulWithBiasAndRelu(opBuilder.build()); + return new QuantizedMatMulWithBiasAndRelu<>(opBuilder.build()); } - + /** - * @param transposeA If true, `a` is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, `b` is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** + * Sets the inputQuantMode option. + * * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBiasAndRelu"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMulWithBiasAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndRelu} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = inputQuantMode; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndReluAndRequantize.java index 06734e0a715..65415fbfd3c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/QuantizedMatMulWithBiasAndReluAndRequantize.java @@ -25,83 +25,69 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * Perform a quantized matrix multiplication of `a` by the matrix `b` with bias + * 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 `a` (after being transposed if `transpose_a` is non-zero) must - * match the outer dimension of `b` (after being transposed if `transposed_b` is + * 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 `b`. Then do + * 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 data type for {@code out()} output + * + * @param data type for {@code out} output */ -public final class QuantizedMatMulWithBiasAndReluAndRequantize extends RawOp { - +public final class QuantizedMatMulWithBiasAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA If true, `a` is transposed before multiplication. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB If true, `b` is transposed before multiplication. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBiasAndReluAndRequantize"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + private QuantizedMatMulWithBiasAndReluAndRequantize(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndReluAndRequantize operation. - * + * * @param scope current scope - * @param a A matrix to be multiplied. Must be a two-dimensional tensor of type `quint8`. - * @param b A matrix to be multiplied and must be a two-dimensional tensor of type `qint8`. - * @param bias A 1D bias tensor with size matching with inner dimension of `b` (after being - * transposed if `transposed_b` is non-zero). - * @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 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 - * @param Toutput - * @param options carries optional attributes values + * @param maxFreezedOutput the maxFreezedOutput value + * @param Toutput the value of the Toutput property + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBiasAndReluAndRequantize} output and operands * @return a new instance of QuantizedMatMulWithBiasAndReluAndRequantize */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBiasAndReluAndRequantize create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Operand minFreezedOutput, Operand maxFreezedOutput, Class Toutput, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBiasAndReluAndRequantize create( + Scope scope, Operand a, Operand b, + Operand bias, Operand minA, Operand maxA, + Operand minB, Operand maxB, Operand minFreezedOutput, + Operand maxFreezedOutput, Class Toutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndReluAndRequantize", scope.makeOpName("QuantizedMatMulWithBiasAndReluAndRequantize")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -127,62 +113,110 @@ public static QuantizedMatMulWithBiasAndReluAndRequantize c } } } - return new QuantizedMatMulWithBiasAndReluAndRequantize(opBuilder.build()); + return new QuantizedMatMulWithBiasAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param transposeA If true, `a` is transposed before multiplication. + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB If true, `b` is transposed before multiplication. + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** + * Sets the inputQuantMode option. + * * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBiasAndReluAndRequantize"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMulWithBiasAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMulWithBiasAndReluAndRequantize} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA If true, {@code a} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB If true, {@code b} is transposed before multiplication. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode Input data quantization mode. Either MIN_FIRST(default) or SCALED. + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = inputQuantMode; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SelfAdjointEig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SelfAdjointEig.java index b0617360f1c..d01b4f3b829 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SelfAdjointEig.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SelfAdjointEig.java @@ -29,54 +29,53 @@ /** * 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 data type for {@code e} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class SelfAdjointEig extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.SelfAdjointEig} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeV If `True` then eigenvectors will be computed and returned in `v`. - * Otherwise, only the eigenvalues will be computed. - */ - public Options computeV(Boolean computeV) { - this.computeV = computeV; - return this; - } - - private Boolean computeV; - - private Options() { - } + public static final String OP_NAME = "SelfAdjointEigV2"; + + private Output e; + + private Output v; + + private SelfAdjointEig(Operation operation) { + super(operation); + int outputIdx = 0; + e = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SelfAdjointEig operation. - * + * Factory method to create a class wrapping a new SelfAdjointEigV2 operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static SelfAdjointEig create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SelfAdjointEig create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SelfAdjointEigV2", scope.makeOpName("SelfAdjointEig")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -87,41 +86,57 @@ public static SelfAdjointEig create(Scope scope, Operand } } } - return new SelfAdjointEig(opBuilder.build()); + return new SelfAdjointEig<>(opBuilder.build()); } - + /** - * @param computeV If `True` then eigenvectors will be computed and returned in `v`. + * Sets the computeV option. + * + * @param computeV If {@code True} then eigenvectors will be computed and returned in {@code v}. * Otherwise, only the eigenvalues will be computed. + * @return this Options instance. */ public static Options computeV(Boolean computeV) { return new Options().computeV(computeV); } - + /** - * Eigenvalues. Shape is `[N]`. + * Gets e. + * Eigenvalues. Shape is {@code [N]}. + * @return e. */ public Output e() { return e; } - + /** - * Eigenvectors. Shape is `[N, N]`. + * Gets v. + * Eigenvectors. Shape is {@code [N, N]}. + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SelfAdjointEigV2"; - - private Output e; - private Output v; - - private SelfAdjointEig(Operation operation) { - super(operation); - int outputIdx = 0; - e = operation.output(outputIdx++); - v = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.SelfAdjointEig} + */ + public static class Options { + private Boolean computeV; + + private Options() { + } + + /** + * Sets the computeV option. + * + * @param computeV If {@code True} then eigenvectors will be computed and returned in {@code v}. + * Otherwise, only the eigenvalues will be computed. + * @return this Options instance. + */ + public Options computeV(Boolean computeV) { + this.computeV = computeV; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Solve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Solve.java index 2c44b02cbc8..2fe29966804 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Solve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Solve.java @@ -29,50 +29,47 @@ /** * 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 + * {@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 data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Solve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Solve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjoint Boolean indicating whether to solve with `matrix` or its (block-wise) - * adjoint. - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "MatrixSolve"; + + private Output output; + + private Solve(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Solve operation. - * + * Factory method to create a class wrapping a new MatrixSolve operation. + * * @param scope current scope - * @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 MatrixSolve} output and operands * @return a new instance of Solve */ - @Endpoint(describeByClass = true) - public static Solve create(Scope scope, Operand matrix, Operand rhs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Solve create(Scope scope, Operand matrix, Operand rhs, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixSolve", scope.makeOpName("Solve")); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); @@ -84,37 +81,53 @@ public static Solve create(Scope scope, Operand matrix, } } } - return new Solve(opBuilder.build()); + return new Solve<>(opBuilder.build()); } - + /** - * @param adjoint Boolean indicating whether to solve with `matrix` or its (block-wise) + * Sets the adjoint option. + * + * @param adjoint Boolean indicating whether to solve with {@code matrix} or its (block-wise) * adjoint. + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** - * Shape is `[..., M, K]`. + * Gets output. + * Shape is {@code [..., M, K]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixSolve"; - - private Output output; - - private Solve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Solve} + */ + public static class Options { + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the adjoint option. + * + * @param adjoint Boolean indicating whether to solve with {@code matrix} or its (block-wise) + * adjoint. + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = adjoint; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Sqrtm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Sqrtm.java index 742b75e147e..3b09ba5ce39 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Sqrtm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Sqrtm.java @@ -29,67 +29,70 @@ /** * 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 + *

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 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 `[..., :, :]`. - * - * @param data type for {@code output()} output + * containing the matrix square root for all input submatrices {@code [..., :, :]}. + * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Sqrtm extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Sqrtm operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MatrixSquareRoot"; + + private Output output; + + private Sqrtm(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new MatrixSquareRoot operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sqrtm create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixSquareRoot", scope.makeOpName("Sqrtm")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Sqrtm(opBuilder.build()); + return new Sqrtm<>(opBuilder.build()); } - + /** - * Shape is `[..., M, M]`. - *

- * @compatibility(scipy) + * Gets output. + * Shape is {@code [..., M, M]}. + *

{@literal @}compatibility(scipy)
* Equivalent to scipy.linalg.sqrtm - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixSquareRoot"; - - private Output output; - - private Sqrtm(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Svd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Svd.java index c24b4882bb8..ed2ae52d604 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Svd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Svd.java @@ -29,66 +29,55 @@ /** * 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 data type for {@code s} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Svd extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.Svd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param computeUv If true, left and right singular vectors will be - * computed and returned in `u` and `v`, respectively. - * If false, `u` and `v` are not set and should never referenced. - */ - public Options computeUv(Boolean computeUv) { - this.computeUv = computeUv; - return this; - } - - /** - * @param fullMatrices If true, compute full-sized `u` and `v`. If false - * (the default), compute only the leading `P` singular vectors. - * Ignored if `compute_uv` is `False`. - */ - public Options fullMatrices(Boolean fullMatrices) { - this.fullMatrices = fullMatrices; - return this; - } - - private Boolean computeUv; - private Boolean fullMatrices; - - private Options() { - } + public static final String OP_NAME = "Svd"; + + private Output s; + + private Output u; + + private Output v; + + private Svd(Operation operation) { + super(operation); + int outputIdx = 0; + s = operation.output(outputIdx++); + u = operation.output(outputIdx++); + v = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Svd operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Svd create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Svd", scope.makeOpName("Svd")); opBuilder.addInput(input.asOutput()); @@ -103,64 +92,99 @@ public static Svd create(Scope scope, Operand input, Opt } } } - return new Svd(opBuilder.build()); + return new Svd<>(opBuilder.build()); } - + /** + * Sets the computeUv option. + * * @param computeUv If true, left and right singular vectors will be - * computed and returned in `u` and `v`, respectively. - * If false, `u` and `v` are not set and should never referenced. + * computed and returned in {@code u} and {@code v}, respectively. + * If false, {@code u} and {@code v} are not set and should never referenced. + * @return this Options instance. */ public static Options computeUv(Boolean computeUv) { return new Options().computeUv(computeUv); } - + /** - * @param fullMatrices If true, compute full-sized `u` and `v`. If false - * (the default), compute only the leading `P` singular vectors. - * Ignored if `compute_uv` is `False`. + * Sets the fullMatrices option. + * + * @param fullMatrices If true, compute full-sized {@code u} and {@code v}. If false + * (the default), compute only the leading {@code P} singular vectors. + * Ignored if {@code compute_uv} is {@code False}. + * @return this Options instance. */ public static Options fullMatrices(Boolean fullMatrices) { return new Options().fullMatrices(fullMatrices); } - + /** - * Singular values. Shape is `[..., P]`. + * Gets s. + * Singular values. Shape is {@code [..., P]}. + * @return s. */ public Output s() { return s; } - + /** - * Left singular vectors. If `full_matrices` is `False` then shape is - * `[..., M, P]`; if `full_matrices` is `True` then shape is - * `[..., M, M]`. Undefined if `compute_uv` is `False`. + * Gets u. + * Left singular vectors. If {@code full_matrices} is {@code False} then shape is + * {@code [..., M, P]}; if {@code full_matrices} is {@code True} then shape is + * {@code [..., M, M]}. Undefined if {@code compute_uv} is {@code False}. + * @return u. */ public Output u() { return u; } - + /** - * Left singular vectors. If `full_matrices` is `False` then shape is - * `[..., N, P]`. If `full_matrices` is `True` then shape is `[..., N, N]`. - * Undefined if `compute_uv` is false. + * Gets v. + * Left singular vectors. If {@code full_matrices} is {@code False} then shape is + * {@code [..., N, P]}. If {@code full_matrices} is {@code True} then shape is {@code [..., N, N]}. + * Undefined if {@code compute_uv} is false. + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Svd"; - - private Output s; - private Output u; - private Output v; - - private Svd(Operation operation) { - super(operation); - int outputIdx = 0; - s = operation.output(outputIdx++); - u = operation.output(outputIdx++); - v = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.Svd} + */ + public static class Options { + private Boolean computeUv; + + private Boolean fullMatrices; + + private Options() { + } + + /** + * Sets the computeUv option. + * + * @param computeUv If true, left and right singular vectors will be + * computed and returned in {@code u} and {@code v}, respectively. + * If false, {@code u} and {@code v} are not set and should never referenced. + * @return this Options instance. + */ + public Options computeUv(Boolean computeUv) { + this.computeUv = computeUv; + return this; + } + + /** + * Sets the fullMatrices option. + * + * @param fullMatrices If true, compute full-sized {@code u} and {@code v}. If false + * (the default), compute only the leading {@code P} singular vectors. + * Ignored if {@code compute_uv} is {@code False}. + * @return this Options instance. + */ + public Options fullMatrices(Boolean fullMatrices) { + this.fullMatrices = fullMatrices; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiag.java index 13dfe42f962..29f5a142746 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiag.java @@ -29,64 +29,68 @@ /** * 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 data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class TensorDiag extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorDiag operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Diag"; + + private Output output; + + private TensorDiag(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Diag operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TensorDiag create(Scope scope, Operand diagonal) { OperationBuilder opBuilder = scope.env().opBuilder("Diag", scope.makeOpName("TensorDiag")); opBuilder.addInput(diagonal.asOutput()); opBuilder = scope.apply(opBuilder); - return new TensorDiag(opBuilder.build()); + return new TensorDiag<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Diag"; - - private Output output; - - private TensorDiag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiagPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiagPart.java index ee7010dd7e6..0ec6ee1c92b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiagPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TensorDiagPart.java @@ -29,66 +29,69 @@ /** * 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]
- * }
- * - * - * @param data type for {@code diagonal()} output + * + * tf.diag_part(input) ==> [1, 2, 3, 4] + *
+ * + * @param data type for {@code diagonal} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class TensorDiagPart extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorDiagPart operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DiagPart"; + + private Output diagonal; + + private TensorDiagPart(Operation operation) { + super(operation); + int outputIdx = 0; + diagonal = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new DiagPart operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TensorDiagPart create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("DiagPart", scope.makeOpName("TensorDiagPart")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new TensorDiagPart(opBuilder.build()); + return new TensorDiagPart<>(opBuilder.build()); } - + /** + * Gets diagonal. * The extracted diagonal. + * @return diagonal. */ public Output diagonal() { return diagonal; } - + @Override public Output asOutput() { return diagonal; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DiagPart"; - - private Output diagonal; - - private TensorDiagPart(Operation operation) { - super(operation); - int outputIdx = 0; - diagonal = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Transpose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Transpose.java index 41d9c28d9d2..ecec93ee1b2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Transpose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Transpose.java @@ -30,51 +30,60 @@ /** * 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]` - * - * @param data type for {@code y()} output + * 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 */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class Transpose extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Transpose"; + + private Output y; + + private Transpose(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Transpose operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Transpose create(Scope scope, Operand x, Operand perm) { + @Endpoint( + describeByClass = true + ) + public static Transpose create(Scope scope, Operand x, + Operand perm) { OperationBuilder opBuilder = scope.env().opBuilder("Transpose", scope.makeOpName("Transpose")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(perm.asOutput()); opBuilder = scope.apply(opBuilder); - return new Transpose(opBuilder.build()); + return new Transpose<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Transpose"; - - private Output y; - - private Transpose(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TriangularSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TriangularSolve.java index 03bb6f86426..63d24dd8554 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TriangularSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TriangularSolve.java @@ -29,104 +29,83 @@ /** * 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, N]`. - *

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

- * Note, the batch shapes for the inputs only need to broadcast. - *

- * 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],
  *                  [1,  1,  1,  1]], dtype=tf.float32)
- * 
+ *
  * b = tf.constant([[4],
  *                  [2],
  *                  [4],
  *                  [2]], dtype=tf.float32)
- * 
+ *
  * 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)
- * # 
- * }
- * - * - * @param data type for {@code output()} output + * # [1.9999999]], dtype=float32)> + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "linalg") +@Operator( + group = "linalg" +) public final class TriangularSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.TriangularSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param lower Boolean indicating whether the innermost matrices in `matrix` are - * lower or upper triangular. - */ - public Options lower(Boolean lower) { - this.lower = lower; - return this; - } - - /** - * @param adjoint Boolean indicating whether to solve with `matrix` or its (block-wise) - * adjoint. - *

- * @compatibility(numpy) - * Equivalent to scipy.linalg.solve_triangular - * @end_compatibility - */ - public Options adjoint(Boolean adjoint) { - this.adjoint = adjoint; - return this; - } - - private Boolean lower; - private Boolean adjoint; - - private Options() { - } + public static final String OP_NAME = "MatrixTriangularSolve"; + + private Output output; + + private TriangularSolve(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TriangularSolve operation. - * + * Factory method to create a class wrapping a new MatrixTriangularSolve operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static TriangularSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TriangularSolve create(Scope scope, Operand matrix, + Operand rhs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixTriangularSolve", scope.makeOpName("TriangularSolve")); opBuilder.addInput(matrix.asOutput()); opBuilder.addInput(rhs.asOutput()); @@ -141,49 +120,84 @@ public static TriangularSolve create(Scope scope, Operand(opBuilder.build()); + return new TriangularSolve<>(opBuilder.build()); } - + /** - * @param lower Boolean indicating whether the innermost matrices in `matrix` are + * Sets the lower option. + * + * @param lower Boolean indicating whether the innermost matrices in {@code matrix} are * lower or upper triangular. + * @return this Options instance. */ public static Options lower(Boolean lower) { return new Options().lower(lower); } - + /** - * @param adjoint Boolean indicating whether to solve with `matrix` or its (block-wise) - * adjoint. - *

- * @compatibility(numpy) + * Sets the adjoint option. + * + * @param adjoint Boolean indicating whether to solve with {@code matrix} or its (block-wise) + * adjoint. + *

{@literal @}compatibility(numpy)
* Equivalent to scipy.linalg.solve_triangular - * @end_compatibility + *
{@literal @}end_compatibility + * @return this Options instance. */ public static Options adjoint(Boolean adjoint) { return new Options().adjoint(adjoint); } - + /** - * Shape is `[..., M, K]`. + * Gets output. + * Shape is {@code [..., M, K]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MatrixTriangularSolve"; - - private Output output; - - private TriangularSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.TriangularSolve} + */ + public static class Options { + private Boolean lower; + + private Boolean adjoint; + + private Options() { + } + + /** + * Sets the lower option. + * + * @param lower Boolean indicating whether the innermost matrices in {@code matrix} are + * lower or upper triangular. + * @return this Options instance. + */ + public Options lower(Boolean lower) { + this.lower = lower; + return this; + } + + /** + * Sets the adjoint option. + * + * @param adjoint Boolean indicating whether to solve with {@code matrix} or its (block-wise) + * adjoint. + *

{@literal @}compatibility(numpy)
+ * Equivalent to scipy.linalg.solve_triangular + *
{@literal @}end_compatibility + * @return this Options instance. + */ + public Options adjoint(Boolean adjoint) { + this.adjoint = adjoint; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalMatMul.java index 6a77d00f8d1..c7e17d347e2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalMatMul.java @@ -24,63 +24,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Calculate product with tridiagonal matrix. - *

* Calculates product of two matrices, where left matrix is a tridiagonal matrix. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class TridiagonalMatMul extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TridiagonalMatMul"; + + private Output output; + + private TridiagonalMatMul(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TridiagonalMatMul operation. - * + * * @param scope current scope - * @param superdiag Tensor of shape `[..., 1, M]`, representing superdiagonals of + * @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 `[..., 1, M]`, representing main diagonals of tri-diagonal + * @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 `[..., 1, M]`, representing subdiagonals of tri-diagonal + * @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 `[..., M, N]`, representing MxN matrices to the right of + * @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 */ - @Endpoint(describeByClass = true) - public static TridiagonalMatMul create(Scope scope, Operand superdiag, Operand maindiag, Operand subdiag, Operand rhs) { + @Endpoint( + describeByClass = true + ) + public static TridiagonalMatMul create(Scope scope, Operand superdiag, + Operand maindiag, Operand subdiag, Operand rhs) { OperationBuilder opBuilder = scope.env().opBuilder("TridiagonalMatMul", scope.makeOpName("TridiagonalMatMul")); opBuilder.addInput(superdiag.asOutput()); opBuilder.addInput(maindiag.asOutput()); opBuilder.addInput(subdiag.asOutput()); opBuilder.addInput(rhs.asOutput()); opBuilder = scope.apply(opBuilder); - return new TridiagonalMatMul(opBuilder.build()); + return new TridiagonalMatMul<>(opBuilder.build()); } - + /** - * Tensor of shape `[..., M, N]` containing the product. + * Gets output. + * Tensor of shape {@code [..., M, N]} containing the product. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TridiagonalMatMul"; - - private Output output; - - private TridiagonalMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalSolve.java index 2b379d46d5e..f2e37cd217b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/TridiagonalSolve.java @@ -24,59 +24,53 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * 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 `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 data type for {@code output()} output + * 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 data type for {@code output} output */ public final class TridiagonalSolve extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.TridiagonalSolve} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param partialPivoting Whether to apply partial pivoting. Partial pivoting makes the procedure more - * stable, but slower. - */ - public Options partialPivoting(Boolean partialPivoting) { - this.partialPivoting = partialPivoting; - return this; - } - - private Boolean partialPivoting; - - private Options() { - } + public static final String OP_NAME = "TridiagonalSolve"; + + private Output output; + + private TridiagonalSolve(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TridiagonalSolve operation. - * + * * @param scope current scope - * @param diagonals Tensor of shape `[..., 3, M]` whose innermost 2 dimensions represent the + * @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 `[..., M, K]`, representing K right-hand sides per each + * @param rhs Tensor of shape {@code [..., M, K]}, representing K right-hand sides per each * left-hand side. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TridiagonalSolve} output and operands * @return a new instance of TridiagonalSolve */ - @Endpoint(describeByClass = true) - public static TridiagonalSolve create(Scope scope, Operand diagonals, Operand rhs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TridiagonalSolve create(Scope scope, Operand diagonals, + Operand rhs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TridiagonalSolve", scope.makeOpName("TridiagonalSolve")); opBuilder.addInput(diagonals.asOutput()); opBuilder.addInput(rhs.asOutput()); @@ -88,37 +82,53 @@ public static TridiagonalSolve create(Scope scope, Operand< } } } - return new TridiagonalSolve(opBuilder.build()); + return new TridiagonalSolve<>(opBuilder.build()); } - + /** + * Sets the partialPivoting option. + * * @param partialPivoting Whether to apply partial pivoting. Partial pivoting makes the procedure more * stable, but slower. + * @return this Options instance. */ public static Options partialPivoting(Boolean partialPivoting) { return new Options().partialPivoting(partialPivoting); } - + /** - * Tensor of shape `[..., M, K]` containing the solutions + * Gets output. + * Tensor of shape {@code [..., M, K]} containing the solutions + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TridiagonalSolve"; - - private Output output; - - private TridiagonalSolve(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.TridiagonalSolve} + */ + public static class Options { + private Boolean partialPivoting; + + private Options() { + } + + /** + * Sets the partialPivoting option. + * + * @param partialPivoting Whether to apply partial pivoting. Partial pivoting makes the procedure more + * stable, but slower. + * @return this Options instance. + */ + public Options partialPivoting(Boolean partialPivoting) { + this.partialPivoting = partialPivoting; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixComponents.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixComponents.java index 5f215d1e8b1..ea4b548550d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixComponents.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixComponents.java @@ -25,72 +25,83 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** - * Reads out the CSR components at batch `index`. - *

+ * 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 data type for {@code values()} output + * + * @param data type for {@code values} output */ public final class CSRSparseMatrixComponents extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CSRSparseMatrixComponents"; + + private Output rowPtrs; + + private Output colInds; + + private Output values; + + private CSRSparseMatrixComponents(Operation operation) { + super(operation); + int outputIdx = 0; + rowPtrs = operation.output(outputIdx++); + colInds = operation.output(outputIdx++); + values = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CSRSparseMatrixComponents operation. - * + * * @param scope current scope * @param csrSparseMatrix A batched CSRSparseMatrix. - * @param index The index in `csr_sparse_matrix`'s batch. - * @param type + * @param index The index in {@code csr_sparse_matrix}'s batch. + * @param type the value of the type property + * @param data type for {@code CSRSparseMatrixComponents} output and operands * @return a new instance of CSRSparseMatrixComponents */ - @Endpoint(describeByClass = true) - public static CSRSparseMatrixComponents create(Scope scope, Operand csrSparseMatrix, Operand index, Class type) { + @Endpoint( + describeByClass = true + ) + public static CSRSparseMatrixComponents create(Scope scope, + Operand csrSparseMatrix, Operand index, Class type) { OperationBuilder opBuilder = scope.env().opBuilder("CSRSparseMatrixComponents", scope.makeOpName("CSRSparseMatrixComponents")); opBuilder.addInput(csrSparseMatrix.asOutput()); opBuilder.addInput(index.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); - return new CSRSparseMatrixComponents(opBuilder.build()); + return new CSRSparseMatrixComponents<>(opBuilder.build()); } - + /** + * Gets rowPtrs. * An array containing CSR matrix row pointers. + * @return rowPtrs. */ public Output rowPtrs() { return rowPtrs; } - + /** + * Gets colInds. * An array containing CSR matrix column indices. + * @return colInds. */ public Output colInds() { return colInds; } - + /** + * Gets values. * An array containing CSR matrix nonzero values. + * @return values. */ public Output values() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSRSparseMatrixComponents"; - - private Output rowPtrs; - private Output colInds; - private Output values; - - private CSRSparseMatrixComponents(Operation operation) { - super(operation); - int outputIdx = 0; - rowPtrs = operation.output(outputIdx++); - colInds = operation.output(outputIdx++); - values = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToDense.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToDense.java index 2c42786fb53..cc8ac477876 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToDense.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToDense.java @@ -25,53 +25,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Convert a (possibly batched) CSRSparseMatrix to dense. - * - * @param data type for {@code denseOutput()} output + * + * @param data type for {@code dense_output} output */ public final class CSRSparseMatrixToDense extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CSRSparseMatrixToDense"; + + private Output denseOutput; + + private CSRSparseMatrixToDense(Operation operation) { + super(operation); + int outputIdx = 0; + denseOutput = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CSRSparseMatrixToDense operation. - * + * * @param scope current scope * @param sparseInput A batched CSRSparseMatrix. - * @param type + * @param type the value of the type property + * @param data type for {@code CSRSparseMatrixToDense} output and operands * @return a new instance of CSRSparseMatrixToDense */ - @Endpoint(describeByClass = true) - public static CSRSparseMatrixToDense create(Scope scope, Operand sparseInput, Class type) { + @Endpoint( + describeByClass = true + ) + public static CSRSparseMatrixToDense create(Scope scope, + Operand sparseInput, Class type) { OperationBuilder opBuilder = scope.env().opBuilder("CSRSparseMatrixToDense", scope.makeOpName("CSRSparseMatrixToDense")); opBuilder.addInput(sparseInput.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); - return new CSRSparseMatrixToDense(opBuilder.build()); + return new CSRSparseMatrixToDense<>(opBuilder.build()); } - + /** + * Gets denseOutput. * A dense tensor. + * @return denseOutput. */ public Output denseOutput() { return denseOutput; } - + @Override public Output asOutput() { return denseOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSRSparseMatrixToDense"; - - private Output denseOutput; - - private CSRSparseMatrixToDense(Operation operation) { - super(operation); - int outputIdx = 0; - denseOutput = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToSparseTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToSparseTensor.java index 3b88662432f..553480c9462 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToSparseTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/CSRSparseMatrixToSparseTensor.java @@ -25,67 +25,79 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Converts a (possibly batched) CSRSparesMatrix to a SparseTensor. - * - * @param data type for {@code values()} output + * + * @param data type for {@code values} output */ public final class CSRSparseMatrixToSparseTensor extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CSRSparseMatrixToSparseTensor"; + + private Output indices; + + private Output values; + + private Output denseShape; + + private CSRSparseMatrixToSparseTensor(Operation operation) { + super(operation); + int outputIdx = 0; + indices = operation.output(outputIdx++); + values = operation.output(outputIdx++); + denseShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CSRSparseMatrixToSparseTensor operation. - * + * * @param scope current scope * @param sparseMatrix A (possibly batched) CSRSparseMatrix. - * @param type + * @param type the value of the type property + * @param data type for {@code CSRSparseMatrixToSparseTensor} output and operands * @return a new instance of CSRSparseMatrixToSparseTensor */ - @Endpoint(describeByClass = true) - public static CSRSparseMatrixToSparseTensor create(Scope scope, Operand sparseMatrix, Class type) { + @Endpoint( + describeByClass = true + ) + public static CSRSparseMatrixToSparseTensor create(Scope scope, + Operand sparseMatrix, Class type) { OperationBuilder opBuilder = scope.env().opBuilder("CSRSparseMatrixToSparseTensor", scope.makeOpName("CSRSparseMatrixToSparseTensor")); opBuilder.addInput(sparseMatrix.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); - return new CSRSparseMatrixToSparseTensor(opBuilder.build()); + return new CSRSparseMatrixToSparseTensor<>(opBuilder.build()); } - + /** + * Gets indices. * SparseTensor indices. + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets values. * SparseTensor values. + * @return values. */ public Output values() { return values; } - + /** + * Gets denseShape. * SparseTensor dense shape. + * @return denseShape. */ public Output denseShape() { return denseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CSRSparseMatrixToSparseTensor"; - - private Output indices; - private Output values; - private Output denseShape; - - private CSRSparseMatrixToSparseTensor(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - values = operation.output(outputIdx++); - denseShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/DenseToCSRSparseMatrix.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/DenseToCSRSparseMatrix.java index f380826f82d..982450f9174 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/DenseToCSRSparseMatrix.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/DenseToCSRSparseMatrix.java @@ -24,7 +24,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -32,45 +31,52 @@ * Converts a dense tensor to a (possibly batched) CSRSparseMatrix. */ public final class DenseToCSRSparseMatrix extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DenseToCSRSparseMatrix"; + + private Output sparseOutput; + + @SuppressWarnings("unchecked") + private DenseToCSRSparseMatrix(Operation operation) { + super(operation); + int outputIdx = 0; + sparseOutput = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DenseToCSRSparseMatrix operation. - * + * * @param scope current scope * @param denseInput A Dense tensor. * @param indices Indices of nonzero elements. * @return a new instance of DenseToCSRSparseMatrix */ - @Endpoint(describeByClass = true) - public static DenseToCSRSparseMatrix create(Scope scope, Operand denseInput, Operand indices) { + @Endpoint( + describeByClass = true + ) + public static DenseToCSRSparseMatrix create(Scope scope, Operand denseInput, + Operand indices) { OperationBuilder opBuilder = scope.env().opBuilder("DenseToCSRSparseMatrix", scope.makeOpName("DenseToCSRSparseMatrix")); opBuilder.addInput(denseInput.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder = scope.apply(opBuilder); return new DenseToCSRSparseMatrix(opBuilder.build()); } - + /** + * Gets sparseOutput. * A (possibly batched) CSRSparseMatrix. + * @return sparseOutput. */ - public Output sparseOutput() { + public Output sparseOutput() { return sparseOutput; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) sparseOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseToCSRSparseMatrix"; - - private Output sparseOutput; - - private DenseToCSRSparseMatrix(Operation operation) { - super(operation); - int outputIdx = 0; - sparseOutput = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixAdd.java index dca9b41ab13..2aa740b9c1c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixAdd.java @@ -24,29 +24,44 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * 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). */ public final class SparseMatrixAdd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseMatrixAdd"; + + private Output c; + + @SuppressWarnings("unchecked") + private SparseMatrixAdd(Operation operation) { + super(operation); + int outputIdx = 0; + c = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixAdd operation. - * + * * @param scope current scope * @param a A CSRSparseMatrix. * @param b A CSRSparseMatrix. * @param alpha A constant scalar. * @param beta A constant scalar. + * @param data type for {@code SparseMatrixAdd} output and operands * @return a new instance of SparseMatrixAdd */ - @Endpoint(describeByClass = true) - public static SparseMatrixAdd create(Scope scope, Operand a, Operand b, Operand alpha, Operand beta) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixAdd create(Scope scope, Operand a, + Operand b, Operand alpha, Operand beta) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixAdd", scope.makeOpName("SparseMatrixAdd")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -55,28 +70,19 @@ public static SparseMatrixAdd create(Scope scope, Operand a opBuilder = scope.apply(opBuilder); return new SparseMatrixAdd(opBuilder.build()); } - + /** + * Gets c. * A CSRSparseMatrix. + * @return c. */ - public Output c() { + public Output c() { return c; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) c; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixAdd"; - - private Output c; - - private SparseMatrixAdd(Operation operation) { - super(operation); - int outputIdx = 0; - c = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMatMul.java index ee5bf50586c..021e86bf4d1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMatMul.java @@ -24,116 +24,63 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * 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 data type for {@code output} output */ public final class SparseMatrixMatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA Indicates whether `a` should be transposed. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB Indicates whether `b` should be transposed. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param adjointA Indicates whether `a` should be conjugate-transposed. - */ - public Options adjointA(Boolean adjointA) { - this.adjointA = adjointA; - return this; - } - - /** - * @param adjointB Indicates whether `b` should be conjugate-transposed. - */ - public Options adjointB(Boolean adjointB) { - this.adjointB = adjointB; - return this; - } - - /** - * @param transposeOutput Transposes the product of `a` and `b`. - */ - public Options transposeOutput(Boolean transposeOutput) { - this.transposeOutput = transposeOutput; - return this; - } - - /** - * @param conjugateOutput Conjugates the product of `a` and `b`. - */ - public Options conjugateOutput(Boolean conjugateOutput) { - this.conjugateOutput = conjugateOutput; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private Boolean adjointA; - private Boolean adjointB; - private Boolean transposeOutput; - private Boolean conjugateOutput; - - private Options() { - } + public static final String OP_NAME = "SparseMatrixMatMul"; + + private Output output; + + private SparseMatrixMatMul(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseMatrixMatMul operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SparseMatrixMatMul create(Scope scope, Operand a, Operand b, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixMatMul create(Scope scope, + Operand a, Operand b, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixMatMul", scope.makeOpName("SparseMatrixMatMul")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -160,71 +107,166 @@ public static SparseMatrixMatMul create(Scope scope, Operan } } } - return new SparseMatrixMatMul(opBuilder.build()); + return new SparseMatrixMatMul<>(opBuilder.build()); } - + /** - * @param transposeA Indicates whether `a` should be transposed. + * Sets the transposeA option. + * + * @param transposeA Indicates whether {@code a} should be transposed. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB Indicates whether `b` should be transposed. + * Sets the transposeB option. + * + * @param transposeB Indicates whether {@code b} should be transposed. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param adjointA Indicates whether `a` should be conjugate-transposed. + * Sets the adjointA option. + * + * @param adjointA Indicates whether {@code a} should be conjugate-transposed. + * @return this Options instance. */ public static Options adjointA(Boolean adjointA) { return new Options().adjointA(adjointA); } - + /** - * @param adjointB Indicates whether `b` should be conjugate-transposed. + * Sets the adjointB option. + * + * @param adjointB Indicates whether {@code b} should be conjugate-transposed. + * @return this Options instance. */ public static Options adjointB(Boolean adjointB) { return new Options().adjointB(adjointB); } - + /** - * @param transposeOutput Transposes the product of `a` and `b`. + * Sets the transposeOutput option. + * + * @param transposeOutput Transposes the product of {@code a} and {@code b}. + * @return this Options instance. */ public static Options transposeOutput(Boolean transposeOutput) { return new Options().transposeOutput(transposeOutput); } - + /** - * @param conjugateOutput Conjugates the product of `a` and `b`. + * Sets the conjugateOutput option. + * + * @param conjugateOutput Conjugates the product of {@code a} and {@code b}. + * @return this Options instance. */ public static Options conjugateOutput(Boolean conjugateOutput) { return new Options().conjugateOutput(conjugateOutput); } - + /** + * Gets output. * A dense output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixMatMul"; - - private Output output; - - private SparseMatrixMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixMatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Boolean adjointA; + + private Boolean adjointB; + + private Boolean transposeOutput; + + private Boolean conjugateOutput; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA Indicates whether {@code a} should be transposed. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB Indicates whether {@code b} should be transposed. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the adjointA option. + * + * @param adjointA Indicates whether {@code a} should be conjugate-transposed. + * @return this Options instance. + */ + public Options adjointA(Boolean adjointA) { + this.adjointA = adjointA; + return this; + } + + /** + * Sets the adjointB option. + * + * @param adjointB Indicates whether {@code b} should be conjugate-transposed. + * @return this Options instance. + */ + public Options adjointB(Boolean adjointB) { + this.adjointB = adjointB; + return this; + } + + /** + * Sets the transposeOutput option. + * + * @param transposeOutput Transposes the product of {@code a} and {@code b}. + * @return this Options instance. + */ + public Options transposeOutput(Boolean transposeOutput) { + this.transposeOutput = transposeOutput; + return this; + } + + /** + * Sets the conjugateOutput option. + * + * @param conjugateOutput Conjugates the product of {@code a} and {@code b}. + * @return this Options instance. + */ + public Options conjugateOutput(Boolean conjugateOutput) { + this.conjugateOutput = conjugateOutput; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMul.java index 0939b31939c..4a9591186f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixMul.java @@ -24,61 +24,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * 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. */ public final class SparseMatrixMul extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseMatrixMul"; + + private Output output; + + @SuppressWarnings("unchecked") + private SparseMatrixMul(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixMul operation. - * + * * @param scope current scope * @param a A CSRSparseMatrix. * @param b A dense tensor. * @return a new instance of SparseMatrixMul */ - @Endpoint(describeByClass = true) - public static SparseMatrixMul create(Scope scope, Operand a, Operand b) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixMul create(Scope scope, Operand a, + Operand b) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixMul", scope.makeOpName("SparseMatrixMul")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder = scope.apply(opBuilder); return new SparseMatrixMul(opBuilder.build()); } - + /** + * Gets output. * A dense output tensor. + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixMul"; - - private Output output; - - private SparseMatrixMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixNNZ.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixNNZ.java index a39b5cd941c..25bcb71d722 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixNNZ.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixNNZ.java @@ -24,49 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** - * Returns the number of nonzeroes of `sparse_matrix`. + * Returns the number of nonzeroes of {@code sparse_matrix}. */ public final class SparseMatrixNNZ extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseMatrixNNZ"; + + private Output nnz; + + private SparseMatrixNNZ(Operation operation) { + super(operation); + int outputIdx = 0; + nnz = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixNNZ operation. - * + * * @param scope current scope * @param sparseMatrix A CSRSparseMatrix. * @return a new instance of SparseMatrixNNZ */ - @Endpoint(describeByClass = true) - public static SparseMatrixNNZ create(Scope scope, Operand sparseMatrix) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixNNZ create(Scope scope, Operand sparseMatrix) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixNNZ", scope.makeOpName("SparseMatrixNNZ")); opBuilder.addInput(sparseMatrix.asOutput()); opBuilder = scope.apply(opBuilder); return new SparseMatrixNNZ(opBuilder.build()); } - + /** - * The number of nonzeroes of `sparse_matrix`. + * Gets nnz. + * The number of nonzeroes of {@code sparse_matrix}. + * @return nnz. */ public Output nnz() { return nnz; } - + @Override public Output asOutput() { return nnz; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixNNZ"; - - private Output nnz; - - private SparseMatrixNNZ(Operation operation) { - super(operation); - int outputIdx = 0; - nnz = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixOrderingAMD.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixOrderingAMD.java index f440f3fccc7..2e3c95d2db8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixOrderingAMD.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixOrderingAMD.java @@ -24,97 +24,95 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** - * 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]])
  *     a_values = np.array([1.0, 2.0, 1.0, 3.0, 4.0], np.float32)
  *     a_dense_shape = [4, 4]
- * 
+ *
  *     with tf.Session() as sess:
  *       # Define (COO format) SparseTensor over Numpy array.
  *       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(
  *           a_st.indices, a_st.values, a_st.dense_shape)
- * 
+ *
  *       # Obtain the AMD Ordering for the CSR 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}. */ public final class SparseMatrixOrderingAMD extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseMatrixOrderingAMD"; + + private Output output; + + private SparseMatrixOrderingAMD(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixOrderingAMD operation. - * + * * @param scope current scope - * @param input A `CSRSparseMatrix`. + * @param input A {@code CSRSparseMatrix}. * @return a new instance of SparseMatrixOrderingAMD */ - @Endpoint(describeByClass = true) - public static SparseMatrixOrderingAMD create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixOrderingAMD create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixOrderingAMD", scope.makeOpName("SparseMatrixOrderingAMD")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new SparseMatrixOrderingAMD(opBuilder.build()); } - + /** - * The Approximate Minimum Degree (AMD) ordering of `input`. + * Gets output. + * The Approximate Minimum Degree (AMD) ordering of {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixOrderingAMD"; - - private Output output; - - private SparseMatrixOrderingAMD(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmax.java index 973a63ade9d..c7edeac6eca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmax.java @@ -25,59 +25,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * 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). */ public final class SparseMatrixSoftmax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseMatrixSoftmax"; + + private Output softmax; + + @SuppressWarnings("unchecked") + private SparseMatrixSoftmax(Operation operation) { + super(operation); + int outputIdx = 0; + softmax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixSoftmax operation. - * + * * @param scope current scope * @param logits A CSRSparseMatrix. - * @param type + * @param type the value of the type property + * @param data type for {@code SparseMatrixSoftmax} output and operands * @return a new instance of SparseMatrixSoftmax */ - @Endpoint(describeByClass = true) - public static SparseMatrixSoftmax create(Scope scope, Operand logits, Class type) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixSoftmax create(Scope scope, + Operand logits, Class type) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixSoftmax", scope.makeOpName("SparseMatrixSoftmax")); opBuilder.addInput(logits.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); return new SparseMatrixSoftmax(opBuilder.build()); } - + /** + * Gets softmax. * A CSRSparseMatrix. + * @return softmax. */ - public Output softmax() { + public Output softmax() { return softmax; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) softmax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixSoftmax"; - - private Output softmax; - - private SparseMatrixSoftmax(Operation operation) { - super(operation); - int outputIdx = 0; - softmax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmaxGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmaxGrad.java index 3de1b6edc1b..b420c86cfa7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmaxGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSoftmaxGrad.java @@ -25,7 +25,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; @@ -33,18 +32,35 @@ * Calculates the gradient of the SparseMatrixSoftmax op. */ public final class SparseMatrixSoftmaxGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseMatrixSoftmaxGrad"; + + private Output gradient; + + @SuppressWarnings("unchecked") + private SparseMatrixSoftmaxGrad(Operation operation) { + super(operation); + int outputIdx = 0; + gradient = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixSoftmaxGrad operation. - * + * * @param scope current scope * @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 property + * @param data type for {@code SparseMatrixSoftmaxGrad} output and operands * @return a new instance of SparseMatrixSoftmaxGrad */ - @Endpoint(describeByClass = true) - public static SparseMatrixSoftmaxGrad create(Scope scope, Operand softmax, Operand gradSoftmax, Class type) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixSoftmaxGrad create(Scope scope, + Operand softmax, Operand gradSoftmax, Class type) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixSoftmaxGrad", scope.makeOpName("SparseMatrixSoftmaxGrad")); opBuilder.addInput(softmax.asOutput()); opBuilder.addInput(gradSoftmax.asOutput()); @@ -52,28 +68,19 @@ public static SparseMatrixSoftmaxGrad create(Scope scope, Op opBuilder.setAttr("type", Operands.toDataType(type)); return new SparseMatrixSoftmaxGrad(opBuilder.build()); } - + /** + * Gets gradient. * The output gradient. + * @return gradient. */ - public Output gradient() { + public Output gradient() { return gradient; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) gradient; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixSoftmaxGrad"; - - private Output gradient; - - private SparseMatrixSoftmaxGrad(Operation operation) { - super(operation); - int outputIdx = 0; - gradient = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseCholesky.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseCholesky.java index 91ec5e652a4..bfd4c8ad6a1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseCholesky.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseCholesky.java @@ -25,97 +25,106 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** - * 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]])
  *     a_values = np.array([1.0, 2.0, 1.0, 3.0, 4.0], np.float32)
  *     a_dense_shape = [4, 4]
- * 
+ *
  *     with tf.Session() as sess:
  *       # Define (COO format) SparseTensor over Numpy array.
  *       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(
  *           a_st.indices, a_st.values, a_st.dense_shape)
- * 
+ *
  *       # Obtain the Sparse Cholesky factor using AMD Ordering for reducing zero
  *       # fill-in (number of structural non-zeros in the sparse Cholesky factor).
  *       ordering_amd = sparse_csr_matrix_ops.sparse_matrix_ordering_amd(sparse_matrix)
  *       cholesky_sparse_matrices = (
  *           sparse_csr_matrix_ops.sparse_matrix_sparse_cholesky(
  *               sparse_matrix, ordering_amd, type=tf.float32))
- * 
+ *
  *       # Convert the CSRSparseMatrix Cholesky factor to a dense Tensor
  *       dense_cholesky = sparse_csr_matrix_ops.csr_sparse_matrix_to_dense(
  *           cholesky_sparse_matrices, tf.float32)
- * 
+ *
  *       # 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}. */ public final class SparseMatrixSparseCholesky extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseMatrixSparseCholesky"; + + private Output output; + + @SuppressWarnings("unchecked") + private SparseMatrixSparseCholesky(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixSparseCholesky operation. - * + * * @param scope current scope - * @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 property + * @param data type for {@code SparseMatrixSparseCholesky} output and operands * @return a new instance of SparseMatrixSparseCholesky */ - @Endpoint(describeByClass = true) - public static SparseMatrixSparseCholesky create(Scope scope, Operand input, Operand permutation, Class type) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixSparseCholesky create(Scope scope, + Operand input, Operand permutation, Class type) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixSparseCholesky", scope.makeOpName("SparseMatrixSparseCholesky")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(permutation.asOutput()); @@ -123,28 +132,19 @@ public static SparseMatrixSparseCholesky create(Scope scope, O opBuilder.setAttr("type", Operands.toDataType(type)); return new SparseMatrixSparseCholesky(opBuilder.build()); } - + /** - * The sparse Cholesky decompsition of `input`. + * Gets output. + * The sparse Cholesky decompsition of {@code input}. + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixSparseCholesky"; - - private Output output; - - private SparseMatrixSparseCholesky(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseMatMul.java index 2e47c1ca6ab..22b6bac7a83 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixSparseMatMul.java @@ -25,145 +25,108 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * 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]])
  *     a_values = np.array([1.0, 5.0, -1.0, -2.0], np.float32)
  *     a_dense_shape = [4, 5]
- * 
+ *
  *     b_indices = np.array([[0, 0], [3, 0], [3, 1]])
  *     b_values = np.array([2.0, 7.0, 8.0], np.float32)
  *     b_dense_shape = [5, 3]
- * 
+ *
  *     with tf.Session() as sess:
  *       # Define (COO format) Sparse Tensors over Numpy arrays
  *       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(
  *           a_st.indices, a_st.values, a_st.dense_shape)
  *       b_sm = sparse_csr_matrix_ops.sparse_tensor_to_csr_sparse_matrix(
  *           b_st.indices, b_st.values, b_st.dense_shape)
- * 
+ *
  *       # Compute the CSR SparseMatrix matrix multiplication
  *       c_sm = sparse_csr_matrix_ops.sparse_matrix_sparse_mat_mul(
  *           a=a_sm, b=b_sm, type=tf.float32)
- * 
+ *
  *       # Convert the CSR SparseMatrix product to a dense Tensor
  *       c_sm_dense = sparse_csr_matrix_ops.csr_sparse_matrix_to_dense(
  *           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. */ public final class SparseMatrixSparseMatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixSparseMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA Indicates whether `a` should be transposed. - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB Indicates whether `b` should be transposed. - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param adjointA Indicates whether `a` should be conjugate-transposed. - */ - public Options adjointA(Boolean adjointA) { - this.adjointA = adjointA; - return this; - } - - /** - * @param adjointB Indicates whether `b` should be conjugate-transposed. - */ - public Options adjointB(Boolean adjointB) { - this.adjointB = adjointB; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private Boolean adjointA; - private Boolean adjointB; - - private Options() { - } + public static final String OP_NAME = "SparseMatrixSparseMatMul"; + + private Output c; + + @SuppressWarnings("unchecked") + private SparseMatrixSparseMatMul(Operation operation) { + super(operation); + int outputIdx = 0; + c = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseMatrixSparseMatMul operation. - * + * * @param scope current scope * @param a A CSRSparseMatrix. * @param b A CSRSparseMatrix. - * @param type - * @param options carries optional attributes values + * @param type the value of the type property + * @param options carries optional attribute values + * @param data type for {@code SparseMatrixSparseMatMul} output and operands * @return a new instance of SparseMatrixSparseMatMul */ - @Endpoint(describeByClass = true) - public static SparseMatrixSparseMatMul create(Scope scope, Operand a, Operand b, Class type, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixSparseMatMul create(Scope scope, + Operand a, Operand b, Class type, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixSparseMatMul", scope.makeOpName("SparseMatrixSparseMatMul")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -187,56 +150,119 @@ public static SparseMatrixSparseMatMul create(Scope scope, Ope } return new SparseMatrixSparseMatMul(opBuilder.build()); } - + /** - * @param transposeA Indicates whether `a` should be transposed. + * Sets the transposeA option. + * + * @param transposeA Indicates whether {@code a} should be transposed. + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB Indicates whether `b` should be transposed. + * Sets the transposeB option. + * + * @param transposeB Indicates whether {@code b} should be transposed. + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param adjointA Indicates whether `a` should be conjugate-transposed. + * Sets the adjointA option. + * + * @param adjointA Indicates whether {@code a} should be conjugate-transposed. + * @return this Options instance. */ public static Options adjointA(Boolean adjointA) { return new Options().adjointA(adjointA); } - + /** - * @param adjointB Indicates whether `b` should be conjugate-transposed. + * Sets the adjointB option. + * + * @param adjointB Indicates whether {@code b} should be conjugate-transposed. + * @return this Options instance. */ public static Options adjointB(Boolean adjointB) { return new Options().adjointB(adjointB); } - + /** + * Gets c. * A CSRSparseMatrix. + * @return c. */ - public Output c() { + public Output c() { return c; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) c; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixSparseMatMul"; - - private Output c; - - private SparseMatrixSparseMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - c = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixSparseMatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Boolean adjointA; + + private Boolean adjointB; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA Indicates whether {@code a} should be transposed. + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB Indicates whether {@code b} should be transposed. + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the adjointA option. + * + * @param adjointA Indicates whether {@code a} should be conjugate-transposed. + * @return this Options instance. + */ + public Options adjointA(Boolean adjointA) { + this.adjointA = adjointA; + return this; + } + + /** + * Sets the adjointB option. + * + * @param adjointB Indicates whether {@code b} should be conjugate-transposed. + * @return this Options instance. + */ + public Options adjointB(Boolean adjointB) { + this.adjointB = adjointB; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixTranspose.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixTranspose.java index f1f71b33b4f..29432e58cf0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixTranspose.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixTranspose.java @@ -25,47 +25,43 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Transposes the inner (matrix) dimensions of a CSRSparseMatrix. - *

* Transposes the inner (matrix) dimensions of a SparseMatrix and optionally * conjugates its values. */ public final class SparseMatrixTranspose extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixTranspose} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param conjugate Indicates whether `input` should be conjugated. - */ - public Options conjugate(Boolean conjugate) { - this.conjugate = conjugate; - return this; - } - - private Boolean conjugate; - - private Options() { - } + public static final String OP_NAME = "SparseMatrixTranspose"; + + private Output output; + + @SuppressWarnings("unchecked") + private SparseMatrixTranspose(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseMatrixTranspose operation. - * + * * @param scope current scope * @param input A CSRSparseMatrix. - * @param type - * @param options carries optional attributes values + * @param type the value of the type property + * @param options carries optional attribute values + * @param data type for {@code SparseMatrixTranspose} output and operands * @return a new instance of SparseMatrixTranspose */ - @Endpoint(describeByClass = true) - public static SparseMatrixTranspose create(Scope scope, Operand input, Class type, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixTranspose create(Scope scope, + Operand input, Class type, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixTranspose", scope.makeOpName("SparseMatrixTranspose")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -79,35 +75,50 @@ public static SparseMatrixTranspose create(Scope scope, Operan } return new SparseMatrixTranspose(opBuilder.build()); } - + /** - * @param conjugate Indicates whether `input` should be conjugated. + * Sets the conjugate option. + * + * @param conjugate Indicates whether {@code input} should be conjugated. + * @return this Options instance. */ public static Options conjugate(Boolean conjugate) { return new Options().conjugate(conjugate); } - + /** + * Gets output. * A CSRSparseMatrix. + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixTranspose"; - - private Output output; - - private SparseMatrixTranspose(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.linalg.sparse.SparseMatrixTranspose} + */ + public static class Options { + private Boolean conjugate; + + private Options() { + } + + /** + * Sets the conjugate option. + * + * @param conjugate Indicates whether {@code input} should be conjugated. + * @return this Options instance. + */ + public Options conjugate(Boolean conjugate) { + this.conjugate = conjugate; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixZeros.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixZeros.java index eea60f2298a..81651bcd0f6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixZeros.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseMatrixZeros.java @@ -25,53 +25,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** - * Creates an all-zeros CSRSparseMatrix with shape `dense_shape`. + * Creates an all-zeros CSRSparseMatrix with shape {@code dense_shape}. */ public final class SparseMatrixZeros extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseMatrixZeros"; + + private Output sparseMatrix; + + @SuppressWarnings("unchecked") + private SparseMatrixZeros(Operation operation) { + super(operation); + int outputIdx = 0; + sparseMatrix = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseMatrixZeros operation. - * + * * @param scope current scope * @param denseShape The desired matrix shape. - * @param type + * @param type the value of the type property + * @param data type for {@code SparseMatrixZeros} output and operands * @return a new instance of SparseMatrixZeros */ - @Endpoint(describeByClass = true) - public static SparseMatrixZeros create(Scope scope, Operand denseShape, Class type) { + @Endpoint( + describeByClass = true + ) + public static SparseMatrixZeros create(Scope scope, Operand denseShape, + Class type) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatrixZeros", scope.makeOpName("SparseMatrixZeros")); opBuilder.addInput(denseShape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("type", Operands.toDataType(type)); return new SparseMatrixZeros(opBuilder.build()); } - + /** - * An empty CSR matrix with shape `dense_shape`. + * Gets sparseMatrix. + * An empty CSR matrix with shape {@code dense_shape}. + * @return sparseMatrix. */ - public Output sparseMatrix() { + public Output sparseMatrix() { return sparseMatrix; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) sparseMatrix; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatrixZeros"; - - private Output sparseMatrix; - - private SparseMatrixZeros(Operation operation) { - super(operation); - int outputIdx = 0; - sparseMatrix = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseTensorToCSRSparseMatrix.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseTensorToCSRSparseMatrix.java index 985d39b6ce5..357549e364e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseTensorToCSRSparseMatrix.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/sparse/SparseTensorToCSRSparseMatrix.java @@ -24,7 +24,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; @@ -32,18 +31,34 @@ * Converts a SparseTensor to a (possibly batched) CSRSparseMatrix. */ public final class SparseTensorToCSRSparseMatrix extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseTensorToCSRSparseMatrix"; + + private Output sparseMatrix; + + @SuppressWarnings("unchecked") + private SparseTensorToCSRSparseMatrix(Operation operation) { + super(operation); + int outputIdx = 0; + sparseMatrix = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseTensorToCSRSparseMatrix operation. - * + * * @param scope current scope * @param indices SparseTensor indices. * @param values SparseTensor values. * @param denseShape SparseTensor dense shape. * @return a new instance of SparseTensorToCSRSparseMatrix */ - @Endpoint(describeByClass = true) - public static SparseTensorToCSRSparseMatrix create(Scope scope, Operand indices, Operand values, Operand denseShape) { + @Endpoint( + describeByClass = true + ) + public static SparseTensorToCSRSparseMatrix create(Scope scope, Operand indices, + Operand values, Operand denseShape) { OperationBuilder opBuilder = scope.env().opBuilder("SparseTensorToCSRSparseMatrix", scope.makeOpName("SparseTensorToCSRSparseMatrix")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); @@ -51,28 +66,19 @@ public static SparseTensorToCSRSparseMatrix create(Scope scope, Operand opBuilder = scope.apply(opBuilder); return new SparseTensorToCSRSparseMatrix(opBuilder.build()); } - + /** + * Gets sparseMatrix. * A (possibly batched) CSRSparseMatrix. + * @return sparseMatrix. */ - public Output sparseMatrix() { + public Output sparseMatrix() { return sparseMatrix; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) sparseMatrix; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseTensorToCSRSparseMatrix"; - - private Output sparseMatrix; - - private SparseTensorToCSRSparseMatrix(Operation operation) { - super(operation); - int outputIdx = 0; - sparseMatrix = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Abs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Abs.java index dd31fbdc711..f29c1aedd64 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Abs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Abs.java @@ -29,50 +29,58 @@ /** * 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|\\). - * - * @param data type for {@code y()} output + * 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 */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Abs extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Abs"; + + private Output y; + + private Abs(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Abs operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Abs} output and operands * @return a new instance of Abs */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Abs create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Abs", scope.makeOpName("Abs")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Abs(opBuilder.build()); + return new Abs<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Abs"; - - private Output y; - - private Abs(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AccumulateN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AccumulateN.java index 1bfbe61fac9..11beca2b5a9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AccumulateN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AccumulateN.java @@ -31,57 +31,64 @@ /** * 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 + *

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 data type for {@code sum} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class AccumulateN extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new AccumulateN operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulateNV2"; + + private Output sum; + + private AccumulateN(Operation operation) { + super(operation); + int outputIdx = 0; + sum = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new AccumulateNV2 operation. + * * @param scope current scope - * @param inputs A list of `Tensor` objects, each with same shape and type. - * @param shape Shape of elements of `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 */ - @Endpoint(describeByClass = true) - public static AccumulateN create(Scope scope, Iterable> inputs, Shape shape) { + @Endpoint( + describeByClass = true + ) + public static AccumulateN create(Scope scope, Iterable> inputs, + Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("AccumulateNV2", scope.makeOpName("AccumulateN")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("shape", shape); - return new AccumulateN(opBuilder.build()); + return new AccumulateN<>(opBuilder.build()); } - + /** + * Gets sum. + * + * @return sum. */ public Output sum() { return sum; } - + @Override public Output asOutput() { return sum; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulateNV2"; - - private Output sum; - - private AccumulateN(Operation operation) { - super(operation); - int outputIdx = 0; - sum = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acos.java index 8e0c146d03b..d25c76a840f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acos.java @@ -29,52 +29,57 @@ /** * Computes acos of x element-wise. - *

- * - * Provided an input tensor, the `tf.math.acos` operation returns the inverse cosine of each element of the tensor. If `y = tf.math.cos(x)` then, `x = tf.math.acos(y)`. - *

- * Input range is `[-1, 1]` and the output has a range of `[0, pi]`. - * - * - * @param data type for {@code y()} output + * 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 */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Acos extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Acos"; + + private Output y; + + private Acos(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Acos operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Acos} output and operands * @return a new instance of Acos */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Acos create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Acos", scope.makeOpName("Acos")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Acos(opBuilder.build()); + return new Acos<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Acos"; - - private Output y; - - private Acos(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acosh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acosh.java index 64384fef1c0..a6170975930 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acosh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Acosh.java @@ -29,54 +29,61 @@ /** * 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 + * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Acosh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Acosh"; + + private Output y; + + private Acosh(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Acosh operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Acosh} output and operands * @return a new instance of Acosh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Acosh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Acosh", scope.makeOpName("Acosh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Acosh(opBuilder.build()); + return new Acosh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Acosh"; - - private Output y; - - private Acosh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Add.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Add.java index 5ec4a7e295a..a7072481217 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Add.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Add.java @@ -29,56 +29,61 @@ /** * 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) - *

- * Given two input tensors, the `tf.add` operation computes the sum for every element in the tensor. - *

- * Both input and output have a range `(-inf, inf)`. - * - * - * @param data type for {@code z()} output + * 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 data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Add extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Add"; + + private Output z; + + private Add(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Add operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Add create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Add", scope.makeOpName("Add")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Add(opBuilder.build()); + return new Add<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Add"; - - private Output z; - - private Add(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AddN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AddN.java index a29b27e2ce7..0519af46cb5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AddN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/AddN.java @@ -30,54 +30,60 @@ /** * 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 + * Inputs must be of same size and shape. + *
+ * x = [9, 7, 10]
+ * tf.math.add_n(x) ==> 26
+ * 
+ * + * @param data type for {@code sum} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class AddN extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AddN"; + + private Output sum; + + private AddN(Operation operation) { + super(operation); + int outputIdx = 0; + sum = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AddN operation. - * + * * @param scope current scope - * @param inputs + * @param inputs the inputs value + * @param data type for {@code AddN} output and operands * @return a new instance of AddN */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static AddN create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("AddN", scope.makeOpName("AddN")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); - return new AddN(opBuilder.build()); + return new AddN<>(opBuilder.build()); } - + /** + * Gets sum. + * + * @return sum. */ public Output sum() { return sum; } - + @Override public Output asOutput() { return sum; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AddN"; - - private Output sum; - - private AddN(Operation operation) { - super(operation); - int outputIdx = 0; - sum = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Angle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Angle.java index c92611dbc52..7a7a059538c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Angle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Angle.java @@ -32,76 +32,85 @@ /** * 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) + * tf.angle(input) ==> [2.0132, 1.056] + *
+ *

{@literal @}compatibility(numpy)
* Equivalent to np.angle. - * @end_compatibility - * - * @param data type for {@code output()} output + *
{@literal @}end_compatibility + * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Angle extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Angle"; + + private Output output; + + private Angle(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Angle operation. - * + * * @param scope current scope - * @param input - * @param Tout + * @param input the input value + * @param Tout the value of the Tout property + * @param data type for {@code Angle} output and operands * @return a new instance of Angle */ - @Endpoint(describeByClass = true) - public static Angle create(Scope scope, Operand input, Class Tout) { + @Endpoint( + describeByClass = true + ) + public static Angle create(Scope scope, Operand input, + Class Tout) { OperationBuilder opBuilder = scope.env().opBuilder("Angle", scope.makeOpName("Angle")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new Angle(opBuilder.build()); + return new Angle<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Angle operation using default output types. - * + * Factory method to create a class wrapping a new Angle operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Angle + * @param input the input value + * @return a new instance of Angle, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Angle create(Scope scope, Operand input) { return create(scope, input, TFloat32.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Angle"; - - private Output output; - - private Angle(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ApproximateEqual.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ApproximateEqual.java index 2a7ecb6b5d7..5da4254ff88 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ApproximateEqual.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ApproximateEqual.java @@ -29,41 +29,40 @@ import org.tensorflow.types.family.TType; /** - * Returns the truth value of abs(x-y) < tolerance element-wise. + * Returns the truth value of abs(x-y) < tolerance element-wise. */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class ApproximateEqual extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.ApproximateEqual} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tolerance - */ - public Options tolerance(Float tolerance) { - this.tolerance = tolerance; - return this; - } - - private Float tolerance; - - private Options() { - } + public static final String OP_NAME = "ApproximateEqual"; + + private Output z; + + private ApproximateEqual(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApproximateEqual operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static ApproximateEqual create(Scope scope, Operand x, Operand y, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApproximateEqual create(Scope scope, Operand x, Operand y, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApproximateEqual", scope.makeOpName("ApproximateEqual")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -77,33 +76,49 @@ public static ApproximateEqual create(Scope scope, Operand } return new ApproximateEqual(opBuilder.build()); } - + /** - * @param tolerance + * Sets the tolerance option. + * + * @param tolerance the tolerance option + * @return this Options instance. */ public static Options tolerance(Float tolerance) { return new Options().tolerance(tolerance); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApproximateEqual"; - - private Output z; - - private ApproximateEqual(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.ApproximateEqual} + */ + public static class Options { + private Float tolerance; + + private Options() { + } + + /** + * Sets the tolerance option. + * + * @param tolerance the tolerance option + * @return this Options instance. + */ + public Options tolerance(Float tolerance) { + this.tolerance = tolerance; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMax.java index 051a1645c72..3e9308f1a06 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMax.java @@ -32,80 +32,90 @@ /** * 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 + *

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 data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class ArgMax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ArgMax"; + + private Output output; + + private ArgMax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ArgMax operation. - * + * * @param scope current scope - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @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 property + * @param data type for {@code ArgMax} output and operands * @return a new instance of ArgMax */ - @Endpoint(describeByClass = true) - public static ArgMax create(Scope scope, Operand input, Operand dimension, Class outputType) { + @Endpoint( + describeByClass = true + ) + public static ArgMax create(Scope scope, Operand input, + Operand dimension, Class outputType) { OperationBuilder opBuilder = scope.env().opBuilder("ArgMax", scope.makeOpName("ArgMax")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(dimension.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_type", Operands.toDataType(outputType)); - return new ArgMax(opBuilder.build()); + return new ArgMax<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ArgMax operation using default output types. - * + * Factory method to create a class wrapping a new ArgMax operation, with the default output types. + * * @param scope current scope - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @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 ArgMax + * @return a new instance of ArgMax, with default output types */ - @Endpoint(describeByClass = true) - public static ArgMax create(Scope scope, Operand input, Operand dimension) { + @Endpoint( + describeByClass = true + ) + public static ArgMax create(Scope scope, Operand input, + Operand dimension) { return create(scope, input, dimension, TInt64.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ArgMax"; - - private Output output; - - private ArgMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMin.java index 8ff43dd5900..d72605944fc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ArgMin.java @@ -32,80 +32,90 @@ /** * 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 + *

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 data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class ArgMin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ArgMin"; + + private Output output; + + private ArgMin(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ArgMin operation. - * + * * @param scope current scope - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @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 property + * @param data type for {@code ArgMin} output and operands * @return a new instance of ArgMin */ - @Endpoint(describeByClass = true) - public static ArgMin create(Scope scope, Operand input, Operand dimension, Class outputType) { + @Endpoint( + describeByClass = true + ) + public static ArgMin create(Scope scope, Operand input, + Operand dimension, Class outputType) { OperationBuilder opBuilder = scope.env().opBuilder("ArgMin", scope.makeOpName("ArgMin")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(dimension.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_type", Operands.toDataType(outputType)); - return new ArgMin(opBuilder.build()); + return new ArgMin<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ArgMin operation using default output types. - * + * Factory method to create a class wrapping a new ArgMin operation, with the default output types. + * * @param scope current scope - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @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 */ - @Endpoint(describeByClass = true) - public static ArgMin create(Scope scope, Operand input, Operand dimension) { + @Endpoint( + describeByClass = true + ) + public static ArgMin create(Scope scope, Operand input, + Operand dimension) { return create(scope, input, dimension, TInt64.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ArgMin"; - - private Output output; - - private ArgMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asin.java index 0a4a3e7fc18..600d865afed 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asin.java @@ -29,62 +29,67 @@ /** * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Asin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Asin"; + + private Output y; + + private Asin(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Asin operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Asin} output and operands * @return a new instance of Asin */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Asin create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Asin", scope.makeOpName("Asin")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Asin(opBuilder.build()); + return new Asin<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Asin"; - - private Output y; - - private Asin(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asinh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asinh.java index 920f43774ed..f8b6fd84adc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asinh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Asinh.java @@ -29,56 +29,62 @@ /** * 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 + * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Asinh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Asinh"; + + private Output y; + + private Asinh(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Asinh operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Asinh} output and operands * @return a new instance of Asinh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Asinh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Asinh", scope.makeOpName("Asinh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Asinh(opBuilder.build()); + return new Asinh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Asinh"; - - private Output y; - - private Asinh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan.java index 07397b65f6b..85a6a0ef221 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan.java @@ -29,62 +29,67 @@ /** * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Atan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Atan"; + + private Output y; + + private Atan(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Atan operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Atan} output and operands * @return a new instance of Atan */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Atan create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Atan", scope.makeOpName("Atan")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Atan(opBuilder.build()); + return new Atan<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Atan"; - - private Output y; - - private Atan(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan2.java index e8ad73ca897..822425ac47a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atan2.java @@ -28,55 +28,63 @@ import org.tensorflow.types.family.TNumber; /** - * Computes arctangent of `y/x` element-wise, respecting signs of the arguments. - *

- * This is the angle \( \theta \in [-\pi, \pi] \) such that - * \[ x = r \cos(\theta) \] + * 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 + * [ y = r \sin(\theta) ] + * where (r = \sqrt(x^2 + y^2) ). + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Atan2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Atan2"; + + private Output z; + + private Atan2(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Atan2 operation. - * + * * @param scope current scope - * @param y - * @param x + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Atan2 create(Scope scope, Operand y, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Atan2", scope.makeOpName("Atan2")); opBuilder.addInput(y.asOutput()); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Atan2(opBuilder.build()); + return new Atan2<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Atan2"; - - private Output z; - - private Atan2(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atanh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atanh.java index e24a225e341..55bb3b613b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atanh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Atanh.java @@ -29,58 +29,64 @@ /** * 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 + * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Atanh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Atanh"; + + private Output y; + + private Atanh(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Atanh operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Atanh} output and operands * @return a new instance of Atanh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Atanh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Atanh", scope.makeOpName("Atanh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Atanh(opBuilder.build()); + return new Atanh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Atanh"; - - private Output y; - - private Atanh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0.java index ec9c56c199e..3c906b94eb0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselI0 operation + * + * @param data type for {@code y} output */ public final class BesselI0 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselI0"; + + private Output y; + + private BesselI0(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselI0 operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselI0} output and operands * @return a new instance of BesselI0 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselI0 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselI0", scope.makeOpName("BesselI0")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselI0(opBuilder.build()); + return new BesselI0<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselI0"; - - private Output y; - - private BesselI0(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0e.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0e.java index 26cfa68f377..be97c5a5715 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0e.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI0e.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselI0e operation + * + * @param data type for {@code y} output */ public final class BesselI0e extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselI0e"; + + private Output y; + + private BesselI0e(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselI0e operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselI0e} output and operands * @return a new instance of BesselI0e */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselI0e create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselI0e", scope.makeOpName("BesselI0e")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselI0e(opBuilder.build()); + return new BesselI0e<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselI0e"; - - private Output y; - - private BesselI0e(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1.java index 4eb2b0d38da..9b5c2e38932 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselI1 operation + * + * @param data type for {@code y} output */ public final class BesselI1 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselI1"; + + private Output y; + + private BesselI1(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselI1 operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselI1} output and operands * @return a new instance of BesselI1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselI1 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselI1", scope.makeOpName("BesselI1")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselI1(opBuilder.build()); + return new BesselI1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselI1"; - - private Output y; - - private BesselI1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1e.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1e.java index 8eed4770299..e79790decfd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1e.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/BesselI1e.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselI1e operation + * + * @param data type for {@code y} output */ public final class BesselI1e extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselI1e"; + + private Output y; + + private BesselI1e(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselI1e operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselI1e} output and operands * @return a new instance of BesselI1e */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselI1e create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselI1e", scope.makeOpName("BesselI1e")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselI1e(opBuilder.build()); + return new BesselI1e<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselI1e"; - - private Output y; - - private BesselI1e(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Betainc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Betainc.java index 86caad140d5..c7ba55995a5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Betainc.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Betainc.java @@ -28,62 +28,67 @@ import org.tensorflow.types.family.TNumber; /** - * 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 data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Betainc extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Betainc"; + + private Output z; + + private Betainc(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Betainc operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Betainc create(Scope scope, Operand a, Operand b, Operand x) { + @Endpoint( + describeByClass = true + ) + public static Betainc create(Scope scope, Operand a, Operand b, + Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Betainc", scope.makeOpName("Betainc")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Betainc(opBuilder.build()); + return new Betainc<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Betainc"; - - private Output z; - - private Betainc(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Bincount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Bincount.java index 9e8f03af4cc..aba2671e133 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Bincount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Bincount.java @@ -30,62 +30,69 @@ /** * 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 + * 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 data type for {@code bins} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Bincount extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Bincount"; + + private Output bins; + + private Bincount(Operation operation) { + super(operation); + int outputIdx = 0; + bins = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Bincount operation. - * + * * @param scope current scope - * @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 + * @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 */ - @Endpoint(describeByClass = true) - public static Bincount create(Scope scope, Operand arr, Operand size, Operand weights) { + @Endpoint( + describeByClass = true + ) + public static Bincount create(Scope scope, Operand arr, + Operand sizeOutput, Operand weights) { OperationBuilder opBuilder = scope.env().opBuilder("Bincount", scope.makeOpName("Bincount")); opBuilder.addInput(arr.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(weights.asOutput()); opBuilder = scope.apply(opBuilder); - return new Bincount(opBuilder.build()); + return new Bincount<>(opBuilder.build()); } - + /** - * 1D `Tensor` with length equal to `size`. The counts or summed weights for + * Gets bins. + * 1D {@code Tensor} with length equal to {@code size}. The counts or summed weights for * each value in the range [0, size). + * @return bins. */ public Output bins() { return bins; } - + @Override public Output asOutput() { return bins; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Bincount"; - - private Output bins; - - private Bincount(Operation operation) { - super(operation); - int outputIdx = 0; - bins = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ceil.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ceil.java index ab36643898b..e77f5356233 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ceil.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ceil.java @@ -29,46 +29,55 @@ /** * Returns element-wise smallest integer not less than x. - * - * @param data type for {@code y()} output + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Ceil extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Ceil"; + + private Output y; + + private Ceil(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Ceil operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Ceil} output and operands * @return a new instance of Ceil */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ceil create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Ceil", scope.makeOpName("Ceil")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Ceil(opBuilder.build()); + return new Ceil<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Ceil"; - - private Output y; - - private Ceil(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CompareAndBitpack.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CompareAndBitpack.java index 7a3ea0e193f..06c8f028453 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CompareAndBitpack.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CompareAndBitpack.java @@ -29,15 +29,13 @@ import org.tensorflow.types.family.TType; /** - * 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; + * Compare values of {@code input} to {@code threshold} and pack resulting bits into a {@code uint8}. + * Each comparison returns a boolean {@code true} (if {@code input_value > threshold}) + * or and {@code false} otherwise. + *

This operation is useful for Locality-Sensitive-Hashing (LSH) and other + * algorithms that use hashing approximations of cosine and {@code 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],
@@ -46,53 +44,61 @@
  * 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 + *
+ *

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]`. + *

Given an {@code input} shaped {@code [s0, s1, ..., s_n]}, the output is + * a {@code uint8} tensor shaped {@code [s0, s1, ..., s_n / 8]}. */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class CompareAndBitpack extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CompareAndBitpack"; + + private Output output; + + private CompareAndBitpack(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CompareAndBitpack operation. - * + * * @param scope current scope - * @param input Values to compare against `threshold` and bitpack. + * @param input Values to compare against {@code threshold} and bitpack. * @param threshold Threshold to compare against. + * @param data type for {@code CompareAndBitpack} output and operands * @return a new instance of CompareAndBitpack */ - @Endpoint(describeByClass = true) - public static CompareAndBitpack create(Scope scope, Operand input, Operand threshold) { + @Endpoint( + describeByClass = true + ) + public static CompareAndBitpack create(Scope scope, Operand input, + Operand threshold) { OperationBuilder opBuilder = scope.env().opBuilder("CompareAndBitpack", scope.makeOpName("CompareAndBitpack")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(threshold.asOutput()); opBuilder = scope.apply(opBuilder); return new CompareAndBitpack(opBuilder.build()); } - + /** + * Gets output. * The bitpacked comparisons. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CompareAndBitpack"; - - private Output output; - - private CompareAndBitpack(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java index 67a698e0365..5f9dc2e62f6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ComplexAbs.java @@ -32,65 +32,76 @@ /** * 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 + * 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}\). + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class ComplexAbs extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ComplexAbs"; + + private Output y; + + private ComplexAbs(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ComplexAbs operation. - * + * * @param scope current scope - * @param x - * @param Tout + * @param x the x value + * @param Tout the value of the Tout property + * @param data type for {@code ComplexAbs} output and operands * @return a new instance of ComplexAbs */ - @Endpoint(describeByClass = true) - public static ComplexAbs create(Scope scope, Operand x, Class Tout) { + @Endpoint( + describeByClass = true + ) + public static ComplexAbs create(Scope scope, Operand x, + Class Tout) { OperationBuilder opBuilder = scope.env().opBuilder("ComplexAbs", scope.makeOpName("ComplexAbs")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new ComplexAbs(opBuilder.build()); + return new ComplexAbs<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ComplexAbs operation using default output types. - * + * Factory method to create a class wrapping a new ComplexAbs operation, with the default output types. + * * @param scope current scope - * @param x - * @return a new instance of ComplexAbs + * @param x the x value + * @return a new instance of ComplexAbs, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ComplexAbs create(Scope scope, Operand x) { return create(scope, x, TFloat32.class); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ComplexAbs"; - - private Output y; - - private ComplexAbs(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Conj.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Conj.java index cf429b6e96f..3d009360a25 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Conj.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Conj.java @@ -29,60 +29,65 @@ /** * 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]
- * }
- * - * - * @param data type for {@code output()} output + * tf.conj(input) ==> [-2.25 - 4.75j, 3.25 - 5.75j] + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Conj extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Conj"; + + private Output output; + + private Conj(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Conj operation. - * + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code Conj} output and operands * @return a new instance of Conj */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Conj create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Conj", scope.makeOpName("Conj")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Conj(opBuilder.build()); + return new Conj<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conj"; - - private Output output; - - private Conj(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cos.java index 614057659d5..84a1665786b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cos.java @@ -29,57 +29,63 @@ /** * 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 + * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Cos extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Cos"; + + private Output y; + + private Cos(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Cos operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Cos} output and operands * @return a new instance of Cos */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Cos create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Cos", scope.makeOpName("Cos")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Cos(opBuilder.build()); + return new Cos<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cos"; - - private Output y; - - private Cos(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cosh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cosh.java index e47154811a2..92ff056d059 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cosh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cosh.java @@ -29,56 +29,62 @@ /** * 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 + * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Cosh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Cosh"; + + private Output y; + + private Cosh(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Cosh operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Cosh} output and operands * @return a new instance of Cosh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Cosh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Cosh", scope.makeOpName("Cosh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Cosh(opBuilder.build()); + return new Cosh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cosh"; - - private Output y; - - private Cosh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumprod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumprod.java index 96c8285ea92..f4c6602ec56 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumprod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumprod.java @@ -29,78 +29,65 @@ import org.tensorflow.types.family.TType; /** - * 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 + *
+ * 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 data type for {@code out} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Cumprod extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.Cumprod} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param exclusive If `True`, perform exclusive cumprod. - */ - public Options exclusive(Boolean exclusive) { - this.exclusive = exclusive; - return this; - } - - /** - * @param reverse A `bool` (default: False). - */ - public Options reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - private Boolean exclusive; - private Boolean reverse; - - private Options() { - } + public static final String OP_NAME = "Cumprod"; + + private Output out; + + private Cumprod(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Cumprod operation. - * + * * @param scope current scope - * @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 + * @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 */ - @Endpoint(describeByClass = true) - public static Cumprod create(Scope scope, Operand x, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Cumprod create(Scope scope, Operand x, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Cumprod", scope.makeOpName("Cumprod")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -115,42 +102,74 @@ public static Cumprod create(Scope scope, Operand x, Ope } } } - return new Cumprod(opBuilder.build()); + return new Cumprod<>(opBuilder.build()); } - + /** - * @param exclusive If `True`, perform exclusive cumprod. + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumprod. + * @return this Options instance. */ public static Options exclusive(Boolean exclusive) { return new Options().exclusive(exclusive); } - + /** - * @param reverse A `bool` (default: False). + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. */ public static Options reverse(Boolean reverse) { return new Options().reverse(reverse); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cumprod"; - - private Output out; - - private Cumprod(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.Cumprod} + */ + public static class Options { + private Boolean exclusive; + + private Boolean reverse; + + private Options() { + } + + /** + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumprod. + * @return this Options instance. + */ + public Options exclusive(Boolean exclusive) { + this.exclusive = exclusive; + return this; + } + + /** + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. + */ + public Options reverse(Boolean reverse) { + this.reverse = reverse; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumsum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumsum.java index 72395338fda..fed21ea095b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumsum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Cumsum.java @@ -29,78 +29,65 @@ import org.tensorflow.types.family.TType; /** - * 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 + *
+ * 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 data type for {@code out} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Cumsum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.Cumsum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param exclusive If `True`, perform exclusive cumsum. - */ - public Options exclusive(Boolean exclusive) { - this.exclusive = exclusive; - return this; - } - - /** - * @param reverse A `bool` (default: False). - */ - public Options reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - private Boolean exclusive; - private Boolean reverse; - - private Options() { - } + public static final String OP_NAME = "Cumsum"; + + private Output out; + + private Cumsum(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Cumsum operation. - * + * * @param scope current scope - * @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 + * @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 */ - @Endpoint(describeByClass = true) - public static Cumsum create(Scope scope, Operand x, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Cumsum create(Scope scope, Operand x, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Cumsum", scope.makeOpName("Cumsum")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -115,42 +102,74 @@ public static Cumsum create(Scope scope, Operand x, Oper } } } - return new Cumsum(opBuilder.build()); + return new Cumsum<>(opBuilder.build()); } - + /** - * @param exclusive If `True`, perform exclusive cumsum. + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumsum. + * @return this Options instance. */ public static Options exclusive(Boolean exclusive) { return new Options().exclusive(exclusive); } - + /** - * @param reverse A `bool` (default: False). + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. */ public static Options reverse(Boolean reverse) { return new Options().reverse(reverse); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Cumsum"; - - private Output out; - - private Cumsum(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.Cumsum} + */ + public static class Options { + private Boolean exclusive; + + private Boolean reverse; + + private Options() { + } + + /** + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumsum. + * @return this Options instance. + */ + public Options exclusive(Boolean exclusive) { + this.exclusive = exclusive; + return this; + } + + /** + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. + */ + public Options reverse(Boolean reverse) { + this.reverse = reverse; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CumulativeLogsumexp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CumulativeLogsumexp.java index b8d65b857da..cb240aa3f7b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CumulativeLogsumexp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CumulativeLogsumexp.java @@ -24,74 +24,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * 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 cumulative log-sum-exp, * which means that the first * element of the input is identical to the first element of the output: - *

{@code
- * tf.math.cumulative_logsumexp([a, b, c])  # => [a, log(exp(a) + exp(b)), log(exp(a) + exp(b) + exp(c))]
- * }
- * By setting the `exclusive` kwarg to `True`, an exclusive cumulative log-sum-exp is + *
+ * 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: - *

{@code
- * 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 `-inf`, + *
+ * 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 `reverse` kwarg to `True`, the cumulative log-sum-exp is performed in the + *

By setting the {@code reverse} kwarg to {@code True}, the cumulative log-sum-exp is performed in the * opposite direction. - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ public final class CumulativeLogsumexp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.CumulativeLogsumexp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param exclusive If `True`, perform exclusive cumulative log-sum-exp. - */ - public Options exclusive(Boolean exclusive) { - this.exclusive = exclusive; - return this; - } - - /** - * @param reverse A `bool` (default: False). - */ - public Options reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - private Boolean exclusive; - private Boolean reverse; - - private Options() { - } + public static final String OP_NAME = "CumulativeLogsumexp"; + + private Output out; + + private CumulativeLogsumexp(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CumulativeLogsumexp operation. - * + * * @param scope current scope - * @param x A `Tensor`. Must be one of the following types: `float16`, `float32`, `float64`. - * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range - * `[-rank(x), rank(x))`. - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CumulativeLogsumexp create(Scope scope, Operand x, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CumulativeLogsumexp create(Scope scope, Operand x, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CumulativeLogsumexp", scope.makeOpName("CumulativeLogsumexp")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -106,42 +91,74 @@ public static CumulativeLogsumexp create(Scope scope, Ope } } } - return new CumulativeLogsumexp(opBuilder.build()); + return new CumulativeLogsumexp<>(opBuilder.build()); } - + /** - * @param exclusive If `True`, perform exclusive cumulative log-sum-exp. + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumulative log-sum-exp. + * @return this Options instance. */ public static Options exclusive(Boolean exclusive) { return new Options().exclusive(exclusive); } - + /** - * @param reverse A `bool` (default: False). + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. */ public static Options reverse(Boolean reverse) { return new Options().reverse(reverse); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CumulativeLogsumexp"; - - private Output out; - - private CumulativeLogsumexp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.CumulativeLogsumexp} + */ + public static class Options { + private Boolean exclusive; + + private Boolean reverse; + + private Options() { + } + + /** + * Sets the exclusive option. + * + * @param exclusive If {@code True}, perform exclusive cumulative log-sum-exp. + * @return this Options instance. + */ + public Options exclusive(Boolean exclusive) { + this.exclusive = exclusive; + return this; + } + + /** + * Sets the reverse option. + * + * @param reverse A {@code bool} (default: False). + * @return this Options instance. + */ + public Options reverse(Boolean reverse) { + this.reverse = reverse; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DenseBincount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DenseBincount.java index d6a9d95e4d8..542464e1daa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DenseBincount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DenseBincount.java @@ -29,56 +29,54 @@ /** * 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 output()} output + * 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 data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class DenseBincount extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.DenseBincount} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. - */ - public Options binaryOutput(Boolean binaryOutput) { - this.binaryOutput = binaryOutput; - return this; - } - - private Boolean binaryOutput; - - private Options() { - } + public static final String OP_NAME = "DenseBincount"; + + private Output output; + + private DenseBincount(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DenseBincount operation. - * + * * @param scope current scope - * @param input 1D or 2D int `Tensor`. - * @param size non-negative int 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 + * @param input 1D or 2D int {@code Tensor}. + * @param sizeOutput non-negative int 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 options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static DenseBincount create(Scope scope, Operand input, Operand size, Operand weights, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DenseBincount create(Scope scope, + Operand input, Operand sizeOutput, Operand weights, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DenseBincount", scope.makeOpName("DenseBincount")); opBuilder.addInput(input.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(weights.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { @@ -88,37 +86,52 @@ public static DenseBincount create(Sco } } } - return new DenseBincount(opBuilder.build()); + return new DenseBincount<>(opBuilder.build()); } - + /** + * Sets the binaryOutput option. + * * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. */ public static Options binaryOutput(Boolean binaryOutput) { return new Options().binaryOutput(binaryOutput); } - + /** - * 1D `Tensor` with length equal to `size` or 2D `Tensor` with [batch_size, `size`]. + * Gets output. + * 1D {@code Tensor} with length equal to {@code size} or 2D {@code Tensor} with [batch_size, {@code size}]. * The counts or summed weights for each value in the range [0, size). + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseBincount"; - - private Output output; - - private DenseBincount(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.DenseBincount} + */ + public static class Options { + private Boolean binaryOutput; + + private Options() { + } + + /** + * Sets the binaryOutput option. + * + * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. + */ + public Options binaryOutput(Boolean binaryOutput) { + this.binaryOutput = binaryOutput; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Digamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Digamma.java index c64f3b40f6d..3b9bdcb8cc4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Digamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Digamma.java @@ -29,48 +29,56 @@ /** * Computes Psi, the derivative of Lgamma (the log of the absolute value of - *

- * `Gamma(x)`), element-wise. - * - * @param data type for {@code y()} output + * {@code Gamma(x)}), element-wise. + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Digamma extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Digamma"; + + private Output y; + + private Digamma(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Digamma operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Digamma} output and operands * @return a new instance of Digamma */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Digamma create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Digamma", scope.makeOpName("Digamma")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Digamma(opBuilder.build()); + return new Digamma<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Digamma"; - - private Output y; - - private Digamma(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Div.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Div.java index 60895ff2c56..97ec0fb4ac8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Div.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Div.java @@ -29,51 +29,59 @@ /** * Returns x / y element-wise. - *

- * NOTE: `math.Div` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.Div} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Div extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Div"; + + private Output z; + + private Div(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Div operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Div create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Div", scope.makeOpName("Div")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Div(opBuilder.build()); + return new Div<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Div"; - - private Output z; - - private Div(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DivNoNan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DivNoNan.java index 62651e64084..1fd6eb73e25 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DivNoNan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/DivNoNan.java @@ -29,52 +29,59 @@ /** * 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) - * - * @param data type for {@code z()} output + * NOTE: {@code math.DivNoNan} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class DivNoNan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DivNoNan"; + + private Output z; + + private DivNoNan(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DivNoNan operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DivNoNan create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("DivNoNan", scope.makeOpName("DivNoNan")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new DivNoNan(opBuilder.build()); + return new DivNoNan<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DivNoNan"; - - private Output z; - - private DivNoNan(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Equal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Equal.java index 962a271e93d..c36a207d014 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Equal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Equal.java @@ -30,53 +30,50 @@ /** * 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]) + *
*/ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Equal extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.Equal} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param incompatibleShapeError - */ - public Options incompatibleShapeError(Boolean incompatibleShapeError) { - this.incompatibleShapeError = incompatibleShapeError; - return this; - } - - private Boolean incompatibleShapeError; - - private Options() { - } + public static final String OP_NAME = "Equal"; + + private Output z; + + private Equal(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Equal operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Equal create(Scope scope, Operand x, Operand y, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Equal create(Scope scope, Operand x, Operand y, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Equal", scope.makeOpName("Equal")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -90,33 +87,49 @@ public static Equal create(Scope scope, Operand x, Operand< } return new Equal(opBuilder.build()); } - + /** - * @param incompatibleShapeError + * Sets the incompatibleShapeError option. + * + * @param incompatibleShapeError the incompatibleShapeError option + * @return this Options instance. */ public static Options incompatibleShapeError(Boolean incompatibleShapeError) { return new Options().incompatibleShapeError(incompatibleShapeError); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Equal"; - - private Output z; - - private Equal(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.Equal} + */ + public static class Options { + private Boolean incompatibleShapeError; + + private Options() { + } + + /** + * Sets the incompatibleShapeError option. + * + * @param incompatibleShapeError the incompatibleShapeError option + * @return this Options instance. + */ + public Options incompatibleShapeError(Boolean incompatibleShapeError) { + this.incompatibleShapeError = incompatibleShapeError; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erf.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erf.java index eb723c89f2a..37a0cbba878 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erf.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erf.java @@ -28,47 +28,56 @@ import org.tensorflow.types.family.TNumber; /** - * Computes the Gauss error function of `x` element-wise. - * - * @param data type for {@code y()} output + * Computes the Gauss error function of {@code x} element-wise. + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Erf extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Erf"; + + private Output y; + + private Erf(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Erf operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Erf} output and operands * @return a new instance of Erf */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Erf create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Erf", scope.makeOpName("Erf")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Erf(opBuilder.build()); + return new Erf<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Erf"; - - private Output y; - - private Erf(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erfc.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erfc.java index 123ce651d03..c36514488e2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erfc.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Erfc.java @@ -28,47 +28,56 @@ import org.tensorflow.types.family.TNumber; /** - * Computes the complementary error function of `x` element-wise. - * - * @param data type for {@code y()} output + * Computes the complementary error function of {@code x} element-wise. + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Erfc extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Erfc"; + + private Output y; + + private Erfc(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Erfc operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Erfc} output and operands * @return a new instance of Erfc */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Erfc create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Erfc", scope.makeOpName("Erfc")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Erfc(opBuilder.build()); + return new Erfc<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Erfc"; - - private Output y; - - private Erfc(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Exp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Exp.java index c5a55cba72b..d983f91e8f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Exp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Exp.java @@ -28,73 +28,77 @@ import org.tensorflow.types.family.TType; /** - * 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 + * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Exp extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Exp"; + + private Output y; + + private Exp(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Exp operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Exp} output and operands * @return a new instance of Exp */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Exp create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Exp", scope.makeOpName("Exp")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Exp(opBuilder.build()); + return new Exp<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Exp"; - - private Output y; - - private Exp(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Expm1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Expm1.java index 86d10be91e7..f8d20f833a8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Expm1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Expm1.java @@ -28,62 +28,68 @@ import org.tensorflow.types.family.TType; /** - * 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
- * 
- *   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)
- *   }
- * - * - * @param data type for {@code y()} output + * 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(1 + 1j)
+ * tf.math.expm1(x) ==> (0.46869393991588515+2.2873552871788423j)
+ * 
+ * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Expm1 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Expm1"; + + private Output y; + + private Expm1(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Expm1 operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Expm1} output and operands * @return a new instance of Expm1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Expm1 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Expm1", scope.makeOpName("Expm1")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Expm1(opBuilder.build()); + return new Expm1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Expm1"; - - private Output y; - - private Expm1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Fact.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Fact.java index 2d7f39d217e..a4e3fc96366 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Fact.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Fact.java @@ -30,41 +30,49 @@ /** * Output a fact about factorials. */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Fact extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Fact"; + + private Output fact; + + private Fact(Operation operation) { + super(operation); + int outputIdx = 0; + fact = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Fact operation. - * + * * @param scope current scope * @return a new instance of Fact */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Fact create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("Fact", scope.makeOpName("Fact")); opBuilder = scope.apply(opBuilder); return new Fact(opBuilder.build()); } - + /** + * Gets fact. + * + * @return fact. */ public Output fact() { return fact; } - + @Override public Output asOutput() { return fact; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Fact"; - - private Output fact; - - private Fact(Operation operation) { - super(operation); - int outputIdx = 0; - fact = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Floor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Floor.java index 2fa22d7a60c..fdca33b84eb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Floor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Floor.java @@ -29,46 +29,55 @@ /** * Returns element-wise largest integer not greater than x. - * - * @param data type for {@code y()} output + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Floor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Floor"; + + private Output y; + + private Floor(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Floor operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Floor} output and operands * @return a new instance of Floor */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Floor create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Floor", scope.makeOpName("Floor")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Floor(opBuilder.build()); + return new Floor<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Floor"; - - private Output y; - - private Floor(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorDiv.java index 5cd5fe74349..4dfca58ce59 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorDiv.java @@ -29,51 +29,59 @@ /** * Returns x // y element-wise. - *

- * NOTE: `math.FloorDiv` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.FloorDiv} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class FloorDiv extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FloorDiv"; + + private Output z; + + private FloorDiv(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FloorDiv operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FloorDiv create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("FloorDiv", scope.makeOpName("FloorDiv")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new FloorDiv(opBuilder.build()); + return new FloorDiv<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FloorDiv"; - - private Output z; - - private FloorDiv(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorMod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorMod.java index 18c6c4fd34d..43ac259ac8d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorMod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/FloorMod.java @@ -28,55 +28,62 @@ import org.tensorflow.types.family.TNumber; /** - * Returns element-wise remainder of division. When `x < 0` xor `y < 0` is - *

+ * Returns element-wise remainder of division. When {@code x < 0} xor {@code 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) - * - * @param data type for {@code z()} output + * with a flooring divide. E.g. {@code floor(x / y) * y + mod(x, y) = x}. + *

NOTE: {@code math.FloorMod} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class FloorMod extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FloorMod"; + + private Output z; + + private FloorMod(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FloorMod operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FloorMod create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("FloorMod", scope.makeOpName("FloorMod")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new FloorMod(opBuilder.build()); + return new FloorMod<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FloorMod"; - - private Output z; - - private FloorMod(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Greater.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Greater.java index 3db7896647a..e79a13cbac4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Greater.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Greater.java @@ -29,35 +29,49 @@ import org.tensorflow.types.family.TNumber; /** - * 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] + *
*/ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Greater extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Greater"; + + private Output z; + + private Greater(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Greater operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Greater create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Greater", scope.makeOpName("Greater")); opBuilder.addInput(x.asOutput()); @@ -65,26 +79,18 @@ public static Greater create(Scope scope, Operand x, Oper opBuilder = scope.apply(opBuilder); return new Greater(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Greater"; - - private Output z; - - private Greater(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/GreaterEqual.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/GreaterEqual.java index abeb67c3e66..6c49da75fae 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/GreaterEqual.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/GreaterEqual.java @@ -29,35 +29,49 @@ import org.tensorflow.types.family.TNumber; /** - * 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] + *
*/ -@Operator(group = "math") +@Operator( + group = "math" +) public final class GreaterEqual extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GreaterEqual"; + + private Output z; + + private GreaterEqual(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GreaterEqual operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static GreaterEqual create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("GreaterEqual", scope.makeOpName("GreaterEqual")); opBuilder.addInput(x.asOutput()); @@ -65,26 +79,18 @@ public static GreaterEqual create(Scope scope, Operand x, opBuilder = scope.apply(opBuilder); return new GreaterEqual(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GreaterEqual"; - - private Output z; - - private GreaterEqual(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igamma.java index 7cb4c526e14..e03507c1be5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igamma.java @@ -28,62 +28,65 @@ import org.tensorflow.types.family.TNumber; /** - * 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 data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Igamma extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Igamma"; + + private Output z; + + private Igamma(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Igamma operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Igamma create(Scope scope, Operand a, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Igamma", scope.makeOpName("Igamma")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Igamma(opBuilder.build()); + return new Igamma<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Igamma"; - - private Output z; - - private Igamma(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IgammaGradA.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IgammaGradA.java index e81622a3391..fd31d8cd394 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IgammaGradA.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IgammaGradA.java @@ -24,52 +24,58 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * Computes the gradient of `igamma(a, x)` wrt `a`. - * - * @param data type for {@code z()} output + * Computes the gradient of {@code igamma(a, x)} wrt {@code a}. + * + * @param data type for {@code z} output */ public final class IgammaGradA extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IgammaGradA"; + + private Output z; + + private IgammaGradA(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IgammaGradA operation. - * + * * @param scope current scope - * @param a - * @param x + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IgammaGradA create(Scope scope, Operand a, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("IgammaGradA", scope.makeOpName("IgammaGradA")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new IgammaGradA(opBuilder.build()); + return new IgammaGradA<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IgammaGradA"; - - private Output z; - - private IgammaGradA(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igammac.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igammac.java index ab67c74b7b5..d2a517e65c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igammac.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Igammac.java @@ -28,62 +28,65 @@ import org.tensorflow.types.family.TNumber; /** - * Compute the upper regularized incomplete Gamma function `Q(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 Gama function. + *

Note, above {@code P(a, x)} ({@code Igamma}) is the lower regularized complete * Gamma function. - * - * @param data type for {@code z()} output + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Igammac extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Igammac"; + + private Output z; + + private Igammac(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Igammac operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Igammac create(Scope scope, Operand a, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Igammac", scope.makeOpName("Igammac")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Igammac(opBuilder.build()); + return new Igammac<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Igammac"; - - private Output z; - - private Igammac(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Imag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Imag.java index 74058c43ad1..6b873186138 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Imag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Imag.java @@ -32,72 +32,81 @@ /** * 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]
- * }
- * - * - * @param data type for {@code output()} output + * tf.imag(input) ==> [4.75, 5.75] + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Imag extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Imag"; + + private Output output; + + private Imag(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Imag operation. - * + * * @param scope current scope - * @param input - * @param Tout + * @param input the input value + * @param Tout the value of the Tout property + * @param data type for {@code Imag} output and operands * @return a new instance of Imag */ - @Endpoint(describeByClass = true) - public static Imag create(Scope scope, Operand input, Class Tout) { + @Endpoint( + describeByClass = true + ) + public static Imag create(Scope scope, Operand input, + Class Tout) { OperationBuilder opBuilder = scope.env().opBuilder("Imag", scope.makeOpName("Imag")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new Imag(opBuilder.build()); + return new Imag<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Imag operation using default output types. - * + * Factory method to create a class wrapping a new Imag operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Imag + * @param input the input value + * @return a new instance of Imag, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Imag create(Scope scope, Operand input) { return create(scope, input, TFloat32.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Imag"; - - private Output output; - - private Imag(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/InvertPermutation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/InvertPermutation.java index 04373176367..49a6a2574ba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/InvertPermutation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/InvertPermutation.java @@ -29,63 +29,66 @@ /** * 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]
- * }
- * - * - * @param data type for {@code y()} output + * invert_permutation(x) ==> [2, 4, 3, 0, 1] + *
+ * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class InvertPermutation extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InvertPermutation"; + + private Output y; + + private InvertPermutation(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InvertPermutation operation. - * + * * @param scope current scope * @param x 1-D. + * @param data type for {@code InvertPermutation} output and operands * @return a new instance of InvertPermutation */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static InvertPermutation create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("InvertPermutation", scope.makeOpName("InvertPermutation")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new InvertPermutation(opBuilder.build()); + return new InvertPermutation<>(opBuilder.build()); } - + /** + * Gets y. * 1-D. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InvertPermutation"; - - private Output y; - - private InvertPermutation(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsFinite.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsFinite.java index 6f047b27412..ddd2f552f29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsFinite.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsFinite.java @@ -30,55 +30,60 @@ /** * Returns which elements of x are finite. - *

- * @compatibility(numpy) + * {@literal @}compatibility(numpy)
* Equivalent to np.isfinite - * @end_compatibility - *

- * Example: - *

{@code
+ * 
{@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]
- * }
- * + * tf.math.is_finite(x) ==> [True, True, True, False, False] + *
*/ -@Operator(group = "math") +@Operator( + group = "math" +) public final class IsFinite extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsFinite"; + + private Output y; + + private IsFinite(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsFinite operation. - * + * * @param scope current scope - * @param x + * @param x the x value * @return a new instance of IsFinite */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsFinite create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("IsFinite", scope.makeOpName("IsFinite")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); return new IsFinite(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsFinite"; - - private Output y; - - private IsFinite(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsInf.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsInf.java index a66ef147923..9e77a33cfbe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsInf.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsInf.java @@ -30,55 +30,60 @@ /** * Returns which elements of x are Inf. - *

- * @compatibility(numpy) + * {@literal @}compatibility(numpy)
* Equivalent to np.isinf - * @end_compatibility - *

- * Example: - *

{@code
+ * 
{@literal @}end_compatibility + *

Example: + *

  * x = tf.constant([5.0, np.inf, 6.8, np.inf])
- * tf.math.is_inf(x) ==> [False, True, False, True]
- * }
- * + * tf.math.is_inf(x) ==> [False, True, False, True] + *
*/ -@Operator(group = "math") +@Operator( + group = "math" +) public final class IsInf extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsInf"; + + private Output y; + + private IsInf(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsInf operation. - * + * * @param scope current scope - * @param x + * @param x the x value * @return a new instance of IsInf */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsInf create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("IsInf", scope.makeOpName("IsInf")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); return new IsInf(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsInf"; - - private Output y; - - private IsInf(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsNan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsNan.java index e7542bad57e..d760997cce2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsNan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/IsNan.java @@ -30,55 +30,60 @@ /** * Returns which elements of x are NaN. - *

- * @compatibility(numpy) + * {@literal @}compatibility(numpy)
* Equivalent to np.isnan - * @end_compatibility - *

- * Example: - *

{@code
+ * 
{@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]
- * }
- * + * tf.math.is_nan(x) ==> [False, True, False, True, False] + *
*/ -@Operator(group = "math") +@Operator( + group = "math" +) public final class IsNan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsNan"; + + private Output y; + + private IsNan(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsNan operation. - * + * * @param scope current scope - * @param x + * @param x the x value * @return a new instance of IsNan */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsNan create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("IsNan", scope.makeOpName("IsNan")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); return new IsNan(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsNan"; - - private Output y; - - private IsNan(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Less.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Less.java index 9564f1b84ff..2526b390242 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Less.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Less.java @@ -29,35 +29,49 @@ import org.tensorflow.types.family.TNumber; /** - * 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] + *
*/ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Less extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Less"; + + private Output z; + + private Less(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Less operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Less create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Less", scope.makeOpName("Less")); opBuilder.addInput(x.asOutput()); @@ -65,26 +79,18 @@ public static Less create(Scope scope, Operand x, Operand opBuilder = scope.apply(opBuilder); return new Less(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Less"; - - private Output z; - - private Less(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LessEqual.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LessEqual.java index 10c0b7647cb..ea46f504b0d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LessEqual.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LessEqual.java @@ -29,35 +29,49 @@ import org.tensorflow.types.family.TNumber; /** - * 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] + *
*/ -@Operator(group = "math") +@Operator( + group = "math" +) public final class LessEqual extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LessEqual"; + + private Output z; + + private LessEqual(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LessEqual operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LessEqual create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("LessEqual", scope.makeOpName("LessEqual")); opBuilder.addInput(x.asOutput()); @@ -65,26 +79,18 @@ public static LessEqual create(Scope scope, Operand x, Op opBuilder = scope.apply(opBuilder); return new LessEqual(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LessEqual"; - - private Output z; - - private LessEqual(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Lgamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Lgamma.java index 817993ef5c5..561f491b09d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Lgamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Lgamma.java @@ -28,57 +28,63 @@ import org.tensorflow.types.family.TNumber; /** - * 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]
- * }
- * - * - * @param data type for {@code y()} output + * tf.math.lgamma(x) ==> [inf, 0.5723649, 0., 2.4537368, inf, -4.6477685] + *
+ * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Lgamma extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Lgamma"; + + private Output y; + + private Lgamma(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Lgamma operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Lgamma} output and operands * @return a new instance of Lgamma */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Lgamma create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Lgamma", scope.makeOpName("Lgamma")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Lgamma(opBuilder.build()); + return new Lgamma<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Lgamma"; - - private Output y; - - private Lgamma(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log.java index 4b45bf622d1..416279c57c6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log.java @@ -29,55 +29,61 @@ /** * 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]
- * }
- * - * - * @param data type for {@code y()} output + * tf.math.log(x) ==> [-inf, -0.6931472, 0. , 1.609438] + *
+ * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Log extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Log"; + + private Output y; + + private Log(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Log operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Log} output and operands * @return a new instance of Log */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Log create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Log", scope.makeOpName("Log")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Log(opBuilder.build()); + return new Log<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Log"; - - private Output y; - - private Log(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log1p.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log1p.java index ed84f97012e..84a48b62611 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log1p.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Log1p.java @@ -29,55 +29,61 @@ /** * 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]
- * }
- * - * - * @param data type for {@code y()} output + * tf.math.log1p(x) ==> [0., 0.4054651, 0.6931472, 1.7917595] + *
+ * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Log1p extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Log1p"; + + private Output y; + + private Log1p(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Log1p operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Log1p} output and operands * @return a new instance of Log1p */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Log1p create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Log1p", scope.makeOpName("Log1p")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Log1p(opBuilder.build()); + return new Log1p<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Log1p"; - - private Output y; - - private Log1p(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalAnd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalAnd.java index 214e0b61ea3..dbbd7a94226 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalAnd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalAnd.java @@ -29,22 +29,37 @@ /** * 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 */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class LogicalAnd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogicalAnd"; + + private Output z; + + private LogicalAnd(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogicalAnd operation. - * + * * @param scope current scope - * @param x - * @param y + * @param x the x value + * @param y the y value * @return a new instance of LogicalAnd */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogicalAnd create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("LogicalAnd", scope.makeOpName("LogicalAnd")); opBuilder.addInput(x.asOutput()); @@ -52,26 +67,18 @@ public static LogicalAnd create(Scope scope, Operand x, Operand y) opBuilder = scope.apply(opBuilder); return new LogicalAnd(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogicalAnd"; - - private Output z; - - private LogicalAnd(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalNot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalNot.java index 7bcb001cc6a..286e24ed931 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalNot.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalNot.java @@ -28,46 +28,53 @@ import org.tensorflow.types.TBool; /** - * Returns the truth value of `NOT x` element-wise. + * Returns the truth value of {@code NOT x} element-wise. */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class LogicalNot extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogicalNot"; + + private Output y; + + private LogicalNot(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogicalNot operation. - * + * * @param scope current scope - * @param x A `Tensor` of type `bool`. + * @param x A {@code Tensor} of type {@code bool}. * @return a new instance of LogicalNot */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogicalNot create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("LogicalNot", scope.makeOpName("LogicalNot")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); return new LogicalNot(opBuilder.build()); } - + /** - * A `Tensor` of type `bool` with the same shape as `x`. The logical negation of `x`. + * Gets y. + * A {@code Tensor} of type {@code bool} with the same shape as {@code x}. The logical negation of {@code x}. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogicalNot"; - - private Output y; - - private LogicalNot(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalOr.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalOr.java index 5465751c543..016f936fe2e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalOr.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/LogicalOr.java @@ -29,22 +29,37 @@ /** * 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 */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class LogicalOr extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogicalOr"; + + private Output z; + + private LogicalOr(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogicalOr operation. - * + * * @param scope current scope - * @param x - * @param y + * @param x the x value + * @param y the y value * @return a new instance of LogicalOr */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogicalOr create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("LogicalOr", scope.makeOpName("LogicalOr")); opBuilder.addInput(x.asOutput()); @@ -52,26 +67,18 @@ public static LogicalOr create(Scope scope, Operand x, Operand y) opBuilder = scope.apply(opBuilder); return new LogicalOr(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogicalOr"; - - private Output z; - - private LogicalOr(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Maximum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Maximum.java index e592e34e500..05123a062fa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Maximum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Maximum.java @@ -28,52 +28,60 @@ import org.tensorflow.types.family.TNumber; /** - * 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) - * - * @param data type for {@code z()} output + * 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 */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Maximum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Maximum"; + + private Output z; + + private Maximum(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Maximum operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Maximum create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Maximum", scope.makeOpName("Maximum")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Maximum(opBuilder.build()); + return new Maximum<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Maximum"; - - private Output z; - - private Maximum(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mean.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mean.java index 6cff5088249..b0c3a6ae37d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mean.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mean.java @@ -30,48 +30,46 @@ /** * 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 data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Mean extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.Mean} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "Mean"; + + private Output output; + + private Mean(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Mean operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static Mean create(Scope scope, Operand input, Operand axis, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Mean create(Scope scope, Operand input, + Operand axis, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Mean", scope.makeOpName("Mean")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(axis.asOutput()); @@ -83,36 +81,51 @@ public static Mean create(Scope scope, Operand input, Op } } } - return new Mean(opBuilder.build()); + return new Mean<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets output. * The reduced tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Mean"; - - private Output output; - - private Mean(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.Mean} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Minimum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Minimum.java index 1c3ab3bb724..d8bb23fc36e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Minimum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Minimum.java @@ -28,52 +28,60 @@ import org.tensorflow.types.family.TNumber; /** - * 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) - * - * @param data type for {@code z()} output + * 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 */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Minimum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Minimum"; + + private Output z; + + private Minimum(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Minimum operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Minimum create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Minimum", scope.makeOpName("Minimum")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Minimum(opBuilder.build()); + return new Minimum<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Minimum"; - - private Output z; - - private Minimum(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mod.java index e8ead53a30d..e4c80f108a2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mod.java @@ -29,54 +29,61 @@ /** * 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 + * {@code tf.truncatediv(x, y) * y + truncate_mod(x, y) = x}. + *

NOTE: {@code math.Mod} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Mod extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Mod"; + + private Output z; + + private Mod(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Mod operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Mod create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Mod", scope.makeOpName("Mod")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Mod(opBuilder.build()); + return new Mod<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Mod"; - - private Output z; - - private Mod(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mul.java index 4d91744ba23..3996906af1a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Mul.java @@ -29,51 +29,59 @@ /** * Returns x * y element-wise. - *

- * NOTE: `math.Mul` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.Mul} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Mul extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Mul"; + + private Output z; + + private Mul(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Mul operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Mul create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Mul", scope.makeOpName("Mul")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Mul(opBuilder.build()); + return new Mul<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Mul"; - - private Output z; - - private Mul(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/MulNoNan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/MulNoNan.java index 312b0e0018a..40d660ca27d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/MulNoNan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/MulNoNan.java @@ -29,51 +29,59 @@ /** * 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) - * - * @param data type for {@code z()} output + * NOTE: {@code math.MulNoNan} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class MulNoNan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MulNoNan"; + + private Output z; + + private MulNoNan(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MulNoNan operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MulNoNan create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("MulNoNan", scope.makeOpName("MulNoNan")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new MulNoNan(opBuilder.build()); + return new MulNoNan<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MulNoNan"; - - private Output z; - - private MulNoNan(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ndtri.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ndtri.java index 5e5f9d8b326..727c4f54ee0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ndtri.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Ndtri.java @@ -28,45 +28,56 @@ import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The Ndtri operation + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Ndtri extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Ndtri"; + + private Output y; + + private Ndtri(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Ndtri operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Ndtri} output and operands * @return a new instance of Ndtri */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ndtri create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Ndtri", scope.makeOpName("Ndtri")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Ndtri(opBuilder.build()); + return new Ndtri<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Ndtri"; - - private Output y; - - private Ndtri(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Neg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Neg.java index 4ecedcfff31..dd0d280adec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Neg.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Neg.java @@ -29,48 +29,56 @@ /** * Computes numerical negative value element-wise. - *

- * I.e., \\(y = -x\\). - * - * @param data type for {@code y()} output + * I.e., \(y = -x\). + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Neg extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Neg"; + + private Output y; + + private Neg(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Neg operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Neg} output and operands * @return a new instance of Neg */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Neg create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Neg", scope.makeOpName("Neg")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Neg(opBuilder.build()); + return new Neg<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Neg"; - - private Output y; - - private Neg(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NextAfter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NextAfter.java index ec8a0231618..824652cd6d1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NextAfter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NextAfter.java @@ -28,57 +28,63 @@ import org.tensorflow.types.family.TNumber; /** - * 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) + *

It can also return a subnormal number. + *

{@literal @}compatibility(cpp)
* Equivalent to C++ std::nextafter function. - * @end_compatibility - * - * @param data type for {@code output()} output + *
{@literal @}end_compatibility + * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class NextAfter extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NextAfter"; + + private Output output; + + private NextAfter(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NextAfter operation. - * + * * @param scope current scope - * @param x1 - * @param x2 + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static NextAfter create(Scope scope, Operand x1, Operand x2) { OperationBuilder opBuilder = scope.env().opBuilder("NextAfter", scope.makeOpName("NextAfter")); opBuilder.addInput(x1.asOutput()); opBuilder.addInput(x2.asOutput()); opBuilder = scope.apply(opBuilder); - return new NextAfter(opBuilder.build()); + return new NextAfter<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NextAfter"; - - private Output output; - - private NextAfter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NotEqual.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NotEqual.java index 852567ff301..1eb47231fd9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NotEqual.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/NotEqual.java @@ -30,43 +30,41 @@ /** * 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 */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class NotEqual extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.math.NotEqual} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param incompatibleShapeError - */ - public Options incompatibleShapeError(Boolean incompatibleShapeError) { - this.incompatibleShapeError = incompatibleShapeError; - return this; - } - - private Boolean incompatibleShapeError; - - private Options() { - } + public static final String OP_NAME = "NotEqual"; + + private Output z; + + private NotEqual(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new NotEqual operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static NotEqual create(Scope scope, Operand x, Operand y, Options... options) { + @Endpoint( + describeByClass = true + ) + public static NotEqual create(Scope scope, Operand x, Operand y, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("NotEqual", scope.makeOpName("NotEqual")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -80,33 +78,49 @@ public static NotEqual create(Scope scope, Operand x, Opera } return new NotEqual(opBuilder.build()); } - + /** - * @param incompatibleShapeError + * Sets the incompatibleShapeError option. + * + * @param incompatibleShapeError the incompatibleShapeError option + * @return this Options instance. */ public static Options incompatibleShapeError(Boolean incompatibleShapeError) { return new Options().incompatibleShapeError(incompatibleShapeError); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NotEqual"; - - private Output z; - - private NotEqual(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.math.NotEqual} + */ + public static class Options { + private Boolean incompatibleShapeError; + + private Options() { + } + + /** + * Sets the incompatibleShapeError option. + * + * @param incompatibleShapeError the incompatibleShapeError option + * @return this Options instance. + */ + public Options incompatibleShapeError(Boolean incompatibleShapeError) { + this.incompatibleShapeError = incompatibleShapeError; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Polygamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Polygamma.java index f17bc4958b1..51755979c87 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Polygamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Polygamma.java @@ -28,56 +28,62 @@ import org.tensorflow.types.family.TNumber; /** - * 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 + *

\(\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 */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Polygamma extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Polygamma"; + + private Output z; + + private Polygamma(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Polygamma operation. - * + * * @param scope current scope - * @param a - * @param x + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Polygamma create(Scope scope, Operand a, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Polygamma", scope.makeOpName("Polygamma")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Polygamma(opBuilder.build()); + return new Polygamma<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Polygamma"; - - private Output z; - - private Polygamma(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/PopulationCount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/PopulationCount.java index 4907717b342..a1bb46a9ec5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/PopulationCount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/PopulationCount.java @@ -30,51 +30,57 @@ /** * 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. */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class PopulationCount extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "PopulationCount"; + + private Output y; + + private PopulationCount(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new PopulationCount operation. - * + * * @param scope current scope - * @param x + * @param x the x value * @return a new instance of PopulationCount */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static PopulationCount create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("PopulationCount", scope.makeOpName("PopulationCount")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); return new PopulationCount(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PopulationCount"; - - private Output y; - - private PopulationCount(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Pow.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Pow.java index d9347818c1a..82ddfd03026 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Pow.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Pow.java @@ -29,57 +29,64 @@ /** * 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]]
- * }
- * - * - * @param data type for {@code z()} output + * tf.pow(x, y) ==> [[256, 65536], [9, 27]] + *
+ * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Pow extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Pow"; + + private Output z; + + private Pow(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Pow operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Pow create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Pow", scope.makeOpName("Pow")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Pow(opBuilder.build()); + return new Pow<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Pow"; - - private Output z; - - private Pow(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedAdd.java index 5ae6dd24dd4..bc1d4b07165 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedAdd.java @@ -27,31 +27,56 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Returns x + y element-wise, working on quantized buffers. - * - * @param data type for {@code z()} output + * + * @param data type for {@code z} output */ -@Operator(group = "math") -public final class QuantizedAdd extends RawOp { - +@Operator( + group = "math" +) +public final class QuantizedAdd extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedAdd"; + + private Output z; + + private Output minZ; + + private Output maxZ; + + private QuantizedAdd(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + minZ = operation.output(outputIdx++); + maxZ = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedAdd operation. - * + * * @param scope current scope - * @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 property + * @param data type for {@code QuantizedAdd} output and operands * @return a new instance of QuantizedAdd */ - @Endpoint(describeByClass = true) - public static QuantizedAdd create(Scope scope, Operand x, Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, Class Toutput) { + @Endpoint( + describeByClass = true + ) + public static QuantizedAdd create(Scope scope, + Operand x, Operand y, Operand minX, + Operand maxX, Operand minY, Operand maxY, Class Toutput) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedAdd", scope.makeOpName("QuantizedAdd")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -61,44 +86,35 @@ public static QuantizedAdd create(Scope scope, Operand(opBuilder.build()); + return new QuantizedAdd<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + /** + * Gets minZ. * The float value that the lowest quantized output value represents. + * @return minZ. */ public Output minZ() { return minZ; } - + /** + * Gets maxZ. * The float value that the highest quantized output value represents. - *

- * NOTE: `math.QuantizedAdd` supports limited forms of broadcasting. More about - * broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + *

NOTE: {@code math.QuantizedAdd} supports limited forms of broadcasting. More about + * broadcasting here + * @return maxZ. */ public Output maxZ() { return maxZ; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedAdd"; - - private Output z; - private Output minZ; - private Output maxZ; - - private QuantizedAdd(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - minZ = operation.output(outputIdx++); - maxZ = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedMul.java index bc64e12438b..cb69740807e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/QuantizedMul.java @@ -27,31 +27,56 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Returns x * y element-wise, working on quantized buffers. - * - * @param data type for {@code z()} output + * + * @param data type for {@code z} output */ -@Operator(group = "math") -public final class QuantizedMul extends RawOp { - +@Operator( + group = "math" +) +public final class QuantizedMul extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedMul"; + + private Output z; + + private Output minZ; + + private Output maxZ; + + private QuantizedMul(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + minZ = operation.output(outputIdx++); + maxZ = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedMul operation. - * + * * @param scope current scope - * @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 property + * @param data type for {@code QuantizedMul} output and operands * @return a new instance of QuantizedMul */ - @Endpoint(describeByClass = true) - public static QuantizedMul create(Scope scope, Operand x, Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, Class Toutput) { + @Endpoint( + describeByClass = true + ) + public static QuantizedMul create(Scope scope, + Operand x, Operand y, Operand minX, + Operand maxX, Operand minY, Operand maxY, Class Toutput) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMul", scope.makeOpName("QuantizedMul")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -61,44 +86,35 @@ public static QuantizedMul create(Scope scope, Operand(opBuilder.build()); + return new QuantizedMul<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + /** + * Gets minZ. * The float value that the lowest quantized output value represents. + * @return minZ. */ public Output minZ() { return minZ; } - + /** + * Gets maxZ. * The float value that the highest quantized output value represents. - *

- * NOTE: `math.QuantizedMul` supports limited forms of broadcasting. More about - * broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) + *

NOTE: {@code math.QuantizedMul} supports limited forms of broadcasting. More about + * broadcasting here + * @return maxZ. */ public Output maxZ() { return maxZ; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMul"; - - private Output z; - private Output minZ; - private Output maxZ; - - private QuantizedMul(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - minZ = operation.output(outputIdx++); - maxZ = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Real.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Real.java index 8758983ba50..8c6f5a8eb8d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Real.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Real.java @@ -32,72 +32,81 @@ /** * 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]
- * }
- * - * - * @param data type for {@code output()} output + * tf.real(input) ==> [-2.25, 3.25] + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Real extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Real"; + + private Output output; + + private Real(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Real operation. - * + * * @param scope current scope - * @param input - * @param Tout + * @param input the input value + * @param Tout the value of the Tout property + * @param data type for {@code Real} output and operands * @return a new instance of Real */ - @Endpoint(describeByClass = true) - public static Real create(Scope scope, Operand input, Class Tout) { + @Endpoint( + describeByClass = true + ) + public static Real create(Scope scope, Operand input, + Class Tout) { OperationBuilder opBuilder = scope.env().opBuilder("Real", scope.makeOpName("Real")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tout", Operands.toDataType(Tout)); - return new Real(opBuilder.build()); + return new Real<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Real operation using default output types. - * + * Factory method to create a class wrapping a new Real operation, with the default output types. + * * @param scope current scope - * @param input - * @return a new instance of Real + * @param input the input value + * @return a new instance of Real, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Real create(Scope scope, Operand input) { return create(scope, input, TFloat32.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Real"; - - private Output output; - - private Real(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RealDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RealDiv.java index 5c5155ed78c..2bf500ef10a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RealDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RealDiv.java @@ -29,53 +29,60 @@ /** * 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 + * 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 data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class RealDiv extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RealDiv"; + + private Output z; + + private RealDiv(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RealDiv operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RealDiv create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("RealDiv", scope.makeOpName("RealDiv")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new RealDiv(opBuilder.build()); + return new RealDiv<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RealDiv"; - - private Output z; - - private RealDiv(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Reciprocal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Reciprocal.java index 0b8571d742c..17caba787df 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Reciprocal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Reciprocal.java @@ -29,48 +29,56 @@ /** * Computes the reciprocal of x element-wise. - *

- * I.e., \\(y = 1 / x\\). - * - * @param data type for {@code y()} output + * I.e., \(y = 1 / x\). + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Reciprocal extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Reciprocal"; + + private Output y; + + private Reciprocal(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Reciprocal operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Reciprocal} output and operands * @return a new instance of Reciprocal */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Reciprocal create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Reciprocal", scope.makeOpName("Reciprocal")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Reciprocal(opBuilder.build()); + return new Reciprocal<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Reciprocal"; - - private Output y; - - private Reciprocal(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ReciprocalGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ReciprocalGrad.java index 6c1c8edc3b9..cc0ec84a0c5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ReciprocalGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/ReciprocalGrad.java @@ -24,55 +24,61 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Computes the gradient for the inverse of `x` wrt its input. - *

- * Specifically, `grad = -dy yy`, where `y = 1/x`, and `dy` + * 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 data type for {@code z()} output + * + * @param data type for {@code z} output */ public final class ReciprocalGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReciprocalGrad"; + + private Output z; + + private ReciprocalGrad(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ReciprocalGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) - public static ReciprocalGrad create(Scope scope, Operand y, Operand dy) { + @Endpoint( + describeByClass = true + ) + public static ReciprocalGrad create(Scope scope, Operand y, + Operand dy) { OperationBuilder opBuilder = scope.env().opBuilder("ReciprocalGrad", scope.makeOpName("ReciprocalGrad")); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); opBuilder = scope.apply(opBuilder); - return new ReciprocalGrad(opBuilder.build()); + return new ReciprocalGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReciprocalGrad"; - - private Output z; - - private ReciprocalGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizationRangePerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizationRangePerChannel.java index 9439a3be134..4ccf6718696 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizationRangePerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizationRangePerChannel.java @@ -24,18 +24,32 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes requantization range per channel. */ public final class RequantizationRangePerChannel extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RequantizationRangePerChannel"; + + private Output outputMin; + + private Output outputMax; + + private RequantizationRangePerChannel(Operation operation) { + super(operation); + int outputIdx = 0; + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RequantizationRangePerChannel operation. - * + * * @param scope current scope * @param input The original input tensor. * @param inputMin The minimum value of the input tensor @@ -44,8 +58,11 @@ public final class RequantizationRangePerChannel extends RawOp { * Example: set this to 6 for Relu6. * @return a new instance of RequantizationRangePerChannel */ - @Endpoint(describeByClass = true) - public static RequantizationRangePerChannel create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Float clipValueMax) { + @Endpoint( + describeByClass = true + ) + public static RequantizationRangePerChannel create(Scope scope, Operand input, + Operand inputMin, Operand inputMax, Float clipValueMax) { OperationBuilder opBuilder = scope.env().opBuilder("RequantizationRangePerChannel", scope.makeOpName("RequantizationRangePerChannel")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); @@ -54,31 +71,22 @@ public static RequantizationRangePerChannel create(Scope scope, Operand outputMin() { return outputMin; } - + /** + * Gets outputMax. * The maximum value of the final output tensor. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RequantizationRangePerChannel"; - - private Output outputMin; - private Output outputMax; - - private RequantizationRangePerChannel(Operation operation) { - super(operation); - int outputIdx = 0; - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizePerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizePerChannel.java index a1995a76e20..fb21eb1e38a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizePerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RequantizePerChannel.java @@ -25,20 +25,37 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Requantizes input with min and max values known per channel. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -public final class RequantizePerChannel extends RawOp { - +public final class RequantizePerChannel extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RequantizePerChannel"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + private RequantizePerChannel(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RequantizePerChannel operation. - * + * * @param scope current scope * @param input The original input tensor. * @param inputMin The minimum value of the input tensor @@ -46,10 +63,16 @@ public final class RequantizePerChannel extends RawOp { * @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 */ - @Endpoint(describeByClass = true) - public static RequantizePerChannel create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, Class outType) { + @Endpoint( + describeByClass = true + ) + public static RequantizePerChannel create(Scope scope, + Operand input, Operand inputMin, Operand inputMax, + Operand requestedOutputMin, Operand requestedOutputMax, + Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("RequantizePerChannel", scope.makeOpName("RequantizePerChannel")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); @@ -58,42 +81,33 @@ public static RequantizePerChannel create(Scope scope, Oper opBuilder.addInput(requestedOutputMax.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new RequantizePerChannel(opBuilder.build()); + return new RequantizePerChannel<>(opBuilder.build()); } - + /** + * Gets output. * Output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The minimum value of the final output tensor + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The maximum value of the final output tensor. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RequantizePerChannel"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private RequantizePerChannel(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rint.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rint.java index 1de8f528899..1b481b2b613 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rint.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rint.java @@ -29,56 +29,63 @@ /** * 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 + *
+ * 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 */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Rint extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Rint"; + + private Output y; + + private Rint(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Rint operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Rint} output and operands * @return a new instance of Rint */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Rint create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Rint", scope.makeOpName("Rint")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Rint(opBuilder.build()); + return new Rint<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Rint"; - - private Output y; - - private Rint(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Round.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Round.java index 4c1352fb547..b1c9d56e6a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Round.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Round.java @@ -29,49 +29,57 @@ /** * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Round extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Round"; + + private Output y; + + private Round(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Round operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Round} output and operands * @return a new instance of Round */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Round create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Round", scope.makeOpName("Round")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Round(opBuilder.build()); + return new Round<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Round"; - - private Output y; - - private Round(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rsqrt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rsqrt.java index 4d8d3e620e4..664dd6722c8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rsqrt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Rsqrt.java @@ -29,48 +29,56 @@ /** * Computes reciprocal of square root of x element-wise. - *

- * I.e., \\(y = 1 / \sqrt{x}\\). - * - * @param data type for {@code y()} output + * I.e., \(y = 1 / \sqrt{x}\). + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Rsqrt extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Rsqrt"; + + private Output y; + + private Rsqrt(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Rsqrt operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Rsqrt} output and operands * @return a new instance of Rsqrt */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Rsqrt create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Rsqrt", scope.makeOpName("Rsqrt")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Rsqrt(opBuilder.build()); + return new Rsqrt<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Rsqrt"; - - private Output y; - - private Rsqrt(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RsqrtGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RsqrtGrad.java index a1696644fc3..9391283211d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RsqrtGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/RsqrtGrad.java @@ -24,55 +24,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Computes the gradient for the rsqrt of `x` wrt its input. - *

- * Specifically, `grad = dy * -0.5 * y^3`, where `y = rsqrt(x)`, and `dy` + * 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 data type for {@code z()} output + * + * @param data type for {@code z} output */ public final class RsqrtGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RsqrtGrad"; + + private Output z; + + private RsqrtGrad(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RsqrtGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RsqrtGrad create(Scope scope, Operand y, Operand dy) { OperationBuilder opBuilder = scope.env().opBuilder("RsqrtGrad", scope.makeOpName("RsqrtGrad")); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); opBuilder = scope.apply(opBuilder); - return new RsqrtGrad(opBuilder.build()); + return new RsqrtGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RsqrtGrad"; - - private Output z; - - private RsqrtGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMax.java index 8c5bc8344fa..e480323f02b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMax.java @@ -29,74 +29,77 @@ /** * 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`. - *

+ *

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 max is empty for a given segment ID {@code i}, {@code output[i] = 0}. *

* *
- *

- * For example: - *

{@code
+ * 

For example: + *

  * 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],
+ * # ==> [[4, 3, 3, 4],
  * #      [5, 6, 7, 8]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class SegmentMax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentMax"; + + private Output output; + + private SegmentMax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SegmentMax operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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. + * @param data type for {@code SegmentMax} output and operands * @return a new instance of SegmentMax */ - @Endpoint(describeByClass = true) - public static SegmentMax create(Scope scope, Operand data, Operand segmentIds) { + @Endpoint( + describeByClass = true + ) + public static SegmentMax create(Scope scope, Operand data, + Operand segmentIds) { OperationBuilder opBuilder = scope.env().opBuilder("SegmentMax", scope.makeOpName("SegmentMax")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder = scope.apply(opBuilder); - return new SegmentMax(opBuilder.build()); + return new SegmentMax<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentMax"; - - private Output output; - - private SegmentMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMean.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMean.java index 558a027606a..de3468012ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMean.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMean.java @@ -30,75 +30,78 @@ /** * 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}. *

* *
- *

- * For example: - *

{@code
+ * 

For example: + *

  * 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],
+ * # ==> [[2.5, 2.5, 2.5, 2.5],
  * #      [5, 6, 7, 8]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class SegmentMean extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentMean"; + + private Output output; + + private SegmentMean(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SegmentMean operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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. + * @param data type for {@code SegmentMean} output and operands * @return a new instance of SegmentMean */ - @Endpoint(describeByClass = true) - public static SegmentMean create(Scope scope, Operand data, Operand segmentIds) { + @Endpoint( + describeByClass = true + ) + public static SegmentMean create(Scope scope, Operand data, + Operand segmentIds) { OperationBuilder opBuilder = scope.env().opBuilder("SegmentMean", scope.makeOpName("SegmentMean")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder = scope.apply(opBuilder); - return new SegmentMean(opBuilder.build()); + return new SegmentMean<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentMean"; - - private Output output; - - private SegmentMean(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMin.java index 5b8b768ac75..eab68f6bccd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentMin.java @@ -29,74 +29,77 @@ /** * 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`. - *

+ *

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 min is empty for a given segment ID {@code i}, {@code output[i] = 0}. *

* *
- *

- * For example: - *

{@code
+ * 

For example: + *

  * 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],
+ * # ==> [[1, 2, 2, 1],
  * #      [5, 6, 7, 8]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class SegmentMin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentMin"; + + private Output output; + + private SegmentMin(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SegmentMin operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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. + * @param data type for {@code SegmentMin} output and operands * @return a new instance of SegmentMin */ - @Endpoint(describeByClass = true) - public static SegmentMin create(Scope scope, Operand data, Operand segmentIds) { + @Endpoint( + describeByClass = true + ) + public static SegmentMin create(Scope scope, Operand data, + Operand segmentIds) { OperationBuilder opBuilder = scope.env().opBuilder("SegmentMin", scope.makeOpName("SegmentMin")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder = scope.apply(opBuilder); - return new SegmentMin(opBuilder.build()); + return new SegmentMin<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentMin"; - - private Output output; - - private SegmentMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentProd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentProd.java index ff79fb6fa8a..a29b348a830 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentProd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentProd.java @@ -30,74 +30,77 @@ /** * 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`. - *

+ *

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}. *

* *
- *

- * For example: - *

{@code
+ * 

For example: + *

  * 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],
+ * # ==> [[4, 6, 6, 4],
  * #      [5, 6, 7, 8]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class SegmentProd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentProd"; + + private Output output; + + private SegmentProd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SegmentProd operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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. + * @param data type for {@code SegmentProd} output and operands * @return a new instance of SegmentProd */ - @Endpoint(describeByClass = true) - public static SegmentProd create(Scope scope, Operand data, Operand segmentIds) { + @Endpoint( + describeByClass = true + ) + public static SegmentProd create(Scope scope, Operand data, + Operand segmentIds) { OperationBuilder opBuilder = scope.env().opBuilder("SegmentProd", scope.makeOpName("SegmentProd")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder = scope.apply(opBuilder); - return new SegmentProd(opBuilder.build()); + return new SegmentProd<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentProd"; - - private Output output; - - private SegmentProd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentSum.java index e86b3a55469..0f726cc10e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SegmentSum.java @@ -30,74 +30,77 @@ /** * 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`. - *

+ *

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}. *

* *
- *

- * For example: - *

{@code
+ * 

For example: + *

  * 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, 5, 5, 5],
  * #      [5, 6, 7, 8]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class SegmentSum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SegmentSum"; + + private Output output; + + private SegmentSum(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SegmentSum operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @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. + * @param data type for {@code SegmentSum} output and operands * @return a new instance of SegmentSum */ - @Endpoint(describeByClass = true) - public static SegmentSum create(Scope scope, Operand data, Operand segmentIds) { + @Endpoint( + describeByClass = true + ) + public static SegmentSum create(Scope scope, Operand data, + Operand segmentIds) { OperationBuilder opBuilder = scope.env().opBuilder("SegmentSum", scope.makeOpName("SegmentSum")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder = scope.apply(opBuilder); - return new SegmentSum(opBuilder.build()); + return new SegmentSum<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SegmentSum"; - - private Output output; - - private SegmentSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sigmoid.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sigmoid.java index bd2a43a910f..752113b4947 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sigmoid.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sigmoid.java @@ -28,49 +28,57 @@ import org.tensorflow.types.family.TType; /** - * Computes sigmoid of `x` element-wise. - *

- * Specifically, `y = 1 / (1 + exp(-x))`. - * - * @param data type for {@code y()} output + * Computes sigmoid of {@code x} element-wise. + * Specifically, {@code y = 1 / (1 + exp(-x))}. + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Sigmoid extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sigmoid"; + + private Output y; + + private Sigmoid(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sigmoid operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Sigmoid} output and operands * @return a new instance of Sigmoid */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sigmoid create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sigmoid", scope.makeOpName("Sigmoid")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Sigmoid(opBuilder.build()); + return new Sigmoid<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sigmoid"; - - private Output y; - - private Sigmoid(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SigmoidGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SigmoidGrad.java index 5bb275ca5ce..ee500922cd6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SigmoidGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SigmoidGrad.java @@ -24,55 +24,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Computes the gradient of the sigmoid of `x` wrt its input. - *

- * Specifically, `grad = dy * y * (1 - y)`, where `y = sigmoid(x)`, and - * `dy` is the corresponding input gradient. - * - * @param data type for {@code z()} output + * 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 data type for {@code z} output */ public final class SigmoidGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SigmoidGrad"; + + private Output z; + + private SigmoidGrad(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SigmoidGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SigmoidGrad create(Scope scope, Operand y, Operand dy) { OperationBuilder opBuilder = scope.env().opBuilder("SigmoidGrad", scope.makeOpName("SigmoidGrad")); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); opBuilder = scope.apply(opBuilder); - return new SigmoidGrad(opBuilder.build()); + return new SigmoidGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SigmoidGrad"; - - private Output z; - - private SigmoidGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sign.java index ca2ae2cda02..a8b3940948b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sign.java @@ -29,54 +29,66 @@ /** * 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 + * {@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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Sign extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sign"; + + private Output y; + + private Sign(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sign operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Sign} output and operands * @return a new instance of Sign */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sign create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sign", scope.makeOpName("Sign")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Sign(opBuilder.build()); + return new Sign<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sign"; - - private Output y; - - private Sign(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sin.java index 35f6f8fd812..9e076a6a8fd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sin.java @@ -29,56 +29,62 @@ /** * 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 + * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Sin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sin"; + + private Output y; + + private Sin(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sin operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Sin} output and operands * @return a new instance of Sin */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sin create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sin", scope.makeOpName("Sin")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Sin(opBuilder.build()); + return new Sin<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sin"; - - private Output y; - - private Sin(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sinh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sinh.java index 8ee456108fa..8365de53578 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sinh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sinh.java @@ -29,56 +29,62 @@ /** * 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 + * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Sinh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sinh"; + + private Output y; + + private Sinh(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sinh operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Sinh} output and operands * @return a new instance of Sinh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sinh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sinh", scope.makeOpName("Sinh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Sinh(opBuilder.build()); + return new Sinh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sinh"; - - private Output y; - - private Sinh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SobolSample.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SobolSample.java index 5424188a9a6..88523a88cb0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SobolSample.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SobolSample.java @@ -25,80 +25,88 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Generates points from the Sobol sequence. - *

- * Creates a Sobol sequence with `num_results` samples. Each sample has dimension - * `dim`. Skips the first `skip` samples. - * - * @param data type for {@code samples()} output + * 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 samples} output */ public final class SobolSample extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SobolSample"; + + private Output samples; + + private SobolSample(Operation operation) { + super(operation); + int outputIdx = 0; + samples = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SobolSample operation. - * + * * @param scope current scope - * @param dim Positive scalar `Tensor` representing each sample's dimension. - * @param numResults Positive scalar `Tensor` of dtype int32. The number of Sobol points to return + * @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 `Tensor` of dtype int32. The number of initial points of the + * @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: `float32` or `float64`. + * @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 */ - @Endpoint(describeByClass = true) - public static SobolSample create(Scope scope, Operand dim, Operand numResults, Operand skip, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static SobolSample create(Scope scope, Operand dim, + Operand numResults, Operand skip, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("SobolSample", scope.makeOpName("SobolSample")); opBuilder.addInput(dim.asOutput()); opBuilder.addInput(numResults.asOutput()); opBuilder.addInput(skip.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new SobolSample(opBuilder.build()); + return new SobolSample<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new SobolSample operation using default output types. - * + * Factory method to create a class wrapping a new SobolSample operation, with the default output types. + * * @param scope current scope - * @param dim Positive scalar `Tensor` representing each sample's dimension. - * @param numResults Positive scalar `Tensor` of dtype int32. The number of Sobol points to return + * @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 `Tensor` of dtype int32. The number of initial points of the + * @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 + * @return a new instance of SobolSample, with default output types */ - @Endpoint(describeByClass = true) - public static SobolSample create(Scope scope, Operand dim, Operand numResults, Operand skip) { + @Endpoint( + describeByClass = true + ) + public static SobolSample create(Scope scope, Operand dim, + Operand numResults, Operand skip) { return create(scope, dim, numResults, skip, TFloat32.class); } - + /** - * `Tensor` of samples from Sobol sequence with `shape` [num_results, dim]. + * Gets samples. + * {@code Tensor} of samples from Sobol sequence with {@code shape} [num_results, dim]. + * @return samples. */ public Output samples() { return samples; } - + @Override public Output asOutput() { return samples; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SobolSample"; - - private Output samples; - - private SobolSample(Operation operation) { - super(operation); - int outputIdx = 0; - samples = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Softplus.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Softplus.java index 1014467d255..c1be1a20816 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Softplus.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Softplus.java @@ -28,47 +28,56 @@ import org.tensorflow.types.family.TNumber; /** - * Computes softplus: `log(exp(features) + 1)`. - * - * @param data type for {@code activations()} output + * Computes softplus: {@code log(exp(features) + 1)}. + * + * @param data type for {@code activations} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Softplus extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Softplus"; + + private Output activations; + + private Softplus(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Softplus operation. - * + * * @param scope current scope - * @param features + * @param features the features value + * @param data type for {@code Softplus} output and operands * @return a new instance of Softplus */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Softplus create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Softplus", scope.makeOpName("Softplus")); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new Softplus(opBuilder.build()); + return new Softplus<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Softplus"; - - private Output activations; - - private Softplus(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SoftplusGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SoftplusGrad.java index e3582acab64..0cf9b9963bc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SoftplusGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SoftplusGrad.java @@ -24,53 +24,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Computes softplus gradients for a softplus operation. - * - * @param data type for {@code backprops()} output + * + * @param data type for {@code backprops} output */ public final class SoftplusGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SoftplusGrad"; + + private Output backprops; + + private SoftplusGrad(Operation operation) { + super(operation); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SoftplusGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SoftplusGrad create(Scope scope, Operand gradients, Operand features) { + @Endpoint( + describeByClass = true + ) + public static SoftplusGrad create(Scope scope, Operand gradients, + Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("SoftplusGrad", scope.makeOpName("SoftplusGrad")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new SoftplusGrad(opBuilder.build()); + return new SoftplusGrad<>(opBuilder.build()); } - + /** - * The gradients: `gradients / (1 + exp(-features))`. + * Gets backprops. + * The gradients: {@code gradients / (1 + exp(-features))}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SoftplusGrad"; - - private Output backprops; - - private SoftplusGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sqrt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sqrt.java index 5cf9dd2327f..bcba1c9e2ef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sqrt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sqrt.java @@ -29,48 +29,56 @@ /** * Computes square root of x element-wise. - *

- * I.e., \\(y = \sqrt{x} = x^{1/2}\\). - * - * @param data type for {@code y()} output + * I.e., \(y = \sqrt{x} = x^{1/2}\). + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Sqrt extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sqrt"; + + private Output y; + + private Sqrt(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sqrt operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Sqrt} output and operands * @return a new instance of Sqrt */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sqrt create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sqrt", scope.makeOpName("Sqrt")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Sqrt(opBuilder.build()); + return new Sqrt<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sqrt"; - - private Output y; - - private Sqrt(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SqrtGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SqrtGrad.java index 9b9bef4fd92..15ac765690a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SqrtGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SqrtGrad.java @@ -24,55 +24,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Computes the gradient for the sqrt of `x` wrt its input. - *

- * Specifically, `grad = dy * 0.5 / y`, where `y = sqrt(x)`, and `dy` + * 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 data type for {@code z()} output + * + * @param data type for {@code z} output */ public final class SqrtGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SqrtGrad"; + + private Output z; + + private SqrtGrad(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SqrtGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SqrtGrad create(Scope scope, Operand y, Operand dy) { OperationBuilder opBuilder = scope.env().opBuilder("SqrtGrad", scope.makeOpName("SqrtGrad")); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); opBuilder = scope.apply(opBuilder); - return new SqrtGrad(opBuilder.build()); + return new SqrtGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SqrtGrad"; - - private Output z; - - private SqrtGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Square.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Square.java index c7f2781605f..22321e62837 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Square.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Square.java @@ -29,48 +29,56 @@ /** * Computes square of x element-wise. - *

- * I.e., \\(y = x * x = x^2\\). - * - * @param data type for {@code y()} output + * I.e., \(y = x * x = x^2\). + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Square extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Square"; + + private Output y; + + private Square(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Square operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Square} output and operands * @return a new instance of Square */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Square create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Square", scope.makeOpName("Square")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Square(opBuilder.build()); + return new Square<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Square"; - - private Output y; - - private Square(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SquaredDifference.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SquaredDifference.java index 4874e3db903..0b01fa5a1f7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SquaredDifference.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/SquaredDifference.java @@ -29,51 +29,60 @@ /** * Returns conj(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) - * - * @param data type for {@code z()} output + * NOTE: {@code math.SquaredDifference} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class SquaredDifference extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SquaredDifference"; + + private Output z; + + private SquaredDifference(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SquaredDifference operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static SquaredDifference create(Scope scope, Operand x, Operand y) { + @Endpoint( + describeByClass = true + ) + public static SquaredDifference create(Scope scope, Operand x, + Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("SquaredDifference", scope.makeOpName("SquaredDifference")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new SquaredDifference(opBuilder.build()); + return new SquaredDifference<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SquaredDifference"; - - private Output z; - - private SquaredDifference(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sub.java index bb81618f654..f1fae6af3d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Sub.java @@ -29,51 +29,59 @@ /** * Returns x - y element-wise. - *

- * NOTE: `math.Sub` supports broadcasting. More about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - * - * @param data type for {@code z()} output + * NOTE: {@code math.Sub} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Sub extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Sub"; + + private Output z; + + private Sub(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Sub operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sub create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Sub", scope.makeOpName("Sub")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Sub(opBuilder.build()); + return new Sub<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Sub"; - - private Output z; - - private Sub(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tan.java index 0ea80fcfaa8..0511fd4c0a6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tan.java @@ -29,57 +29,63 @@ /** * 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 + * 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 data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Tan extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Tan"; + + private Output y; + + private Tan(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Tan operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Tan} output and operands * @return a new instance of Tan */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Tan create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Tan", scope.makeOpName("Tan")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Tan(opBuilder.build()); + return new Tan<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Tan"; - - private Output y; - - private Tan(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tanh.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tanh.java index 5f71c39cd78..ce218e74fc9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tanh.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Tanh.java @@ -28,58 +28,70 @@ import org.tensorflow.types.family.TType; /** - * 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]`. - *

- * >>> x = tf.constant([-float("inf"), -5, -0.5, 1, 1.2, 2, 3, float("inf")]) - * >>> tf.math.tanh(x) - * - * - * - * @param data type for {@code y()} output + * 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.99990916, -0.46211717, 0.7615942 , 0.8336547 , + * 0.9640276 , 0.9950547 , 1. ], dtype=float32)> + *

+ *
+ *
+ * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Tanh extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Tanh"; + + private Output y; + + private Tanh(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Tanh operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Tanh} output and operands * @return a new instance of Tanh */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Tanh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Tanh", scope.makeOpName("Tanh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Tanh(opBuilder.build()); + return new Tanh<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Tanh"; - - private Output y; - - private Tanh(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TanhGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TanhGrad.java index 8b292523cce..a46fb120cc6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TanhGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TanhGrad.java @@ -24,55 +24,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Computes the gradient for the tanh of `x` wrt its input. - *

- * Specifically, `grad = dy (1 - yy)`, where `y = tanh(x)`, and `dy` + * 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 data type for {@code z()} output + * + * @param data type for {@code z} output */ public final class TanhGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TanhGrad"; + + private Output z; + + private TanhGrad(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TanhGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TanhGrad create(Scope scope, Operand y, Operand dy) { OperationBuilder opBuilder = scope.env().opBuilder("TanhGrad", scope.makeOpName("TanhGrad")); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); opBuilder = scope.apply(opBuilder); - return new TanhGrad(opBuilder.build()); + return new TanhGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TanhGrad"; - - private Output z; - - private TanhGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateDiv.java index 5902ad64c3f..101422dc4c0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateDiv.java @@ -29,56 +29,63 @@ /** * Returns x / y element-wise for integer types. - *

* 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) - * - * @param data type for {@code z()} output + *

NOTE: {@code math.TruncateDiv} supports broadcasting. More about broadcasting + * here + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class TruncateDiv extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TruncateDiv"; + + private Output z; + + private TruncateDiv(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TruncateDiv operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TruncateDiv create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("TruncateDiv", scope.makeOpName("TruncateDiv")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new TruncateDiv(opBuilder.build()); + return new TruncateDiv<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TruncateDiv"; - - private Output z; - - private TruncateDiv(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateMod.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateMod.java index 9419e0db0e4..05e9b656cb1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateMod.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/TruncateMod.java @@ -29,54 +29,60 @@ /** * 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 + * 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 data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class TruncateMod extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TruncateMod"; + + private Output z; + + private TruncateMod(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TruncateMod operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TruncateMod create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("TruncateMod", scope.makeOpName("TruncateMod")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new TruncateMod(opBuilder.build()); + return new TruncateMod<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TruncateMod"; - - private Output z; - - private TruncateMod(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMax.java index cdfc300c790..9ae0ba7019d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMax.java @@ -29,84 +29,85 @@ /** * 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 the unsorted segment sum operator found + * (here) . * 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. - *

*

* *
- *

- * For example: - *

{@code
+ * 

For example: + *

  * 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],
+ * # ==> [[ 4,  3, 3, 4],
  * #       [5,  6, 7, 8]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class UnsortedSegmentMax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnsortedSegmentMax"; + + private Output output; + + private UnsortedSegmentMax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnsortedSegmentMax operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + * @param data the data value + * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. + * @param numSegments the numSegments value + * @param data type for {@code UnsortedSegmentMax} output and operands * @return a new instance of UnsortedSegmentMax */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentMax create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentMax create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentMax", scope.makeOpName("UnsortedSegmentMax")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); opBuilder = scope.apply(opBuilder); - return new UnsortedSegmentMax(opBuilder.build()); + return new UnsortedSegmentMax<>(opBuilder.build()); } - + /** - * Has same shape as data, except for the first `segment_ids.rank` + * Gets output. + * Has same shape as data, except for the first {@code segment_ids.rank} * dimensions, which are replaced with a single dimension which has size - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentMax"; - - private Output output; - - private UnsortedSegmentMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMin.java index 080e45d9608..2d3497e61ae 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentMin.java @@ -29,78 +29,82 @@ /** * 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 the unsorted segment sum operator found + * (here) . * 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
+ * {@code output[i] = numeric_limits::max()}.
+ * 

For example: + *

  * 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],
+ * # ==> [[ 1,  2, 2, 1],
  * #       [5,  6, 7, 8]]
- * }
- * If the given segment ID `i` is negative, then the corresponding value is + *
+ *

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 type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class UnsortedSegmentMin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnsortedSegmentMin"; + + private Output output; + + private UnsortedSegmentMin(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnsortedSegmentMin operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + * @param data the data value + * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. + * @param numSegments the numSegments value + * @param data type for {@code UnsortedSegmentMin} output and operands * @return a new instance of UnsortedSegmentMin */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentMin create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentMin create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentMin", scope.makeOpName("UnsortedSegmentMin")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); opBuilder = scope.apply(opBuilder); - return new UnsortedSegmentMin(opBuilder.build()); + return new UnsortedSegmentMin<>(opBuilder.build()); } - + /** - * Has same shape as data, except for the first `segment_ids.rank` + * Gets output. + * Has same shape as data, except for the first {@code segment_ids.rank} * dimensions, which are replaced with a single dimension which has size - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentMin"; - - private Output output; - - private UnsortedSegmentMin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentProd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentProd.java index 992f1863978..5677ce1943f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentProd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentProd.java @@ -30,77 +30,81 @@ /** * 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 the unsorted segment sum operator found + * (here) . * 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
+ * 

\(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.unsorted_segment_prod(c, tf.constant([0, 1, 0]), num_segments=2)
- * # ==> [[ 4,  6, 6, 4],
+ * # ==> [[ 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 + *

+ *

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 type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class UnsortedSegmentProd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnsortedSegmentProd"; + + private Output output; + + private UnsortedSegmentProd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnsortedSegmentProd operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + * @param data the data value + * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. + * @param numSegments the numSegments value + * @param data type for {@code UnsortedSegmentProd} output and operands * @return a new instance of UnsortedSegmentProd */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentProd create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentProd create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentProd", scope.makeOpName("UnsortedSegmentProd")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); opBuilder = scope.apply(opBuilder); - return new UnsortedSegmentProd(opBuilder.build()); + return new UnsortedSegmentProd<>(opBuilder.build()); } - + /** - * Has same shape as data, except for the first `segment_ids.rank` + * Gets output. + * Has same shape as data, except for the first {@code segment_ids.rank} * dimensions, which are replaced with a single dimension which has size - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentProd"; - - private Output output; - - private UnsortedSegmentProd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentSum.java index a5fbc0acbe2..9bf98201624 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/UnsortedSegmentSum.java @@ -30,80 +30,83 @@ /** * 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. *

* *
- *
{@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,  5, 5, 5],
  * #       [5,  6, 7, 8]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class UnsortedSegmentSum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnsortedSegmentSum"; + + private Output output; + + private UnsortedSegmentSum(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnsortedSegmentSum operation. - * + * * @param scope current scope - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments + * @param data the data value + * @param segmentIds A tensor whose shape is a prefix of {@code data.shape}. + * @param numSegments the numSegments value + * @param data type for {@code UnsortedSegmentSum} output and operands * @return a new instance of UnsortedSegmentSum */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentSum create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentSum create(Scope scope, Operand data, + Operand segmentIds, Operand numSegments) { OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentSum", scope.makeOpName("UnsortedSegmentSum")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); opBuilder = scope.apply(opBuilder); - return new UnsortedSegmentSum(opBuilder.build()); + return new UnsortedSegmentSum<>(opBuilder.build()); } - + /** - * Has same shape as data, except for the first `segment_ids.rank` + * Gets output. + * Has same shape as data, except for the first {@code segment_ids.rank} * dimensions, which are replaced with a single dimension which has size - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentSum"; - - private Output output; - - private UnsortedSegmentSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xdivy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xdivy.java index 445519d405c..b27043121f1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xdivy.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xdivy.java @@ -29,48 +29,57 @@ /** * Returns 0 if x == 0, and x / y otherwise, elementwise. - * - * @param data type for {@code z()} output + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Xdivy extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Xdivy"; + + private Output z; + + private Xdivy(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Xdivy operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Xdivy create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Xdivy", scope.makeOpName("Xdivy")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Xdivy(opBuilder.build()); + return new Xdivy<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Xdivy"; - - private Output z; - - private Xdivy(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlog1py.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlog1py.java index 0bfd71e66b4..a266f4f7947 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlog1py.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlog1py.java @@ -29,48 +29,57 @@ /** * Returns 0 if x == 0, and x * log1p(y) otherwise, elementwise. - * - * @param data type for {@code z()} output + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Xlog1py extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Xlog1py"; + + private Output z; + + private Xlog1py(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Xlog1py operation. - * + * * @param scope current scope - * @param x - * @param y + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Xlog1py create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Xlog1py", scope.makeOpName("Xlog1py")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Xlog1py(opBuilder.build()); + return new Xlog1py<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Xlog1py"; - - private Output z; - - private Xlog1py(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlogy.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlogy.java index 2311fb50cf8..a5227700166 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlogy.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Xlogy.java @@ -29,48 +29,57 @@ /** * Returns 0 if x == 0, and x * log(y) otherwise, elementwise. - * - * @param data type for {@code z()} output + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Xlogy extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Xlogy"; + + private Output z; + + private Xlogy(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Xlogy operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Xlogy create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Xlogy", scope.makeOpName("Xlogy")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.apply(opBuilder); - return new Xlogy(opBuilder.build()); + return new Xlogy<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Xlogy"; - - private Output z; - - private Xlogy(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Zeta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Zeta.java index 73c290262c8..40502468711 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Zeta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/Zeta.java @@ -28,53 +28,60 @@ import org.tensorflow.types.family.TNumber; /** - * 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}\\) - * - * @param data type for {@code z()} output + *

\(\zeta(x, q) = \sum_{n=0}^{\infty} (q + n)^{-x}\) + * + * @param data type for {@code z} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class Zeta extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Zeta"; + + private Output z; + + private Zeta(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Zeta operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Zeta create(Scope scope, Operand x, Operand q) { OperationBuilder opBuilder = scope.env().opBuilder("Zeta", scope.makeOpName("Zeta")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(q.asOutput()); opBuilder = scope.apply(opBuilder); - return new Zeta(opBuilder.build()); + return new Zeta<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Zeta"; - - private Output z; - - private Zeta(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/erfinv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/erfinv.java index cfa2adab329..2f8af83f094 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/erfinv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/erfinv.java @@ -28,45 +28,56 @@ import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The Erfinv operation + * + * @param data type for {@code y} output */ -@Operator(group = "math") +@Operator( + group = "math" +) public final class erfinv extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new erfinv operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Erfinv"; + + private Output y; + + private erfinv(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Erfinv operation. + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Erfinv} output and operands * @return a new instance of erfinv */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static erfinv create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Erfinv", scope.makeOpName("erfinv")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new erfinv(opBuilder.build()); + return new erfinv<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Erfinv"; - - private Output y; - - private erfinv(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ0.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ0.java index 597e82504d0..42f0519eaa7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ0.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ0.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselJ0 operation + * + * @param data type for {@code y} output */ public final class BesselJ0 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselJ0"; + + private Output y; + + private BesselJ0(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselJ0 operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselJ0} output and operands * @return a new instance of BesselJ0 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselJ0 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselJ0", scope.makeOpName("BesselJ0")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselJ0(opBuilder.build()); + return new BesselJ0<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselJ0"; - - private Output y; - - private BesselJ0(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ1.java index 0e05c32334d..c288143289c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselJ1.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselJ1 operation + * + * @param data type for {@code y} output */ public final class BesselJ1 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselJ1"; + + private Output y; + + private BesselJ1(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselJ1 operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselJ1} output and operands * @return a new instance of BesselJ1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselJ1 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselJ1", scope.makeOpName("BesselJ1")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselJ1(opBuilder.build()); + return new BesselJ1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselJ1"; - - private Output y; - - private BesselJ1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0.java index ae0586d549c..7c13e1cb6fc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselK0 operation + * + * @param data type for {@code y} output */ public final class BesselK0 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselK0"; + + private Output y; + + private BesselK0(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselK0 operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselK0} output and operands * @return a new instance of BesselK0 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselK0 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselK0", scope.makeOpName("BesselK0")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselK0(opBuilder.build()); + return new BesselK0<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselK0"; - - private Output y; - - private BesselK0(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0e.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0e.java index e4a677d2f1a..1ec7c7cafca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0e.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK0e.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselK0e operation + * + * @param data type for {@code y} output */ public final class BesselK0e extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselK0e"; + + private Output y; + + private BesselK0e(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselK0e operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselK0e} output and operands * @return a new instance of BesselK0e */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselK0e create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselK0e", scope.makeOpName("BesselK0e")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselK0e(opBuilder.build()); + return new BesselK0e<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselK0e"; - - private Output y; - - private BesselK0e(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1.java index bcdd407508b..58163b4fff0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselK1 operation + * + * @param data type for {@code y} output */ public final class BesselK1 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselK1"; + + private Output y; + + private BesselK1(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselK1 operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselK1} output and operands * @return a new instance of BesselK1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselK1 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselK1", scope.makeOpName("BesselK1")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselK1(opBuilder.build()); + return new BesselK1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselK1"; - - private Output y; - - private BesselK1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1e.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1e.java index c5824c47cbd..cc8e512c4b6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1e.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselK1e.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselK1e operation + * + * @param data type for {@code y} output */ public final class BesselK1e extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselK1e"; + + private Output y; + + private BesselK1e(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselK1e operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselK1e} output and operands * @return a new instance of BesselK1e */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselK1e create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselK1e", scope.makeOpName("BesselK1e")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselK1e(opBuilder.build()); + return new BesselK1e<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselK1e"; - - private Output y; - - private BesselK1e(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY0.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY0.java index 03c8c1ade60..4b6eb42de1e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY0.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY0.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselY0 operation + * + * @param data type for {@code y} output */ public final class BesselY0 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselY0"; + + private Output y; + + private BesselY0(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselY0 operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselY0} output and operands * @return a new instance of BesselY0 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselY0 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselY0", scope.makeOpName("BesselY0")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselY0(opBuilder.build()); + return new BesselY0<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselY0"; - - private Output y; - - private BesselY0(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY1.java index 92a7561ee8a..4965db1cd8c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/BesselY1.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The BesselY1 operation + * + * @param data type for {@code y} output */ public final class BesselY1 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BesselY1"; + + private Output y; + + private BesselY1(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BesselY1 operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code BesselY1} output and operands * @return a new instance of BesselY1 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static BesselY1 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselY1", scope.makeOpName("BesselY1")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new BesselY1(opBuilder.build()); + return new BesselY1<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BesselY1"; - - private Output y; - - private BesselY1(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Dawsn.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Dawsn.java index 9e50d639d02..ef5934fb7ce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Dawsn.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Dawsn.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The Dawsn operation + * + * @param data type for {@code y} output */ public final class Dawsn extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Dawsn"; + + private Output y; + + private Dawsn(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Dawsn operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Dawsn} output and operands * @return a new instance of Dawsn */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Dawsn create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Dawsn", scope.makeOpName("Dawsn")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Dawsn(opBuilder.build()); + return new Dawsn<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dawsn"; - - private Output y; - - private Dawsn(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Expint.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Expint.java index 8cff09b15c3..999dfee7900 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Expint.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Expint.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The Expint operation + * + * @param data type for {@code y} output */ public final class Expint extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Expint"; + + private Output y; + + private Expint(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Expint operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Expint} output and operands * @return a new instance of Expint */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Expint create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Expint", scope.makeOpName("Expint")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Expint(opBuilder.build()); + return new Expint<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Expint"; - - private Output y; - - private Expint(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelCos.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelCos.java index f3d0848f814..d590d1869b5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelCos.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelCos.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The FresnelCos operation + * + * @param data type for {@code y} output */ public final class FresnelCos extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FresnelCos"; + + private Output y; + + private FresnelCos(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FresnelCos operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code FresnelCos} output and operands * @return a new instance of FresnelCos */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FresnelCos create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("FresnelCos", scope.makeOpName("FresnelCos")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new FresnelCos(opBuilder.build()); + return new FresnelCos<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FresnelCos"; - - private Output y; - - private FresnelCos(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelSin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelSin.java index 33d738bf9fd..919b887cf29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelSin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/FresnelSin.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The FresnelSin operation + * + * @param data type for {@code y} output */ public final class FresnelSin extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FresnelSin"; + + private Output y; + + private FresnelSin(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new FresnelSin operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code FresnelSin} output and operands * @return a new instance of FresnelSin */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static FresnelSin create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("FresnelSin", scope.makeOpName("FresnelSin")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new FresnelSin(opBuilder.build()); + return new FresnelSin<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FresnelSin"; - - private Output y; - - private FresnelSin(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Spence.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Spence.java index 39a3c134ebb..8d6a983ffa5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Spence.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/special/Spence.java @@ -24,48 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code y()} output + * The Spence operation + * + * @param data type for {@code y} output */ public final class Spence extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Spence"; + + private Output y; + + private Spence(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Spence operation. - * + * * @param scope current scope - * @param x + * @param x the x value + * @param data type for {@code Spence} output and operands * @return a new instance of Spence */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Spence create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Spence", scope.makeOpName("Spence")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); - return new Spence(opBuilder.build()); + return new Spence<>(opBuilder.build()); } - + /** + * Gets y. + * + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Spence"; - - private Output y; - - private Spence(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool.java index 77fb90557ec..d9ff43a7bf0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool.java @@ -30,61 +30,55 @@ /** * 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 + * 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 */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class AvgPool extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.AvgPool} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "AvgPool"; + + private Output output; + + private AvgPool(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AvgPool operation. - * + * * @param scope current scope - * @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`. + * @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 */ - @Endpoint(describeByClass = true) - public static AvgPool create(Scope scope, Operand value, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AvgPool create(Scope scope, Operand value, + List ksize, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AvgPool", scope.makeOpName("AvgPool")); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -96,40 +90,59 @@ public static AvgPool create(Scope scope, Operand valu } } } - return new AvgPool(opBuilder.build()); + return new AvgPool<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. * The average pooled output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AvgPool"; - - private Output output; - - private AvgPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.AvgPool} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3d.java index b75ad74af9a..97e608b32c8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3d.java @@ -30,63 +30,57 @@ /** * Performs 3D 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 + * 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 */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class AvgPool3d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "AvgPool3D"; + + private Output output; + + private AvgPool3d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new AvgPool3d operation. - * + * Factory method to create a class wrapping a new AvgPool3D operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static AvgPool3d create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AvgPool3d create(Scope scope, Operand input, + List ksize, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AvgPool3D", scope.makeOpName("AvgPool3d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -98,40 +92,59 @@ public static AvgPool3d create(Scope scope, Operand in } } } - return new AvgPool3d(opBuilder.build()); + return new AvgPool3d<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. * The average pooled output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AvgPool3D"; - - private Output output; - - private AvgPool3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3d} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3dGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3dGrad.java index 96ad463e8aa..4bdb6034816 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3dGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPool3dGrad.java @@ -31,62 +31,58 @@ /** * Computes gradients of average pooling function. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class AvgPool3dGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3dGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "AvgPool3DGrad"; + + private Output output; + + private AvgPool3dGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new AvgPool3dGrad operation. - * + * Factory method to create a class wrapping a new AvgPool3DGrad operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static AvgPool3dGrad create(Scope scope, Operand origInputShape, Operand grad, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AvgPool3dGrad create(Scope scope, + Operand origInputShape, Operand grad, List ksize, List strides, + String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AvgPool3DGrad", scope.makeOpName("AvgPool3dGrad")); opBuilder.addInput(origInputShape.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -98,40 +94,59 @@ public static AvgPool3dGrad create(Scope scope, Operand(opBuilder.build()); + return new AvgPool3dGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. * The backprop for input. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AvgPool3DGrad"; - - private Output output; - - private AvgPool3dGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3dGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPoolGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPoolGrad.java index 585f72414e1..039307cdbdd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPoolGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/AvgPoolGrad.java @@ -25,66 +25,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Computes gradients of the average pooling function. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class AvgPoolGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.AvgPoolGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "AvgPoolGrad"; + + private Output output; + + private AvgPoolGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AvgPoolGrad operation. - * + * * @param scope current scope - * @param origInputShape 1-D. Shape of the original input to `avg_pool`. - * @param grad 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. - * the output of `avg_pool`. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code AvgPoolGrad} output and operands * @return a new instance of AvgPoolGrad */ - @Endpoint(describeByClass = true) - public static AvgPoolGrad create(Scope scope, Operand origInputShape, Operand grad, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AvgPoolGrad create(Scope scope, + Operand origInputShape, Operand grad, List ksize, List strides, + String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AvgPoolGrad", scope.makeOpName("AvgPoolGrad")); opBuilder.addInput(origInputShape.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -96,40 +89,59 @@ public static AvgPoolGrad create(Scope scope, Operand(opBuilder.build()); + return new AvgPoolGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** - * 4-D. Gradients w.r.t. the input of `avg_pool`. + * Gets output. + * 4-D. Gradients w.r.t. the input of {@code avg_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AvgPoolGrad"; - - private Output output; - - private AvgPoolGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.AvgPoolGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalization.java index 18ad9cf60ee..7c84dd5f26f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalization.java @@ -29,17 +29,30 @@ /** * Batch normalization. - *

- * This op is deprecated. Prefer `tf.nn.batch_normalization`. - * - * @param data type for {@code result()} output + * This op is deprecated. Prefer {@code tf.nn.batch_normalization}. + * + * @param data type for {@code result} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class BatchNormWithGlobalNormalization extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchNormWithGlobalNormalization"; + + private Output result; + + private BatchNormWithGlobalNormalization(Operation operation) { + super(operation); + int outputIdx = 0; + result = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchNormWithGlobalNormalization operation. - * + * * @param scope current scope * @param t A 4D input Tensor. * @param m A 1D mean Tensor with size matching the last dimension of t. @@ -51,15 +64,20 @@ public final class BatchNormWithGlobalNormalization extends Raw * @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 */ - @Endpoint(describeByClass = true) - public static BatchNormWithGlobalNormalization create(Scope scope, Operand t, Operand m, Operand v, Operand beta, Operand gamma, Float varianceEpsilon, Boolean scaleAfterNormalization) { + @Endpoint( + describeByClass = true + ) + public static BatchNormWithGlobalNormalization create(Scope scope, + Operand t, Operand m, Operand v, Operand beta, Operand gamma, + Float varianceEpsilon, Boolean scaleAfterNormalization) { OperationBuilder opBuilder = scope.env().opBuilder("BatchNormWithGlobalNormalization", scope.makeOpName("BatchNormWithGlobalNormalization")); opBuilder.addInput(t.asOutput()); opBuilder.addInput(m.asOutput()); @@ -69,28 +87,20 @@ public static BatchNormWithGlobalNormalization create(Scope opBuilder = scope.apply(opBuilder); opBuilder.setAttr("variance_epsilon", varianceEpsilon); opBuilder.setAttr("scale_after_normalization", scaleAfterNormalization); - return new BatchNormWithGlobalNormalization(opBuilder.build()); + return new BatchNormWithGlobalNormalization<>(opBuilder.build()); } - + /** + * Gets result. + * + * @return result. */ public Output result() { return result; } - + @Override public Output asOutput() { return result; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchNormWithGlobalNormalization"; - - private Output result; - - private BatchNormWithGlobalNormalization(Operation operation) { - super(operation); - int outputIdx = 0; - result = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalizationGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalizationGrad.java index 31819d472e9..01189753828 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalizationGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BatchNormWithGlobalNormalizationGrad.java @@ -29,17 +29,42 @@ /** * Gradients for batch normalization. - *

- * This op is deprecated. See `tf.nn.batch_normalization`. - * - * @param data type for {@code dx()} output + * This op is deprecated. See {@code tf.nn.batch_normalization}. + * + * @param data type for {@code dx} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class BatchNormWithGlobalNormalizationGrad extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchNormWithGlobalNormalizationGrad"; + + private Output dx; + + private Output dm; + + private Output dv; + + private Output db; + + private Output dg; + + private BatchNormWithGlobalNormalizationGrad(Operation operation) { + super(operation); + int outputIdx = 0; + dx = operation.output(outputIdx++); + dm = operation.output(outputIdx++); + dv = operation.output(outputIdx++); + db = operation.output(outputIdx++); + dg = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new BatchNormWithGlobalNormalizationGrad operation. - * + * * @param scope current scope * @param t A 4D input Tensor. * @param m A 1D mean Tensor with size matching the last dimension of t. @@ -49,16 +74,21 @@ public final class BatchNormWithGlobalNormalizationGrad extends * 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 */ - @Endpoint(describeByClass = true) - public static BatchNormWithGlobalNormalizationGrad create(Scope scope, Operand t, Operand m, Operand v, Operand gamma, Operand backprop, Float varianceEpsilon, Boolean scaleAfterNormalization) { + @Endpoint( + describeByClass = true + ) + public static BatchNormWithGlobalNormalizationGrad create(Scope scope, + Operand t, Operand m, Operand v, Operand gamma, Operand backprop, + Float varianceEpsilon, Boolean scaleAfterNormalization) { OperationBuilder opBuilder = scope.env().opBuilder("BatchNormWithGlobalNormalizationGrad", scope.makeOpName("BatchNormWithGlobalNormalizationGrad")); opBuilder.addInput(t.asOutput()); opBuilder.addInput(m.asOutput()); @@ -68,60 +98,51 @@ public static BatchNormWithGlobalNormalizationGrad create(S opBuilder = scope.apply(opBuilder); opBuilder.setAttr("variance_epsilon", varianceEpsilon); opBuilder.setAttr("scale_after_normalization", scaleAfterNormalization); - return new BatchNormWithGlobalNormalizationGrad(opBuilder.build()); + return new BatchNormWithGlobalNormalizationGrad<>(opBuilder.build()); } - + /** + * Gets dx. * 4D backprop tensor for input. + * @return dx. */ public Output dx() { return dx; } - + /** + * Gets dm. * 1D backprop tensor for mean. + * @return dm. */ public Output dm() { return dm; } - + /** + * Gets dv. * 1D backprop tensor for variance. + * @return dv. */ public Output dv() { return dv; } - + /** + * Gets db. * 1D backprop tensor for beta. + * @return db. */ public Output db() { return db; } - + /** + * Gets dg. * 1D backprop tensor for gamma. + * @return dg. */ public Output dg() { return dg; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchNormWithGlobalNormalizationGrad"; - - private Output dx; - private Output dm; - private Output dv; - private Output db; - private Output dg; - - private BatchNormWithGlobalNormalizationGrad(Operation operation) { - super(operation); - int outputIdx = 0; - dx = operation.output(outputIdx++); - dm = operation.output(outputIdx++); - dv = operation.output(outputIdx++); - db = operation.output(outputIdx++); - dg = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAdd.java index 2d402e4b608..26445fd21e5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAdd.java @@ -28,52 +28,44 @@ import org.tensorflow.types.family.TType; /** - * 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. - * - * @param data type for {@code output()} output + * 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 */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class BiasAdd extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.BiasAdd} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the bias tensor will be added to the last dimension - * of the value tensor. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - * The tensor will be added to "in_channels", the third-to-the-last - * dimension. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "BiasAdd"; + + private Output output; + + private BiasAdd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BiasAdd operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static BiasAdd create(Scope scope, Operand value, Operand bias, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BiasAdd create(Scope scope, Operand value, Operand bias, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BiasAdd", scope.makeOpName("BiasAdd")); opBuilder.addInput(value.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -85,42 +77,63 @@ public static BiasAdd create(Scope scope, Operand value, } } } - return new BiasAdd(opBuilder.build()); + return new BiasAdd<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the bias tensor will be added to the last dimension + * default format "NHWC", the bias tensor will be added to the last dimension * of the value tensor. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - * The tensor will be added to "in_channels", the third-to-the-last - * dimension. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * The tensor will be added to "in_channels", the third-to-the-last + * dimension. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** - * Broadcasted sum of `value` and `bias`. + * Gets output. + * Broadcasted sum of {@code value} and {@code bias}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BiasAdd"; - - private Output output; - - private BiasAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.BiasAdd} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the bias tensor will be added to the last dimension + * of the value tensor. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * The tensor will be added to "in_channels", the third-to-the-last + * dimension. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAddGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAddGrad.java index 05b7cad74b7..4ef33c75908 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAddGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BiasAddGrad.java @@ -28,52 +28,44 @@ import org.tensorflow.types.family.TType; /** - * 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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class BiasAddGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.BiasAddGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the bias tensor will be added to the last dimension - * of the value tensor. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - * The tensor will be added to "in_channels", the third-to-the-last - * dimension. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "BiasAddGrad"; + + private Output output; + + private BiasAddGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new BiasAddGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static BiasAddGrad create(Scope scope, Operand outBackprop, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BiasAddGrad create(Scope scope, Operand outBackprop, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BiasAddGrad", scope.makeOpName("BiasAddGrad")); opBuilder.addInput(outBackprop.asOutput()); opBuilder = scope.apply(opBuilder); @@ -84,42 +76,63 @@ public static BiasAddGrad create(Scope scope, Operand ou } } } - return new BiasAddGrad(opBuilder.build()); + return new BiasAddGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the bias tensor will be added to the last dimension + * default format "NHWC", the bias tensor will be added to the last dimension * of the value tensor. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - * The tensor will be added to "in_channels", the third-to-the-last - * dimension. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * The tensor will be added to "in_channels", the third-to-the-last + * dimension. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** - * 1-D with size the feature dimension of `out_backprop`. + * Gets output. + * 1-D with size the feature dimension of {@code out_backprop}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BiasAddGrad"; - - private Output output; - - private BiasAddGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.BiasAddGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the bias tensor will be added to the last dimension + * of the value tensor. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * The tensor will be added to "in_channels", the third-to-the-last + * dimension. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTM.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTM.java index 9b1b33daee8..9e2adfd2b29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTM.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTM.java @@ -24,15 +24,13 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Computes the LSTM cell forward propagation for all the time steps. - *

* This is equivalent to applying LSTMBlockCell in a loop, like so: - *

{@code
+ * 
  * for x1 in unpack(x):
  *   i1, cs1, f1, o1, ci1, co1, h1 = LSTMBlock(
  *     x1, cs_prev, h_prev, w, wci, wcf, wco, b)
@@ -46,48 +44,49 @@
  *   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 data type for {@code i()} output + *
+ * + * @param data type for {@code i} output */ public final class BlockLSTM extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.BlockLSTM} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param cellClip Value to clip the 'cs' value to. - */ - public Options cellClip(Float cellClip) { - this.cellClip = cellClip; - return this; - } - - /** - * @param usePeephole Whether to use peephole weights. - */ - public Options usePeephole(Boolean usePeephole) { - this.usePeephole = usePeephole; - return this; - } - - private Float cellClip; - private Boolean usePeephole; - - private Options() { - } + public static final String OP_NAME = "BlockLSTMV2"; + + private Output i; + + private Output cs; + + private Output f; + + private Output o; + + private Output ci; + + private Output co; + + private Output h; + + private BlockLSTM(Operation operation) { + super(operation); + int outputIdx = 0; + i = operation.output(outputIdx++); + cs = operation.output(outputIdx++); + f = operation.output(outputIdx++); + o = operation.output(outputIdx++); + ci = operation.output(outputIdx++); + co = operation.output(outputIdx++); + h = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BlockLSTM operation. - * + * Factory method to create a class wrapping a new BlockLSTMV2 operation. + * * @param scope current scope * @param seqLenMax Maximum time length actually used by this input. Outputs are padded * with zeros beyond this length. @@ -99,11 +98,16 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code BlockLSTMV2} output and operands * @return a new instance of BlockLSTM */ - @Endpoint(describeByClass = true) - public static BlockLSTM create(Scope scope, Operand seqLenMax, Operand x, Operand csPrev, Operand hPrev, Operand w, Operand wci, Operand wcf, Operand wco, Operand b, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BlockLSTM create(Scope scope, Operand seqLenMax, + Operand x, Operand csPrev, Operand hPrev, Operand w, Operand wci, + Operand wcf, Operand wco, Operand b, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BlockLSTMV2", scope.makeOpName("BlockLSTM")); opBuilder.addInput(seqLenMax.asOutput()); opBuilder.addInput(x.asOutput()); @@ -125,92 +129,123 @@ public static BlockLSTM create(Scope scope, Operand(opBuilder.build()); + return new BlockLSTM<>(opBuilder.build()); } - + /** + * Sets the cellClip option. + * * @param cellClip Value to clip the 'cs' value to. + * @return this Options instance. */ public static Options cellClip(Float cellClip) { return new Options().cellClip(cellClip); } - + /** + * Sets the usePeephole option. + * * @param usePeephole Whether to use peephole weights. + * @return this Options instance. */ public static Options usePeephole(Boolean usePeephole) { return new Options().usePeephole(usePeephole); } - + /** + * Gets i. * The input gate over the whole time sequence. + * @return i. */ public Output i() { return i; } - + /** + * Gets cs. * The cell state before the tanh over the whole time sequence. + * @return cs. */ public Output cs() { return cs; } - + /** + * Gets f. * The forget gate over the whole time sequence. + * @return f. */ public Output f() { return f; } - + /** + * Gets o. * The output gate over the whole time sequence. + * @return o. */ public Output o() { return o; } - + /** + * Gets ci. * The cell input over the whole time sequence. + * @return ci. */ public Output ci() { return ci; } - + /** + * Gets co. * The cell after the tanh over the whole time sequence. + * @return co. */ public Output co() { return co; } - + /** + * Gets h. * The output h vector over the whole time sequence. + * @return h. */ public Output h() { return h; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BlockLSTMV2"; - - private Output i; - private Output cs; - private Output f; - private Output o; - private Output ci; - private Output co; - private Output h; - - private BlockLSTM(Operation operation) { - super(operation); - int outputIdx = 0; - i = operation.output(outputIdx++); - cs = operation.output(outputIdx++); - f = operation.output(outputIdx++); - o = operation.output(outputIdx++); - ci = operation.output(outputIdx++); - co = operation.output(outputIdx++); - h = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.BlockLSTM} + */ + public static class Options { + private Float cellClip; + + private Boolean usePeephole; + + private Options() { + } + + /** + * Sets the cellClip option. + * + * @param cellClip Value to clip the 'cs' value to. + * @return this Options instance. + */ + public Options cellClip(Float cellClip) { + this.cellClip = cellClip; + return this; + } + + /** + * Sets the usePeephole option. + * + * @param usePeephole Whether to use peephole weights. + * @return this Options instance. + */ + public Options usePeephole(Boolean usePeephole) { + this.usePeephole = usePeephole; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTMGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTMGrad.java index f7f0c2449d4..ed7c7b79957 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTMGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/BlockLSTMGrad.java @@ -24,22 +24,53 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Computes the LSTM cell backward propagation for the entire time sequence. - *

* This implementation is to be used in conjunction of BlockLSTMV2. - * - * @param data type for {@code xGrad()} output + * + * @param data type for {@code x_grad} output */ public final class BlockLSTMGrad extends RawOp { - /** - * Factory method to create a class wrapping a new BlockLSTMGrad operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BlockLSTMGradV2"; + + private Output xGrad; + + private Output csPrevGrad; + + private Output hPrevGrad; + + private Output wGrad; + + private Output wciGrad; + + private Output wcfGrad; + + private Output wcoGrad; + + private Output bGrad; + + private BlockLSTMGrad(Operation operation) { + super(operation); + int outputIdx = 0; + xGrad = operation.output(outputIdx++); + csPrevGrad = operation.output(outputIdx++); + hPrevGrad = operation.output(outputIdx++); + wGrad = operation.output(outputIdx++); + wciGrad = operation.output(outputIdx++); + wcfGrad = operation.output(outputIdx++); + wcoGrad = operation.output(outputIdx++); + bGrad = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BlockLSTMGradV2 operation. + * * @param scope current scope * @param seqLenMax Maximum time length actually used by this input. Outputs are padded * with zeros beyond this length. @@ -61,10 +92,17 @@ public final class BlockLSTMGrad extends RawOp { * @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 */ - @Endpoint(describeByClass = true) - public static BlockLSTMGrad create(Scope scope, 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) { + @Endpoint( + describeByClass = true + ) + public static BlockLSTMGrad create(Scope scope, 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) { OperationBuilder opBuilder = scope.env().opBuilder("BlockLSTMGradV2", scope.makeOpName("BlockLSTMGrad")); opBuilder.addInput(seqLenMax.asOutput()); opBuilder.addInput(x.asOutput()); @@ -86,87 +124,78 @@ public static BlockLSTMGrad create(Scope scope, Operand(opBuilder.build()); + return new BlockLSTMGrad<>(opBuilder.build()); } - + /** + * Gets xGrad. * The gradient of x to be back-propped. + * @return xGrad. */ public Output xGrad() { return xGrad; } - + /** + * Gets csPrevGrad. * The gradient of cs_prev to be back-propped. + * @return csPrevGrad. */ public Output csPrevGrad() { return csPrevGrad; } - + /** + * Gets hPrevGrad. * The gradient of h_prev to be back-propped. + * @return hPrevGrad. */ public Output hPrevGrad() { return hPrevGrad; } - + /** + * Gets wGrad. * The gradient for w to be back-propped. + * @return wGrad. */ public Output wGrad() { return wGrad; } - + /** + * Gets wciGrad. * The gradient for wci to be back-propped. + * @return wciGrad. */ public Output wciGrad() { return wciGrad; } - + /** + * Gets wcfGrad. * The gradient for wcf to be back-propped. + * @return wcfGrad. */ public Output wcfGrad() { return wcfGrad; } - + /** + * Gets wcoGrad. * The gradient for wco to be back-propped. + * @return wcoGrad. */ public Output wcoGrad() { return wcoGrad; } - + /** + * Gets bGrad. * The gradient for w to be back-propped. + * @return bGrad. */ public Output bGrad() { return bGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BlockLSTMGradV2"; - - private Output xGrad; - private Output csPrevGrad; - private Output hPrevGrad; - private Output wGrad; - private Output wciGrad; - private Output wcfGrad; - private Output wcoGrad; - private Output bGrad; - - private BlockLSTMGrad(Operation operation) { - super(operation); - int outputIdx = 0; - xGrad = operation.output(outputIdx++); - csPrevGrad = operation.output(outputIdx++); - hPrevGrad = operation.output(outputIdx++); - wGrad = operation.output(outputIdx++); - wciGrad = operation.output(outputIdx++); - wcfGrad = operation.output(outputIdx++); - wcoGrad = operation.output(outputIdx++); - bGrad = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CTCLossV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CTCLossV2.java index b39d4bfeba5..17b187b0ec4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CTCLossV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CTCLossV2.java @@ -24,77 +24,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; /** * 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. */ public final class CTCLossV2 extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CTCLossV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param preprocessCollapseRepeated Scalar, if true then repeated labels are - * collapsed prior to the CTC calculation. - */ - public Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { - this.preprocessCollapseRepeated = preprocessCollapseRepeated; - return this; - } - - /** - * @param ctcMergeRepeated Scalar. If set to false, during CTC calculation - * repeated non-blank labels will not be merged and are interpreted as - * individual labels. This is a simplified version of CTC. - */ - public Options ctcMergeRepeated(Boolean ctcMergeRepeated) { - this.ctcMergeRepeated = ctcMergeRepeated; - return this; - } - - /** - * @param ignoreLongerOutputsThanInputs Scalar. If set to true, during CTC - * calculation, items that have longer output sequences than input sequences - * are skipped: they don't contribute to the loss term and have zero-gradient. - */ - public Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { - this.ignoreLongerOutputsThanInputs = ignoreLongerOutputsThanInputs; - return this; - } - - private Boolean preprocessCollapseRepeated; - private Boolean ctcMergeRepeated; - private Boolean ignoreLongerOutputsThanInputs; - - private Options() { - } + public static final String OP_NAME = "CTCLossV2"; + + private Output loss; + + private Output gradient; + + private CTCLossV2(Operation operation) { + super(operation); + int outputIdx = 0; + loss = operation.output(outputIdx++); + gradient = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new CTCLossV2 operation. - * + * * @param scope current scope - * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. Default blank + * @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 `SparseTensor`. - * `labels_indices(i, :) == [b, t]` means `labels_values(i)` stores the id for - * `(batch b, time t)`. + * @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 * @return a new instance of CTCLossV2 */ - @Endpoint(describeByClass = true) - public static CTCLossV2 create(Scope scope, Operand inputs, Operand labelsIndices, Operand labelsValues, Operand sequenceLength, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CTCLossV2 create(Scope scope, Operand inputs, + Operand labelsIndices, Operand labelsValues, Operand sequenceLength, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CTCLossV2", scope.makeOpName("CTCLossV2")); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(labelsIndices.asOutput()); @@ -116,58 +91,110 @@ public static CTCLossV2 create(Scope scope, Operand inputs, Operandduring CTC calculation + * Sets the ctcMergeRepeated option. + * + * @param ctcMergeRepeated Scalar. If set to false, during CTC calculation * repeated non-blank labels will not be merged and are interpreted as * individual labels. This is a simplified version of CTC. + * @return this Options instance. */ public static Options ctcMergeRepeated(Boolean ctcMergeRepeated) { return new Options().ctcMergeRepeated(ctcMergeRepeated); } - + /** + * Sets the ignoreLongerOutputsThanInputs option. + * * @param ignoreLongerOutputsThanInputs Scalar. If set to true, during CTC * calculation, items that have longer output sequences than input sequences * are skipped: they don't contribute to the loss term and have zero-gradient. + * @return this Options instance. */ public static Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { return new Options().ignoreLongerOutputsThanInputs(ignoreLongerOutputsThanInputs); } - + /** + * Gets loss. * A vector (batch) containing log-probabilities. + * @return loss. */ public Output loss() { return loss; } - + /** - * The gradient of `loss`. 3-D, shape: - * `(max_time x batch_size x num_classes)`. + * Gets gradient. + * The gradient of {@code loss}. 3-D, shape: + * {@code (max_time x batch_size x num_classes)}. + * @return gradient. */ public Output gradient() { return gradient; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CTCLossV2"; - - private Output loss; - private Output gradient; - - private CTCLossV2(Operation operation) { - super(operation); - int outputIdx = 0; - loss = operation.output(outputIdx++); - gradient = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CTCLossV2} + */ + public static class Options { + private Boolean preprocessCollapseRepeated; + + private Boolean ctcMergeRepeated; + + private Boolean ignoreLongerOutputsThanInputs; + + private Options() { + } + + /** + * Sets the preprocessCollapseRepeated option. + * + * @param preprocessCollapseRepeated Scalar, if true then repeated labels are + * collapsed prior to the CTC calculation. + * @return this Options instance. + */ + public Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { + this.preprocessCollapseRepeated = preprocessCollapseRepeated; + return this; + } + + /** + * Sets the ctcMergeRepeated option. + * + * @param ctcMergeRepeated Scalar. If set to false, during CTC calculation + * repeated non-blank labels will not be merged and are interpreted as + * individual labels. This is a simplified version of CTC. + * @return this Options instance. + */ + public Options ctcMergeRepeated(Boolean ctcMergeRepeated) { + this.ctcMergeRepeated = ctcMergeRepeated; + return this; + } + + /** + * Sets the ignoreLongerOutputsThanInputs option. + * + * @param ignoreLongerOutputsThanInputs Scalar. If set to true, during CTC + * calculation, items that have longer output sequences than input sequences + * are skipped: they don't contribute to the loss term and have zero-gradient. + * @return this Options instance. + */ + public Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { + this.ignoreLongerOutputsThanInputs = ignoreLongerOutputsThanInputs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ComputeAccidentalHits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ComputeAccidentalHits.java index 1007ad691ff..9a7dbaf6080 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ComputeAccidentalHits.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ComputeAccidentalHits.java @@ -31,57 +31,49 @@ /** * 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 * making the classifier sure that they are sampled labels. */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class ComputeAccidentalHits extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.ComputeAccidentalHits} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either seed or seed2 are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "ComputeAccidentalHits"; + + private Output indices; + + private Output ids; + + private Output weights; + + private ComputeAccidentalHits(Operation operation) { + super(operation); + int outputIdx = 0; + indices = operation.output(outputIdx++); + ids = operation.output(outputIdx++); + weights = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ComputeAccidentalHits operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static ComputeAccidentalHits create(Scope scope, Operand trueClasses, Operand sampledCandidates, Long numTrue, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ComputeAccidentalHits create(Scope scope, Operand trueClasses, + Operand sampledCandidates, Long numTrue, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ComputeAccidentalHits", scope.makeOpName("ComputeAccidentalHits")); opBuilder.addInput(trueClasses.asOutput()); opBuilder.addInput(sampledCandidates.asOutput()); @@ -99,58 +91,91 @@ public static ComputeAccidentalHits create(Scope scope, Operand trueClas } return new ComputeAccidentalHits(opBuilder.build()); } - + /** + * Sets the seed option. + * * @param seed If either seed or seed2 are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets indices. * A vector of indices corresponding to rows of true_candidates. + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets ids. * A vector of IDs of positions in sampled_candidates that match a true_label * for the row with the corresponding index in indices. + * @return ids. */ public Output ids() { return ids; } - + /** + * Gets weights. * A vector of the same length as indices and ids, in which each element * is -FLOAT_MAX. + * @return weights. */ public Output weights() { return weights; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ComputeAccidentalHits"; - - private Output indices; - private Output ids; - private Output weights; - - private ComputeAccidentalHits(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - ids = operation.output(outputIdx++); - weights = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.ComputeAccidentalHits} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2d.java index e3d98fe0882..cf5b02bc8bb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2d.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -29,115 +30,74 @@ import org.tensorflow.types.family.TNumber; /** - * 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 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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Conv2d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv2d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useCudnnOnGpu - */ - public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { - this.useCudnnOnGpu = useCudnnOnGpu; - return this; - } - - /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith - * dimension, the amount of padding inserted before and after the dimension is - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each - * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private Boolean useCudnnOnGpu; - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv2D"; + + private Output output; + + private Conv2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv2d operation. - * + * Factory method to create a class wrapping a new Conv2D operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static Conv2d create(Scope scope, Operand input, Operand filter, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Conv2d create(Scope scope, Operand input, + Operand filter, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Conv2D", scope.makeOpName("Conv2d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -149,7 +109,7 @@ public static Conv2d create(Scope scope, Operand input } if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -159,76 +119,206 @@ public static Conv2d create(Scope scope, Operand input } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv2d(opBuilder.build()); + return new Conv2d<>(opBuilder.build()); } - + /** - * @param useCudnnOnGpu + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. */ public static Options useCudnnOnGpu(Boolean useCudnnOnGpu) { return new Options().useCudnnOnGpu(useCudnnOnGpu); } - + /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith * dimension, the amount of padding inserted before and after the dimension is - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. */ public static Options explicitPaddings(List explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } - + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public static Options explicitPaddings(Long[] explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and + * value of {@code data_format}, see above for details. Dilations in the batch and * depth dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. * A 4-D tensor. The dimension order is determined by the value of - * `data_format`, see below for details. + * {@code data_format}, see below for details. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv2D"; - - private Output output; - - private Conv2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv2d} + */ + public static class Options { + private Boolean useCudnnOnGpu; + + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. + */ + public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { + this.useCudnnOnGpu = useCudnnOnGpu; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(Long... explicitPaddings) { + this.explicitPaddings = Arrays.asList(explicitPaddings); + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilter.java index bc282d8b349..b1fcfad96b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropFilter.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -31,95 +32,57 @@ /** * Computes the gradients of convolution with respect to the filter. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Conv2dBackpropFilter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropFilter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useCudnnOnGpu - */ - public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { - this.useCudnnOnGpu = useCudnnOnGpu; - return this; - } - - /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith - * dimension, the amount of padding inserted before and after the dimension is - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter - * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private Boolean useCudnnOnGpu; - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv2DBackpropFilter"; + + private Output output; + + private Conv2dBackpropFilter(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv2dBackpropFilter operation. - * + * Factory method to create a class wrapping a new Conv2DBackpropFilter operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Conv2dBackpropFilter create(Scope scope, Operand input, Operand filterSizes, Operand outBackprop, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Conv2dBackpropFilter create(Scope scope, Operand input, + Operand filterSizes, Operand outBackprop, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Conv2DBackpropFilter", scope.makeOpName("Conv2dBackpropFilter")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filterSizes.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -131,7 +94,7 @@ public static Conv2dBackpropFilter create(Scope scope, Op } if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -141,77 +104,207 @@ public static Conv2dBackpropFilter create(Scope scope, Op } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv2dBackpropFilter(opBuilder.build()); + return new Conv2dBackpropFilter<>(opBuilder.build()); } - + /** - * @param useCudnnOnGpu + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. */ public static Options useCudnnOnGpu(Boolean useCudnnOnGpu) { return new Options().useCudnnOnGpu(useCudnnOnGpu); } - + /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith * dimension, the amount of padding inserted before and after the dimension is - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. */ public static Options explicitPaddings(List explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } - + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public static Options explicitPaddings(Long[] explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth + * {@code data_format}, see above for details. Dilations in the batch and depth * dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. * 4-D with shape - * `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t. - * the `filter` input of the convolution. + * {@code [filter_height, filter_width, in_channels, out_channels]}. Gradient w.r.t. + * the {@code filter} input of the convolution. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv2DBackpropFilter"; - - private Output output; - - private Conv2dBackpropFilter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropFilter} + */ + public static class Options { + private Boolean useCudnnOnGpu; + + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. + */ + public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { + this.useCudnnOnGpu = useCudnnOnGpu; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(Long... explicitPaddings) { + this.explicitPaddings = Arrays.asList(explicitPaddings); + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInput.java index 3b43fa3301d..5058b930786 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv2dBackpropInput.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -31,95 +32,57 @@ /** * Computes the gradients of convolution with respect to the input. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Conv2dBackpropInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useCudnnOnGpu - */ - public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { - this.useCudnnOnGpu = useCudnnOnGpu; - return this; - } - - /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith - * dimension, the amount of padding inserted before and after the dimension is - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter - * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private Boolean useCudnnOnGpu; - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv2DBackpropInput"; + + private Output output; + + private Conv2dBackpropInput(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv2dBackpropInput operation. - * + * Factory method to create a class wrapping a new Conv2DBackpropInput operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Conv2dBackpropInput create(Scope scope, Operand inputSizes, Operand filter, Operand outBackprop, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Conv2dBackpropInput create(Scope scope, + Operand inputSizes, Operand filter, Operand outBackprop, List strides, + String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Conv2DBackpropInput", scope.makeOpName("Conv2dBackpropInput")); opBuilder.addInput(inputSizes.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -131,7 +94,7 @@ public static Conv2dBackpropInput create(Scope scope, Ope } if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -141,76 +104,206 @@ public static Conv2dBackpropInput create(Scope scope, Ope } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv2dBackpropInput(opBuilder.build()); + return new Conv2dBackpropInput<>(opBuilder.build()); } - + /** - * @param useCudnnOnGpu + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. */ public static Options useCudnnOnGpu(Boolean useCudnnOnGpu) { return new Options().useCudnnOnGpu(useCudnnOnGpu); } - + /** - * @param explicitPaddings If `padding` is `"EXPLICIT"`, the list of explicit padding amounts. For the ith + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith * dimension, the amount of padding inserted before and after the dimension is - * `explicit_paddings[2 * i]` and `explicit_paddings[2 * i + 1]`, respectively. If - * `padding` is not `"EXPLICIT"`, `explicit_paddings` must be empty. + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. */ public static Options explicitPaddings(List explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } - + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public static Options explicitPaddings(Long[] explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth + * {@code data_format}, see above for details. Dilations in the batch and depth * dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** - * 4-D with shape `[batch, in_height, in_width, in_channels]`. Gradient + * Gets output. + * 4-D with shape {@code [batch, in_height, in_width, in_channels]}. Gradient * w.r.t. the input of the convolution. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv2DBackpropInput"; - - private Output output; - - private Conv2dBackpropInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropInput} + */ + public static class Options { + private Boolean useCudnnOnGpu; + + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the useCudnnOnGpu option. + * + * @param useCudnnOnGpu the useCudnnOnGpu option + * @return this Options instance. + */ + public Options useCudnnOnGpu(Boolean useCudnnOnGpu) { + this.useCudnnOnGpu = useCudnnOnGpu; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings If {@code padding} is {@code "EXPLICIT"}, the list of explicit padding amounts. For the ith + * dimension, the amount of padding inserted before and after the dimension is + * {@code explicit_paddings[2 * i]} and {@code explicit_paddings[2 * i + 1]}, respectively. If + * {@code padding} is not {@code "EXPLICIT"}, {@code explicit_paddings} must be empty. + * @return this Options instance. + */ + public Options explicitPaddings(Long... explicitPaddings) { + this.explicitPaddings = Arrays.asList(explicitPaddings); + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3d.java index b778819c0ce..ed04f1095da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3d.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -29,76 +30,55 @@ import org.tensorflow.types.family.TNumber; /** - * Computes a 3-D convolution given 5-D `input` and `filter` tensors. - *

+ * 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. - * - * @param data type for {@code output()} output + *

Our Conv3D implements a form of cross-correlation. + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Conv3d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv3d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each - * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv3D"; + + private Output output; + + private Conv3d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv3d operation. - * + * Factory method to create a class wrapping a new Conv3D operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Conv3d create(Scope scope, Operand input, Operand filter, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Conv3d create(Scope scope, Operand input, + Operand filter, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Conv3D", scope.makeOpName("Conv3d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -110,57 +90,126 @@ public static Conv3d create(Scope scope, Operand input } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv3d(opBuilder.build()); + return new Conv3d<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and + * value of {@code data_format}, see above for details. Dilations in the batch and * depth dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv3D"; - - private Output output; - - private Conv3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv3d} + */ + public static class Options { + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropFilter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropFilter.java index 6ec7dd5b71a..d0ea22719a6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropFilter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropFilter.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -31,74 +32,56 @@ /** * Computes the gradients of 3-D convolution with respect to the filter. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Conv3dBackpropFilter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropFilter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each - * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv3DBackpropFilterV2"; + + private Output output; + + private Conv3dBackpropFilter(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv3dBackpropFilter operation. - * + * Factory method to create a class wrapping a new Conv3DBackpropFilterV2 operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Conv3dBackpropFilter create(Scope scope, Operand input, Operand filterSizes, Operand outBackprop, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Conv3dBackpropFilter create(Scope scope, Operand input, + Operand filterSizes, Operand outBackprop, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Conv3DBackpropFilterV2", scope.makeOpName("Conv3dBackpropFilter")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filterSizes.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -110,57 +93,126 @@ public static Conv3dBackpropFilter create(Scope scope, Op } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv3dBackpropFilter(opBuilder.build()); + return new Conv3dBackpropFilter<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and + * value of {@code data_format}, see above for details. Dilations in the batch and * depth dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv3DBackpropFilterV2"; - - private Output output; - - private Conv3dBackpropFilter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropFilter} + */ + public static class Options { + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropInput.java index eb4a0460a65..919a06a6646 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Conv3dBackpropInput.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -30,74 +31,56 @@ /** * Computes the gradients of 3-D convolution with respect to the input. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Conv3dBackpropInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each - * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "Conv3DBackpropInputV2"; + + private Output output; + + private Conv3dBackpropInput(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Conv3dBackpropInput operation. - * + * Factory method to create a class wrapping a new Conv3DBackpropInputV2 operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Conv3dBackpropInput create(Scope scope, Operand inputSizes, Operand filter, Operand outBackprop, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Conv3dBackpropInput create(Scope scope, + Operand inputSizes, Operand filter, Operand outBackprop, + List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Conv3DBackpropInputV2", scope.makeOpName("Conv3dBackpropInput")); opBuilder.addInput(inputSizes.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -109,57 +92,126 @@ public static Conv3dBackpropInput create(Scope scope, Ope } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new Conv3dBackpropInput(opBuilder.build()); + return new Conv3dBackpropInput<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and + * value of {@code data_format}, see above for details. Dilations in the batch and * depth dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Conv3DBackpropInputV2"; - - private Output output; - - private Conv3dBackpropInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropInput} + */ + public static class Options { + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 5. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcBeamSearchDecoder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcBeamSearchDecoder.java index 6fb3ae265f4..88e3c05a648 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcBeamSearchDecoder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcBeamSearchDecoder.java @@ -33,50 +33,64 @@ /** * 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 data type for {@code log_probability} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class CtcBeamSearchDecoder extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CtcBeamSearchDecoder} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param mergeRepeated If true, merge repeated classes in output. - */ - public Options mergeRepeated(Boolean mergeRepeated) { - this.mergeRepeated = mergeRepeated; - return this; - } - - private Boolean mergeRepeated; - - private Options() { - } + public static final String OP_NAME = "CTCBeamSearchDecoder"; + + private List> decodedIndices; + + private List> decodedValues; + + private List> decodedShape; + + private Output logProbability; + + @SuppressWarnings("unchecked") + private CtcBeamSearchDecoder(Operation operation) { + super(operation); + int outputIdx = 0; + int decodedIndicesLength = operation.outputListLength("decoded_indices"); + decodedIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, decodedIndicesLength)); + outputIdx += decodedIndicesLength; + int decodedValuesLength = operation.outputListLength("decoded_values"); + decodedValues = Arrays.asList((Output[]) operation.outputList(outputIdx, decodedValuesLength)); + outputIdx += decodedValuesLength; + int decodedShapeLength = operation.outputListLength("decoded_shape"); + decodedShape = Arrays.asList((Output[]) operation.outputList(outputIdx, decodedShapeLength)); + outputIdx += decodedShapeLength; + logProbability = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CtcBeamSearchDecoder operation. - * + * Factory method to create a class wrapping a new CTCBeamSearchDecoder operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static CtcBeamSearchDecoder create(Scope scope, Operand inputs, Operand sequenceLength, Long beamWidth, Long topPaths, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CtcBeamSearchDecoder create(Scope scope, Operand inputs, + Operand sequenceLength, Long beamWidth, Long topPaths, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CTCBeamSearchDecoder", scope.makeOpName("CtcBeamSearchDecoder")); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(sequenceLength.asOutput()); @@ -90,72 +104,80 @@ public static CtcBeamSearchDecoder create(Scope scope, Op } } } - return new CtcBeamSearchDecoder(opBuilder.build()); + return new CtcBeamSearchDecoder<>(opBuilder.build()); } - + /** + * Sets the mergeRepeated option. + * * @param mergeRepeated If true, merge repeated classes in output. + * @return this Options instance. */ public static Options mergeRepeated(Boolean mergeRepeated) { return new Options().mergeRepeated(mergeRepeated); } - + /** + * Gets decodedIndices. * A list (length: top_paths) of indices matrices. Matrix j, - * size `(total_decoded_outputs[j] x 2)`, has indices of a - * `SparseTensor`. The rows store: [batch, time]. + * size {@code (total_decoded_outputs[j] x 2)}, has indices of a + * {@code SparseTensor}. The rows store: [batch, time]. + * @return decodedIndices. */ public List> decodedIndices() { return decodedIndices; } - + /** + * Gets decodedValues. * A list (length: top_paths) of values vectors. Vector j, - * size `(length total_decoded_outputs[j])`, has the values of a - * `SparseTensor`. The vector stores the decoded classes for beam j. + * size {@code (length total_decoded_outputs[j])}, has the values of a + * {@code SparseTensor}. The vector stores the decoded classes for beam j. + * @return decodedValues. */ public List> decodedValues() { return decodedValues; } - + /** + * Gets decodedShape. * A list (length: top_paths) of shape vector. Vector j, - * size `(2)`, stores the shape of the decoded `SparseTensor[j]`. - * Its values are: `[batch_size, max_decoded_length[j]]`. + * size {@code (2)}, stores the shape of the decoded {@code SparseTensor[j]}. + * Its values are: {@code [batch_size, max_decoded_length[j]]}. + * @return decodedShape. */ public List> decodedShape() { return decodedShape; } - + /** - * A matrix, shaped: `(batch_size x top_paths)`. The + * Gets logProbability. + * A matrix, shaped: {@code (batch_size x top_paths)}. The * sequence log-probabilities. + * @return logProbability. */ public Output logProbability() { return logProbability; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CTCBeamSearchDecoder"; - - private List> decodedIndices; - private List> decodedValues; - private List> decodedShape; - private Output logProbability; - - @SuppressWarnings("unchecked") - private CtcBeamSearchDecoder(Operation operation) { - super(operation); - int outputIdx = 0; - int decodedIndicesLength = operation.outputListLength("decoded_indices"); - decodedIndices = Arrays.asList((Output[])operation.outputList(outputIdx, decodedIndicesLength)); - outputIdx += decodedIndicesLength; - int decodedValuesLength = operation.outputListLength("decoded_values"); - decodedValues = Arrays.asList((Output[])operation.outputList(outputIdx, decodedValuesLength)); - outputIdx += decodedValuesLength; - int decodedShapeLength = operation.outputListLength("decoded_shape"); - decodedShape = Arrays.asList((Output[])operation.outputList(outputIdx, decodedShapeLength)); - outputIdx += decodedShapeLength; - logProbability = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CtcBeamSearchDecoder} + */ + public static class Options { + private Boolean mergeRepeated; + + private Options() { + } + + /** + * Sets the mergeRepeated option. + * + * @param mergeRepeated If true, merge repeated classes in output. + * @return this Options instance. + */ + public Options mergeRepeated(Boolean mergeRepeated) { + this.mergeRepeated = mergeRepeated; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcGreedyDecoder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcGreedyDecoder.java index 2e22105a783..843715ec1c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcGreedyDecoder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcGreedyDecoder.java @@ -31,52 +31,58 @@ /** * 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 data type for {@code log_probability} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class CtcGreedyDecoder extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CtcGreedyDecoder} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param mergeRepeated If True, merge repeated classes in output. - */ - public Options mergeRepeated(Boolean mergeRepeated) { - this.mergeRepeated = mergeRepeated; - return this; - } - - private Boolean mergeRepeated; - - private Options() { - } + public static final String OP_NAME = "CTCGreedyDecoder"; + + private Output decodedIndices; + + private Output decodedValues; + + private Output decodedShape; + + private Output logProbability; + + private CtcGreedyDecoder(Operation operation) { + super(operation); + int outputIdx = 0; + decodedIndices = operation.output(outputIdx++); + decodedValues = operation.output(outputIdx++); + decodedShape = operation.output(outputIdx++); + logProbability = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CtcGreedyDecoder operation. - * + * Factory method to create a class wrapping a new CTCGreedyDecoder operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static CtcGreedyDecoder create(Scope scope, Operand inputs, Operand sequenceLength, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CtcGreedyDecoder create(Scope scope, Operand inputs, + Operand sequenceLength, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CTCGreedyDecoder", scope.makeOpName("CtcGreedyDecoder")); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(sequenceLength.asOutput()); @@ -88,62 +94,77 @@ public static CtcGreedyDecoder create(Scope scope, Operan } } } - return new CtcGreedyDecoder(opBuilder.build()); + return new CtcGreedyDecoder<>(opBuilder.build()); } - + /** + * Sets the mergeRepeated option. + * * @param mergeRepeated If True, merge repeated classes in output. + * @return this Options instance. */ public static Options mergeRepeated(Boolean mergeRepeated) { return new Options().mergeRepeated(mergeRepeated); } - + /** - * Indices matrix, size `(total_decoded_outputs x 2)`, - * of a `SparseTensor`. The rows store: [batch, time]. + * Gets decodedIndices. + * Indices matrix, size {@code (total_decoded_outputs x 2)}, + * of a {@code SparseTensor}. The rows store: [batch, time]. + * @return decodedIndices. */ public Output decodedIndices() { return decodedIndices; } - + /** - * Values vector, size: `(total_decoded_outputs)`, - * of a `SparseTensor`. The vector stores the decoded classes. + * Gets decodedValues. + * Values vector, size: {@code (total_decoded_outputs)}, + * of a {@code SparseTensor}. The vector stores the decoded classes. + * @return decodedValues. */ public Output decodedValues() { return decodedValues; } - + /** - * Shape vector, size `(2)`, of the decoded SparseTensor. - * Values are: `[batch_size, max_decoded_length]`. + * Gets decodedShape. + * Shape vector, size {@code (2)}, of the decoded SparseTensor. + * Values are: {@code [batch_size, max_decoded_length]}. + * @return decodedShape. */ public Output decodedShape() { return decodedShape; } - + /** - * Matrix, size `(batch_size x 1)`, containing sequence + * Gets logProbability. + * Matrix, size {@code (batch_size x 1)}, containing sequence * log-probabilities. + * @return logProbability. */ public Output logProbability() { return logProbability; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CTCGreedyDecoder"; - - private Output decodedIndices; - private Output decodedValues; - private Output decodedShape; - private Output logProbability; - - private CtcGreedyDecoder(Operation operation) { - super(operation); - int outputIdx = 0; - decodedIndices = operation.output(outputIdx++); - decodedValues = operation.output(outputIdx++); - decodedShape = operation.output(outputIdx++); - logProbability = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CtcGreedyDecoder} + */ + public static class Options { + private Boolean mergeRepeated; + + private Options() { + } + + /** + * Sets the mergeRepeated option. + * + * @param mergeRepeated If True, merge repeated classes in output. + * @return this Options instance. + */ + public Options mergeRepeated(Boolean mergeRepeated) { + this.mergeRepeated = mergeRepeated; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcLoss.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcLoss.java index 1ea61f47a0b..75bbbe7747c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcLoss.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CtcLoss.java @@ -31,72 +31,51 @@ /** * 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 data type for {@code loss} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class CtcLoss extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CtcLoss} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param preprocessCollapseRepeated Scalar, if true then repeated labels are - * collapsed prior to the CTC calculation. - */ - public Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { - this.preprocessCollapseRepeated = preprocessCollapseRepeated; - return this; - } - - /** - * @param ctcMergeRepeated Scalar. If set to false, during CTC calculation - * repeated non-blank labels will not be merged and are interpreted as - * individual labels. This is a simplified version of CTC. - */ - public Options ctcMergeRepeated(Boolean ctcMergeRepeated) { - this.ctcMergeRepeated = ctcMergeRepeated; - return this; - } - - /** - * @param ignoreLongerOutputsThanInputs Scalar. If set to true, during CTC - * calculation, items that have longer output sequences than input sequences - * are skipped: they don't contribute to the loss term and have zero-gradient. - */ - public Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { - this.ignoreLongerOutputsThanInputs = ignoreLongerOutputsThanInputs; - return this; - } - - private Boolean preprocessCollapseRepeated; - private Boolean ctcMergeRepeated; - private Boolean ignoreLongerOutputsThanInputs; - - private Options() { - } + public static final String OP_NAME = "CTCLoss"; + + private Output loss; + + private Output gradient; + + private CtcLoss(Operation operation) { + super(operation); + int outputIdx = 0; + loss = operation.output(outputIdx++); + gradient = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CtcLoss operation. - * + * Factory method to create a class wrapping a new CTCLoss operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static CtcLoss create(Scope scope, Operand inputs, Operand labelsIndices, Operand labelsValues, Operand sequenceLength, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CtcLoss create(Scope scope, Operand inputs, + Operand labelsIndices, Operand labelsValues, Operand sequenceLength, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CTCLoss", scope.makeOpName("CtcLoss")); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(labelsIndices.asOutput()); @@ -116,60 +95,112 @@ public static CtcLoss create(Scope scope, Operand inpu } } } - return new CtcLoss(opBuilder.build()); + return new CtcLoss<>(opBuilder.build()); } - + /** + * Sets the preprocessCollapseRepeated option. + * * @param preprocessCollapseRepeated Scalar, if true then repeated labels are * collapsed prior to the CTC calculation. + * @return this Options instance. */ public static Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { return new Options().preprocessCollapseRepeated(preprocessCollapseRepeated); } - + /** - * @param ctcMergeRepeated Scalar. If set to false, during CTC calculation + * Sets the ctcMergeRepeated option. + * + * @param ctcMergeRepeated Scalar. If set to false, during CTC calculation * repeated non-blank labels will not be merged and are interpreted as * individual labels. This is a simplified version of CTC. + * @return this Options instance. */ public static Options ctcMergeRepeated(Boolean ctcMergeRepeated) { return new Options().ctcMergeRepeated(ctcMergeRepeated); } - + /** + * Sets the ignoreLongerOutputsThanInputs option. + * * @param ignoreLongerOutputsThanInputs Scalar. If set to true, during CTC * calculation, items that have longer output sequences than input sequences * are skipped: they don't contribute to the loss term and have zero-gradient. + * @return this Options instance. */ public static Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { return new Options().ignoreLongerOutputsThanInputs(ignoreLongerOutputsThanInputs); } - + /** + * Gets loss. * A vector (batch) containing log-probabilities. + * @return loss. */ public Output loss() { return loss; } - + /** - * The gradient of `loss`. 3-D, shape: - * `(max_time x batch_size x num_classes)`. + * Gets gradient. + * The gradient of {@code loss}. 3-D, shape: + * {@code (max_time x batch_size x num_classes)}. + * @return gradient. */ public Output gradient() { return gradient; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CTCLoss"; - - private Output loss; - private Output gradient; - - private CtcLoss(Operation operation) { - super(operation); - int outputIdx = 0; - loss = operation.output(outputIdx++); - gradient = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CtcLoss} + */ + public static class Options { + private Boolean preprocessCollapseRepeated; + + private Boolean ctcMergeRepeated; + + private Boolean ignoreLongerOutputsThanInputs; + + private Options() { + } + + /** + * Sets the preprocessCollapseRepeated option. + * + * @param preprocessCollapseRepeated Scalar, if true then repeated labels are + * collapsed prior to the CTC calculation. + * @return this Options instance. + */ + public Options preprocessCollapseRepeated(Boolean preprocessCollapseRepeated) { + this.preprocessCollapseRepeated = preprocessCollapseRepeated; + return this; + } + + /** + * Sets the ctcMergeRepeated option. + * + * @param ctcMergeRepeated Scalar. If set to false, during CTC calculation + * repeated non-blank labels will not be merged and are interpreted as + * individual labels. This is a simplified version of CTC. + * @return this Options instance. + */ + public Options ctcMergeRepeated(Boolean ctcMergeRepeated) { + this.ctcMergeRepeated = ctcMergeRepeated; + return this; + } + + /** + * Sets the ignoreLongerOutputsThanInputs option. + * + * @param ignoreLongerOutputsThanInputs Scalar. If set to true, during CTC + * calculation, items that have longer output sequences than input sequences + * are skipped: they don't contribute to the loss term and have zero-gradient. + * @return this Options instance. + */ + public Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsThanInputs) { + this.ignoreLongerOutputsThanInputs = ignoreLongerOutputsThanInputs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNN.java index 12e94a102f6..5817e7011cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNN.java @@ -24,160 +24,97 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * 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. + * 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'. + * 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". + * "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]. + * [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]. + * [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. + * [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 + * 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]. + * [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. + * training. * time_major: Indicates whether the input/output format is time major or batch - * major. + * major. * reserve_space: An opaque tensor that can be used in backprop calculation. It - * is only produced if is_training is true. - * - * @param data type for {@code output()} output + * is only produced if is_training is true. + * + * @param data type for {@code output} output */ public final class CudnnRNN extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNN} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - /** - * @param isTraining - */ - public Options isTraining(Boolean isTraining) { - this.isTraining = isTraining; - return this; - } - - /** - * @param timeMajor - */ - public Options timeMajor(Boolean timeMajor) { - this.timeMajor = timeMajor; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - private Boolean isTraining; - private Boolean timeMajor; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNV3"; + + private Output output; + + private Output outputH; + + private Output outputC; + + private Output reserveSpace; + + private Output hostReserved; + + @SuppressWarnings("unchecked") + private CudnnRNN(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputH = operation.output(outputIdx++); + outputC = operation.output(outputIdx++); + reserveSpace = operation.output(outputIdx++); + hostReserved = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CudnnRNN operation. - * + * Factory method to create a class wrapping a new CudnnRNNV3 operation. + * * @param scope current scope - * @param input - * @param inputH - * @param inputC - * @param params - * @param sequenceLengths - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CudnnRNN create(Scope scope, Operand input, Operand inputH, Operand inputC, Operand params, Operand sequenceLengths, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CudnnRNN create(Scope scope, Operand input, + Operand inputH, Operand inputC, Operand params, Operand sequenceLengths, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNV3", scope.makeOpName("CudnnRNN")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputH.asOutput()); @@ -216,118 +153,266 @@ public static CudnnRNN create(Scope scope, Operand inp } } } - return new CudnnRNN(opBuilder.build()); + return new CudnnRNN<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** - * @param isTraining + * Sets the isTraining option. + * + * @param isTraining the isTraining option + * @return this Options instance. */ public static Options isTraining(Boolean isTraining) { return new Options().isTraining(isTraining); } - + /** - * @param timeMajor + * Sets the timeMajor option. + * + * @param timeMajor the timeMajor option + * @return this Options instance. */ public static Options timeMajor(Boolean timeMajor) { return new Options().timeMajor(timeMajor); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets outputH. + * + * @return outputH. */ public Output outputH() { return outputH; } - + /** + * Gets outputC. + * + * @return outputC. */ public Output outputC() { return outputC; } - + /** + * Gets reserveSpace. + * + * @return reserveSpace. */ public Output reserveSpace() { return reserveSpace; } - + /** + * Gets hostReserved. + * + * @return hostReserved. */ - public Output hostReserved() { + public Output hostReserved() { return hostReserved; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNV3"; - - private Output output; - private Output outputH; - private Output outputC; - private Output reserveSpace; - private Output hostReserved; - - private CudnnRNN(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputH = operation.output(outputIdx++); - outputC = operation.output(outputIdx++); - reserveSpace = operation.output(outputIdx++); - hostReserved = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNN} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Boolean isTraining; + + private Boolean timeMajor; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = numProj; + return this; + } + + /** + * Sets the isTraining option. + * + * @param isTraining the isTraining option + * @return this Options instance. + */ + public Options isTraining(Boolean isTraining) { + this.isTraining = isTraining; + return this; + } + + /** + * Sets the timeMajor option. + * + * @param timeMajor the timeMajor option + * @return this Options instance. + */ + public Options timeMajor(Boolean timeMajor) { + this.timeMajor = timeMajor; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNBackprop.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNBackprop.java index 78a08d58328..d7a50c029db 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNBackprop.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNBackprop.java @@ -24,169 +24,113 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * 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. + * "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'. + * 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". + * "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]. + * [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]. + * [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. + * [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 + * 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]. + * [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. + * pass. * output_c_backprop: A 3-D tensor with the same shape as output_c in the forward - * pass. + * pass. * time_major: Indicates whether the input/output format is time major or batch - * major. + * 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. + * as input. * input_h_backprop: The backprop to input_h in the forward pass. Has the same - * shape as input_h. + * shape as input_h. * input_c_backprop: The backprop to input_c in the forward pass. Has the same - * shape as input_c. + * shape as input_c. * params_backprop: The backprop to the params buffer in the forward pass. Has the - * same shape as params. - * - * @param data type for {@code inputBackprop()} output + * same shape as params. + * + * @param data type for {@code input_backprop} output */ public final class CudnnRNNBackprop extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNBackprop} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - /** - * @param timeMajor - */ - public Options timeMajor(Boolean timeMajor) { - this.timeMajor = timeMajor; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - private Boolean timeMajor; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNBackpropV3"; + + private Output inputBackprop; + + private Output inputHBackprop; + + private Output inputCBackprop; + + private Output paramsBackprop; + + private CudnnRNNBackprop(Operation operation) { + super(operation); + int outputIdx = 0; + inputBackprop = operation.output(outputIdx++); + inputHBackprop = operation.output(outputIdx++); + inputCBackprop = operation.output(outputIdx++); + paramsBackprop = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CudnnRNNBackprop operation. - * + * Factory method to create a class wrapping a new CudnnRNNBackpropV3 operation. + * * @param scope current scope - * @param input - * @param inputH - * @param inputC - * @param params - * @param sequenceLengths - * @param output - * @param outputH - * @param outputC - * @param outputBackprop - * @param outputHBackprop - * @param outputCBackprop - * @param reserveSpace - * @param hostReserved - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CudnnRNNBackprop create(Scope scope, 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, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CudnnRNNBackprop create(Scope scope, 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, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNBackpropV3", scope.makeOpName("CudnnRNNBackprop")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputH.asOutput()); @@ -230,103 +174,234 @@ public static CudnnRNNBackprop create(Scope scope, Operan } } } - return new CudnnRNNBackprop(opBuilder.build()); + return new CudnnRNNBackprop<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** - * @param timeMajor + * Sets the timeMajor option. + * + * @param timeMajor the timeMajor option + * @return this Options instance. */ public static Options timeMajor(Boolean timeMajor) { return new Options().timeMajor(timeMajor); } - + /** + * Gets inputBackprop. + * + * @return inputBackprop. */ public Output inputBackprop() { return inputBackprop; } - + /** + * Gets inputHBackprop. + * + * @return inputHBackprop. */ public Output inputHBackprop() { return inputHBackprop; } - + /** + * Gets inputCBackprop. + * + * @return inputCBackprop. */ public Output inputCBackprop() { return inputCBackprop; } - + /** + * Gets paramsBackprop. + * + * @return paramsBackprop. */ public Output paramsBackprop() { return paramsBackprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNBackpropV3"; - - private Output inputBackprop; - private Output inputHBackprop; - private Output inputCBackprop; - private Output paramsBackprop; - - private CudnnRNNBackprop(Operation operation) { - super(operation); - int outputIdx = 0; - inputBackprop = operation.output(outputIdx++); - inputHBackprop = operation.output(outputIdx++); - inputCBackprop = operation.output(outputIdx++); - paramsBackprop = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNBackprop} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Boolean timeMajor; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = numProj; + return this; + } + + /** + * Sets the timeMajor option. + * + * @param timeMajor the timeMajor option + * @return this Options instance. + */ + public Options timeMajor(Boolean timeMajor) { + this.timeMajor = timeMajor; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNCanonicalToParams.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNCanonicalToParams.java index 2c5c451fac8..c704ad9fe1f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNCanonicalToParams.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNCanonicalToParams.java @@ -31,130 +31,73 @@ /** * 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. + * 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 + * no projection is performed. + * + * @param data type for {@code params} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class CudnnRNNCanonicalToParams extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNCanonicalToParams} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNCanonicalToParamsV2"; + + private Output params; + + private CudnnRNNCanonicalToParams(Operation operation) { + super(operation); + int outputIdx = 0; + params = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CudnnRNNCanonicalToParams operation. - * + * Factory method to create a class wrapping a new CudnnRNNCanonicalToParamsV2 operation. + * * @param scope current scope - * @param numLayers - * @param numUnits - * @param inputSize - * @param weights - * @param biases - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static CudnnRNNCanonicalToParams create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Iterable> weights, Iterable> biases, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CudnnRNNCanonicalToParams create(Scope scope, + Operand numLayers, Operand numUnits, Operand inputSize, + Iterable> weights, Iterable> biases, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNCanonicalToParamsV2", scope.makeOpName("CudnnRNNCanonicalToParams")); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); @@ -187,77 +130,189 @@ public static CudnnRNNCanonicalToParams create(Scope scop } } } - return new CudnnRNNCanonicalToParams(opBuilder.build()); + return new CudnnRNNCanonicalToParams<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** + * Gets params. + * + * @return params. */ public Output params() { return params; } - + @Override public Output asOutput() { return params; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNCanonicalToParamsV2"; - - private Output params; - - private CudnnRNNCanonicalToParams(Operation operation) { - super(operation); - int outputIdx = 0; - params = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNCanonicalToParams} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = numProj; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNParamsToCanonical.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNParamsToCanonical.java index adf30df3312..f336e5bd553 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNParamsToCanonical.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRNNParamsToCanonical.java @@ -32,131 +32,82 @@ /** * 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_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 + * no projection is performed. + * + * @param data type for {@code weights} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class CudnnRNNParamsToCanonical extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNParamsToCanonical} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNParamsToCanonicalV2"; + + private List> weights; + + private List> biases; + + @SuppressWarnings("unchecked") + private CudnnRNNParamsToCanonical(Operation operation) { + super(operation); + int outputIdx = 0; + int weightsLength = operation.outputListLength("weights"); + weights = Arrays.asList((Output[]) operation.outputList(outputIdx, weightsLength)); + outputIdx += weightsLength; + int biasesLength = operation.outputListLength("biases"); + biases = Arrays.asList((Output[]) operation.outputList(outputIdx, biasesLength)); + outputIdx += biasesLength; } - + /** - * Factory method to create a class wrapping a new CudnnRNNParamsToCanonical operation. - * + * Factory method to create a class wrapping a new CudnnRNNParamsToCanonicalV2 operation. + * * @param scope current scope - * @param numLayers - * @param numUnits - * @param inputSize - * @param params - * @param numParamsWeights - * @param numParamsBiases - * @param options carries optional attributes values + * @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 property + * @param numParamsBiases the value of the numParamsBiases property + * @param options carries optional attribute values + * @param data type for {@code CudnnRNNParamsToCanonicalV2} output and operands * @return a new instance of CudnnRNNParamsToCanonical */ - @Endpoint(describeByClass = true) - public static CudnnRNNParamsToCanonical create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Operand params, Long numParamsWeights, Long numParamsBiases, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CudnnRNNParamsToCanonical create(Scope scope, + Operand numLayers, Operand numUnits, Operand inputSize, + Operand params, Long numParamsWeights, Long numParamsBiases, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNParamsToCanonicalV2", scope.makeOpName("CudnnRNNParamsToCanonical")); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); @@ -190,85 +141,193 @@ public static CudnnRNNParamsToCanonical create(Scope scop } } } - return new CudnnRNNParamsToCanonical(opBuilder.build()); + return new CudnnRNNParamsToCanonical<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** + * Gets weights. + * + * @return weights. */ public List> weights() { return weights; } - + /** + * Gets biases. + * + * @return biases. */ public List> biases() { return biases; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNParamsToCanonicalV2"; - - private List> weights; - private List> biases; - - @SuppressWarnings("unchecked") - private CudnnRNNParamsToCanonical(Operation operation) { - super(operation); - int outputIdx = 0; - int weightsLength = operation.outputListLength("weights"); - weights = Arrays.asList((Output[])operation.outputList(outputIdx, weightsLength)); - outputIdx += weightsLength; - int biasesLength = operation.outputListLength("biases"); - biases = Arrays.asList((Output[])operation.outputList(outputIdx, biasesLength)); - outputIdx += biasesLength; + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRNNParamsToCanonical} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = numProj; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRnnParamsSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRnnParamsSize.java index 14dcc23a10e..642a79909fd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRnnParamsSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/CudnnRnnParamsSize.java @@ -31,121 +31,66 @@ /** * 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 + * 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 params_size} output */ -@Operator(group = "nn") -public final class CudnnRnnParamsSize extends RawOp implements Operand { - +@Operator( + group = "nn" +) +public final class CudnnRnnParamsSize extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.nn.CudnnRnnParamsSize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param rnnMode - */ - public Options rnnMode(String rnnMode) { - this.rnnMode = rnnMode; - return this; - } - - /** - * @param inputMode - */ - public Options inputMode(String inputMode) { - this.inputMode = inputMode; - return this; - } - - /** - * @param direction - */ - public Options direction(String direction) { - this.direction = direction; - return this; - } - - /** - * @param dropout - */ - public Options dropout(Float dropout) { - this.dropout = dropout; - return this; - } - - /** - * @param seed - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - /** - * @param numProj - */ - public Options numProj(Long numProj) { - this.numProj = numProj; - return this; - } - - private String rnnMode; - private String inputMode; - private String direction; - private Float dropout; - private Long seed; - private Long seed2; - private Long numProj; - - private Options() { - } + public static final String OP_NAME = "CudnnRNNParamsSize"; + + private Output paramsSize; + + private CudnnRnnParamsSize(Operation operation) { + super(operation); + int outputIdx = 0; + paramsSize = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new CudnnRnnParamsSize operation. - * + * Factory method to create a class wrapping a new CudnnRNNParamsSize operation. + * * @param scope current scope - * @param numLayers - * @param numUnits - * @param inputSize - * @param T - * @param S - * @param options carries optional attributes values + * @param numLayers the numLayers value + * @param numUnits the numUnits value + * @param inputSize the inputSize value + * @param T the value of the T property + * @param S the value of the S property + * @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 */ - @Endpoint(describeByClass = true) - public static CudnnRnnParamsSize create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Class T, Class S, Options... options) { + @Endpoint( + describeByClass = true + ) + public static CudnnRnnParamsSize create(Scope scope, + Operand numLayers, Operand numUnits, Operand inputSize, Class T, + Class S, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNParamsSize", scope.makeOpName("CudnnRnnParamsSize")); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); @@ -178,77 +123,189 @@ public static CudnnRnnParamsSize creat } } } - return new CudnnRnnParamsSize(opBuilder.build()); + return new CudnnRnnParamsSize<>(opBuilder.build()); } - + /** - * @param rnnMode + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. */ public static Options rnnMode(String rnnMode) { return new Options().rnnMode(rnnMode); } - + /** - * @param inputMode + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. */ public static Options inputMode(String inputMode) { return new Options().inputMode(inputMode); } - + /** - * @param direction + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. */ public static Options direction(String direction) { return new Options().direction(direction); } - + /** - * @param dropout + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. */ public static Options dropout(Float dropout) { return new Options().dropout(dropout); } - + /** - * @param seed + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** - * @param seed2 + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * @param numProj + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. */ public static Options numProj(Long numProj) { return new Options().numProj(numProj); } - + /** + * Gets paramsSize. + * + * @return paramsSize. */ - public Output paramsSize() { + public Output paramsSize() { return paramsSize; } - + @Override - public Output asOutput() { + public Output asOutput() { return paramsSize; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CudnnRNNParamsSize"; - - private Output paramsSize; - - private CudnnRnnParamsSize(Operation operation) { - super(operation); - int outputIdx = 0; - paramsSize = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.CudnnRnnParamsSize} + */ + public static class Options { + private String rnnMode; + + private String inputMode; + + private String direction; + + private Float dropout; + + private Long seed; + + private Long seed2; + + private Long numProj; + + private Options() { + } + + /** + * Sets the rnnMode option. + * + * @param rnnMode the rnnMode option + * @return this Options instance. + */ + public Options rnnMode(String rnnMode) { + this.rnnMode = rnnMode; + return this; + } + + /** + * Sets the inputMode option. + * + * @param inputMode the inputMode option + * @return this Options instance. + */ + public Options inputMode(String inputMode) { + this.inputMode = inputMode; + return this; + } + + /** + * Sets the direction option. + * + * @param direction the direction option + * @return this Options instance. + */ + public Options direction(String direction) { + this.direction = direction; + return this; + } + + /** + * Sets the dropout option. + * + * @param dropout the dropout option + * @return this Options instance. + */ + public Options dropout(Float dropout) { + this.dropout = dropout; + return this; + } + + /** + * Sets the seed option. + * + * @param seed the seed option + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 the seed2 option + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } + + /** + * Sets the numProj option. + * + * @param numProj the numProj option + * @return this Options instance. + */ + public Options numProj(Long numProj) { + this.numProj = numProj; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatDimMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatDimMap.java index 115a5bb12d8..991d5961a29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatDimMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatDimMap.java @@ -29,53 +29,42 @@ /** * 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 data type for {@code y} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class DataFormatDimMap extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DataFormatDimMap} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param srcFormat source data format. - */ - public Options srcFormat(String srcFormat) { - this.srcFormat = srcFormat; - return this; - } - - /** - * @param dstFormat destination data format. - */ - public Options dstFormat(String dstFormat) { - this.dstFormat = dstFormat; - return this; - } - - private String srcFormat; - private String dstFormat; - - private Options() { - } + public static final String OP_NAME = "DataFormatDimMap"; + + private Output y; + + private DataFormatDimMap(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DataFormatDimMap operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static DataFormatDimMap create(Scope scope, Operand x, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DataFormatDimMap create(Scope scope, Operand x, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DataFormatDimMap", scope.makeOpName("DataFormatDimMap")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); @@ -89,43 +78,74 @@ public static DataFormatDimMap create(Scope scope, Operan } } } - return new DataFormatDimMap(opBuilder.build()); + return new DataFormatDimMap<>(opBuilder.build()); } - + /** + * Sets the srcFormat option. + * * @param srcFormat source data format. + * @return this Options instance. */ public static Options srcFormat(String srcFormat) { return new Options().srcFormat(srcFormat); } - + /** + * Sets the dstFormat option. + * * @param dstFormat destination data format. + * @return this Options instance. */ public static Options dstFormat(String dstFormat) { return new Options().dstFormat(dstFormat); } - + /** + * Gets y. * A Tensor with each element as a dimension index in destination data format. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DataFormatDimMap"; - - private Output y; - - private DataFormatDimMap(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DataFormatDimMap} + */ + public static class Options { + private String srcFormat; + + private String dstFormat; + + private Options() { + } + + /** + * Sets the srcFormat option. + * + * @param srcFormat source data format. + * @return this Options instance. + */ + public Options srcFormat(String srcFormat) { + this.srcFormat = srcFormat; + return this; + } + + /** + * Sets the dstFormat option. + * + * @param dstFormat destination data format. + * @return this Options instance. + */ + public Options dstFormat(String dstFormat) { + this.dstFormat = dstFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatVecPermute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatVecPermute.java index 78f640b17f1..fcc7c3fe995 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatVecPermute.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DataFormatVecPermute.java @@ -28,73 +28,60 @@ import org.tensorflow.types.family.TNumber; /** - * Permute input tensor from `src_format` to `dst_format`. - *

+ * Permute input tensor from {@code src_format} to {@code dst_format}. * Input tensor must be a vector of size 4, or a 4x2 tensor. - *

- * For example, with `src_format` of `NHWC`, `dst_format` of `NCHW`, and inputs: - *

{@code
+ * 

For example, with {@code src_format} of {@code NHWC}, {@code dst_format} of {@code NCHW}, and inputs: + *

  * [1, 2, 3, 4]
- * }
- * and - *
{@code
+ * 
+ *

and + *

  * [[1, 2, 3, 4],
  *  [5, 6, 7, 8]]
- * }
- * , the outputs will be (respectively): - *
{@code
+ * 
+ *

, the outputs will be (respectively): + *

  * [1, 4, 2, 3]
- * }
- * and - *
{@code
+ * 
+ *

and + *

  * [[1, 4, 2, 3],
  *  [5, 8, 6, 7]]
- * }
- * - * - * @param data type for {@code y()} output + *
+ * + * @param data type for {@code y} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class DataFormatVecPermute extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DataFormatVecPermute} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param srcFormat source data format. - */ - public Options srcFormat(String srcFormat) { - this.srcFormat = srcFormat; - return this; - } - - /** - * @param dstFormat destination data format. - */ - public Options dstFormat(String dstFormat) { - this.dstFormat = dstFormat; - return this; - } - - private String srcFormat; - private String dstFormat; - - private Options() { - } + public static final String OP_NAME = "DataFormatVecPermute"; + + private Output y; + + private DataFormatVecPermute(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DataFormatVecPermute operation. - * + * * @param scope current scope * @param x Vector of size 4 or Tensor of shape (4, 2) in source data format. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DataFormatVecPermute} output and operands * @return a new instance of DataFormatVecPermute */ - @Endpoint(describeByClass = true) - public static DataFormatVecPermute create(Scope scope, Operand x, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DataFormatVecPermute create(Scope scope, Operand x, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DataFormatVecPermute", scope.makeOpName("DataFormatVecPermute")); opBuilder.addInput(x.asOutput()); opBuilder = scope.apply(opBuilder); @@ -108,43 +95,74 @@ public static DataFormatVecPermute create(Scope scope, Op } } } - return new DataFormatVecPermute(opBuilder.build()); + return new DataFormatVecPermute<>(opBuilder.build()); } - + /** + * Sets the srcFormat option. + * * @param srcFormat source data format. + * @return this Options instance. */ public static Options srcFormat(String srcFormat) { return new Options().srcFormat(srcFormat); } - + /** + * Sets the dstFormat option. + * * @param dstFormat destination data format. + * @return this Options instance. */ public static Options dstFormat(String dstFormat) { return new Options().dstFormat(dstFormat); } - + /** + * Gets y. * Vector of size 4 or Tensor of shape (4, 2) in destination data format. + * @return y. */ public Output y() { return y; } - + @Override public Output asOutput() { return y; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DataFormatVecPermute"; - - private Output y; - - private DataFormatVecPermute(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DataFormatVecPermute} + */ + public static class Options { + private String srcFormat; + + private String dstFormat; + + private Options() { + } + + /** + * Sets the srcFormat option. + * + * @param srcFormat source data format. + * @return this Options instance. + */ + public Options srcFormat(String srcFormat) { + this.srcFormat = srcFormat; + return this; + } + + /** + * Sets the dstFormat option. + * + * @param dstFormat destination data format. + * @return this Options instance. + */ + public Options dstFormat(String dstFormat) { + this.dstFormat = dstFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthToSpace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthToSpace.java index 2f95879ddd7..11595c5d17e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthToSpace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthToSpace.java @@ -29,122 +29,115 @@ /** * 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 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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class DepthToSpace extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DepthToSpace} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "DepthToSpace"; + + private Output output; + + private DepthToSpace(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DepthToSpace operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static DepthToSpace create(Scope scope, Operand input, Long blockSize, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DepthToSpace create(Scope scope, Operand input, + Long blockSize, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DepthToSpace", scope.makeOpName("DepthToSpace")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -156,35 +149,51 @@ public static DepthToSpace create(Scope scope, Operand i } } } - return new DepthToSpace(opBuilder.build()); + return new DepthToSpace<>(opBuilder.build()); } - + /** - * @param dataFormat + * Sets the dataFormat option. + * + * @param dataFormat the dataFormat option + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DepthToSpace"; - - private Output output; - - private DepthToSpace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DepthToSpace} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat the dataFormat option + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNative.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNative.java index 8420a6524dc..2062c1d2823 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNative.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNative.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -29,95 +30,67 @@ import org.tensorflow.types.family.TNumber; /** - * 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]`. - * - * @param data type for {@code output()} output + *
+ *

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 */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class DepthwiseConv2dNative extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNative} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param explicitPaddings - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter - * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "DepthwiseConv2dNative"; + + private Output output; + + private DepthwiseConv2dNative(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DepthwiseConv2dNative operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static DepthwiseConv2dNative create(Scope scope, Operand input, Operand filter, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DepthwiseConv2dNative create(Scope scope, Operand input, + Operand filter, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DepthwiseConv2dNative", scope.makeOpName("DepthwiseConv2dNative")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -126,7 +99,7 @@ public static DepthwiseConv2dNative create(Scope scope, O for (Options opts : options) { if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -136,64 +109,170 @@ public static DepthwiseConv2dNative create(Scope scope, O } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new DepthwiseConv2dNative(opBuilder.build()); + return new DepthwiseConv2dNative<>(opBuilder.build()); } - + /** - * @param explicitPaddings + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. */ public static Options explicitPaddings(List explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } - + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public static Options explicitPaddings(Long[] explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth + * {@code data_format}, see above for details. Dilations in the batch and depth * dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DepthwiseConv2dNative"; - - private Output output; - - private DepthwiseConv2dNative(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNative} + */ + public static class Options { + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public Options explicitPaddings(Long... explicitPaddings) { + this.explicitPaddings = Arrays.asList(explicitPaddings); + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropFilter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropFilter.java index 3825826677b..cb53251b8bd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropFilter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropFilter.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -31,86 +32,59 @@ /** * Computes the gradients of depthwise convolution with respect to the filter. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class DepthwiseConv2dNativeBackpropFilter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropFilter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param explicitPaddings - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter - * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "DepthwiseConv2dNativeBackpropFilter"; + + private Output output; + + private DepthwiseConv2dNativeBackpropFilter(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DepthwiseConv2dNativeBackpropFilter operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static DepthwiseConv2dNativeBackpropFilter create(Scope scope, Operand input, Operand filterSizes, Operand outBackprop, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DepthwiseConv2dNativeBackpropFilter create(Scope scope, + Operand input, Operand filterSizes, Operand outBackprop, List strides, + String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DepthwiseConv2dNativeBackpropFilter", scope.makeOpName("DepthwiseConv2dNativeBackpropFilter")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filterSizes.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -119,7 +93,7 @@ public static DepthwiseConv2dNativeBackpropFilter create( for (Options opts : options) { if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -129,67 +103,172 @@ public static DepthwiseConv2dNativeBackpropFilter create( } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new DepthwiseConv2dNativeBackpropFilter(opBuilder.build()); + return new DepthwiseConv2dNativeBackpropFilter<>(opBuilder.build()); } - + /** - * @param explicitPaddings + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. */ public static Options explicitPaddings(List explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } - + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public static Options explicitPaddings(Long[] explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth + * {@code data_format}, see above for details. Dilations in the batch and depth * dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. * 4-D with shape - * `[filter_height, filter_width, in_channels, out_channels]`. Gradient w.r.t. - * the `filter` input of the convolution. + * {@code [filter_height, filter_width, in_channels, out_channels]}. Gradient w.r.t. + * the {@code filter} input of the convolution. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DepthwiseConv2dNativeBackpropFilter"; - - private Output output; - - private DepthwiseConv2dNativeBackpropFilter(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropFilter} + */ + public static class Options { + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public Options explicitPaddings(Long... explicitPaddings) { + this.explicitPaddings = Arrays.asList(explicitPaddings); + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropInput.java index 35f10aaed5d..6d514f599ec 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/DepthwiseConv2dNativeBackpropInput.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -31,85 +32,59 @@ /** * Computes the gradients of depthwise convolution with respect to the input. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class DepthwiseConv2dNativeBackpropInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param explicitPaddings - */ - public Options explicitPaddings(List explicitPaddings) { - this.explicitPaddings = explicitPaddings; - return this; - } - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter - * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth - * dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List explicitPaddings; - private String dataFormat; - private List dilations; - - private Options() { - } + public static final String OP_NAME = "DepthwiseConv2dNativeBackpropInput"; + + private Output output; + + private DepthwiseConv2dNativeBackpropInput(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DepthwiseConv2dNativeBackpropInput operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static DepthwiseConv2dNativeBackpropInput create(Scope scope, Operand inputSizes, Operand filter, Operand outBackprop, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DepthwiseConv2dNativeBackpropInput create(Scope scope, + Operand inputSizes, Operand filter, Operand outBackprop, List strides, + String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DepthwiseConv2dNativeBackpropInput", scope.makeOpName("DepthwiseConv2dNativeBackpropInput")); opBuilder.addInput(inputSizes.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -118,7 +93,7 @@ public static DepthwiseConv2dNativeBackpropInput create(S for (Options opts : options) { if (opts.explicitPaddings != null) { long[] explicitPaddingsArray = new long[opts.explicitPaddings.size()]; - for (int i = 0; i < explicitPaddingsArray.length; ++i) { + for (int i = 0 ; i < explicitPaddingsArray.length ; i++) { explicitPaddingsArray[i] = opts.explicitPaddings.get(i); } opBuilder.setAttr("explicit_paddings", explicitPaddingsArray); @@ -128,68 +103,172 @@ public static DepthwiseConv2dNativeBackpropInput create(S } if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new DepthwiseConv2dNativeBackpropInput(opBuilder.build()); + return new DepthwiseConv2dNativeBackpropInput<>(opBuilder.build()); } - + /** - * @param explicitPaddings + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. */ public static Options explicitPaddings(List explicitPaddings) { return new Options().explicitPaddings(explicitPaddings); } - + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public static Options explicitPaddings(Long[] explicitPaddings) { + return new Options().explicitPaddings(explicitPaddings); + } + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, height, width, channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, channels, height, width]. + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each filter + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter * element on that dimension. The dimension order is determined by the value of - * `data_format`, see above for details. Dilations in the batch and depth + * {@code data_format}, see above for details. Dilations in the batch and depth * dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** - * 4-D with shape according to `data_format`. For example, if - * `data_format` is 'NHWC', output shape is `[batch, in_height, - * in_width, in_channels]`. Gradient w.r.t. the input of the + * Gets output. + * 4-D with shape according to {@code data_format}. For example, if + * {@code data_format} is 'NHWC', output shape is {@code [batch, in_height, in_width, in_channels]}. Gradient w.r.t. the input of the * convolution. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DepthwiseConv2dNativeBackpropInput"; - - private Output output; - - private DepthwiseConv2dNativeBackpropInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropInput} + */ + public static class Options { + private List explicitPaddings; + + private String dataFormat; + + private List dilations; + + private Options() { + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public Options explicitPaddings(List explicitPaddings) { + this.explicitPaddings = explicitPaddings; + return this; + } + + /** + * Sets the explicitPaddings option. + * + * @param explicitPaddings the explicitPaddings option + * @return this Options instance. + */ + public Options explicitPaddings(Long... explicitPaddings) { + this.explicitPaddings = Arrays.asList(explicitPaddings); + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, height, width, channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, channels, height, width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each filter + * element on that dimension. The dimension order is determined by the value of + * {@code data_format}, see above for details. Dilations in the batch and depth + * dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2d.java index d87f33ca07f..0838b5f6eea 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2d.java @@ -29,90 +29,96 @@ import org.tensorflow.types.family.TNumber; /** - * 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`. - * - * @param data type for {@code output()} output + *

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 */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Dilation2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Dilation2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Dilation2D"; + + private Output output; + + private Dilation2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Dilation2D operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Dilation2d create(Scope scope, Operand input, Operand filter, List strides, List rates, String padding) { + @Endpoint( + describeByClass = true + ) + public static Dilation2d create(Scope scope, Operand input, + Operand filter, List strides, List rates, String padding) { OperationBuilder opBuilder = scope.env().opBuilder("Dilation2D", scope.makeOpName("Dilation2d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); long[] ratesArray = new long[rates.size()]; - for (int i = 0; i < ratesArray.length; ++i) { + for (int i = 0 ; i < ratesArray.length ; i++) { ratesArray[i] = rates.get(i); } opBuilder.setAttr("rates", ratesArray); opBuilder.setAttr("padding", padding); - return new Dilation2d(opBuilder.build()); + return new Dilation2d<>(opBuilder.build()); } - + /** - * 4-D with shape `[batch, out_height, out_width, depth]`. + * Gets output. + * 4-D with shape {@code [batch, out_height, out_width, depth]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dilation2D"; - - private Output output; - - private Dilation2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropFilter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropFilter.java index c4e1d45a440..fb07f81692a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropFilter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropFilter.java @@ -30,67 +30,77 @@ /** * Computes the gradient of morphological 2-D dilation with respect to the filter. - * - * @param data type for {@code filterBackprop()} output + * + * @param data type for {@code filter_backprop} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Dilation2dBackpropFilter extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Dilation2dBackpropFilter operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Dilation2DBackpropFilter"; + + private Output filterBackprop; + + private Dilation2dBackpropFilter(Operation operation) { + super(operation); + int outputIdx = 0; + filterBackprop = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Dilation2DBackpropFilter operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Dilation2dBackpropFilter create(Scope scope, Operand input, Operand filter, Operand outBackprop, List strides, List rates, String padding) { + @Endpoint( + describeByClass = true + ) + public static Dilation2dBackpropFilter create(Scope scope, + Operand input, Operand filter, Operand outBackprop, List strides, + List rates, String padding) { OperationBuilder opBuilder = scope.env().opBuilder("Dilation2DBackpropFilter", scope.makeOpName("Dilation2dBackpropFilter")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); long[] ratesArray = new long[rates.size()]; - for (int i = 0; i < ratesArray.length; ++i) { + for (int i = 0 ; i < ratesArray.length ; i++) { ratesArray[i] = rates.get(i); } opBuilder.setAttr("rates", ratesArray); opBuilder.setAttr("padding", padding); - return new Dilation2dBackpropFilter(opBuilder.build()); + return new Dilation2dBackpropFilter<>(opBuilder.build()); } - + /** - * 3-D with shape `[filter_height, filter_width, depth]`. + * Gets filterBackprop. + * 3-D with shape {@code [filter_height, filter_width, depth]}. + * @return filterBackprop. */ public Output filterBackprop() { return filterBackprop; } - + @Override public Output asOutput() { return filterBackprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dilation2DBackpropFilter"; - - private Output filterBackprop; - - private Dilation2dBackpropFilter(Operation operation) { - super(operation); - int outputIdx = 0; - filterBackprop = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropInput.java index 3f6bb100bc5..e7f407b7d50 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Dilation2dBackpropInput.java @@ -30,67 +30,77 @@ /** * Computes the gradient of morphological 2-D dilation with respect to the input. - * - * @param data type for {@code inBackprop()} output + * + * @param data type for {@code in_backprop} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Dilation2dBackpropInput extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Dilation2dBackpropInput operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Dilation2DBackpropInput"; + + private Output inBackprop; + + private Dilation2dBackpropInput(Operation operation) { + super(operation); + int outputIdx = 0; + inBackprop = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new Dilation2DBackpropInput operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static Dilation2dBackpropInput create(Scope scope, Operand input, Operand filter, Operand outBackprop, List strides, List rates, String padding) { + @Endpoint( + describeByClass = true + ) + public static Dilation2dBackpropInput create(Scope scope, Operand input, + Operand filter, Operand outBackprop, List strides, List rates, + String padding) { OperationBuilder opBuilder = scope.env().opBuilder("Dilation2DBackpropInput", scope.makeOpName("Dilation2dBackpropInput")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder.addInput(outBackprop.asOutput()); opBuilder = scope.apply(opBuilder); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); long[] ratesArray = new long[rates.size()]; - for (int i = 0; i < ratesArray.length; ++i) { + for (int i = 0 ; i < ratesArray.length ; i++) { ratesArray[i] = rates.get(i); } opBuilder.setAttr("rates", ratesArray); opBuilder.setAttr("padding", padding); - return new Dilation2dBackpropInput(opBuilder.build()); + return new Dilation2dBackpropInput<>(opBuilder.build()); } - + /** - * 4-D with shape `[batch, in_height, in_width, depth]`. + * Gets inBackprop. + * 4-D with shape {@code [batch, in_height, in_width, depth]}. + * @return inBackprop. */ public Output inBackprop() { return inBackprop; } - + @Override public Output asOutput() { return inBackprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dilation2DBackpropInput"; - - private Output inBackprop; - - private Dilation2dBackpropInput(Operation operation) { - super(operation); - int outputIdx = 0; - inBackprop = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Elu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Elu.java index 86012a4c4ef..66ce871ca7a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Elu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Elu.java @@ -28,50 +28,58 @@ import org.tensorflow.types.family.TNumber; /** - * 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 + * Computes exponential linear: {@code exp(features) - 1} if < 0, {@code features} otherwise. + * See Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs) + * + * + * @param data type for {@code activations} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Elu extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Elu"; + + private Output activations; + + private Elu(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Elu operation. - * + * * @param scope current scope - * @param features + * @param features the features value + * @param data type for {@code Elu} output and operands * @return a new instance of Elu */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Elu create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Elu", scope.makeOpName("Elu")); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new Elu(opBuilder.build()); + return new Elu<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Elu"; - - private Output activations; - - private Elu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/EluGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/EluGrad.java index 4771374123e..94c17656ca9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/EluGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/EluGrad.java @@ -24,54 +24,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Computes gradients for the exponential linear (Elu) operation. - * - * @param data type for {@code backprops()} output + * + * @param data type for {@code backprops} output */ public final class EluGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "EluGrad"; + + private Output backprops; + + private EluGrad(Operation operation) { + super(operation); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new EluGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static EluGrad create(Scope scope, Operand gradients, Operand outputs) { + @Endpoint( + describeByClass = true + ) + public static EluGrad create(Scope scope, Operand gradients, + Operand outputs) { OperationBuilder opBuilder = scope.env().opBuilder("EluGrad", scope.makeOpName("EluGrad")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(outputs.asOutput()); opBuilder = scope.apply(opBuilder); - return new EluGrad(opBuilder.build()); + return new EluGrad<>(opBuilder.build()); } - + /** - * The gradients: `gradients * (outputs + 1)` if outputs < 0, - * `gradients` otherwise. + * Gets backprops. + * The gradients: {@code gradients * (outputs + 1)} if outputs < 0, + * {@code gradients} otherwise. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EluGrad"; - - private Output backprops; - - private EluGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.java index 6e72e03eb38..86aaf612abf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -31,129 +32,44 @@ /** * 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. */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class FixedUnigramCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FixedUnigramCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param vocabFile Each valid line in this file (which should have a CSV-like format) - * corresponds to a valid word ID. IDs are in sequential order, starting from - * num_reserved_ids. The last entry in each line is expected to be a value - * corresponding to the count or relative probability. Exactly one of vocab_file - * and unigrams needs to be passed to this op. - */ - public Options vocabFile(String vocabFile) { - this.vocabFile = vocabFile; - return this; - } - - /** - * @param distortion The distortion is used to skew the unigram probability distribution. - * Each weight is first raised to the distortion's power before adding to the - * internal unigram distribution. As a result, distortion = 1.0 gives regular - * unigram sampling (as defined by the vocab file), and distortion = 0.0 gives - * a uniform distribution. - */ - public Options distortion(Float distortion) { - this.distortion = distortion; - return this; - } - - /** - * @param numReservedIds Optionally some reserved IDs can be added in the range [0, - * ..., num_reserved_ids) by the users. One use case is that a special unknown - * word token is used as ID 0. These IDs will have a sampling probability of 0. - */ - public Options numReservedIds(Long numReservedIds) { - this.numReservedIds = numReservedIds; - return this; - } - - /** - * @param numShards A sampler can be used to sample from a subset of the original range - * in order to speed up the whole computation through parallelism. This parameter - * (together with 'shard') indicates the number of partitions that are being - * used in the overall computation. - */ - public Options numShards(Long numShards) { - this.numShards = numShards; - return this; - } - - /** - * @param shard A sampler can be used to sample from a subset of the original range - * in order to speed up the whole computation through parallelism. This parameter - * (together with 'num_shards') indicates the particular partition number of a - * sampler op, when partitioning is being used. - */ - public Options shard(Long shard) { - this.shard = shard; - return this; - } - - /** - * @param unigrams A list of unigram counts or probabilities, one per ID in sequential - * order. Exactly one of vocab_file and unigrams should be passed to this op. - */ - public Options unigrams(List unigrams) { - this.unigrams = unigrams; - return this; - } - - /** - * @param seed If either seed or seed2 are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private String vocabFile; - private Float distortion; - private Long numReservedIds; - private Long numShards; - private Long shard; - private List unigrams; - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "FixedUnigramCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + private FixedUnigramCandidateSampler(Operation operation) { + super(operation); + int outputIdx = 0; + sampledCandidates = operation.output(outputIdx++); + trueExpectedCount = operation.output(outputIdx++); + sampledExpectedCount = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FixedUnigramCandidateSampler operation. - * + * * @param scope current scope * @param trueClasses A batch_size * num_true matrix, in which each row contains the * IDs of the num_true target_classes in the corresponding original label. @@ -163,11 +79,14 @@ private Options() { * 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 */ - @Endpoint(describeByClass = true) - public static FixedUnigramCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FixedUnigramCandidateSampler create(Scope scope, Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FixedUnigramCandidateSampler", scope.makeOpName("FixedUnigramCandidateSampler")); opBuilder.addInput(trueClasses.asOutput()); opBuilder = scope.apply(opBuilder); @@ -194,7 +113,7 @@ public static FixedUnigramCandidateSampler create(Scope scope, Operand t } if (opts.unigrams != null) { float[] unigramsArray = new float[opts.unigrams.size()]; - for (int i = 0; i < unigramsArray.length; ++i) { + for (int i = 0 ; i < unigramsArray.length ; i++) { unigramsArray[i] = opts.unigrams.get(i); } opBuilder.setAttr("unigrams", unigramsArray); @@ -209,121 +128,290 @@ public static FixedUnigramCandidateSampler create(Scope scope, Operand t } return new FixedUnigramCandidateSampler(opBuilder.build()); } - + /** + * Sets the vocabFile option. + * * @param vocabFile Each valid line in this file (which should have a CSV-like format) * corresponds to a valid word ID. IDs are in sequential order, starting from * num_reserved_ids. The last entry in each line is expected to be a value * corresponding to the count or relative probability. Exactly one of vocab_file * and unigrams needs to be passed to this op. + * @return this Options instance. */ public static Options vocabFile(String vocabFile) { return new Options().vocabFile(vocabFile); } - + /** + * Sets the distortion option. + * * @param distortion The distortion is used to skew the unigram probability distribution. * Each weight is first raised to the distortion's power before adding to the * internal unigram distribution. As a result, distortion = 1.0 gives regular * unigram sampling (as defined by the vocab file), and distortion = 0.0 gives * a uniform distribution. + * @return this Options instance. */ public static Options distortion(Float distortion) { return new Options().distortion(distortion); } - + /** + * Sets the numReservedIds option. + * * @param numReservedIds Optionally some reserved IDs can be added in the range [0, * ..., num_reserved_ids) by the users. One use case is that a special unknown * word token is used as ID 0. These IDs will have a sampling probability of 0. + * @return this Options instance. */ public static Options numReservedIds(Long numReservedIds) { return new Options().numReservedIds(numReservedIds); } - + /** + * Sets the numShards option. + * * @param numShards A sampler can be used to sample from a subset of the original range * in order to speed up the whole computation through parallelism. This parameter * (together with 'shard') indicates the number of partitions that are being * used in the overall computation. + * @return this Options instance. */ public static Options numShards(Long numShards) { return new Options().numShards(numShards); } - + /** + * Sets the shard option. + * * @param shard A sampler can be used to sample from a subset of the original range * in order to speed up the whole computation through parallelism. This parameter * (together with 'num_shards') indicates the particular partition number of a * sampler op, when partitioning is being used. + * @return this Options instance. */ public static Options shard(Long shard) { return new Options().shard(shard); } - + /** + * Sets the unigrams option. + * * @param unigrams A list of unigram counts or probabilities, one per ID in sequential * order. Exactly one of vocab_file and unigrams should be passed to this op. + * @return this Options instance. */ public static Options unigrams(List unigrams) { return new Options().unigrams(unigrams); } - + /** + * Sets the unigrams option. + * + * @param unigrams A list of unigram counts or probabilities, one per ID in sequential + * order. Exactly one of vocab_file and unigrams should be passed to this op. + * @return this Options instance. + */ + public static Options unigrams(Float[] unigrams) { + return new Options().unigrams(unigrams); + } + + /** + * Sets the seed option. + * * @param seed If either seed or seed2 are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets sampledCandidates. * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. + * @return sampledCandidates. */ public Output sampledCandidates() { return sampledCandidates; } - + /** + * Gets trueExpectedCount. * A batch_size * num_true matrix, representing * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. + * @return trueExpectedCount. */ public Output trueExpectedCount() { return trueExpectedCount; } - + /** + * Gets sampledExpectedCount. * A vector of length num_sampled, for each sampled * candidate representing the number of times the candidate is expected * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. + * @return sampledExpectedCount. */ public Output sampledExpectedCount() { return sampledExpectedCount; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FixedUnigramCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private FixedUnigramCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FixedUnigramCandidateSampler} + */ + public static class Options { + private String vocabFile; + + private Float distortion; + + private Long numReservedIds; + + private Long numShards; + + private Long shard; + + private List unigrams; + + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the vocabFile option. + * + * @param vocabFile Each valid line in this file (which should have a CSV-like format) + * corresponds to a valid word ID. IDs are in sequential order, starting from + * num_reserved_ids. The last entry in each line is expected to be a value + * corresponding to the count or relative probability. Exactly one of vocab_file + * and unigrams needs to be passed to this op. + * @return this Options instance. + */ + public Options vocabFile(String vocabFile) { + this.vocabFile = vocabFile; + return this; + } + + /** + * Sets the distortion option. + * + * @param distortion The distortion is used to skew the unigram probability distribution. + * Each weight is first raised to the distortion's power before adding to the + * internal unigram distribution. As a result, distortion = 1.0 gives regular + * unigram sampling (as defined by the vocab file), and distortion = 0.0 gives + * a uniform distribution. + * @return this Options instance. + */ + public Options distortion(Float distortion) { + this.distortion = distortion; + return this; + } + + /** + * Sets the numReservedIds option. + * + * @param numReservedIds Optionally some reserved IDs can be added in the range [0, + * ..., num_reserved_ids) by the users. One use case is that a special unknown + * word token is used as ID 0. These IDs will have a sampling probability of 0. + * @return this Options instance. + */ + public Options numReservedIds(Long numReservedIds) { + this.numReservedIds = numReservedIds; + return this; + } + + /** + * Sets the numShards option. + * + * @param numShards A sampler can be used to sample from a subset of the original range + * in order to speed up the whole computation through parallelism. This parameter + * (together with 'shard') indicates the number of partitions that are being + * used in the overall computation. + * @return this Options instance. + */ + public Options numShards(Long numShards) { + this.numShards = numShards; + return this; + } + + /** + * Sets the shard option. + * + * @param shard A sampler can be used to sample from a subset of the original range + * in order to speed up the whole computation through parallelism. This parameter + * (together with 'num_shards') indicates the particular partition number of a + * sampler op, when partitioning is being used. + * @return this Options instance. + */ + public Options shard(Long shard) { + this.shard = shard; + return this; + } + + /** + * Sets the unigrams option. + * + * @param unigrams A list of unigram counts or probabilities, one per ID in sequential + * order. Exactly one of vocab_file and unigrams should be passed to this op. + * @return this Options instance. + */ + public Options unigrams(List unigrams) { + this.unigrams = unigrams; + return this; + } + + /** + * Sets the unigrams option. + * + * @param unigrams A list of unigram counts or probabilities, one per ID in sequential + * order. Exactly one of vocab_file and unigrams should be passed to this op. + * @return this Options instance. + */ + public Options unigrams(Float... unigrams) { + this.unigrams = Arrays.asList(unigrams); + return this; + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPool.java index a9bddf8774c..5fddbf60bbe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPool.java @@ -31,108 +31,61 @@ /** * 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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class FractionalAvgPool extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPool} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param pseudoRandom When set to True, generates the pooling sequence in a - * pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin - * Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for - * difference between pseudorandom and random. - */ - public Options pseudoRandom(Boolean pseudoRandom) { - this.pseudoRandom = pseudoRandom; - return this; - } - - /** - * @param overlapping When set to True, it means when pooling, the values at the boundary - * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. - * The result would be [41/3, 26/3] for fractional avg pooling. - */ - public Options overlapping(Boolean overlapping) { - this.overlapping = overlapping; - return this; - } - - /** - * @param deterministic When set to True, a fixed pooling region will be used when - * iterating over a FractionalAvgPool node in the computation graph. Mainly used - * in unit test to make FractionalAvgPool deterministic. - */ - public Options deterministic(Boolean deterministic) { - this.deterministic = deterministic; - return this; - } - - /** - * @param seed If either seed or seed2 are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Boolean pseudoRandom; - private Boolean overlapping; - private Boolean deterministic; - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "FractionalAvgPool"; + + private Output output; + + private Output rowPoolingSequence; + + private Output colPoolingSequence; + + private FractionalAvgPool(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + rowPoolingSequence = operation.output(outputIdx++); + colPoolingSequence = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FractionalAvgPool operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static FractionalAvgPool create(Scope scope, Operand value, List poolingRatio, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FractionalAvgPool create(Scope scope, Operand value, + List poolingRatio, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FractionalAvgPool", scope.makeOpName("FractionalAvgPool")); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); float[] poolingRatioArray = new float[poolingRatio.size()]; - for (int i = 0; i < poolingRatioArray.length; ++i) { + for (int i = 0 ; i < poolingRatioArray.length ; i++) { poolingRatioArray[i] = poolingRatio.get(i); } opBuilder.setAttr("pooling_ratio", poolingRatioArray); @@ -155,92 +108,180 @@ public static FractionalAvgPool create(Scope scope, Opera } } } - return new FractionalAvgPool(opBuilder.build()); + return new FractionalAvgPool<>(opBuilder.build()); } - + /** + * Sets the pseudoRandom option. + * * @param pseudoRandom When set to True, generates the pooling sequence in a - * pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin - * Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for + * pseudorandom fashion, otherwise, in a random fashion. Check paper Benjamin + * Graham, Fractional Max-Pooling for * difference between pseudorandom and random. + * @return this Options instance. */ public static Options pseudoRandom(Boolean pseudoRandom) { return new Options().pseudoRandom(pseudoRandom); } - + /** + * Sets the overlapping option. + * * @param overlapping When set to True, it means when pooling, the values at the boundary * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + *

{@code index 0 1 2 3 4} + *

{@code value 20 5 16 3 7} + *

If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. * The result would be [41/3, 26/3] for fractional avg pooling. + * @return this Options instance. */ public static Options overlapping(Boolean overlapping) { return new Options().overlapping(overlapping); } - + /** + * Sets the deterministic option. + * * @param deterministic When set to True, a fixed pooling region will be used when * iterating over a FractionalAvgPool node in the computation graph. Mainly used * in unit test to make FractionalAvgPool deterministic. + * @return this Options instance. */ public static Options deterministic(Boolean deterministic) { return new Options().deterministic(deterministic); } - + /** + * Sets the seed option. + * * @param seed If either seed or seed2 are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * output tensor after fractional avg pooling. + * @return output. */ public Output output() { return output; } - + /** + * Gets rowPoolingSequence. * row pooling sequence, needed to calculate gradient. + * @return rowPoolingSequence. */ public Output rowPoolingSequence() { return rowPoolingSequence; } - + /** + * Gets colPoolingSequence. * column pooling sequence, needed to calculate gradient. + * @return colPoolingSequence. */ public Output colPoolingSequence() { return colPoolingSequence; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FractionalAvgPool"; - - private Output output; - private Output rowPoolingSequence; - private Output colPoolingSequence; - - private FractionalAvgPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - rowPoolingSequence = operation.output(outputIdx++); - colPoolingSequence = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPool} + */ + public static class Options { + private Boolean pseudoRandom; + + private Boolean overlapping; + + private Boolean deterministic; + + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the pseudoRandom option. + * + * @param pseudoRandom When set to True, generates the pooling sequence in a + * pseudorandom fashion, otherwise, in a random fashion. Check paper Benjamin + * Graham, Fractional Max-Pooling for + * difference between pseudorandom and random. + * @return this Options instance. + */ + public Options pseudoRandom(Boolean pseudoRandom) { + this.pseudoRandom = pseudoRandom; + return this; + } + + /** + * Sets the overlapping option. + * + * @param overlapping When set to True, it means when pooling, the values at the boundary + * of adjacent pooling cells are used by both cells. For example: + *

{@code index 0 1 2 3 4} + *

{@code value 20 5 16 3 7} + *

If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + * The result would be [41/3, 26/3] for fractional avg pooling. + * @return this Options instance. + */ + public Options overlapping(Boolean overlapping) { + this.overlapping = overlapping; + return this; + } + + /** + * Sets the deterministic option. + * + * @param deterministic When set to True, a fixed pooling region will be used when + * iterating over a FractionalAvgPool node in the computation graph. Mainly used + * in unit test to make FractionalAvgPool deterministic. + * @return this Options instance. + */ + public Options deterministic(Boolean deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPoolGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPoolGrad.java index 094ce640a09..298f4309afe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPoolGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalAvgPoolGrad.java @@ -24,66 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * 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 data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class FractionalAvgPoolGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPoolGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param overlapping When set to True, it means when pooling, the values at the boundary - * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. - * The result would be [41/3, 26/3] for fractional avg pooling. - */ - public Options overlapping(Boolean overlapping) { - this.overlapping = overlapping; - return this; - } - - private Boolean overlapping; - - private Options() { - } + public static final String OP_NAME = "FractionalAvgPoolGrad"; + + private Output output; + + private FractionalAvgPoolGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FractionalAvgPoolGrad operation. - * + * * @param scope current scope - * @param origInputTensorShape Original input tensor shape for `fractional_avg_pool` - * @param outBackprop 4-D with shape `[batch, height, width, channels]`. Gradients - * w.r.t. the output of `fractional_avg_pool`. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code FractionalAvgPoolGrad} output and operands * @return a new instance of FractionalAvgPoolGrad */ - @Endpoint(describeByClass = true) - public static FractionalAvgPoolGrad create(Scope scope, Operand origInputTensorShape, Operand outBackprop, Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FractionalAvgPoolGrad create(Scope scope, + Operand origInputTensorShape, Operand outBackprop, + Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FractionalAvgPoolGrad", scope.makeOpName("FractionalAvgPoolGrad")); opBuilder.addInput(origInputTensorShape.asOutput()); opBuilder.addInput(outBackprop.asOutput()); @@ -97,44 +85,61 @@ public static FractionalAvgPoolGrad create(Scope scope, O } } } - return new FractionalAvgPoolGrad(opBuilder.build()); + return new FractionalAvgPoolGrad<>(opBuilder.build()); } - + /** + * Sets the overlapping option. + * * @param overlapping When set to True, it means when pooling, the values at the boundary * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + *

{@code index 0 1 2 3 4} + *

{@code value 20 5 16 3 7} + *

If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. * The result would be [41/3, 26/3] for fractional avg pooling. + * @return this Options instance. */ public static Options overlapping(Boolean overlapping) { return new Options().overlapping(overlapping); } - + /** - * 4-D. Gradients w.r.t. the input of `fractional_avg_pool`. + * Gets output. + * 4-D. Gradients w.r.t. the input of {@code fractional_avg_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FractionalAvgPoolGrad"; - - private Output output; - - private FractionalAvgPoolGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPoolGrad} + */ + public static class Options { + private Boolean overlapping; + + private Options() { + } + + /** + * Sets the overlapping option. + * + * @param overlapping When set to True, it means when pooling, the values at the boundary + * of adjacent pooling cells are used by both cells. For example: + *

{@code index 0 1 2 3 4} + *

{@code value 20 5 16 3 7} + *

If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + * The result would be [41/3, 26/3] for fractional avg pooling. + * @return this Options instance. + */ + public Options overlapping(Boolean overlapping) { + this.overlapping = overlapping; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPool.java index 86c7e204757..ff58d050dfd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPool.java @@ -31,132 +31,83 @@ /** * 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 + *

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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class FractionalMaxPool extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPool} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param pseudoRandom When set to True, generates the pooling sequence in a - * pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin - * Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for - * difference between pseudorandom and random. - */ - public Options pseudoRandom(Boolean pseudoRandom) { - this.pseudoRandom = pseudoRandom; - return this; - } - - /** - * @param overlapping When set to True, it means when pooling, the values at the boundary - * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. - * The result would be [20, 16] for fractional max pooling. - */ - public Options overlapping(Boolean overlapping) { - this.overlapping = overlapping; - return this; - } - - /** - * @param deterministic When set to True, a fixed pooling region will be used when - * iterating over a FractionalMaxPool node in the computation graph. Mainly used - * in unit test to make FractionalMaxPool deterministic. - */ - public Options deterministic(Boolean deterministic) { - this.deterministic = deterministic; - return this; - } - - /** - * @param seed If either seed or seed2 are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Boolean pseudoRandom; - private Boolean overlapping; - private Boolean deterministic; - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "FractionalMaxPool"; + + private Output output; + + private Output rowPoolingSequence; + + private Output colPoolingSequence; + + private FractionalMaxPool(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + rowPoolingSequence = operation.output(outputIdx++); + colPoolingSequence = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FractionalMaxPool operation. - * + * * @param scope current scope - * @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 FractionalMaxPool} output and operands * @return a new instance of FractionalMaxPool */ - @Endpoint(describeByClass = true) - public static FractionalMaxPool create(Scope scope, Operand value, List poolingRatio, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FractionalMaxPool create(Scope scope, Operand value, + List poolingRatio, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FractionalMaxPool", scope.makeOpName("FractionalMaxPool")); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); float[] poolingRatioArray = new float[poolingRatio.size()]; - for (int i = 0; i < poolingRatioArray.length; ++i) { + for (int i = 0 ; i < poolingRatioArray.length ; i++) { poolingRatioArray[i] = poolingRatio.get(i); } opBuilder.setAttr("pooling_ratio", poolingRatioArray); @@ -179,92 +130,180 @@ public static FractionalMaxPool create(Scope scope, Opera } } } - return new FractionalMaxPool(opBuilder.build()); + return new FractionalMaxPool<>(opBuilder.build()); } - + /** + * Sets the pseudoRandom option. + * * @param pseudoRandom When set to True, generates the pooling sequence in a - * pseudorandom fashion, otherwise, in a random fashion. Check paper [Benjamin - * Graham, Fractional Max-Pooling](http://arxiv.org/abs/1412.6071) for + * pseudorandom fashion, otherwise, in a random fashion. Check paper Benjamin + * Graham, Fractional Max-Pooling for * difference between pseudorandom and random. + * @return this Options instance. */ public static Options pseudoRandom(Boolean pseudoRandom) { return new Options().pseudoRandom(pseudoRandom); } - + /** + * Sets the overlapping option. + * * @param overlapping When set to True, it means when pooling, the values at the boundary * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + *

{@code index 0 1 2 3 4} + *

{@code value 20 5 16 3 7} + *

If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. * The result would be [20, 16] for fractional max pooling. + * @return this Options instance. */ public static Options overlapping(Boolean overlapping) { return new Options().overlapping(overlapping); } - + /** + * Sets the deterministic option. + * * @param deterministic When set to True, a fixed pooling region will be used when * iterating over a FractionalMaxPool node in the computation graph. Mainly used * in unit test to make FractionalMaxPool deterministic. + * @return this Options instance. */ public static Options deterministic(Boolean deterministic) { return new Options().deterministic(deterministic); } - + /** + * Sets the seed option. + * * @param seed If either seed or seed2 are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * output tensor after fractional max pooling. + * @return output. */ public Output output() { return output; } - + /** + * Gets rowPoolingSequence. * row pooling sequence, needed to calculate gradient. + * @return rowPoolingSequence. */ public Output rowPoolingSequence() { return rowPoolingSequence; } - + /** + * Gets colPoolingSequence. * column pooling sequence, needed to calculate gradient. + * @return colPoolingSequence. */ public Output colPoolingSequence() { return colPoolingSequence; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FractionalMaxPool"; - - private Output output; - private Output rowPoolingSequence; - private Output colPoolingSequence; - - private FractionalMaxPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - rowPoolingSequence = operation.output(outputIdx++); - colPoolingSequence = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPool} + */ + public static class Options { + private Boolean pseudoRandom; + + private Boolean overlapping; + + private Boolean deterministic; + + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the pseudoRandom option. + * + * @param pseudoRandom When set to True, generates the pooling sequence in a + * pseudorandom fashion, otherwise, in a random fashion. Check paper Benjamin + * Graham, Fractional Max-Pooling for + * difference between pseudorandom and random. + * @return this Options instance. + */ + public Options pseudoRandom(Boolean pseudoRandom) { + this.pseudoRandom = pseudoRandom; + return this; + } + + /** + * Sets the overlapping option. + * + * @param overlapping When set to True, it means when pooling, the values at the boundary + * of adjacent pooling cells are used by both cells. For example: + *

{@code index 0 1 2 3 4} + *

{@code value 20 5 16 3 7} + *

If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + * The result would be [20, 16] for fractional max pooling. + * @return this Options instance. + */ + public Options overlapping(Boolean overlapping) { + this.overlapping = overlapping; + return this; + } + + /** + * Sets the deterministic option. + * + * @param deterministic When set to True, a fixed pooling region will be used when + * iterating over a FractionalMaxPool node in the computation graph. Mainly used + * in unit test to make FractionalMaxPool deterministic. + * @return this Options instance. + */ + public Options deterministic(Boolean deterministic) { + this.deterministic = deterministic; + return this; + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPoolGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPoolGrad.java index e059e233e05..2e1ec6d800d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPoolGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FractionalMaxPoolGrad.java @@ -24,61 +24,50 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Computes gradient of the FractionalMaxPool function. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class FractionalMaxPoolGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPoolGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param overlapping When set to True, it means when pooling, the values at the boundary - * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. - * The result would be [20, 16] for fractional max pooling. - */ - public Options overlapping(Boolean overlapping) { - this.overlapping = overlapping; - return this; - } - - private Boolean overlapping; - - private Options() { - } + public static final String OP_NAME = "FractionalMaxPoolGrad"; + + private Output output; + + private FractionalMaxPoolGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FractionalMaxPoolGrad operation. - * + * * @param scope current scope - * @param origInput Original input for `fractional_max_pool` - * @param origOutput Original output for `fractional_max_pool` - * @param outBackprop 4-D with shape `[batch, height, width, channels]`. Gradients - * w.r.t. the output of `fractional_max_pool`. + * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code FractionalMaxPoolGrad} output and operands * @return a new instance of FractionalMaxPoolGrad */ - @Endpoint(describeByClass = true) - public static FractionalMaxPoolGrad create(Scope scope, Operand origInput, Operand origOutput, Operand outBackprop, Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FractionalMaxPoolGrad create(Scope scope, + Operand origInput, Operand origOutput, Operand outBackprop, + Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FractionalMaxPoolGrad", scope.makeOpName("FractionalMaxPoolGrad")); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); @@ -93,44 +82,61 @@ public static FractionalMaxPoolGrad create(Scope scope, O } } } - return new FractionalMaxPoolGrad(opBuilder.build()); + return new FractionalMaxPoolGrad<>(opBuilder.build()); } - + /** + * Sets the overlapping option. + * * @param overlapping When set to True, it means when pooling, the values at the boundary * of adjacent pooling cells are used by both cells. For example: - *

- * `index 0 1 2 3 4` - *

- * `value 20 5 16 3 7` - *

- * If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + *

{@code index 0 1 2 3 4} + *

{@code value 20 5 16 3 7} + *

If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. * The result would be [20, 16] for fractional max pooling. + * @return this Options instance. */ public static Options overlapping(Boolean overlapping) { return new Options().overlapping(overlapping); } - + /** - * 4-D. Gradients w.r.t. the input of `fractional_max_pool`. + * Gets output. + * 4-D. Gradients w.r.t. the input of {@code fractional_max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FractionalMaxPoolGrad"; - - private Output output; - - private FractionalMaxPoolGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPoolGrad} + */ + public static class Options { + private Boolean overlapping; + + private Options() { + } + + /** + * Sets the overlapping option. + * + * @param overlapping When set to True, it means when pooling, the values at the boundary + * of adjacent pooling cells are used by both cells. For example: + *

{@code index 0 1 2 3 4} + *

{@code value 20 5 16 3 7} + *

If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. + * The result would be [20, 16] for fractional max pooling. + * @return this Options instance. + */ + public Options overlapping(Boolean overlapping) { + this.overlapping = overlapping; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNorm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNorm.java index 29a6c2bdad3..158d5f58709 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNorm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNorm.java @@ -29,66 +29,48 @@ /** * 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 data type for {@code y} output + * + * @param data type for {@code batch_mean} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class FusedBatchNorm extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNorm} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param epsilon A small float number added to the variance of x. - */ - public Options epsilon(Float epsilon) { - this.epsilon = epsilon; - return this; - } - - /** - * @param exponentialAvgFactor - */ - public Options exponentialAvgFactor(Float exponentialAvgFactor) { - this.exponentialAvgFactor = exponentialAvgFactor; - return this; - } - - /** - * @param dataFormat The data format for x and y. Either "NHWC" (default) or "NCHW". - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param isTraining A bool value to indicate the operation is for training (default) - * or inference. - */ - public Options isTraining(Boolean isTraining) { - this.isTraining = isTraining; - return this; - } - - private Float epsilon; - private Float exponentialAvgFactor; - private String dataFormat; - private Boolean isTraining; - - private Options() { - } + public static final String OP_NAME = "FusedBatchNormV3"; + + private Output y; + + private Output batchMean; + + private Output batchVariance; + + private Output reserveSpace1; + + private Output reserveSpace2; + + private Output reserveSpace3; + + private FusedBatchNorm(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + batchMean = operation.output(outputIdx++); + batchVariance = operation.output(outputIdx++); + reserveSpace1 = operation.output(outputIdx++); + reserveSpace2 = operation.output(outputIdx++); + reserveSpace3 = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FusedBatchNorm operation. - * + * Factory method to create a class wrapping a new FusedBatchNormV3 operation. + * * @param scope current scope * @param x A 4D Tensor for input data. * @param scale A 1D Tensor for scaling factor, to scale the normalized x. @@ -97,11 +79,17 @@ private Options() { * 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 */ - @Endpoint(describeByClass = true) - public static FusedBatchNorm create(Scope scope, Operand x, Operand scale, Operand offset, Operand mean, Operand variance, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FusedBatchNorm create(Scope scope, + Operand x, Operand scale, Operand offset, Operand mean, Operand variance, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FusedBatchNormV3", scope.makeOpName("FusedBatchNorm")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(scale.asOutput()); @@ -125,103 +113,167 @@ public static FusedBatchNorm create } } } - return new FusedBatchNorm(opBuilder.build()); + return new FusedBatchNorm<>(opBuilder.build()); } - + /** + * Sets the epsilon option. + * * @param epsilon A small float number added to the variance of x. + * @return this Options instance. */ public static Options epsilon(Float epsilon) { return new Options().epsilon(epsilon); } - + /** - * @param exponentialAvgFactor + * Sets the exponentialAvgFactor option. + * + * @param exponentialAvgFactor the exponentialAvgFactor option + * @return this Options instance. */ public static Options exponentialAvgFactor(Float exponentialAvgFactor) { return new Options().exponentialAvgFactor(exponentialAvgFactor); } - + /** - * @param dataFormat The data format for x and y. Either "NHWC" (default) or "NCHW". + * Sets the dataFormat option. + * + * @param dataFormat The data format for x and y. Either "NHWC" (default) or "NCHW". + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the isTraining option. + * * @param isTraining A bool value to indicate the operation is for training (default) * or inference. + * @return this Options instance. */ public static Options isTraining(Boolean isTraining) { return new Options().isTraining(isTraining); } - + /** + * Gets y. * A 4D Tensor for output data. + * @return y. */ public Output y() { return y; } - + /** + * Gets batchMean. * A 1D Tensor for the computed batch mean, to be used by TensorFlow * to compute the running mean. + * @return batchMean. */ public Output batchMean() { return batchMean; } - + /** + * Gets batchVariance. * A 1D Tensor for the computed batch variance, to be used by * TensorFlow to compute the running variance. + * @return batchVariance. */ public Output batchVariance() { return batchVariance; } - + /** + * Gets reserveSpace1. * A 1D Tensor for the computed batch mean, to be reused * in the gradient computation. + * @return reserveSpace1. */ public Output reserveSpace1() { return reserveSpace1; } - + /** + * Gets reserveSpace2. * A 1D Tensor for the computed batch variance (inverted variance * in the cuDNN case), to be reused in the gradient computation. + * @return reserveSpace2. */ public Output reserveSpace2() { return reserveSpace2; } - + /** + * Gets reserveSpace3. * A 1D Tensor for some intermediate results, to be reused in the gradient * computation for better efficiency. + * @return reserveSpace3. */ public Output reserveSpace3() { return reserveSpace3; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FusedBatchNormV3"; - - private Output y; - private Output batchMean; - private Output batchVariance; - private Output reserveSpace1; - private Output reserveSpace2; - private Output reserveSpace3; - - private FusedBatchNorm(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - batchMean = operation.output(outputIdx++); - batchVariance = operation.output(outputIdx++); - reserveSpace1 = operation.output(outputIdx++); - reserveSpace2 = operation.output(outputIdx++); - reserveSpace3 = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNorm} + */ + public static class Options { + private Float epsilon; + + private Float exponentialAvgFactor; + + private String dataFormat; + + private Boolean isTraining; + + private Options() { + } + + /** + * Sets the epsilon option. + * + * @param epsilon A small float number added to the variance of x. + * @return this Options instance. + */ + public Options epsilon(Float epsilon) { + this.epsilon = epsilon; + return this; + } + + /** + * Sets the exponentialAvgFactor option. + * + * @param exponentialAvgFactor the exponentialAvgFactor option + * @return this Options instance. + */ + public Options exponentialAvgFactor(Float exponentialAvgFactor) { + this.exponentialAvgFactor = exponentialAvgFactor; + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format for x and y. Either "NHWC" (default) or "NCHW". + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the isTraining option. + * + * @param isTraining A bool value to indicate the operation is for training (default) + * or inference. + * @return this Options instance. + */ + public Options isTraining(Boolean isTraining) { + this.isTraining = isTraining; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNormGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNormGrad.java index aa8d3b94b99..081bc93da40 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNormGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedBatchNormGrad.java @@ -30,58 +30,45 @@ /** * 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 data type for {@code x_backprop} output + * + * @param data type for {@code scale_backprop} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class FusedBatchNormGrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNormGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param epsilon A small float number added to the variance of x. - */ - public Options epsilon(Float epsilon) { - this.epsilon = epsilon; - return this; - } - - /** - * @param dataFormat The data format for y_backprop, x, x_backprop. - * Either "NHWC" (default) or "NCHW". - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - /** - * @param isTraining A bool value to indicate the operation is for training (default) - * or inference. - */ - public Options isTraining(Boolean isTraining) { - this.isTraining = isTraining; - return this; - } - - private Float epsilon; - private String dataFormat; - private Boolean isTraining; - - private Options() { - } + public static final String OP_NAME = "FusedBatchNormGradV3"; + + private Output xBackprop; + + private Output scaleBackprop; + + private Output offsetBackprop; + + private Output reserveSpace4; + + private Output reserveSpace5; + + private FusedBatchNormGrad(Operation operation) { + super(operation); + int outputIdx = 0; + xBackprop = operation.output(outputIdx++); + scaleBackprop = operation.output(outputIdx++); + offsetBackprop = operation.output(outputIdx++); + reserveSpace4 = operation.output(outputIdx++); + reserveSpace5 = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FusedBatchNormGrad operation. - * + * Factory method to create a class wrapping a new FusedBatchNormGradV3 operation. + * * @param scope current scope * @param yBackprop A 4D Tensor for the gradient with respect to y. * @param x A 4D Tensor for input data. @@ -98,11 +85,17 @@ private Options() { * @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 */ - @Endpoint(describeByClass = true) - public static FusedBatchNormGrad create(Scope scope, Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, Operand reserveSpace2, Operand reserveSpace3, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FusedBatchNormGrad create(Scope scope, + Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, + Operand reserveSpace2, Operand reserveSpace3, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FusedBatchNormGradV3", scope.makeOpName("FusedBatchNormGrad")); opBuilder.addInput(yBackprop.asOutput()); opBuilder.addInput(x.asOutput()); @@ -124,84 +117,133 @@ public static FusedBatchNormGrad cr } } } - return new FusedBatchNormGrad(opBuilder.build()); + return new FusedBatchNormGrad<>(opBuilder.build()); } - + /** + * Sets the epsilon option. + * * @param epsilon A small float number added to the variance of x. + * @return this Options instance. */ public static Options epsilon(Float epsilon) { return new Options().epsilon(epsilon); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format for y_backprop, x, x_backprop. - * Either "NHWC" (default) or "NCHW". + * Either "NHWC" (default) or "NCHW". + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Sets the isTraining option. + * * @param isTraining A bool value to indicate the operation is for training (default) * or inference. + * @return this Options instance. */ public static Options isTraining(Boolean isTraining) { return new Options().isTraining(isTraining); } - + /** + * Gets xBackprop. * A 4D Tensor for the gradient with respect to x. + * @return xBackprop. */ public Output xBackprop() { return xBackprop; } - + /** + * Gets scaleBackprop. * A 1D Tensor for the gradient with respect to scale. + * @return scaleBackprop. */ public Output scaleBackprop() { return scaleBackprop; } - + /** + * Gets offsetBackprop. * A 1D Tensor for the gradient with respect to offset. + * @return offsetBackprop. */ public Output offsetBackprop() { return offsetBackprop; } - + /** + * Gets reserveSpace4. * Unused placeholder to match the mean input in FusedBatchNorm. + * @return reserveSpace4. */ public Output reserveSpace4() { return reserveSpace4; } - + /** + * Gets reserveSpace5. * Unused placeholder to match the variance input * in FusedBatchNorm. + * @return reserveSpace5. */ public Output reserveSpace5() { return reserveSpace5; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FusedBatchNormGradV3"; - - private Output xBackprop; - private Output scaleBackprop; - private Output offsetBackprop; - private Output reserveSpace4; - private Output reserveSpace5; - - private FusedBatchNormGrad(Operation operation) { - super(operation); - int outputIdx = 0; - xBackprop = operation.output(outputIdx++); - scaleBackprop = operation.output(outputIdx++); - offsetBackprop = operation.output(outputIdx++); - reserveSpace4 = operation.output(outputIdx++); - reserveSpace5 = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNormGrad} + */ + public static class Options { + private Float epsilon; + + private String dataFormat; + + private Boolean isTraining; + + private Options() { + } + + /** + * Sets the epsilon option. + * + * @param epsilon A small float number added to the variance of x. + * @return this Options instance. + */ + public Options epsilon(Float epsilon) { + this.epsilon = epsilon; + return this; + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format for y_backprop, x, x_backprop. + * Either "NHWC" (default) or "NCHW". + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } + + /** + * Sets the isTraining option. + * + * @param isTraining A bool value to indicate the operation is for training (default) + * or inference. + * @return this Options instance. + */ + public Options isTraining(Boolean isTraining) { + this.isTraining = isTraining; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedPadConv2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedPadConv2d.java index db1a7dac897..8e1d840740f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedPadConv2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedPadConv2d.java @@ -31,7 +31,6 @@ /** * 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 @@ -43,29 +42,48 @@ * Internally this op uses a single per-graph scratch buffer, which means that it * 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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class FusedPadConv2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new FusedPadConv2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FusedPadConv2D"; + + private Output output; + + private FusedPadConv2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FusedPadConv2D operation. + * * @param scope current scope - * @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 property * @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 */ - @Endpoint(describeByClass = true) - public static FusedPadConv2d create(Scope scope, Operand input, Operand paddings, Operand filter, String mode, List strides, String padding) { + @Endpoint( + describeByClass = true + ) + public static FusedPadConv2d create(Scope scope, Operand input, + Operand paddings, Operand filter, String mode, List strides, + String padding) { OperationBuilder opBuilder = scope.env().opBuilder("FusedPadConv2D", scope.makeOpName("FusedPadConv2d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); @@ -73,33 +91,25 @@ public static FusedPadConv2d create(Scope scope, Operand< opBuilder = scope.apply(opBuilder); opBuilder.setAttr("mode", mode); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); opBuilder.setAttr("padding", padding); - return new FusedPadConv2d(opBuilder.build()); + return new FusedPadConv2d<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FusedPadConv2D"; - - private Output output; - - private FusedPadConv2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedResizeAndPadConv2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedResizeAndPadConv2d.java index 1bc106ee063..c7e368d1042 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedResizeAndPadConv2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/FusedResizeAndPadConv2d.java @@ -31,7 +31,6 @@ /** * 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 @@ -42,61 +41,60 @@ * Internally this op uses a single per-graph scratch buffer, which means that it * 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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class FusedResizeAndPadConv2d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.FusedResizeAndPadConv2d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param resizeAlignCorners If true, the centers of the 4 corner pixels of the input and output tensors are - * aligned, preserving the values at the corner pixels. Defaults to false. - */ - public Options resizeAlignCorners(Boolean resizeAlignCorners) { - this.resizeAlignCorners = resizeAlignCorners; - return this; - } - - private Boolean resizeAlignCorners; - - private Options() { - } + public static final String OP_NAME = "FusedResizeAndPadConv2D"; + + private Output output; + + private FusedResizeAndPadConv2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new FusedResizeAndPadConv2d operation. - * + * Factory method to create a class wrapping a new FusedResizeAndPadConv2D operation. + * * @param scope current scope - * @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 property * @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 */ - @Endpoint(describeByClass = true) - public static FusedResizeAndPadConv2d create(Scope scope, Operand input, Operand size, Operand paddings, Operand filter, String mode, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FusedResizeAndPadConv2d create(Scope scope, Operand input, + Operand sizeOutput, Operand paddings, Operand filter, String mode, + List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FusedResizeAndPadConv2D", scope.makeOpName("FusedResizeAndPadConv2d")); opBuilder.addInput(input.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(paddings.asOutput()); opBuilder.addInput(filter.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("mode", mode); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -108,36 +106,53 @@ public static FusedResizeAndPadConv2d create(Scope scope, } } } - return new FusedResizeAndPadConv2d(opBuilder.build()); + return new FusedResizeAndPadConv2d<>(opBuilder.build()); } - + /** + * Sets the resizeAlignCorners option. + * * @param resizeAlignCorners If true, the centers of the 4 corner pixels of the input and output tensors are * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. */ public static Options resizeAlignCorners(Boolean resizeAlignCorners) { return new Options().resizeAlignCorners(resizeAlignCorners); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FusedResizeAndPadConv2D"; - - private Output output; - - private FusedResizeAndPadConv2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.FusedResizeAndPadConv2d} + */ + public static class Options { + private Boolean resizeAlignCorners; + + private Options() { + } + + /** + * Sets the resizeAlignCorners option. + * + * @param resizeAlignCorners If true, the centers of the 4 corner pixels of the input and output tensors are + * aligned, preserving the values at the corner pixels. Defaults to false. + * @return this Options instance. + */ + public Options resizeAlignCorners(Boolean resizeAlignCorners) { + this.resizeAlignCorners = resizeAlignCorners; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCell.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCell.java index 19ee4709eb8..cf6598621f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCell.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCell.java @@ -24,75 +24,92 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * 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 + * 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 : - * `b_ru` - constant_initializer(1.0) - * `b_c` - constant_initializer(0.0) - *

- * This kernel op implements the following mathematical equations: - *

{@code
+ * 

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 data type for {@code r()} output + *
+ * + * @param data type for {@code r} output */ public final class GRUBlockCell extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GRUBlockCell"; + + private Output r; + + private Output u; + + private Output c; + + private Output h; + + private GRUBlockCell(Operation operation) { + super(operation); + int outputIdx = 0; + r = operation.output(outputIdx++); + u = operation.output(outputIdx++); + c = operation.output(outputIdx++); + h = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GRUBlockCell operation. - * + * * @param scope current scope - * @param x - * @param hPrev - * @param wRu - * @param wC - * @param bRu - * @param bC + * @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 */ - @Endpoint(describeByClass = true) - public static GRUBlockCell create(Scope scope, Operand x, Operand hPrev, Operand wRu, Operand wC, Operand bRu, Operand bC) { + @Endpoint( + describeByClass = true + ) + public static GRUBlockCell create(Scope scope, Operand x, + Operand hPrev, Operand wRu, Operand wC, Operand bRu, Operand bC) { OperationBuilder opBuilder = scope.env().opBuilder("GRUBlockCell", scope.makeOpName("GRUBlockCell")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(hPrev.asOutput()); @@ -101,47 +118,42 @@ public static GRUBlockCell create(Scope scope, Operand opBuilder.addInput(bRu.asOutput()); opBuilder.addInput(bC.asOutput()); opBuilder = scope.apply(opBuilder); - return new GRUBlockCell(opBuilder.build()); + return new GRUBlockCell<>(opBuilder.build()); } - + /** + * Gets r. + * + * @return r. */ public Output r() { return r; } - + /** + * Gets u. + * + * @return u. */ public Output u() { return u; } - + /** + * Gets c. + * + * @return c. */ public Output c() { return c; } - + /** + * Gets h. + * + * @return h. */ public Output h() { return h; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GRUBlockCell"; - - private Output r; - private Output u; - private Output c; - private Output h; - - private GRUBlockCell(Operation operation) { - super(operation); - int outputIdx = 0; - r = operation.output(outputIdx++); - u = operation.output(outputIdx++); - c = operation.output(outputIdx++); - h = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCellGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCellGrad.java index 16d2efc3dd5..094b7d46f6e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCellGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/GRUBlockCellGrad.java @@ -24,115 +24,132 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * 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 + * 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: - *

- * `w_ru` can be segmented into 4 different matrices. - *

{@code
+ * 

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, `w_c` can be segmented into 2 different matrices. - *
{@code
+ * 
+ *

Similarly, {@code w_c} can be segmented into 2 different matrices. + *

  * w_c = [w_c_x w_c_h_prevr]
- * }
- * Same goes for biases. - *
{@code
+ * 
+ *

Same goes for biases. + *

  * b_ru = [b_ru_x b_ru_h]
  * b_c = [b_c_x b_c_h]
- * }
- * Another note on notation: - *
{@code
+ * 
+ *

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: - *
{@code
+ * 
+ *

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 + *
+ *

Below calculation is performed in the python wrapper for the Gradients * (not in the gradient kernel.) - *

{@code
+ * 
  * 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 data type for {@code dX()} output + *
+ * + * @param data type for {@code d_x} output */ public final class GRUBlockCellGrad extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "GRUBlockCellGrad"; + + private Output dX; + + private Output dHPrev; + + private Output dCBar; + + private Output dRBarUBar; + + private GRUBlockCellGrad(Operation operation) { + super(operation); + int outputIdx = 0; + dX = operation.output(outputIdx++); + dHPrev = operation.output(outputIdx++); + dCBar = operation.output(outputIdx++); + dRBarUBar = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new GRUBlockCellGrad operation. - * + * * @param scope current scope - * @param x - * @param hPrev - * @param wRu - * @param wC - * @param bRu - * @param bC - * @param r - * @param u - * @param c - * @param dH + * @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 */ - @Endpoint(describeByClass = true) - public static GRUBlockCellGrad create(Scope scope, Operand x, Operand hPrev, Operand wRu, Operand wC, Operand bRu, Operand bC, Operand r, Operand u, Operand c, Operand dH) { + @Endpoint( + describeByClass = true + ) + public static GRUBlockCellGrad create(Scope scope, Operand x, + Operand hPrev, Operand wRu, Operand wC, Operand bRu, Operand bC, Operand r, + Operand u, Operand c, Operand dH) { OperationBuilder opBuilder = scope.env().opBuilder("GRUBlockCellGrad", scope.makeOpName("GRUBlockCellGrad")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(hPrev.asOutput()); @@ -145,47 +162,42 @@ public static GRUBlockCellGrad create(Scope scope, Operan opBuilder.addInput(c.asOutput()); opBuilder.addInput(dH.asOutput()); opBuilder = scope.apply(opBuilder); - return new GRUBlockCellGrad(opBuilder.build()); + return new GRUBlockCellGrad<>(opBuilder.build()); } - + /** + * Gets dX. + * + * @return dX. */ public Output dX() { return dX; } - + /** + * Gets dHPrev. + * + * @return dHPrev. */ public Output dHPrev() { return dHPrev; } - + /** + * Gets dCBar. + * + * @return dCBar. */ public Output dCBar() { return dCBar; } - + /** + * Gets dRBarUBar. + * + * @return dRBarUBar. */ public Output dRBarUBar() { return dRBarUBar; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GRUBlockCellGrad"; - - private Output dX; - private Output dHPrev; - private Output dCBar; - private Output dRBarUBar; - - private GRUBlockCellGrad(Operation operation) { - super(operation); - int outputIdx = 0; - dX = operation.output(outputIdx++); - dHPrev = operation.output(outputIdx++); - dCBar = operation.output(outputIdx++); - dRBarUBar = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InTopK.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InTopK.java index bdf5f761d1a..bd307645aed 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InTopK.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InTopK.java @@ -30,37 +30,51 @@ import org.tensorflow.types.family.TNumber; /** - * 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)$$ + * 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)$$ */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class InTopK extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new InTopK operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InTopKV2"; + + private Output precision; + + private InTopK(Operation operation) { + super(operation); + int outputIdx = 0; + precision = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new InTopKV2 operation. + * * @param scope current scope - * @param predictions A `batch_size` x `classes` tensor. - * @param targets A `batch_size` vector of class ids. + * @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 */ - @Endpoint(describeByClass = true) - public static InTopK create(Scope scope, Operand predictions, Operand targets, Operand k) { + @Endpoint( + describeByClass = true + ) + public static InTopK create(Scope scope, Operand predictions, + Operand targets, Operand k) { OperationBuilder opBuilder = scope.env().opBuilder("InTopKV2", scope.makeOpName("InTopK")); opBuilder.addInput(predictions.asOutput()); opBuilder.addInput(targets.asOutput()); @@ -68,27 +82,18 @@ public static InTopK create(Scope scope, Operand p opBuilder = scope.apply(opBuilder); return new InTopK(opBuilder.build()); } - + /** - * Computed precision at `k` as a `bool Tensor`. + * Gets precision. + * Computed precision at {@code k} as a {@code bool Tensor}. + * @return precision. */ public Output precision() { return precision; } - + @Override public Output asOutput() { return precision; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InTopKV2"; - - private Output precision; - - private InTopK(Operation operation) { - super(operation); - int outputIdx = 0; - precision = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InvGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InvGrad.java index 97c79db904a..2673b2e225d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InvGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/InvGrad.java @@ -24,55 +24,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** - * Computes the gradient for the inverse of `x` wrt its input. - *

- * Specifically, `grad = -dy yy`, where `y = 1/x`, and `dy` + * 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 data type for {@code z()} output + * + * @param data type for {@code z} output */ public final class InvGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InvGrad"; + + private Output z; + + private InvGrad(Operation operation) { + super(operation); + int outputIdx = 0; + z = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InvGrad operation. - * + * * @param scope current scope - * @param y - * @param dy + * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static InvGrad create(Scope scope, Operand y, Operand dy) { OperationBuilder opBuilder = scope.env().opBuilder("InvGrad", scope.makeOpName("InvGrad")); opBuilder.addInput(y.asOutput()); opBuilder.addInput(dy.asOutput()); opBuilder = scope.apply(opBuilder); - return new InvGrad(opBuilder.build()); + return new InvGrad<>(opBuilder.build()); } - + /** + * Gets z. + * + * @return z. */ public Output z() { return z; } - + @Override public Output asOutput() { return z; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InvGrad"; - - private Output z; - - private InvGrad(Operation operation) { - super(operation); - int outputIdx = 0; - z = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/IsotonicRegression.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/IsotonicRegression.java index d6ebf48bd75..7e3642b9f5f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/IsotonicRegression.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/IsotonicRegression.java @@ -25,71 +25,82 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * Solves a batch of isotonic regression problems. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class IsotonicRegression extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IsotonicRegression"; + + private Output output; + + private Output segments; + + private IsotonicRegression(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + segments = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new IsotonicRegression operation. - * + * * @param scope current scope * @param input A (batch_size, dim)-tensor holding a batch of inputs. * @param outputDtype Dtype of output. + * @param data type for {@code IsotonicRegression} output and operands * @return a new instance of IsotonicRegression */ - @Endpoint(describeByClass = true) - public static IsotonicRegression create(Scope scope, Operand input, Class outputDtype) { + @Endpoint( + describeByClass = true + ) + public static IsotonicRegression create(Scope scope, + Operand input, Class outputDtype) { OperationBuilder opBuilder = scope.env().opBuilder("IsotonicRegression", scope.makeOpName("IsotonicRegression")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_dtype", Operands.toDataType(outputDtype)); - return new IsotonicRegression(opBuilder.build()); + return new IsotonicRegression<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new IsotonicRegression operation using default output types. - * + * Factory method to create a class wrapping a new IsotonicRegression operation, with the default output types. + * * @param scope current scope * @param input A (batch_size, dim)-tensor holding a batch of inputs. - * @return a new instance of IsotonicRegression + * @return a new instance of IsotonicRegression, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static IsotonicRegression create(Scope scope, Operand input) { return create(scope, input, TFloat32.class); } - + /** + * Gets output. * A (batch_size, dim)-tensor holding the per-batch element solutions. + * @return output. */ public Output output() { return output; } - + /** + * Gets segments. * An int32 (batch_size, dim)-tensor with the segments. + * @return segments. */ public Output segments() { return segments; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IsotonicRegression"; - - private Output output; - private Output segments; - - private IsotonicRegression(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - segments = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/L2Loss.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/L2Loss.java index 45856e6c255..8fb95490147 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/L2Loss.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/L2Loss.java @@ -29,51 +29,59 @@ /** * L2 Loss. - *

- * Computes half the L2 norm of a tensor without the `sqrt`: - *

- * output = sum(t ** 2) / 2 - * - * @param data type for {@code output()} output + * Computes half the L2 norm of a tensor without the {@code sqrt}: + *

+ * output = sum(t ** 2) / 2
+ * 
+ * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class L2Loss extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "L2Loss"; + + private Output output; + + private L2Loss(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new L2Loss operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static L2Loss create(Scope scope, Operand t) { OperationBuilder opBuilder = scope.env().opBuilder("L2Loss", scope.makeOpName("L2Loss")); opBuilder.addInput(t.asOutput()); opBuilder = scope.apply(opBuilder); - return new L2Loss(opBuilder.build()); + return new L2Loss<>(opBuilder.build()); } - + /** + * Gets output. * 0-D. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "L2Loss"; - - private Output output; - - private L2Loss(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCell.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCell.java index ad144fed082..9f9084b8007 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCell.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCell.java @@ -24,81 +24,70 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * 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: - *

{@code
+ * 

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 data type for {@code i()} output + *
+ * + * @param data type for {@code i} output */ public final class LSTMBlockCell extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LSTMBlockCell} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param forgetBias The forget gate bias. - */ - public Options forgetBias(Float forgetBias) { - this.forgetBias = forgetBias; - return this; - } - - /** - * @param cellClip Value to clip the 'cs' value to. - */ - public Options cellClip(Float cellClip) { - this.cellClip = cellClip; - return this; - } - - /** - * @param usePeephole Whether to use peephole weights. - */ - public Options usePeephole(Boolean usePeephole) { - this.usePeephole = usePeephole; - return this; - } - - private Float forgetBias; - private Float cellClip; - private Boolean usePeephole; - - private Options() { - } + public static final String OP_NAME = "LSTMBlockCell"; + + private Output i; + + private Output cs; + + private Output f; + + private Output o; + + private Output ci; + + private Output co; + + private Output h; + + private LSTMBlockCell(Operation operation) { + super(operation); + int outputIdx = 0; + i = operation.output(outputIdx++); + cs = operation.output(outputIdx++); + f = operation.output(outputIdx++); + o = operation.output(outputIdx++); + ci = operation.output(outputIdx++); + co = operation.output(outputIdx++); + h = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LSTMBlockCell operation. - * + * * @param scope current scope * @param x The input to the LSTM cell, shape (batch_size, num_inputs). * @param csPrev Value of the cell state at previous time step. @@ -108,11 +97,16 @@ private Options() { * @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 attributes values + * @param options carries optional attribute values + * @param data type for {@code LSTMBlockCell} output and operands * @return a new instance of LSTMBlockCell */ - @Endpoint(describeByClass = true) - public static LSTMBlockCell create(Scope scope, Operand x, Operand csPrev, Operand hPrev, Operand w, Operand wci, Operand wcf, Operand wco, Operand b, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LSTMBlockCell create(Scope scope, Operand x, + Operand csPrev, Operand hPrev, Operand w, Operand wci, Operand wcf, + Operand wco, Operand b, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LSTMBlockCell", scope.makeOpName("LSTMBlockCell")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(csPrev.asOutput()); @@ -136,99 +130,146 @@ public static LSTMBlockCell create(Scope scope, Operand(opBuilder.build()); + return new LSTMBlockCell<>(opBuilder.build()); } - + /** + * Sets the forgetBias option. + * * @param forgetBias The forget gate bias. + * @return this Options instance. */ public static Options forgetBias(Float forgetBias) { return new Options().forgetBias(forgetBias); } - + /** + * Sets the cellClip option. + * * @param cellClip Value to clip the 'cs' value to. + * @return this Options instance. */ public static Options cellClip(Float cellClip) { return new Options().cellClip(cellClip); } - + /** + * Sets the usePeephole option. + * * @param usePeephole Whether to use peephole weights. + * @return this Options instance. */ public static Options usePeephole(Boolean usePeephole) { return new Options().usePeephole(usePeephole); } - + /** + * Gets i. * The input gate. + * @return i. */ public Output i() { return i; } - + /** + * Gets cs. * The cell state before the tanh. + * @return cs. */ public Output cs() { return cs; } - + /** + * Gets f. * The forget gate. + * @return f. */ public Output f() { return f; } - + /** + * Gets o. * The output gate. + * @return o. */ public Output o() { return o; } - + /** + * Gets ci. * The cell input. + * @return ci. */ public Output ci() { return ci; } - + /** + * Gets co. * The cell after the tanh. + * @return co. */ public Output co() { return co; } - + /** + * Gets h. * The output h vector. + * @return h. */ public Output h() { return h; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LSTMBlockCell"; - - private Output i; - private Output cs; - private Output f; - private Output o; - private Output ci; - private Output co; - private Output h; - - private LSTMBlockCell(Operation operation) { - super(operation); - int outputIdx = 0; - i = operation.output(outputIdx++); - cs = operation.output(outputIdx++); - f = operation.output(outputIdx++); - o = operation.output(outputIdx++); - ci = operation.output(outputIdx++); - co = operation.output(outputIdx++); - h = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LSTMBlockCell} + */ + public static class Options { + private Float forgetBias; + + private Float cellClip; + + private Boolean usePeephole; + + private Options() { + } + + /** + * Sets the forgetBias option. + * + * @param forgetBias The forget gate bias. + * @return this Options instance. + */ + public Options forgetBias(Float forgetBias) { + this.forgetBias = forgetBias; + return this; + } + + /** + * Sets the cellClip option. + * + * @param cellClip Value to clip the 'cs' value to. + * @return this Options instance. + */ + public Options cellClip(Float cellClip) { + this.cellClip = cellClip; + return this; + } + + /** + * Sets the usePeephole option. + * + * @param usePeephole Whether to use peephole weights. + * @return this Options instance. + */ + public Options usePeephole(Boolean usePeephole) { + this.usePeephole = usePeephole; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCellGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCellGrad.java index 6bcf274af61..401ba8a0dd6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCellGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LSTMBlockCellGrad.java @@ -24,21 +24,43 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Computes the LSTM cell backward propagation for 1 timestep. - *

* This implementation is to be used in conjunction of LSTMBlockCell. - * - * @param data type for {@code csPrevGrad()} output + * + * @param data type for {@code cs_prev_grad} output */ public final class LSTMBlockCellGrad extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LSTMBlockCellGrad"; + + private Output csPrevGrad; + + private Output dicfo; + + private Output wciGrad; + + private Output wcfGrad; + + private Output wcoGrad; + + private LSTMBlockCellGrad(Operation operation) { + super(operation); + int outputIdx = 0; + csPrevGrad = operation.output(outputIdx++); + dicfo = operation.output(outputIdx++); + wciGrad = operation.output(outputIdx++); + wcfGrad = operation.output(outputIdx++); + wcoGrad = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LSTMBlockCellGrad operation. - * + * * @param scope current scope * @param x The input to the LSTM cell, shape (batch_size, num_inputs). * @param csPrev The previous cell state. @@ -57,10 +79,16 @@ public final class LSTMBlockCellGrad extends RawOp { * @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 */ - @Endpoint(describeByClass = true) - public static LSTMBlockCellGrad create(Scope scope, 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) { + @Endpoint( + describeByClass = true + ) + public static LSTMBlockCellGrad create(Scope scope, 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) { OperationBuilder opBuilder = scope.env().opBuilder("LSTMBlockCellGrad", scope.makeOpName("LSTMBlockCellGrad")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(csPrev.asOutput()); @@ -80,60 +108,51 @@ public static LSTMBlockCellGrad create(Scope scope, Opera opBuilder.addInput(hGrad.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("use_peephole", usePeephole); - return new LSTMBlockCellGrad(opBuilder.build()); + return new LSTMBlockCellGrad<>(opBuilder.build()); } - + /** + * Gets csPrevGrad. * The gradient of cs to be back-propped. + * @return csPrevGrad. */ public Output csPrevGrad() { return csPrevGrad; } - + /** + * Gets dicfo. * The derivative wrt to [i, cs, f, o]. + * @return dicfo. */ public Output dicfo() { return dicfo; } - + /** + * Gets wciGrad. * The gradient for wci to be back-propped. + * @return wciGrad. */ public Output wciGrad() { return wciGrad; } - + /** + * Gets wcfGrad. * The gradient for wcf to be back-propped. + * @return wcfGrad. */ public Output wcfGrad() { return wcfGrad; } - + /** + * Gets wcoGrad. * The gradient for wco to be back-propped. + * @return wcoGrad. */ public Output wcoGrad() { return wcoGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LSTMBlockCellGrad"; - - private Output csPrevGrad; - private Output dicfo; - private Output wciGrad; - private Output wcfGrad; - private Output wcoGrad; - - private LSTMBlockCellGrad(Operation operation) { - super(operation); - int outputIdx = 0; - csPrevGrad = operation.output(outputIdx++); - dicfo = operation.output(outputIdx++); - wciGrad = operation.output(outputIdx++); - wcfGrad = operation.output(outputIdx++); - wcoGrad = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LeakyRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LeakyRelu.java index 2016d3a6abb..1a0679d979c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LeakyRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LeakyRelu.java @@ -28,42 +28,41 @@ import org.tensorflow.types.family.TNumber; /** - * Computes rectified linear: `max(features, features * alpha)`. - * - * @param data type for {@code activations()} output + * Computes rectified linear: {@code max(features, features * alpha)}. + * + * @param data type for {@code activations} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class LeakyRelu extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LeakyRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param alpha - */ - public Options alpha(Float alpha) { - this.alpha = alpha; - return this; - } - - private Float alpha; - - private Options() { - } + public static final String OP_NAME = "LeakyRelu"; + + private Output activations; + + private LeakyRelu(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LeakyRelu operation. - * + * * @param scope current scope - * @param features - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LeakyRelu create(Scope scope, Operand features, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LeakyRelu create(Scope scope, Operand features, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LeakyRelu", scope.makeOpName("LeakyRelu")); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); @@ -74,35 +73,51 @@ public static LeakyRelu create(Scope scope, Operand fe } } } - return new LeakyRelu(opBuilder.build()); + return new LeakyRelu<>(opBuilder.build()); } - + /** - * @param alpha + * Sets the alpha option. + * + * @param alpha the alpha option + * @return this Options instance. */ public static Options alpha(Float alpha) { return new Options().alpha(alpha); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LeakyRelu"; - - private Output activations; - - private LeakyRelu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LeakyRelu} + */ + public static class Options { + private Float alpha; + + private Options() { + } + + /** + * Sets the alpha option. + * + * @param alpha the alpha option + * @return this Options instance. + */ + public Options alpha(Float alpha) { + this.alpha = alpha; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LearnedUnigramCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LearnedUnigramCandidateSampler.java index fdd595e76cf..e7fba301202 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LearnedUnigramCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LearnedUnigramCandidateSampler.java @@ -30,53 +30,40 @@ /** * 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. */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class LearnedUnigramCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LearnedUnigramCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either seed or seed2 are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "LearnedUnigramCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + private LearnedUnigramCandidateSampler(Operation operation) { + super(operation); + int outputIdx = 0; + sampledCandidates = operation.output(outputIdx++); + trueExpectedCount = operation.output(outputIdx++); + sampledExpectedCount = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LearnedUnigramCandidateSampler operation. - * + * * @param scope current scope * @param trueClasses A batch_size * num_true matrix, in which each row contains the * IDs of the num_true target_classes in the corresponding original label. @@ -86,11 +73,14 @@ private Options() { * 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 */ - @Endpoint(describeByClass = true) - public static LearnedUnigramCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LearnedUnigramCandidateSampler create(Scope scope, Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LearnedUnigramCandidateSampler", scope.makeOpName("LearnedUnigramCandidateSampler")); opBuilder.addInput(trueClasses.asOutput()); opBuilder = scope.apply(opBuilder); @@ -110,62 +100,95 @@ public static LearnedUnigramCandidateSampler create(Scope scope, Operand } return new LearnedUnigramCandidateSampler(opBuilder.build()); } - + /** + * Sets the seed option. + * * @param seed If either seed or seed2 are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets sampledCandidates. * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. + * @return sampledCandidates. */ public Output sampledCandidates() { return sampledCandidates; } - + /** + * Gets trueExpectedCount. * A batch_size * num_true matrix, representing * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. + * @return trueExpectedCount. */ public Output trueExpectedCount() { return trueExpectedCount; } - + /** + * Gets sampledExpectedCount. * A vector of length num_sampled, for each sampled * candidate representing the number of times the candidate is expected * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. + * @return sampledExpectedCount. */ public Output sampledExpectedCount() { return sampledExpectedCount; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LearnedUnigramCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private LearnedUnigramCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LearnedUnigramCandidateSampler} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalization.java index 1e28dd0ee14..2da47d2cecc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalization.java @@ -29,80 +29,51 @@ /** * Local Response Normalization. - *

- * 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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class LocalResponseNormalization extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalization} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param depthRadius 0-D. Half-width of the 1-D normalization window. - */ - public Options depthRadius(Long depthRadius) { - this.depthRadius = depthRadius; - return this; - } - - /** - * @param bias An offset (usually positive to avoid dividing by 0). - */ - public Options bias(Float bias) { - this.bias = bias; - return this; - } - - /** - * @param alpha A scale factor, usually positive. - */ - public Options alpha(Float alpha) { - this.alpha = alpha; - return this; - } - - /** - * @param beta An exponent. - */ - public Options beta(Float beta) { - this.beta = beta; - return this; - } - - private Long depthRadius; - private Float bias; - private Float alpha; - private Float beta; - - private Options() { - } + public static final String OP_NAME = "LRN"; + + private Output output; + + private LocalResponseNormalization(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new LocalResponseNormalization operation. - * + * Factory method to create a class wrapping a new LRN operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static LocalResponseNormalization create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LocalResponseNormalization create(Scope scope, + Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LRN", scope.makeOpName("LocalResponseNormalization")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -122,56 +93,120 @@ public static LocalResponseNormalization create(Scope sco } } } - return new LocalResponseNormalization(opBuilder.build()); + return new LocalResponseNormalization<>(opBuilder.build()); } - + /** + * Sets the depthRadius option. + * * @param depthRadius 0-D. Half-width of the 1-D normalization window. + * @return this Options instance. */ public static Options depthRadius(Long depthRadius) { return new Options().depthRadius(depthRadius); } - + /** + * Sets the bias option. + * * @param bias An offset (usually positive to avoid dividing by 0). + * @return this Options instance. */ public static Options bias(Float bias) { return new Options().bias(bias); } - + /** + * Sets the alpha option. + * * @param alpha A scale factor, usually positive. + * @return this Options instance. */ public static Options alpha(Float alpha) { return new Options().alpha(alpha); } - + /** + * Sets the beta option. + * * @param beta An exponent. + * @return this Options instance. */ public static Options beta(Float beta) { return new Options().beta(beta); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LRN"; - - private Output output; - - private LocalResponseNormalization(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalization} + */ + public static class Options { + private Long depthRadius; + + private Float bias; + + private Float alpha; + + private Float beta; + + private Options() { + } + + /** + * Sets the depthRadius option. + * + * @param depthRadius 0-D. Half-width of the 1-D normalization window. + * @return this Options instance. + */ + public Options depthRadius(Long depthRadius) { + this.depthRadius = depthRadius; + return this; + } + + /** + * Sets the bias option. + * + * @param bias An offset (usually positive to avoid dividing by 0). + * @return this Options instance. + */ + public Options bias(Float bias) { + this.bias = bias; + return this; + } + + /** + * Sets the alpha option. + * + * @param alpha A scale factor, usually positive. + * @return this Options instance. + */ + public Options alpha(Float alpha) { + this.alpha = alpha; + return this; + } + + /** + * Sets the beta option. + * + * @param beta An exponent. + * @return this Options instance. + */ + public Options beta(Float beta) { + this.beta = beta; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalizationGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalizationGrad.java index 51915dc43a7..bbd4a38dee0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalizationGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LocalResponseNormalizationGrad.java @@ -24,74 +24,43 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Gradients for Local Response Normalization. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class LocalResponseNormalizationGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalizationGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param depthRadius A depth radius. - */ - public Options depthRadius(Long depthRadius) { - this.depthRadius = depthRadius; - return this; - } - - /** - * @param bias An offset (usually > 0 to avoid dividing by 0). - */ - public Options bias(Float bias) { - this.bias = bias; - return this; - } - - /** - * @param alpha A scale factor, usually positive. - */ - public Options alpha(Float alpha) { - this.alpha = alpha; - return this; - } - - /** - * @param beta An exponent. - */ - public Options beta(Float beta) { - this.beta = beta; - return this; - } - - private Long depthRadius; - private Float bias; - private Float alpha; - private Float beta; - - private Options() { - } + public static final String OP_NAME = "LRNGrad"; + + private Output output; + + private LocalResponseNormalizationGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new LocalResponseNormalizationGrad operation. - * + * Factory method to create a class wrapping a new LRNGrad operation. + * * @param scope current scope - * @param inputGrads 4-D with shape `[batch, height, width, channels]`. - * @param inputImage 4-D with shape `[batch, height, width, channels]`. - * @param outputImage 4-D with shape `[batch, height, width, channels]`. - * @param options carries optional attributes values + * @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 */ - @Endpoint(describeByClass = true) - public static LocalResponseNormalizationGrad create(Scope scope, Operand inputGrads, Operand inputImage, Operand outputImage, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LocalResponseNormalizationGrad create(Scope scope, + Operand inputGrads, Operand inputImage, Operand outputImage, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LRNGrad", scope.makeOpName("LocalResponseNormalizationGrad")); opBuilder.addInput(inputGrads.asOutput()); opBuilder.addInput(inputImage.asOutput()); @@ -113,57 +82,120 @@ public static LocalResponseNormalizationGrad create(Scope } } } - return new LocalResponseNormalizationGrad(opBuilder.build()); + return new LocalResponseNormalizationGrad<>(opBuilder.build()); } - + /** + * Sets the depthRadius option. + * * @param depthRadius A depth radius. + * @return this Options instance. */ public static Options depthRadius(Long depthRadius) { return new Options().depthRadius(depthRadius); } - + /** - * @param bias An offset (usually > 0 to avoid dividing by 0). + * Sets the bias option. + * + * @param bias An offset (usually > 0 to avoid dividing by 0). + * @return this Options instance. */ public static Options bias(Float bias) { return new Options().bias(bias); } - + /** + * Sets the alpha option. + * * @param alpha A scale factor, usually positive. + * @return this Options instance. */ public static Options alpha(Float alpha) { return new Options().alpha(alpha); } - + /** + * Sets the beta option. + * * @param beta An exponent. + * @return this Options instance. */ public static Options beta(Float beta) { return new Options().beta(beta); } - + /** + * Gets output. * The gradients for LRN. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LRNGrad"; - - private Output output; - - private LocalResponseNormalizationGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalizationGrad} + */ + public static class Options { + private Long depthRadius; + + private Float bias; + + private Float alpha; + + private Float beta; + + private Options() { + } + + /** + * Sets the depthRadius option. + * + * @param depthRadius A depth radius. + * @return this Options instance. + */ + public Options depthRadius(Long depthRadius) { + this.depthRadius = depthRadius; + return this; + } + + /** + * Sets the bias option. + * + * @param bias An offset (usually > 0 to avoid dividing by 0). + * @return this Options instance. + */ + public Options bias(Float bias) { + this.bias = bias; + return this; + } + + /** + * Sets the alpha option. + * + * @param alpha A scale factor, usually positive. + * @return this Options instance. + */ + public Options alpha(Float alpha) { + this.alpha = alpha; + return this; + } + + /** + * Sets the beta option. + * + * @param beta An exponent. + * @return this Options instance. + */ + public Options beta(Float beta) { + this.beta = beta; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LogSoftmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LogSoftmax.java index 75addd4b6a8..e39f5686016 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LogSoftmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/LogSoftmax.java @@ -29,51 +29,59 @@ /** * Computes log softmax activations. - *

- * For each batch `i` and class `j` we have - *

- * logsoftmax[i, j] = logits[i, j] - log(sum(exp(logits[i]))) - * - * @param data type for {@code logsoftmax()} output + * 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 */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class LogSoftmax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "LogSoftmax"; + + private Output logsoftmax; + + private LogSoftmax(Operation operation) { + super(operation); + int outputIdx = 0; + logsoftmax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new LogSoftmax operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static LogSoftmax create(Scope scope, Operand logits) { OperationBuilder opBuilder = scope.env().opBuilder("LogSoftmax", scope.makeOpName("LogSoftmax")); opBuilder.addInput(logits.asOutput()); opBuilder = scope.apply(opBuilder); - return new LogSoftmax(opBuilder.build()); + return new LogSoftmax<>(opBuilder.build()); } - + /** - * Same shape as `logits`. + * Gets logsoftmax. + * Same shape as {@code logits}. + * @return logsoftmax. */ public Output logsoftmax() { return logsoftmax; } - + @Override public Output asOutput() { return logsoftmax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogSoftmax"; - - private Output logsoftmax; - - private LogSoftmax(Operation operation) { - super(operation); - int outputIdx = 0; - logsoftmax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool.java index ad87046045e..9eda868c92f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool.java @@ -26,53 +26,48 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Performs max pooling on the input. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") -public final class MaxPool extends RawOp implements Operand { - +@Operator( + group = "nn" +) +public final class MaxPool extends RawOp implements Operand { /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPool} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPoolV2"; + + private Output output; + + private MaxPool(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPool operation. - * + * Factory method to create a class wrapping a new MaxPoolV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static MaxPool create(Scope scope, Operand input, Operand ksize, Operand strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPool create(Scope scope, Operand input, + Operand ksize, Operand strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolV2", scope.makeOpName("MaxPool")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(ksize.asOutput()); @@ -86,40 +81,59 @@ public static MaxPool create(Scope scope, Operand input, } } } - return new MaxPool(opBuilder.build()); + return new MaxPool<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. * The max pooled output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolV2"; - - private Output output; - - private MaxPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPool} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3d.java index bb802045fc4..9488cba0214 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3d.java @@ -30,60 +30,55 @@ /** * Performs 3D max pooling on the input. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class MaxPool3d extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPool3D"; + + private Output output; + + private MaxPool3d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPool3d operation. - * + * Factory method to create a class wrapping a new MaxPool3D operation. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static MaxPool3d create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPool3d create(Scope scope, Operand input, + List ksize, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPool3D", scope.makeOpName("MaxPool3d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -95,40 +90,59 @@ public static MaxPool3d create(Scope scope, Operand in } } } - return new MaxPool3d(opBuilder.build()); + return new MaxPool3d<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. * The max pooled output tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPool3D"; - - private Output output; - - private MaxPool3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3d} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGrad.java index 12966ef1c04..2d38c68cdbd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGrad.java @@ -30,64 +30,61 @@ /** * Computes gradients of 3D max pooling function. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class MaxPool3dGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPool3DGrad"; + + private Output output; + + private MaxPool3dGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPool3dGrad operation. - * + * Factory method to create a class wrapping a new MaxPool3DGrad operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static MaxPool3dGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPool3dGrad create(Scope scope, + Operand origInput, Operand origOutput, Operand grad, List ksize, + List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPool3DGrad", scope.makeOpName("MaxPool3dGrad")); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -99,39 +96,59 @@ public static MaxPool3dGrad create(Sco } } } - return new MaxPool3dGrad(opBuilder.build()); + return new MaxPool3dGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPool3DGrad"; - - private Output output; - - private MaxPool3dGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGradGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGradGrad.java index 1153cc1fb68..dba59ac6923 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGradGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPool3dGradGrad.java @@ -30,64 +30,60 @@ /** * Computes second-order gradients of the maxpooling function. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class MaxPool3dGradGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGradGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPool3DGradGrad"; + + private Output output; + + private MaxPool3dGradGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPool3dGradGrad operation. - * + * Factory method to create a class wrapping a new MaxPool3DGradGrad operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static MaxPool3dGradGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPool3dGradGrad create(Scope scope, Operand origInput, + Operand origOutput, Operand grad, List ksize, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPool3DGradGrad", scope.makeOpName("MaxPool3dGradGrad")); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -99,40 +95,59 @@ public static MaxPool3dGradGrad create(Scope scope, Opera } } } - return new MaxPool3dGradGrad(opBuilder.build()); + return new MaxPool3dGradGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat The data format of the input and output data. With the - * default format "NDHWC", the data is stored in the order of: - * [batch, in_depth, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCDHW", the data storage order is: - * [batch, in_channels, in_depth, in_height, in_width]. + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** - * Gradients of gradients w.r.t. the input to `max_pool`. + * Gets output. + * Gradients of gradients w.r.t. the input to {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPool3DGradGrad"; - - private Output output; - - private MaxPool3dGradGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGradGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat The data format of the input and output data. With the + * default format "NDHWC", the data is stored in the order of: + * [batch, in_depth, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCDHW", the data storage order is: + * [batch, in_channels, in_depth, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGrad.java index 58bcd623533..3323aeed090 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGrad.java @@ -30,51 +30,47 @@ /** * Computes gradients of the maxpooling function. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class MaxPoolGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPoolGradV2"; + + private Output output; + + private MaxPoolGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPoolGrad operation. - * + * Factory method to create a class wrapping a new MaxPoolGradV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static MaxPoolGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, Operand ksize, Operand strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPoolGrad create(Scope scope, Operand origInput, + Operand origOutput, Operand grad, Operand ksize, Operand strides, + String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolGradV2", scope.makeOpName("MaxPoolGrad")); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); @@ -90,40 +86,59 @@ public static MaxPoolGrad create(Scope scope, Operand } } } - return new MaxPoolGrad(opBuilder.build()); + return new MaxPoolGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** - * Gradients w.r.t. the input to `max_pool`. + * Gets output. + * Gradients w.r.t. the input to {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolGradV2"; - - private Output output; - - private MaxPoolGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGrad.java index 84ad249f82d..e254b70bf7f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGrad.java @@ -30,51 +30,47 @@ /** * Computes second-order gradients of the maxpooling function. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class MaxPoolGradGrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "MaxPoolGradGradV2"; + + private Output output; + + private MaxPoolGradGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new MaxPoolGradGrad operation. - * + * Factory method to create a class wrapping a new MaxPoolGradGradV2 operation. + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static MaxPoolGradGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, Operand ksize, Operand strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPoolGradGrad create(Scope scope, Operand origInput, + Operand origOutput, Operand grad, Operand ksize, Operand strides, + String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolGradGradV2", scope.makeOpName("MaxPoolGradGrad")); opBuilder.addInput(origInput.asOutput()); opBuilder.addInput(origOutput.asOutput()); @@ -90,40 +86,59 @@ public static MaxPoolGradGrad create(Scope scope, Operand } } } - return new MaxPoolGradGrad(opBuilder.build()); + return new MaxPoolGradGrad<>(opBuilder.build()); } - + /** + * Sets the dataFormat option. + * * @param dataFormat Specify the data format of the input and output data. With the - * default format "NHWC", the data is stored in the order of: - * [batch, in_height, in_width, in_channels]. - * Alternatively, the format could be "NCHW", the data storage order of: - * [batch, in_channels, in_height, in_width]. + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** - * Gradients of gradients w.r.t. the input to `max_pool`. + * Gets output. + * Gradients of gradients w.r.t. the input to {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolGradGradV2"; - - private Output output; - - private MaxPoolGradGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGrad} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat Specify the data format of the input and output data. With the + * default format "NHWC", the data is stored in the order of: + * [batch, in_height, in_width, in_channels]. + * Alternatively, the format could be "NCHW", the data storage order of: + * [batch, in_channels, in_height, in_width]. + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGradWithArgmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGradWithArgmax.java index 9c01c23db6d..7751bca3d64 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGradWithArgmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradGradWithArgmax.java @@ -30,60 +30,60 @@ /** * Computes second-order gradients of the maxpooling function. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class MaxPoolGradGradWithArgmax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGradWithArgmax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. - */ - public Options includeBatchInIndex(Boolean includeBatchInIndex) { - this.includeBatchInIndex = includeBatchInIndex; - return this; - } - - private Boolean includeBatchInIndex; - - private Options() { - } + public static final String OP_NAME = "MaxPoolGradGradWithArgmax"; + + private Output output; + + private MaxPoolGradGradWithArgmax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MaxPoolGradGradWithArgmax operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static MaxPoolGradGradWithArgmax create(Scope scope, Operand input, Operand grad, Operand argmax, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPoolGradGradWithArgmax create(Scope scope, + Operand input, Operand grad, Operand argmax, List ksize, + List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolGradGradWithArgmax", scope.makeOpName("MaxPoolGradGradWithArgmax")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(argmax.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -95,36 +95,51 @@ public static MaxPoolGradGradWithArgmax create(Scope scop } } } - return new MaxPoolGradGradWithArgmax(opBuilder.build()); + return new MaxPoolGradGradWithArgmax<>(opBuilder.build()); } - + /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. */ public static Options includeBatchInIndex(Boolean includeBatchInIndex) { return new Options().includeBatchInIndex(includeBatchInIndex); } - + /** - * Gradients of gradients w.r.t. the input of `max_pool`. + * Gets output. + * Gradients of gradients w.r.t. the input of {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolGradGradWithArgmax"; - - private Output output; - - private MaxPoolGradGradWithArgmax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGradWithArgmax} + */ + public static class Options { + private Boolean includeBatchInIndex; + + private Options() { + } + + /** + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. + */ + public Options includeBatchInIndex(Boolean includeBatchInIndex) { + this.includeBatchInIndex = includeBatchInIndex; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradWithArgmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradWithArgmax.java index c07cb6f16a5..e4a93a781a0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradWithArgmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolGradWithArgmax.java @@ -25,64 +25,61 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Computes gradients of the maxpooling function. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class MaxPoolGradWithArgmax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradWithArgmax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. - */ - public Options includeBatchInIndex(Boolean includeBatchInIndex) { - this.includeBatchInIndex = includeBatchInIndex; - return this; - } - - private Boolean includeBatchInIndex; - - private Options() { - } + public static final String OP_NAME = "MaxPoolGradWithArgmax"; + + private Output output; + + private MaxPoolGradWithArgmax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MaxPoolGradWithArgmax operation. - * + * * @param scope current scope * @param input The original input. - * @param grad 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. the - * output 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 + * 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 attributes values + * @param options carries optional attribute values + * @param data type for {@code MaxPoolGradWithArgmax} output and operands * @return a new instance of MaxPoolGradWithArgmax */ - @Endpoint(describeByClass = true) - public static MaxPoolGradWithArgmax create(Scope scope, Operand input, Operand grad, Operand argmax, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPoolGradWithArgmax create(Scope scope, Operand input, + Operand grad, Operand argmax, List ksize, List strides, + String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolGradWithArgmax", scope.makeOpName("MaxPoolGradWithArgmax")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(argmax.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -94,36 +91,51 @@ public static MaxPoolGradWithArgmax create(Scope scope, O } } } - return new MaxPoolGradWithArgmax(opBuilder.build()); + return new MaxPoolGradWithArgmax<>(opBuilder.build()); } - + /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. */ public static Options includeBatchInIndex(Boolean includeBatchInIndex) { return new Options().includeBatchInIndex(includeBatchInIndex); } - + /** - * Gradients w.r.t. the input of `max_pool`. + * Gets output. + * Gradients w.r.t. the input of {@code max_pool}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolGradWithArgmax"; - - private Output output; - - private MaxPoolGradWithArgmax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradWithArgmax} + */ + public static class Options { + private Boolean includeBatchInIndex; + + private Options() { + } + + /** + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. + */ + public Options includeBatchInIndex(Boolean includeBatchInIndex) { + this.includeBatchInIndex = includeBatchInIndex; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java index f269753c21b..bc705020ec7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/MaxPoolWithArgmax.java @@ -32,67 +32,70 @@ /** * 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 data type for {@code output} output + * + * @param data type for {@code argmax} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class MaxPoolWithArgmax extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolWithArgmax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. - */ - public Options includeBatchInIndex(Boolean includeBatchInIndex) { - this.includeBatchInIndex = includeBatchInIndex; - return this; - } - - private Boolean includeBatchInIndex; - - private Options() { - } + public static final String OP_NAME = "MaxPoolWithArgmax"; + + private Output output; + + private Output argmax; + + private MaxPoolWithArgmax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + argmax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new MaxPoolWithArgmax operation. - * + * * @param scope current scope - * @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 property * @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 */ - @Endpoint(describeByClass = true) - public static MaxPoolWithArgmax create(Scope scope, Operand input, List ksize, List strides, Class Targmax, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPoolWithArgmax create(Scope scope, + Operand input, List ksize, List strides, Class Targmax, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolWithArgmax", scope.makeOpName("MaxPoolWithArgmax")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -105,57 +108,76 @@ public static MaxPoolWithArgmax cre } } } - return new MaxPoolWithArgmax(opBuilder.build()); + return new MaxPoolWithArgmax<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new MaxPoolWithArgmax operation using default output types. - * + * Factory method to create a class wrapping a new MaxPoolWithArgmax operation, with the default output types. + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static MaxPoolWithArgmax create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MaxPoolWithArgmax create(Scope scope, + Operand input, List ksize, List strides, String padding, Options[] options) { return create(scope, input, ksize, strides, TInt64.class, padding, options); } - + /** - * @param includeBatchInIndex Whether to include batch dimension in flattened index of `argmax`. + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. */ public static Options includeBatchInIndex(Boolean includeBatchInIndex) { return new Options().includeBatchInIndex(includeBatchInIndex); } - + /** + * Gets output. * The max pooled output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets argmax. * 4-D. The flattened indices of the max values chosen for each output. + * @return argmax. */ public Output argmax() { return argmax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MaxPoolWithArgmax"; - - private Output output; - private Output argmax; - - private MaxPoolWithArgmax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - argmax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolWithArgmax} + */ + public static class Options { + private Boolean includeBatchInIndex; + + private Options() { + } + + /** + * Sets the includeBatchInIndex option. + * + * @param includeBatchInIndex Whether to include batch dimension in flattened index of {@code argmax}. + * @return this Options instance. + */ + public Options includeBatchInIndex(Boolean includeBatchInIndex) { + this.includeBatchInIndex = includeBatchInIndex; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/NthElement.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/NthElement.java index 9ea182bb4e5..33dbf662b9d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/NthElement.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/NthElement.java @@ -29,53 +29,50 @@ import org.tensorflow.types.family.TNumber; /** - * 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] - * - * @param data type for {@code values()} output + *

+ * values.shape = input.shape[:-1]
+ * 
+ * + * @param data type for {@code values} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class NthElement extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.NthElement} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param reverse When set to True, find the nth-largest value in the vector and vice - * versa. - */ - public Options reverse(Boolean reverse) { - this.reverse = reverse; - return this; - } - - private Boolean reverse; - - private Options() { - } + public static final String OP_NAME = "NthElement"; + + private Output values; + + private NthElement(Operation operation) { + super(operation); + int outputIdx = 0; + values = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new NthElement operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static NthElement create(Scope scope, Operand input, Operand n, Options... options) { + @Endpoint( + describeByClass = true + ) + public static NthElement create(Scope scope, Operand input, + Operand n, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("NthElement", scope.makeOpName("NthElement")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(n.asOutput()); @@ -87,37 +84,53 @@ public static NthElement create(Scope scope, Operand i } } } - return new NthElement(opBuilder.build()); + return new NthElement<>(opBuilder.build()); } - + /** + * Sets the reverse option. + * * @param reverse When set to True, find the nth-largest value in the vector and vice * versa. + * @return this Options instance. */ public static Options reverse(Boolean reverse) { return new Options().reverse(reverse); } - + /** - * The `n`-th order statistic along each last dimensional slice. + * Gets values. + * The {@code n}-th order statistic along each last dimensional slice. + * @return values. */ public Output values() { return values; } - + @Override public Output asOutput() { return values; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NthElement"; - - private Output values; - - private NthElement(Operation operation) { - super(operation); - int outputIdx = 0; - values = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.NthElement} + */ + public static class Options { + private Boolean reverse; + + private Options() { + } + + /** + * Sets the reverse option. + * + * @param reverse When set to True, find the nth-largest value in the vector and vice + * versa. + * @return this Options instance. + */ + public Options reverse(Boolean reverse) { + this.reverse = reverse; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedAvgPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedAvgPool.java index 1548219e9e0..34101f042f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedAvgPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedAvgPool.java @@ -27,21 +27,41 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Produces the average pool of the input tensor for quantized types. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") -public final class QuantizedAvgPool extends RawOp { - +@Operator( + group = "nn" +) +public final class QuantizedAvgPool extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedAvgPool"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedAvgPool(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedAvgPool operation. - * + * * @param scope current scope - * @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. @@ -49,61 +69,58 @@ public final class QuantizedAvgPool extends RawOp { * @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 QuantizedAvgPool} output and operands * @return a new instance of QuantizedAvgPool */ - @Endpoint(describeByClass = true) - public static QuantizedAvgPool create(Scope scope, Operand input, Operand minInput, Operand maxInput, List ksize, List strides, String padding) { + @Endpoint( + describeByClass = true + ) + public static QuantizedAvgPool create(Scope scope, Operand input, + Operand minInput, Operand maxInput, List ksize, List strides, + String padding) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedAvgPool", scope.makeOpName("QuantizedAvgPool")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minInput.asOutput()); opBuilder.addInput(maxInput.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); opBuilder.setAttr("padding", padding); - return new QuantizedAvgPool(opBuilder.build()); + return new QuantizedAvgPool<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the lowest quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the highest quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedAvgPool"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedAvgPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBatchNormWithGlobalNormalization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBatchNormWithGlobalNormalization.java index 60f242ef636..058947effea 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBatchNormWithGlobalNormalization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBatchNormWithGlobalNormalization.java @@ -27,22 +27,41 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Quantized Batch normalization. - *

* This op is deprecated and will be removed in the future. Prefer - * `tf.nn.batch_normalization`. - * - * @param data type for {@code result()} output + * {@code tf.nn.batch_normalization}. + * + * @param data type for {@code result} output */ -@Operator(group = "nn") -public final class QuantizedBatchNormWithGlobalNormalization extends RawOp { - +@Operator( + group = "nn" +) +public final class QuantizedBatchNormWithGlobalNormalization extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedBatchNormWithGlobalNormalization"; + + private Output result; + + private Output resultMin; + + private Output resultMax; + + private QuantizedBatchNormWithGlobalNormalization(Operation operation) { + super(operation); + int outputIdx = 0; + result = operation.output(outputIdx++); + resultMin = operation.output(outputIdx++); + resultMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedBatchNormWithGlobalNormalization operation. - * + * * @param scope current scope * @param t A 4D input Tensor. * @param tMin The value represented by the lowest quantized input. @@ -62,18 +81,27 @@ public final class QuantizedBatchNormWithGlobalNormalization ex * @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 property * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedBatchNormWithGlobalNormalization create(Scope scope, 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, Class outType, Float varianceEpsilon, Boolean scaleAfterNormalization) { + @Endpoint( + describeByClass = true + ) + public static QuantizedBatchNormWithGlobalNormalization create( + Scope scope, 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, Class outType, + Float varianceEpsilon, Boolean scaleAfterNormalization) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedBatchNormWithGlobalNormalization", scope.makeOpName("QuantizedBatchNormWithGlobalNormalization")); opBuilder.addInput(t.asOutput()); opBuilder.addInput(tMin.asOutput()); @@ -94,39 +122,33 @@ public static QuantizedBatchNormWithGlobalNor opBuilder.setAttr("out_type", Operands.toDataType(outType)); opBuilder.setAttr("variance_epsilon", varianceEpsilon); opBuilder.setAttr("scale_after_normalization", scaleAfterNormalization); - return new QuantizedBatchNormWithGlobalNormalization(opBuilder.build()); + return new QuantizedBatchNormWithGlobalNormalization<>(opBuilder.build()); } - + /** + * Gets result. + * + * @return result. */ public Output result() { return result; } - + /** + * Gets resultMin. + * + * @return resultMin. */ public Output resultMin() { return resultMin; } - + /** + * Gets resultMax. + * + * @return resultMax. */ public Output resultMax() { return resultMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedBatchNormWithGlobalNormalization"; - - private Output result; - private Output resultMin; - private Output resultMax; - - private QuantizedBatchNormWithGlobalNormalization(Operation operation) { - super(operation); - int outputIdx = 0; - result = operation.output(outputIdx++); - resultMin = operation.output(outputIdx++); - resultMax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBiasAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBiasAdd.java index b0aeac360c4..a5857e1ae76 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBiasAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedBiasAdd.java @@ -27,33 +27,58 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * 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 data type for {@code output} output */ -@Operator(group = "nn") -public final class QuantizedBiasAdd extends RawOp { - +@Operator( + group = "nn" +) +public final class QuantizedBiasAdd extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedBiasAdd"; + + private Output output; + + private Output minOut; + + private Output maxOut; + + private QuantizedBiasAdd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedBiasAdd operation. - * + * * @param scope current scope - * @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 property + * @param data type for {@code QuantizedBiasAdd} output and operands * @return a new instance of QuantizedBiasAdd */ - @Endpoint(describeByClass = true) - public static QuantizedBiasAdd create(Scope scope, Operand input, Operand bias, Operand minInput, Operand maxInput, Operand minBias, Operand maxBias, Class outType) { + @Endpoint( + describeByClass = true + ) + public static QuantizedBiasAdd create(Scope scope, + Operand input, Operand bias, Operand minInput, + Operand maxInput, Operand minBias, Operand maxBias, + Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedBiasAdd", scope.makeOpName("QuantizedBiasAdd")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -63,41 +88,33 @@ public static QuantizedBiasAdd create(Scope scope, Operand< opBuilder.addInput(maxBias.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new QuantizedBiasAdd(opBuilder.build()); + return new QuantizedBiasAdd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOut. * The float value that the lowest quantized output value represents. + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. * The float value that the highest quantized output value represents. + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedBiasAdd"; - - private Output output; - private Output minOut; - private Output maxOut; - - private QuantizedBiasAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRelu.java index fecb450e7da..1548df84847 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRelu.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,61 +27,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DAndRelu operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DAndRelu extends RawOp { - +public final class QuantizedConv2DAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DAndRelu"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DAndRelu(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DAndRelu operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DAndRelu} output and operands * @return a new instance of QuantizedConv2DAndRelu */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DAndRelu create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DAndRelu create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DAndRelu", scope.makeOpName("QuantizedConv2DAndRelu")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -91,7 +90,7 @@ public static QuantizedConv2DAndRelu create(Scope scope, Op opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -100,67 +99,143 @@ public static QuantizedConv2DAndRelu create(Scope scope, Op for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DAndRelu(opBuilder.build()); + return new QuantizedConv2DAndRelu<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DAndRelu"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndRelu} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndReluAndRequantize.java index b1408decd0f..cb0ed49c2e9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndReluAndRequantize.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,63 +27,62 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DAndReluAndRequantize operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DAndReluAndRequantize extends RawOp { - +public final class QuantizedConv2DAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DAndReluAndRequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DAndReluAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DAndReluAndRequantize} output and operands * @return a new instance of QuantizedConv2DAndReluAndRequantize */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DAndReluAndRequantize create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DAndReluAndRequantize create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DAndReluAndRequantize", scope.makeOpName("QuantizedConv2DAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -95,7 +95,7 @@ public static QuantizedConv2DAndReluAndRequantize create(Sc opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -104,67 +104,143 @@ public static QuantizedConv2DAndReluAndRequantize create(Sc for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DAndReluAndRequantize(opBuilder.build()); + return new QuantizedConv2DAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRequantize.java index 5ed39bd2375..ebb408f7434 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRequantize.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,63 +27,62 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DAndRequantize operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DAndRequantize extends RawOp { - +public final class QuantizedConv2DAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DAndRequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DAndRequantize} output and operands * @return a new instance of QuantizedConv2DAndRequantize */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DAndRequantize create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DAndRequantize create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DAndRequantize", scope.makeOpName("QuantizedConv2DAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -95,7 +95,7 @@ public static QuantizedConv2DAndRequantize create(Scope sco opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -104,67 +104,143 @@ public static QuantizedConv2DAndRequantize create(Scope sco for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DAndRequantize(opBuilder.build()); + return new QuantizedConv2DAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DPerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DPerChannel.java index d8f5b063d73..5fb9a7ccae3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DPerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DPerChannel.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,39 +27,37 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes QuantizedConv2D per channel. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DPerChannel extends RawOp { - +public final class QuantizedConv2DPerChannel extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DPerChannel} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations list of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List dilations; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DPerChannel"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DPerChannel(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DPerChannel operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -68,12 +67,19 @@ private Options() { * @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 - * @param options carries optional attributes values + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DPerChannel} output and operands * @return a new instance of QuantizedConv2DPerChannel */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DPerChannel create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DPerChannel create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DPerChannel", scope.makeOpName("QuantizedConv2DPerChannel")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -84,7 +90,7 @@ public static QuantizedConv2DPerChannel create(Scope scope, opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -93,56 +99,92 @@ public static QuantizedConv2DPerChannel create(Scope scope, for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new QuantizedConv2DPerChannel(opBuilder.build()); + return new QuantizedConv2DPerChannel<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations list of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations list of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The minimum value of the final output tensor. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The maximum value of the final output tensor. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DPerChannel"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DPerChannel(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DPerChannel} + */ + public static class Options { + private List dilations; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations list of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations list of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBias.java index 4effcf06f22..4988f86b878 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBias.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,62 +27,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBias operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DWithBias extends RawOp { - +public final class QuantizedConv2DWithBias extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBias} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBias"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DWithBias(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBias operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBias} output and operands * @return a new instance of QuantizedConv2DWithBias */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBias create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBias create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBias", scope.makeOpName("QuantizedConv2DWithBias")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -93,7 +92,7 @@ public static QuantizedConv2DWithBias create(Scope scope, O opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -102,67 +101,143 @@ public static QuantizedConv2DWithBias create(Scope scope, O for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBias(opBuilder.build()); + return new QuantizedConv2DWithBias<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBias"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBias(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBias} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRelu.java index 39764e1f273..4dcee0cfa02 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRelu.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,62 +27,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasAndRelu operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DWithBiasAndRelu extends RawOp { - +public final class QuantizedConv2DWithBiasAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasAndRelu"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DWithBiasAndRelu(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasAndRelu operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasAndRelu} output and operands * @return a new instance of QuantizedConv2DWithBiasAndRelu */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasAndRelu create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasAndRelu create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasAndRelu", scope.makeOpName("QuantizedConv2DWithBiasAndRelu")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -93,7 +92,7 @@ public static QuantizedConv2DWithBiasAndRelu create(Scope s opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -102,67 +101,143 @@ public static QuantizedConv2DWithBiasAndRelu create(Scope s for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasAndRelu(opBuilder.build()); + return new QuantizedConv2DWithBiasAndRelu<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasAndRelu"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRelu} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndReluAndRequantize.java index de31b007153..de6b10dfc0a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndReluAndRequantize.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,64 +27,63 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasAndReluAndRequantize operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DWithBiasAndReluAndRequantize extends RawOp { - +public final class QuantizedConv2DWithBiasAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DWithBiasAndReluAndRequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasAndReluAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasAndReluAndRequantize} output and operands * @return a new instance of QuantizedConv2DWithBiasAndReluAndRequantize */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasAndReluAndRequantize create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasAndReluAndRequantize create( + Scope scope, Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasAndReluAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -97,7 +97,7 @@ public static QuantizedConv2DWithBiasAndReluAndRequantize c opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -106,67 +106,143 @@ public static QuantizedConv2DWithBiasAndReluAndRequantize c for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasAndReluAndRequantize(opBuilder.build()); + return new QuantizedConv2DWithBiasAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRequantize.java index 59d1f4cbfaf..8ff06313fca 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasAndRequantize.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,64 +27,63 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasAndRequantize operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DWithBiasAndRequantize extends RawOp { - +public final class QuantizedConv2DWithBiasAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DWithBiasAndRequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasAndRequantize} output and operands * @return a new instance of QuantizedConv2DWithBiasAndRequantize */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasAndRequantize create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasAndRequantize create(Scope scope, + Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -97,7 +97,7 @@ public static QuantizedConv2DWithBiasAndRequantize create(S opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -106,67 +106,143 @@ public static QuantizedConv2DWithBiasAndRequantize create(S for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasAndRequantize(opBuilder.build()); + return new QuantizedConv2DWithBiasAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java index e9a27a0679f..06cde9bad75 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,67 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasSignedSumAndReluAndRequantize operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DWithBiasSignedSumAndReluAndRequantize extends RawOp { - +public final class QuantizedConv2DWithBiasSignedSumAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasSignedSumAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasSignedSumAndReluAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param summand - * @param minSummand - * @param maxSummand - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasSignedSumAndReluAndRequantize} output and operands * @return a new instance of QuantizedConv2DWithBiasSignedSumAndReluAndRequantize */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasSignedSumAndReluAndRequantize create(Scope scope, 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, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasSignedSumAndReluAndRequantize create( + Scope scope, 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, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasSignedSumAndReluAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasSignedSumAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -103,7 +104,7 @@ public static QuantizedConv2DWithBiasSignedSumAndReluAndRequan opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -112,67 +113,143 @@ public static QuantizedConv2DWithBiasSignedSumAndReluAndRequan for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(opBuilder.build()); + return new QuantizedConv2DWithBiasSignedSumAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasSignedSumAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndRelu.java index 7bcd90b13fd..7cd443db36d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndRelu.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,63 +27,61 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasSumAndRelu operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DWithBiasSumAndRelu extends RawOp { - +public final class QuantizedConv2DWithBiasSumAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasSumAndRelu"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DWithBiasSumAndRelu(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasSumAndRelu operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param summand - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasSumAndRelu} output and operands * @return a new instance of QuantizedConv2DWithBiasSumAndRelu */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasSumAndRelu create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand summand, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasSumAndRelu create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Operand summand, Class outType, List strides, + String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasSumAndRelu", scope.makeOpName("QuantizedConv2DWithBiasSumAndRelu")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -95,7 +94,7 @@ public static QuantizedConv2DWithBiasSumAndRelu create(Scop opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -104,67 +103,143 @@ public static QuantizedConv2DWithBiasSumAndRelu create(Scop for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedConv2DWithBiasSumAndRelu(opBuilder.build()); + return new QuantizedConv2DWithBiasSumAndRelu<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasSumAndRelu"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasSumAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndRelu} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndReluAndRequantize.java index 5a6d223be7c..1081e876325 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DWithBiasSumAndReluAndRequantize.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,67 +27,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The QuantizedConv2DWithBiasSumAndReluAndRequantize operation + * + * @param data type for {@code output} output */ -public final class QuantizedConv2DWithBiasSumAndReluAndRequantize extends RawOp { - +public final class QuantizedConv2DWithBiasSumAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2DWithBiasSumAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2DWithBiasSumAndReluAndRequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedConv2DWithBiasSumAndReluAndRequantize operation. - * + * * @param scope current scope - * @param input - * @param filter - * @param bias - * @param minInput - * @param maxInput - * @param minFilter - * @param maxFilter - * @param minFreezedOutput - * @param maxFreezedOutput - * @param summand - * @param minSummand - * @param maxSummand - * @param outType - * @param strides - * @param padding - * @param options carries optional attributes values + * @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 property + * @param strides the value of the strides property + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedConv2DWithBiasSumAndReluAndRequantize} output and operands * @return a new instance of QuantizedConv2DWithBiasSumAndReluAndRequantize */ - @Endpoint(describeByClass = true) - public static QuantizedConv2DWithBiasSumAndReluAndRequantize create(Scope scope, 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, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2DWithBiasSumAndReluAndRequantize create( + Scope scope, 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, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasSumAndReluAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasSumAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -103,7 +104,7 @@ public static QuantizedConv2DWithBiasSumAndReluAndRequantize QuantizedConv2DWithBiasSumAndReluAndRequantize(opBuilder.build()); + return new QuantizedConv2DWithBiasSumAndReluAndRequantize<>(opBuilder.build()); } - + /** - * @param dilations + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + /** - * @param paddingList + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. + * + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. + * + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2DWithBiasSumAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2DWithBiasSumAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2DWithBiasSumAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations the dilations option + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2d.java index 58a1a2a36e6..634dcbf13eb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2d.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -28,63 +29,66 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * 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 data type for {@code output} output */ -@Operator(group = "nn") -public final class QuantizedConv2d extends RawOp { - +@Operator( + group = "nn" +) +public final class QuantizedConv2d extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2d} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each - * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and - * depth dimensions must be 1. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List dilations; - - private Options() { - } + public static final String OP_NAME = "QuantizedConv2D"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedConv2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new QuantizedConv2d operation. - * + * Factory method to create a class wrapping a new QuantizedConv2D operation. + * * @param scope current scope - * @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 property * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedConv2d create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConv2d create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2D", scope.makeOpName("QuantizedConv2d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -95,7 +99,7 @@ public static QuantizedConv2d create(Scope scope, Operand QuantizedConv2d create(Scope scope, Operand(opBuilder.build()); + return new QuantizedConv2d<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of - * `input`. If set to k > 1, there will be k-1 skipped cells between each + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each * filter element on that dimension. The dimension order is determined by the - * value of `data_format`, see above for details. Dilations in the batch and + * value of {@code data_format}, see above for details. Dilations in the batch and * depth dimensions must be 1. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the lowest quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the highest quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConv2D"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedConv2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2d} + */ + public static class Options { + private List dilations; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations 1-D tensor of length 4. The dilation factor for each dimension of + * {@code input}. If set to k > 1, there will be k-1 skipped cells between each + * filter element on that dimension. The dimension order is determined by the + * value of {@code data_format}, see above for details. Dilations in the batch and + * depth dimensions must be 1. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2D.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2D.java index 17695f4fb77..36acaca3067 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2D.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2D.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,39 +27,37 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -public final class QuantizedDepthwiseConv2D extends RawOp { - +public final class QuantizedDepthwiseConv2D extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2D} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations List of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List dilations; - - private Options() { - } + public static final String OP_NAME = "QuantizedDepthwiseConv2D"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedDepthwiseConv2D(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedDepthwiseConv2D operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -68,12 +67,19 @@ private Options() { * @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 - * @param options carries optional attributes values + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedDepthwiseConv2D} output and operands * @return a new instance of QuantizedDepthwiseConv2D */ - @Endpoint(describeByClass = true) - public static QuantizedDepthwiseConv2D create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedDepthwiseConv2D create(Scope scope, + Operand input, Operand filter, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2D", scope.makeOpName("QuantizedDepthwiseConv2D")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -84,7 +90,7 @@ public static QuantizedDepthwiseConv2D create(Scope scope, opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -93,56 +99,92 @@ public static QuantizedDepthwiseConv2D create(Scope scope, for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new QuantizedDepthwiseConv2D(opBuilder.build()); + return new QuantizedDepthwiseConv2D<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations List of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the minimum quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the maximum quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedDepthwiseConv2D"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedDepthwiseConv2D(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2D} + */ + public static class Options { + private List dilations; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBias.java index 7f37dff79d1..40298bf6d2a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBias.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,39 +27,37 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D with Bias. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -public final class QuantizedDepthwiseConv2DWithBias extends RawOp { - +public final class QuantizedDepthwiseConv2DWithBias extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBias} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations List of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - private List dilations; - - private Options() { - } + public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBias"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedDepthwiseConv2DWithBias(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedDepthwiseConv2DWithBias operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -69,12 +68,19 @@ private Options() { * @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 - * @param options carries optional attributes values + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedDepthwiseConv2DWithBias} output and operands * @return a new instance of QuantizedDepthwiseConv2DWithBias */ - @Endpoint(describeByClass = true) - public static QuantizedDepthwiseConv2DWithBias create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedDepthwiseConv2DWithBias create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2DWithBias", scope.makeOpName("QuantizedDepthwiseConv2DWithBias")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -86,7 +92,7 @@ public static QuantizedDepthwiseConv2DWithBias create(Scope opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -95,56 +101,92 @@ public static QuantizedDepthwiseConv2DWithBias create(Scope for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } } } - return new QuantizedDepthwiseConv2DWithBias(opBuilder.build()); + return new QuantizedDepthwiseConv2DWithBias<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations List of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the minimum quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the maximum quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBias"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedDepthwiseConv2DWithBias(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBias} + */ + public static class Options { + private List dilations; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndRelu.java index 46c8ded50f0..d9105ad94a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndRelu.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,48 +27,37 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D with Bias and Relu. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -public final class QuantizedDepthwiseConv2DWithBiasAndRelu extends RawOp { - +public final class QuantizedDepthwiseConv2DWithBiasAndRelu extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndRelu} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations List of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBiasAndRelu"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedDepthwiseConv2DWithBiasAndRelu(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedDepthwiseConv2DWithBiasAndRelu operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -78,12 +68,19 @@ private Options() { * @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 - * @param options carries optional attributes values + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedDepthwiseConv2DWithBiasAndRelu} output and operands * @return a new instance of QuantizedDepthwiseConv2DWithBiasAndRelu */ - @Endpoint(describeByClass = true) - public static QuantizedDepthwiseConv2DWithBiasAndRelu create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedDepthwiseConv2DWithBiasAndRelu create(Scope scope, + Operand input, Operand filter, Operand bias, + Operand minInput, Operand maxInput, Operand minFilter, + Operand maxFilter, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2DWithBiasAndRelu", scope.makeOpName("QuantizedDepthwiseConv2DWithBiasAndRelu")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -95,7 +92,7 @@ public static QuantizedDepthwiseConv2DWithBiasAndRelu creat opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -104,70 +101,143 @@ public static QuantizedDepthwiseConv2DWithBiasAndRelu creat for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedDepthwiseConv2DWithBiasAndRelu(opBuilder.build()); + return new QuantizedDepthwiseConv2DWithBiasAndRelu<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations List of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** - * @param paddingList + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the minimum quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the maximum quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBiasAndRelu"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedDepthwiseConv2DWithBiasAndRelu(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndRelu} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java index ee9b29129bc..dc801c317f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java @@ -17,6 +17,7 @@ package org.tensorflow.op.nn; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,48 +27,37 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes quantized depthwise Conv2D with Bias, Relu and Requantize. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -public final class QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize extends RawOp { - +public final class QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dilations List of dilation values. - */ - public Options dilations(List dilations) { - this.dilations = dilations; - return this; - } - - /** - * @param paddingList - */ - public Options paddingList(List paddingList) { - this.paddingList = paddingList; - return this; - } - - private List dilations; - private List paddingList; - - private Options() { - } + public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize operation. - * + * * @param scope current scope * @param input The original input tensor. * @param filter The original filter tensor. @@ -80,12 +70,20 @@ private Options() { * @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 - * @param options carries optional attributes values + * @param padding the value of the padding property + * @param options carries optional attribute values + * @param data type for {@code QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize} output and operands * @return a new instance of QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize */ - @Endpoint(describeByClass = true) - public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, Class outType, List strides, String padding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize create( + Scope scope, Operand input, Operand filter, + Operand bias, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, Operand minFreezedOutput, + Operand maxFreezedOutput, Class outType, List strides, String padding, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize", scope.makeOpName("QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -99,7 +97,7 @@ public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequan opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); @@ -108,70 +106,143 @@ public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequan for (Options opts : options) { if (opts.dilations != null) { long[] dilationsArray = new long[opts.dilations.size()]; - for (int i = 0; i < dilationsArray.length; ++i) { + for (int i = 0 ; i < dilationsArray.length ; i++) { dilationsArray[i] = opts.dilations.get(i); } opBuilder.setAttr("dilations", dilationsArray); } if (opts.paddingList != null) { long[] paddingListArray = new long[opts.paddingList.size()]; - for (int i = 0; i < paddingListArray.length; ++i) { + for (int i = 0 ; i < paddingListArray.length ; i++) { paddingListArray[i] = opts.paddingList.get(i); } opBuilder.setAttr("padding_list", paddingListArray); } } } - return new QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(opBuilder.build()); + return new QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize<>(opBuilder.build()); } - + /** + * Sets the dilations option. + * * @param dilations List of dilation values. + * @return this Options instance. */ public static Options dilations(List dilations) { return new Options().dilations(dilations); } - + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public static Options dilations(Long[] dilations) { + return new Options().dilations(dilations); + } + /** - * @param paddingList + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. */ public static Options paddingList(List paddingList) { return new Options().paddingList(paddingList); } - + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public static Options paddingList(Long[] paddingList) { + return new Options().paddingList(paddingList); + } + /** + * Gets output. * The output tensor. + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the minimum quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the maximum quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize} + */ + public static class Options { + private List dilations; + + private List paddingList; + + private Options() { + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(List dilations) { + this.dilations = dilations; + return this; + } + + /** + * Sets the dilations option. + * + * @param dilations List of dilation values. + * @return this Options instance. + */ + public Options dilations(Long... dilations) { + this.dilations = Arrays.asList(dilations); + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(List paddingList) { + this.paddingList = paddingList; + return this; + } + + /** + * Sets the paddingList option. + * + * @param paddingList the paddingList option + * @return this Options instance. + */ + public Options paddingList(Long... paddingList) { + this.paddingList = Arrays.asList(paddingList); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedInstanceNorm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedInstanceNorm.java index f96d7cb9313..28336b47159 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedInstanceNorm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedInstanceNorm.java @@ -26,85 +26,52 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Quantized Instance normalization. - * - * @param data type for {@code y()} output + * + * @param data type for {@code y} output */ -@Operator(group = "nn") -public final class QuantizedInstanceNorm extends RawOp { - +@Operator( + group = "nn" +) +public final class QuantizedInstanceNorm extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.nn.QuantizedInstanceNorm} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param outputRangeGiven If True, `given_y_min` and `given_y_min` - * and `given_y_max` are used as the output range. Otherwise, - * the implementation computes the output range. - */ - public Options outputRangeGiven(Boolean outputRangeGiven) { - this.outputRangeGiven = outputRangeGiven; - return this; - } - - /** - * @param givenYMin Output in `y_min` if `output_range_given` is True. - */ - public Options givenYMin(Float givenYMin) { - this.givenYMin = givenYMin; - return this; - } - - /** - * @param givenYMax Output in `y_max` if `output_range_given` is True. - */ - public Options givenYMax(Float givenYMax) { - this.givenYMax = givenYMax; - return this; - } - - /** - * @param varianceEpsilon A small float number to avoid dividing by 0. - */ - public Options varianceEpsilon(Float varianceEpsilon) { - this.varianceEpsilon = varianceEpsilon; - return this; - } - - /** - * @param minSeparation Minimum value of `y_max - y_min` - */ - public Options minSeparation(Float minSeparation) { - this.minSeparation = minSeparation; - return this; - } - - private Boolean outputRangeGiven; - private Float givenYMin; - private Float givenYMax; - private Float varianceEpsilon; - private Float minSeparation; - - private Options() { - } + public static final String OP_NAME = "QuantizedInstanceNorm"; + + private Output y; + + private Output yMin; + + private Output yMax; + + private QuantizedInstanceNorm(Operation operation) { + super(operation); + int outputIdx = 0; + y = operation.output(outputIdx++); + yMin = operation.output(outputIdx++); + yMax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedInstanceNorm operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedInstanceNorm create(Scope scope, Operand x, Operand xMin, Operand xMax, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedInstanceNorm create(Scope scope, Operand x, + Operand xMin, Operand xMax, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedInstanceNorm", scope.makeOpName("QuantizedInstanceNorm")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(xMin.asOutput()); @@ -129,79 +96,160 @@ public static QuantizedInstanceNorm create(Scope scope, Ope } } } - return new QuantizedInstanceNorm(opBuilder.build()); + return new QuantizedInstanceNorm<>(opBuilder.build()); } - + /** - * @param outputRangeGiven If True, `given_y_min` and `given_y_min` - * and `given_y_max` are used as the output range. Otherwise, + * Sets the outputRangeGiven option. + * + * @param outputRangeGiven If True, {@code given_y_min} and {@code given_y_min} + * and {@code given_y_max} are used as the output range. Otherwise, * the implementation computes the output range. + * @return this Options instance. */ public static Options outputRangeGiven(Boolean outputRangeGiven) { return new Options().outputRangeGiven(outputRangeGiven); } - + /** - * @param givenYMin Output in `y_min` if `output_range_given` is True. + * Sets the givenYMin option. + * + * @param givenYMin Output in {@code y_min} if {@code output_range_given} is True. + * @return this Options instance. */ public static Options givenYMin(Float givenYMin) { return new Options().givenYMin(givenYMin); } - + /** - * @param givenYMax Output in `y_max` if `output_range_given` is True. + * Sets the givenYMax option. + * + * @param givenYMax Output in {@code y_max} if {@code output_range_given} is True. + * @return this Options instance. */ public static Options givenYMax(Float givenYMax) { return new Options().givenYMax(givenYMax); } - + /** + * Sets the varianceEpsilon option. + * * @param varianceEpsilon A small float number to avoid dividing by 0. + * @return this Options instance. */ public static Options varianceEpsilon(Float varianceEpsilon) { return new Options().varianceEpsilon(varianceEpsilon); } - + /** - * @param minSeparation Minimum value of `y_max - y_min` + * Sets the minSeparation option. + * + * @param minSeparation Minimum value of {@code y_max - y_min} + * @return this Options instance. */ public static Options minSeparation(Float minSeparation) { return new Options().minSeparation(minSeparation); } - + /** + * Gets y. * A 4D Tensor. + * @return y. */ public Output y() { return y; } - + /** + * Gets yMin. * The value represented by the lowest quantized output. + * @return yMin. */ public Output yMin() { return yMin; } - + /** + * Gets yMax. * The value represented by the highest quantized output. + * @return yMax. */ public Output yMax() { return yMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedInstanceNorm"; - - private Output y; - private Output yMin; - private Output yMax; - - private QuantizedInstanceNorm(Operation operation) { - super(operation); - int outputIdx = 0; - y = operation.output(outputIdx++); - yMin = operation.output(outputIdx++); - yMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.QuantizedInstanceNorm} + */ + public static class Options { + private Boolean outputRangeGiven; + + private Float givenYMin; + + private Float givenYMax; + + private Float varianceEpsilon; + + private Float minSeparation; + + private Options() { + } + + /** + * Sets the outputRangeGiven option. + * + * @param outputRangeGiven If True, {@code given_y_min} and {@code given_y_min} + * and {@code given_y_max} are used as the output range. Otherwise, + * the implementation computes the output range. + * @return this Options instance. + */ + public Options outputRangeGiven(Boolean outputRangeGiven) { + this.outputRangeGiven = outputRangeGiven; + return this; + } + + /** + * Sets the givenYMin option. + * + * @param givenYMin Output in {@code y_min} if {@code output_range_given} is True. + * @return this Options instance. + */ + public Options givenYMin(Float givenYMin) { + this.givenYMin = givenYMin; + return this; + } + + /** + * Sets the givenYMax option. + * + * @param givenYMax Output in {@code y_max} if {@code output_range_given} is True. + * @return this Options instance. + */ + public Options givenYMax(Float givenYMax) { + this.givenYMax = givenYMax; + return this; + } + + /** + * Sets the varianceEpsilon option. + * + * @param varianceEpsilon A small float number to avoid dividing by 0. + * @return this Options instance. + */ + public Options varianceEpsilon(Float varianceEpsilon) { + this.varianceEpsilon = varianceEpsilon; + return this; + } + + /** + * Sets the minSeparation option. + * + * @param minSeparation Minimum value of {@code y_max - y_min} + * @return this Options instance. + */ + public Options minSeparation(Float minSeparation) { + this.minSeparation = minSeparation; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedMaxPool.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedMaxPool.java index be2c093614a..fef1e38a3d8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedMaxPool.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedMaxPool.java @@ -27,19 +27,39 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Produces the max pool of the input tensor for quantized types. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "nn") -public final class QuantizedMaxPool extends RawOp { - +@Operator( + group = "nn" +) +public final class QuantizedMaxPool extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedMaxPool"; + + private Output output; + + private Output minOutput; + + private Output maxOutput; + + private QuantizedMaxPool(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + minOutput = operation.output(outputIdx++); + maxOutput = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedMaxPool operation. - * + * * @param scope current scope * @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. @@ -49,61 +69,58 @@ public final class QuantizedMaxPool extends RawOp { * @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 */ - @Endpoint(describeByClass = true) - public static QuantizedMaxPool create(Scope scope, Operand input, Operand minInput, Operand maxInput, List ksize, List strides, String padding) { + @Endpoint( + describeByClass = true + ) + public static QuantizedMaxPool create(Scope scope, Operand input, + Operand minInput, Operand maxInput, List ksize, List strides, + String padding) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMaxPool", scope.makeOpName("QuantizedMaxPool")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minInput.asOutput()); opBuilder.addInput(maxInput.asOutput()); opBuilder = scope.apply(opBuilder); long[] ksizeArray = new long[ksize.size()]; - for (int i = 0; i < ksizeArray.length; ++i) { + for (int i = 0 ; i < ksizeArray.length ; i++) { ksizeArray[i] = ksize.get(i); } opBuilder.setAttr("ksize", ksizeArray); long[] stridesArray = new long[strides.size()]; - for (int i = 0; i < stridesArray.length; ++i) { + for (int i = 0 ; i < stridesArray.length ; i++) { stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); opBuilder.setAttr("padding", padding); - return new QuantizedMaxPool(opBuilder.build()); + return new QuantizedMaxPool<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets minOutput. * The float value that the lowest quantized output value represents. + * @return minOutput. */ public Output minOutput() { return minOutput; } - + /** + * Gets maxOutput. * The float value that the highest quantized output value represents. + * @return maxOutput. */ public Output maxOutput() { return maxOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMaxPool"; - - private Output output; - private Output minOutput; - private Output maxOutput; - - private QuantizedMaxPool(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - minOutput = operation.output(outputIdx++); - maxOutput = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu.java index 578b994a3d4..82b87d4f38c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu.java @@ -27,70 +27,86 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * Computes Quantized Rectified Linear: `max(features, 0)` - * - * @param data type for {@code activations()} output + * Computes Quantized Rectified Linear: {@code max(features, 0)} + * + * @param data type for {@code activations} output */ -@Operator(group = "nn") -public final class QuantizedRelu extends RawOp { - +@Operator( + group = "nn" +) +public final class QuantizedRelu extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedRelu"; + + private Output activations; + + private Output minActivations; + + private Output maxActivations; + + private QuantizedRelu(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); + minActivations = operation.output(outputIdx++); + maxActivations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedRelu operation. - * + * * @param scope current scope - * @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 property + * @param data type for {@code QuantizedRelu} output and operands * @return a new instance of QuantizedRelu */ - @Endpoint(describeByClass = true) - public static QuantizedRelu create(Scope scope, Operand features, Operand minFeatures, Operand maxFeatures, Class outType) { + @Endpoint( + describeByClass = true + ) + public static QuantizedRelu create(Scope scope, + Operand features, Operand minFeatures, + Operand maxFeatures, Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedRelu", scope.makeOpName("QuantizedRelu")); opBuilder.addInput(features.asOutput()); opBuilder.addInput(minFeatures.asOutput()); opBuilder.addInput(maxFeatures.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new QuantizedRelu(opBuilder.build()); + return new QuantizedRelu<>(opBuilder.build()); } - + /** - * Has the same output shape as "features". + * Gets activations. + * Has the same output shape as "features". + * @return activations. */ public Output activations() { return activations; } - + /** + * Gets minActivations. * The float value that the lowest quantized value represents. + * @return minActivations. */ public Output minActivations() { return minActivations; } - + /** + * Gets maxActivations. * The float value that the highest quantized value represents. + * @return maxActivations. */ public Output maxActivations() { return maxActivations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedRelu"; - - private Output activations; - private Output minActivations; - private Output maxActivations; - - private QuantizedRelu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - minActivations = operation.output(outputIdx++); - maxActivations = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu6.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu6.java index 4ee22f51238..79034e99177 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu6.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedRelu6.java @@ -27,70 +27,86 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * Computes Quantized Rectified Linear 6: `min(max(features, 0), 6)` - * - * @param data type for {@code activations()} output + * Computes Quantized Rectified Linear 6: {@code min(max(features, 0), 6)} + * + * @param data type for {@code activations} output */ -@Operator(group = "nn") -public final class QuantizedRelu6 extends RawOp { - +@Operator( + group = "nn" +) +public final class QuantizedRelu6 extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedRelu6"; + + private Output activations; + + private Output minActivations; + + private Output maxActivations; + + private QuantizedRelu6(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); + minActivations = operation.output(outputIdx++); + maxActivations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedRelu6 operation. - * + * * @param scope current scope - * @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 property + * @param data type for {@code QuantizedRelu6} output and operands * @return a new instance of QuantizedRelu6 */ - @Endpoint(describeByClass = true) - public static QuantizedRelu6 create(Scope scope, Operand features, Operand minFeatures, Operand maxFeatures, Class outType) { + @Endpoint( + describeByClass = true + ) + public static QuantizedRelu6 create(Scope scope, + Operand features, Operand minFeatures, + Operand maxFeatures, Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedRelu6", scope.makeOpName("QuantizedRelu6")); opBuilder.addInput(features.asOutput()); opBuilder.addInput(minFeatures.asOutput()); opBuilder.addInput(maxFeatures.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new QuantizedRelu6(opBuilder.build()); + return new QuantizedRelu6<>(opBuilder.build()); } - + /** - * Has the same output shape as "features". + * Gets activations. + * Has the same output shape as "features". + * @return activations. */ public Output activations() { return activations; } - + /** + * Gets minActivations. * The float value that the lowest quantized value represents. + * @return minActivations. */ public Output minActivations() { return minActivations; } - + /** + * Gets maxActivations. * The float value that the highest quantized value represents. + * @return maxActivations. */ public Output maxActivations() { return maxActivations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedRelu6"; - - private Output activations; - private Output minActivations; - private Output maxActivations; - - private QuantizedRelu6(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - minActivations = operation.output(outputIdx++); - maxActivations = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedReluX.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedReluX.java index cf9bdc3134e..c529a8851bc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedReluX.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedReluX.java @@ -27,29 +27,54 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * Computes Quantized Rectified Linear X: `min(max(features, 0), max_value)` - * - * @param data type for {@code activations()} output + * Computes Quantized Rectified Linear X: {@code min(max(features, 0), max_value)} + * + * @param data type for {@code activations} output */ -@Operator(group = "nn") -public final class QuantizedReluX extends RawOp { - +@Operator( + group = "nn" +) +public final class QuantizedReluX extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedReluX"; + + private Output activations; + + private Output minActivations; + + private Output maxActivations; + + private QuantizedReluX(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); + minActivations = operation.output(outputIdx++); + maxActivations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedReluX operation. - * + * * @param scope current scope - * @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 property + * @param data type for {@code QuantizedReluX} output and operands * @return a new instance of QuantizedReluX */ - @Endpoint(describeByClass = true) - public static QuantizedReluX create(Scope scope, Operand features, Operand maxValue, Operand minFeatures, Operand maxFeatures, Class outType) { + @Endpoint( + describeByClass = true + ) + public static QuantizedReluX create(Scope scope, + Operand features, Operand maxValue, + Operand minFeatures, Operand maxFeatures, Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedReluX", scope.makeOpName("QuantizedReluX")); opBuilder.addInput(features.asOutput()); opBuilder.addInput(maxValue.asOutput()); @@ -57,42 +82,33 @@ public static QuantizedReluX create(Scope scope, Operand(opBuilder.build()); + return new QuantizedReluX<>(opBuilder.build()); } - + /** - * Has the same output shape as "features". + * Gets activations. + * Has the same output shape as "features". + * @return activations. */ public Output activations() { return activations; } - + /** + * Gets minActivations. * The float value that the lowest quantized value represents. + * @return minActivations. */ public Output minActivations() { return minActivations; } - + /** + * Gets maxActivations. * The float value that the highest quantized value represents. + * @return maxActivations. */ public Output maxActivations() { return maxActivations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedReluX"; - - private Output activations; - private Output minActivations; - private Output maxActivations; - - private QuantizedReluX(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - minActivations = operation.output(outputIdx++); - maxActivations = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu.java index eb0e8957e13..b85617c997f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu.java @@ -25,55 +25,69 @@ import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * 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() + *

+ *
+ *
+ *

tf.nn.relu([-2., 0., -0., 3.]).numpy() * array([ 0., 0., -0., 3.], dtype=float32) - * - * @param data type for {@code activations()} output + *

+ *
+ *
+ * + * @param data type for {@code activations} output */ -@Operator(group = "nn") -public final class Relu extends RawOp implements Operand { - +@Operator( + group = "nn" +) +public final class Relu extends RawOp implements Operand { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Relu"; + + private Output activations; + + private Relu(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Relu operation. - * + * * @param scope current scope - * @param features + * @param features the features value + * @param data type for {@code Relu} output and operands * @return a new instance of Relu */ - @Endpoint(describeByClass = true) - public static Relu create(Scope scope, Operand features) { + @Endpoint( + describeByClass = true + ) + public static Relu create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Relu", scope.makeOpName("Relu")); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new Relu(opBuilder.build()); + return new Relu<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Relu"; - - private Output activations; - - private Relu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6.java index efb80c73be6..7fd261997e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6.java @@ -28,47 +28,56 @@ import org.tensorflow.types.family.TNumber; /** - * Computes rectified linear 6: `min(max(features, 0), 6)`. - * - * @param data type for {@code activations()} output + * Computes rectified linear 6: {@code min(max(features, 0), 6)}. + * + * @param data type for {@code activations} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Relu6 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Relu6"; + + private Output activations; + + private Relu6(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Relu6 operation. - * + * * @param scope current scope - * @param features + * @param features the features value + * @param data type for {@code Relu6} output and operands * @return a new instance of Relu6 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Relu6 create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Relu6", scope.makeOpName("Relu6")); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new Relu6(opBuilder.build()); + return new Relu6<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Relu6"; - - private Output activations; - - private Relu6(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6Grad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6Grad.java index 38e042b1635..ef74b7153e2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6Grad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Relu6Grad.java @@ -24,55 +24,61 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Computes rectified linear 6 gradients for a Relu6 operation. - * - * @param data type for {@code backprops()} output + * + * @param data type for {@code backprops} output */ public final class Relu6Grad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Relu6Grad"; + + private Output backprops; + + private Relu6Grad(Operation operation) { + super(operation); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Relu6Grad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static Relu6Grad create(Scope scope, Operand gradients, Operand features) { + @Endpoint( + describeByClass = true + ) + public static Relu6Grad create(Scope scope, Operand gradients, + Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Relu6Grad", scope.makeOpName("Relu6Grad")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new Relu6Grad(opBuilder.build()); + return new Relu6Grad<>(opBuilder.build()); } - + /** + * Gets backprops. * The gradients: - * `gradients * (features > 0) * (features < 6)`. + * {@code gradients * (features > 0) * (features < 6)}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Relu6Grad"; - - private Output backprops; - - private Relu6Grad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ReluGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ReluGrad.java index 27999096f0e..9d332cb5f9a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ReluGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/ReluGrad.java @@ -24,54 +24,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Computes rectified linear gradients for a Relu operation. - * - * @param data type for {@code backprops()} output + * + * @param data type for {@code backprops} output */ public final class ReluGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ReluGrad"; + + private Output backprops; + + private ReluGrad(Operation operation) { + super(operation); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ReluGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static ReluGrad create(Scope scope, Operand gradients, Operand features) { + @Endpoint( + describeByClass = true + ) + public static ReluGrad create(Scope scope, Operand gradients, + Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("ReluGrad", scope.makeOpName("ReluGrad")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new ReluGrad(opBuilder.build()); + return new ReluGrad<>(opBuilder.build()); } - + /** - * `gradients * (features > 0)`. + * Gets backprops. + * {@code gradients * (features > 0)}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReluGrad"; - - private Output backprops; - - private ReluGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Selu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Selu.java index 0e7b45fcd6a..4958748b10c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Selu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Selu.java @@ -28,55 +28,61 @@ import org.tensorflow.types.family.TNumber; /** - * 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) - * - * @param data type for {@code activations()} output + * 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 */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Selu extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Selu"; + + private Output activations; + + private Selu(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Selu operation. - * + * * @param scope current scope - * @param features + * @param features the features value + * @param data type for {@code Selu} output and operands * @return a new instance of Selu */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Selu create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Selu", scope.makeOpName("Selu")); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new Selu(opBuilder.build()); + return new Selu<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Selu"; - - private Output activations; - - private Selu(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SeluGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SeluGrad.java index e80b0e7114b..5c54a3f109b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SeluGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SeluGrad.java @@ -24,54 +24,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Computes gradients for the scaled exponential linear (Selu) operation. - * - * @param data type for {@code backprops()} output + * + * @param data type for {@code backprops} output */ public final class SeluGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SeluGrad"; + + private Output backprops; + + private SeluGrad(Operation operation) { + super(operation); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SeluGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SeluGrad create(Scope scope, Operand gradients, Operand outputs) { + @Endpoint( + describeByClass = true + ) + public static SeluGrad create(Scope scope, Operand gradients, + Operand outputs) { OperationBuilder opBuilder = scope.env().opBuilder("SeluGrad", scope.makeOpName("SeluGrad")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(outputs.asOutput()); opBuilder = scope.apply(opBuilder); - return new SeluGrad(opBuilder.build()); + return new SeluGrad<>(opBuilder.build()); } - + /** - * The gradients: `gradients * (outputs + scale * alpha)` - * if outputs < 0, `scale * gradients` otherwise. + * Gets backprops. + * The gradients: {@code gradients * (outputs + scale * alpha)} + * if outputs < 0, {@code scale * gradients} otherwise. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SeluGrad"; - - private Output backprops; - - private SeluGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softmax.java index d7180ef953f..fa3f0b32214 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softmax.java @@ -29,51 +29,59 @@ /** * 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]))$$ - * - * @param data type for {@code softmax()} output + * 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 */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Softmax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Softmax"; + + private Output softmax; + + private Softmax(Operation operation) { + super(operation); + int outputIdx = 0; + softmax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Softmax operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Softmax create(Scope scope, Operand logits) { OperationBuilder opBuilder = scope.env().opBuilder("Softmax", scope.makeOpName("Softmax")); opBuilder.addInput(logits.asOutput()); opBuilder = scope.apply(opBuilder); - return new Softmax(opBuilder.build()); + return new Softmax<>(opBuilder.build()); } - + /** - * Same shape as `logits`. + * Gets softmax. + * Same shape as {@code logits}. + * @return softmax. */ public Output softmax() { return softmax; } - + @Override public Output asOutput() { return softmax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Softmax"; - - private Output softmax; - - private Softmax(Operation operation) { - super(operation); - int outputIdx = 0; - softmax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softsign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softsign.java index efd21d04476..5eeb25a3be3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softsign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/Softsign.java @@ -28,47 +28,56 @@ import org.tensorflow.types.family.TNumber; /** - * Computes softsign: `features / (abs(features) + 1)`. - * - * @param data type for {@code activations()} output + * Computes softsign: {@code features / (abs(features) + 1)}. + * + * @param data type for {@code activations} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class Softsign extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Softsign"; + + private Output activations; + + private Softsign(Operation operation) { + super(operation); + int outputIdx = 0; + activations = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Softsign operation. - * + * * @param scope current scope - * @param features + * @param features the features value + * @param data type for {@code Softsign} output and operands * @return a new instance of Softsign */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Softsign create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Softsign", scope.makeOpName("Softsign")); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new Softsign(opBuilder.build()); + return new Softsign<>(opBuilder.build()); } - + /** + * Gets activations. + * + * @return activations. */ public Output activations() { return activations; } - + @Override public Output asOutput() { return activations; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Softsign"; - - private Output activations; - - private Softsign(Operation operation) { - super(operation); - int outputIdx = 0; - activations = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftsignGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftsignGrad.java index a8d5669551d..c60c25a60cd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftsignGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftsignGrad.java @@ -24,53 +24,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Computes softsign gradients for a softsign operation. - * - * @param data type for {@code backprops()} output + * + * @param data type for {@code backprops} output */ public final class SoftsignGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SoftsignGrad"; + + private Output backprops; + + private SoftsignGrad(Operation operation) { + super(operation); + int outputIdx = 0; + backprops = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SoftsignGrad operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SoftsignGrad create(Scope scope, Operand gradients, Operand features) { + @Endpoint( + describeByClass = true + ) + public static SoftsignGrad create(Scope scope, Operand gradients, + Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("SoftsignGrad", scope.makeOpName("SoftsignGrad")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(features.asOutput()); opBuilder = scope.apply(opBuilder); - return new SoftsignGrad(opBuilder.build()); + return new SoftsignGrad<>(opBuilder.build()); } - + /** - * The gradients: `gradients / (1 + abs(features)) ** 2`. + * Gets backprops. + * The gradients: {@code gradients / (1 + abs(features)) ** 2}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SoftsignGrad"; - - private Output backprops; - - private SoftsignGrad(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToBatch.java index 90afda30fe4..b3cd1fb0c60 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToBatch.java @@ -30,126 +30,133 @@ /** * 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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class SpaceToBatch extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SpaceToBatch"; + + private Output output; + + private SpaceToBatch(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SpaceToBatch operation. - * + * * @param scope current scope - * @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
+   * @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
+   * 
+ *

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 blockSize the value of the blockSize property + * @param data type for {@code SpaceToBatch} output and operands * @return a new instance of SpaceToBatch */ - @Endpoint(describeByClass = true) - public static SpaceToBatch create(Scope scope, Operand input, Operand paddings, Long blockSize) { + @Endpoint( + describeByClass = true + ) + public static SpaceToBatch create(Scope scope, Operand input, + Operand paddings, Long blockSize) { OperationBuilder opBuilder = scope.env().opBuilder("SpaceToBatch", scope.makeOpName("SpaceToBatch")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddings.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("block_size", blockSize); - return new SpaceToBatch(opBuilder.build()); + return new SpaceToBatch<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SpaceToBatch"; - - private Output output; - - private SpaceToBatch(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToDepth.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToDepth.java index 6894eb287af..c592597f077 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToDepth.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SpaceToDepth.java @@ -29,116 +29,109 @@ /** * 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 data type for {@code output} output */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class SpaceToDepth extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.nn.SpaceToDepth} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param dataFormat - */ - public Options dataFormat(String dataFormat) { - this.dataFormat = dataFormat; - return this; - } - - private String dataFormat; - - private Options() { - } + public static final String OP_NAME = "SpaceToDepth"; + + private Output output; + + private SpaceToDepth(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SpaceToDepth operation. - * + * * @param scope current scope - * @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 */ - @Endpoint(describeByClass = true) - public static SpaceToDepth create(Scope scope, Operand input, Long blockSize, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SpaceToDepth create(Scope scope, Operand input, + Long blockSize, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SpaceToDepth", scope.makeOpName("SpaceToDepth")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -150,35 +143,51 @@ public static SpaceToDepth create(Scope scope, Operand i } } } - return new SpaceToDepth(opBuilder.build()); + return new SpaceToDepth<>(opBuilder.build()); } - + /** - * @param dataFormat + * Sets the dataFormat option. + * + * @param dataFormat the dataFormat option + * @return this Options instance. */ public static Options dataFormat(String dataFormat) { return new Options().dataFormat(dataFormat); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SpaceToDepth"; - - private Output output; - - private SpaceToDepth(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.SpaceToDepth} + */ + public static class Options { + private String dataFormat; + + private Options() { + } + + /** + * Sets the dataFormat option. + * + * @param dataFormat the dataFormat option + * @return this Options instance. + */ + public Options dataFormat(String dataFormat) { + this.dataFormat = dataFormat; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/TopK.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/TopK.java index d86357aa90d..99d156bba87 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/TopK.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/TopK.java @@ -29,56 +29,55 @@ import org.tensorflow.types.family.TNumber; /** - * 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. - * - * @param data type for {@code values()} output + *

+ * 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 */ -@Operator(group = "nn") +@Operator( + group = "nn" +) public final class TopK extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.nn.TopK} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param sorted If true the resulting `k` elements will be sorted by the values in - * descending order. - */ - public Options sorted(Boolean sorted) { - this.sorted = sorted; - return this; - } - - private Boolean sorted; - - private Options() { - } + public static final String OP_NAME = "TopKV2"; + + private Output values; + + private Output indices; + + private TopK(Operation operation) { + super(operation); + int outputIdx = 0; + values = operation.output(outputIdx++); + indices = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new TopK operation. - * + * Factory method to create a class wrapping a new TopKV2 operation. + * * @param scope current scope - * @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 + * @param options carries optional attribute values + * @param data type for {@code TopKV2} output and operands * @return a new instance of TopK */ - @Endpoint(describeByClass = true) - public static TopK create(Scope scope, Operand input, Operand k, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TopK create(Scope scope, Operand input, Operand k, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TopKV2", scope.makeOpName("TopK")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(k.asOutput()); @@ -90,41 +89,57 @@ public static TopK create(Scope scope, Operand input, } } } - return new TopK(opBuilder.build()); + return new TopK<>(opBuilder.build()); } - + /** - * @param sorted If true the resulting `k` elements will be sorted by the values in + * Sets the sorted option. + * + * @param sorted If true the resulting {@code k} elements will be sorted by the values in * descending order. + * @return this Options instance. */ public static Options sorted(Boolean sorted) { return new Options().sorted(sorted); } - + /** - * The `k` largest elements along each last dimensional slice. + * Gets values. + * The {@code k} largest elements along each last dimensional slice. + * @return values. */ public Output values() { return values; } - + /** - * The indices of `values` within the last dimension of `input`. + * Gets indices. + * The indices of {@code values} within the last dimension of {@code input}. + * @return indices. */ public Output indices() { return indices; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TopKV2"; - - private Output values; - private Output indices; - - private TopK(Operation operation) { - super(operation); - int outputIdx = 0; - values = operation.output(outputIdx++); - indices = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.nn.TopK} + */ + public static class Options { + private Boolean sorted; + + private Options() { + } + + /** + * Sets the sorted option. + * + * @param sorted If true the resulting {@code k} elements will be sorted by the values in + * descending order. + * @return this Options instance. + */ + public Options sorted(Boolean sorted) { + this.sorted = sorted; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SoftmaxCrossEntropyWithLogits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SoftmaxCrossEntropyWithLogits.java index 8032a4c2512..331933979c7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SoftmaxCrossEntropyWithLogits.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SoftmaxCrossEntropyWithLogits.java @@ -29,57 +29,68 @@ /** * Computes softmax cross entropy cost and gradients to backpropagate. - *

* Inputs are the logits, not probabilities. - * - * @param data type for {@code loss()} output + * + * @param data type for {@code loss} output */ -@Operator(group = "nn.raw") +@Operator( + group = "nn.raw" +) public final class SoftmaxCrossEntropyWithLogits extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SoftmaxCrossEntropyWithLogits"; + + private Output loss; + + private Output backprop; + + private SoftmaxCrossEntropyWithLogits(Operation operation) { + super(operation); + int outputIdx = 0; + loss = operation.output(outputIdx++); + backprop = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SoftmaxCrossEntropyWithLogits operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SoftmaxCrossEntropyWithLogits create(Scope scope, Operand features, Operand labels) { + @Endpoint( + describeByClass = true + ) + public static SoftmaxCrossEntropyWithLogits create(Scope scope, + Operand features, Operand labels) { OperationBuilder opBuilder = scope.env().opBuilder("SoftmaxCrossEntropyWithLogits", scope.makeOpName("SoftmaxCrossEntropyWithLogits")); opBuilder.addInput(features.asOutput()); opBuilder.addInput(labels.asOutput()); opBuilder = scope.apply(opBuilder); - return new SoftmaxCrossEntropyWithLogits(opBuilder.build()); + return new SoftmaxCrossEntropyWithLogits<>(opBuilder.build()); } - + /** + * Gets loss. * Per example loss (batch_size vector). + * @return loss. */ public Output loss() { return loss; } - + /** + * Gets backprop. * backpropagated gradients (batch_size x num_classes matrix). + * @return backprop. */ public Output backprop() { return backprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SoftmaxCrossEntropyWithLogits"; - - private Output loss; - private Output backprop; - - private SoftmaxCrossEntropyWithLogits(Operation operation) { - super(operation); - int outputIdx = 0; - loss = operation.output(outputIdx++); - backprop = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SparseSoftmaxCrossEntropyWithLogits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SparseSoftmaxCrossEntropyWithLogits.java index 67650760b1c..8c48cd0db4d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SparseSoftmaxCrossEntropyWithLogits.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/raw/SparseSoftmaxCrossEntropyWithLogits.java @@ -29,61 +29,71 @@ /** * 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. - * - * @param data type for {@code loss()} output + *

Inputs are the logits, not probabilities. + * + * @param data type for {@code loss} output */ -@Operator(group = "nn.raw") +@Operator( + group = "nn.raw" +) public final class SparseSoftmaxCrossEntropyWithLogits extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSoftmaxCrossEntropyWithLogits"; + + private Output loss; + + private Output backprop; + + private SparseSoftmaxCrossEntropyWithLogits(Operation operation) { + super(operation); + int outputIdx = 0; + loss = operation.output(outputIdx++); + backprop = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSoftmaxCrossEntropyWithLogits operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static SparseSoftmaxCrossEntropyWithLogits create(Scope scope, Operand features, Operand labels) { + @Endpoint( + describeByClass = true + ) + public static SparseSoftmaxCrossEntropyWithLogits create(Scope scope, + Operand features, Operand labels) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSoftmaxCrossEntropyWithLogits", scope.makeOpName("SparseSoftmaxCrossEntropyWithLogits")); opBuilder.addInput(features.asOutput()); opBuilder.addInput(labels.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSoftmaxCrossEntropyWithLogits(opBuilder.build()); + return new SparseSoftmaxCrossEntropyWithLogits<>(opBuilder.build()); } - + /** + * Gets loss. * Per example loss (batch_size vector). + * @return loss. */ public Output loss() { return loss; } - + /** + * Gets backprop. * backpropagated gradients (batch_size x num_classes matrix). + * @return backprop. */ public Output backprop() { return backprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSoftmaxCrossEntropyWithLogits"; - - private Output loss; - private Output backprop; - - private SparseSoftmaxCrossEntropyWithLogits(Operation operation) { - super(operation); - int outputIdx = 0; - loss = operation.output(outputIdx++); - backprop = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java index ff6b734970b..134856e714e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Dequantize.java @@ -28,116 +28,91 @@ import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; /** * Dequantize the 'input' tensor into a float or bfloat16 Tensor. - *

* [min_range, max_range] are scalar floats that specify the range for * the output. The 'mode' attribute controls exactly which calculations are * used to convert the float values to their quantized equivalents. - *

- * In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: - *

{@code
+ * 

In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: + *

  * if T == qint8: in[i] += (range(T) + 1)/ 2.0
  * out[i] = min_range + (in[i]* (max_range - min_range) / range(T))
- * }
- * here `range(T) = numeric_limits::max() - numeric_limits::min()` - *

- * MIN_COMBINED Mode Example - *

- * If the input comes from a QuantizedRelu6, the output type is + *

+ *

here {@code range(T) = numeric_limits::max() - numeric_limits::min()} + *

MIN_COMBINED Mode Example + *

If the input comes from a QuantizedRelu6, the output type is * quint8 (range of 0-255) but the possible range of QuantizedRelu6 is * 0-6. The min_range and max_range values are therefore 0.0 and 6.0. * Dequantize on quint8 will take each value, cast to float, and multiply * by 6 / 255. * Note that if quantizedtype is qint8, the operation will additionally add * each value by 128 prior to casting. - *

- * If the mode is 'MIN_FIRST', then this approach is used: - *

{@code
- * num_discrete_values = 1 << (# of bits in T)
+ * 

If the mode is 'MIN_FIRST', then this approach is used: + *

+ * num_discrete_values = 1 << (# of bits in T)
  * range_adjust = num_discrete_values / (num_discrete_values - 1)
  * range = (range_max - range_min) * range_adjust
  * range_scale = range / num_discrete_values
- * const double offset_input = static_cast(input) - lowest_quantized;
- * result = range_min + ((input - numeric_limits::min()) * range_scale)
- * }
- * If the mode is `SCALED`, dequantization is performed by multiplying each + * const double offset_input = static_cast<double>(input) - lowest_quantized; + * result = range_min + ((input - numeric_limits<T>::min()) * range_scale) + *
+ *

If the mode is {@code SCALED}, dequantization is performed by multiplying each * input value by a scaling_factor. (Thus an input of 0 always maps to 0.0). - *

- * The scaling_factor is determined from `min_range`, `max_range`, and - * `narrow_range` in a way that is compatible with `QuantizeAndDequantize{V2|V3}` - * and `QuantizeV2`, using the following algorithm: - *

{@code
- *   const int min_expected_T = std::numeric_limits::min() +
+ * 

The scaling_factor is determined from {@code min_range}, {@code max_range}, and + * {@code narrow_range} in a way that is compatible with {@code QuantizeAndDequantize{V2|V3}} + * and {@code QuantizeV2}, using the following algorithm: + *

+ *
+ *   const int min_expected_T = std::numeric_limits<T>::min() +
  *     (narrow_range ? 1 : 0);
- *   const int max_expected_T = std::numeric_limits::max();
- *   const float max_expected_T = std::numeric_limits::max();
- * 
+ *   const int max_expected_T = std::numeric_limits<T>::max();
+ *   const float max_expected_T = std::numeric_limits<float>::max();
+ *
  *   const float scale_factor =
- *     (std::numeric_limits::min() == 0) ? (max_range / max_expected_T)
+ *     (std::numeric_limits<T>::min() == 0) ? (max_range / max_expected_T)
  *                                          : std::max(min_range / min_expected_T,
  *                                                     max_range / max_expected_T);
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class Dequantize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.Dequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param mode - */ - public Options mode(String mode) { - this.mode = mode; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private String mode; - private Boolean narrowRange; - private Long axis; - - private Options() { - } + public static final String OP_NAME = "Dequantize"; + + private Output output; + + private Dequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Dequantize operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @param minRange The minimum scalar value possibly produced for the input. * @param maxRange The maximum scalar value possibly produced for the input. * @param dtype Type of the output tensor. Currently Dequantize supports float and bfloat16. * If 'dtype' is 'bfloat16', it only supports 'MIN_COMBINED' mode. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Dequantize} output and operands * @return a new instance of Dequantize */ - @Endpoint(describeByClass = true) - public static Dequantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Dequantize create(Scope scope, + Operand input, Operand minRange, Operand maxRange, + Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Dequantize", scope.makeOpName("Dequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minRange.asOutput()); @@ -157,64 +132,115 @@ public static Dequantize create(Scope scope, Operand(opBuilder.build()); + return new Dequantize<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Dequantize operation using default output types. - * + * Factory method to create a class wrapping a new Dequantize operation, with the default output types. + * * @param scope current scope - * @param input + * @param input the input value * @param minRange The minimum scalar value possibly produced for the input. * @param maxRange The maximum scalar value possibly produced for the input. - * @param options carries optional attributes values - * @return a new instance of Dequantize + * @param options carries optional attribute values + * @return a new instance of Dequantize, with default output types */ - @Endpoint(describeByClass = true) - public static Dequantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Dequantize create(Scope scope, Operand input, + Operand minRange, Operand maxRange, Options[] options) { return create(scope, input, minRange, maxRange, TFloat32.class, options); } - + /** - * @param mode + * Sets the mode option. + * + * @param mode the mode option + * @return this Options instance. */ public static Options mode(String mode) { return new Options().mode(mode); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Dequantize"; - - private Output output; - - private Dequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.Dequantize} + */ + public static class Options { + private String mode; + + private Boolean narrowRange; + + private Long axis; + + private Options() { + } + + /** + * Sets the mode option. + * + * @param mode the mode option + * @return this Options instance. + */ + public Options mode(String mode) { + this.mode = mode; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgs.java index 671c5f0ad4f..8f0e3a3cd5d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgs.java @@ -29,99 +29,57 @@ /** * Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same type. - *

* Attributes *

    - *
  • - * `[min; max]` define the clamping range for the `inputs` data. - *
  • - *
  • - * `inputs` values are quantized into the quantization range ( - * `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` - * when it is true) and then de-quantized and output as floats in `[min; max]` - * interval. - *
  • - *
  • - * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. - *
  • + *
  • {@code [min; max]} define the clamping range for the {@code inputs} data.
  • + *
  • {@code inputs} values are quantized into the quantization range ( + * {@code [0; 2^num_bits - 1]} when {@code narrow_range} is false and {@code [1; 2^num_bits - 1]} + * when it is true) and then de-quantized and output as floats in {@code [min; max]} + * interval.
  • + *
  • {@code num_bits} is the bitwidth of the quantization; between 2 and 16, inclusive.
  • *
- * Before quantization, `min` and `max` values are adjusted with the following + *

Before quantization, {@code min} and {@code max} values are adjusted with the following * logic. - * It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, + * It is suggested to have {@code min <= 0 <= max}. If {@code 0} is not in the range of values, * the behavior can be unexpected: *

    - *
  • - * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. - *
  • - *
  • - * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. - *
  • - *
  • - * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `, - * `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. - *
  • + *
  • If {@code 0 < min < max}: {@code min_adj = 0} and {@code max_adj = max - min}.
  • + *
  • If {@code min < max < 0}: {@code min_adj = min - max} and {@code max_adj = 0}.
  • + *
  • If {@code min <= 0 <= max}: {@code scale = (max - min) / (2^num_bits - 1) }, + * {@code min_adj = scale * round(min / scale)} and {@code max_adj = max + min_adj - min}.
  • *
- * Quantization is called fake since the output is still in floating point. + *

Quantization is called fake since the output is still in floating point. */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxArgs extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgs} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param min - */ - public Options min(Float min) { - this.min = min; - return this; - } - - /** - * @param max - */ - public Options max(Float max) { - this.max = max; - return this; - } - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Float min; - private Float max; - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxArgs"; + + private Output outputs; + + private FakeQuantWithMinMaxArgs(Operation operation) { + super(operation); + int outputIdx = 0; + outputs = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxArgs operation. - * + * * @param scope current scope - * @param inputs - * @param options carries optional attributes values + * @param inputs the inputs value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxArgs */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxArgs create(Scope scope, Operand inputs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxArgs create(Scope scope, Operand inputs, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxArgs", scope.makeOpName("FakeQuantWithMinMaxArgs")); opBuilder.addInput(inputs.asOutput()); opBuilder = scope.apply(opBuilder); @@ -143,54 +101,118 @@ public static FakeQuantWithMinMaxArgs create(Scope scope, Operand inpu } return new FakeQuantWithMinMaxArgs(opBuilder.build()); } - + /** - * @param min + * Sets the min option. + * + * @param min the min option + * @return this Options instance. */ public static Options min(Float min) { return new Options().min(min); } - + /** - * @param max + * Sets the max option. + * + * @param max the max option + * @return this Options instance. */ public static Options max(Float max) { return new Options().max(max); } - + /** - * @param numBits + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. */ public static Options numBits(Long numBits) { return new Options().numBits(numBits); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** + * Gets outputs. + * + * @return outputs. */ public Output outputs() { return outputs; } - + @Override public Output asOutput() { return outputs; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxArgs"; - - private Output outputs; - - private FakeQuantWithMinMaxArgs(Operation operation) { - super(operation); - int outputIdx = 0; - outputs = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgs} + */ + public static class Options { + private Float min; + + private Float max; + + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the min option. + * + * @param min the min option + * @return this Options instance. + */ + public Options min(Float min) { + this.min = min; + return this; + } + + /** + * Sets the max option. + * + * @param max the max option + * @return this Options instance. + */ + public Options max(Float max) { + this.max = max; + return this; + } + + /** + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgsGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgsGradient.java index e44b1f9ae73..05da8e5d06f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgsGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxArgsGradient.java @@ -30,66 +30,37 @@ /** * Compute gradients for a FakeQuantWithMinMaxArgs operation. */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxArgsGradient extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgsGradient} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param min - */ - public Options min(Float min) { - this.min = min; - return this; - } - - /** - * @param max - */ - public Options max(Float max) { - this.max = max; - return this; - } - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Float min; - private Float max; - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxArgsGradient"; + + private Output backprops; + + private FakeQuantWithMinMaxArgsGradient(Operation operation) { + super(operation); + int outputIdx = 0; + backprops = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxArgsGradient operation. - * + * * @param scope current scope * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxArgs operation. * @param inputs Values passed as inputs to the FakeQuantWithMinMaxArgs operation. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxArgsGradient */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxArgsGradient create(Scope scope, Operand gradients, Operand inputs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxArgsGradient create(Scope scope, Operand gradients, + Operand inputs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxArgsGradient", scope.makeOpName("FakeQuantWithMinMaxArgsGradient")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(inputs.asOutput()); @@ -112,56 +83,119 @@ public static FakeQuantWithMinMaxArgsGradient create(Scope scope, Operand= min && inputs <= max)`. + * {@code gradients * (inputs >= min && inputs <= max)}. + * @return backprops. */ public Output backprops() { return backprops; } - + @Override public Output asOutput() { return backprops; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxArgsGradient"; - - private Output backprops; - - private FakeQuantWithMinMaxArgsGradient(Operation operation) { - super(operation); - int outputIdx = 0; - backprops = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgsGradient} + */ + public static class Options { + private Float min; + + private Float max; + + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the min option. + * + * @param min the min option + * @return this Options instance. + */ + public Options min(Float min) { + this.min = min; + return this; + } + + /** + * Sets the max option. + * + * @param max the max option + * @return this Options instance. + */ + public Options max(Float max) { + this.max = max; + return this; + } + + /** + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVars.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVars.java index cde8bdab869..e411e8e93d3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVars.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVars.java @@ -29,87 +29,62 @@ /** * Fake-quantize the 'inputs' tensor of type float via global float scalars - *

- * Fake-quantize the `inputs` tensor of type float via global float scalars - * `min` and `max` to `outputs` tensor of same shape as `inputs`. - *

- * Attributes + * Fake-quantize the {@code inputs} tensor of type float via global float scalars + * {@code min} and {@code max} to {@code outputs} tensor of same shape as {@code inputs}. + *

Attributes *

    - *
  • - * `[min; max]` define the clamping range for the `inputs` data. - *
  • - *
  • - * `inputs` values are quantized into the quantization range ( - * `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` - * when it is true) and then de-quantized and output as floats in `[min; max]` - * interval. - *
  • - *
  • - * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. - *
  • + *
  • {@code [min; max]} define the clamping range for the {@code inputs} data.
  • + *
  • {@code inputs} values are quantized into the quantization range ( + * {@code [0; 2^num_bits - 1]} when {@code narrow_range} is false and {@code [1; 2^num_bits - 1]} + * when it is true) and then de-quantized and output as floats in {@code [min; max]} + * interval.
  • + *
  • {@code num_bits} is the bitwidth of the quantization; between 2 and 16, inclusive.
  • *
- * Before quantization, `min` and `max` values are adjusted with the following + *

Before quantization, {@code min} and {@code max} values are adjusted with the following * logic. - * It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, + * It is suggested to have {@code min <= 0 <= max}. If {@code 0} is not in the range of values, * the behavior can be unexpected: *

    - *
  • - * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. - *
  • - *
  • - * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. - *
  • - *
  • - * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `, - * `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. - *
  • + *
  • If {@code 0 < min < max}: {@code min_adj = 0} and {@code max_adj = max - min}.
  • + *
  • If {@code min < max < 0}: {@code min_adj = min - max} and {@code max_adj = 0}.
  • + *
  • If {@code min <= 0 <= max}: {@code scale = (max - min) / (2^num_bits - 1) }, + * {@code min_adj = scale * round(min / scale)} and {@code max_adj = max + min_adj - min}.
  • *
- * This operation has a gradient and thus allows for training `min` and `max` + *

This operation has a gradient and thus allows for training {@code min} and {@code max} * values. */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxVars extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVars} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxVars"; + + private Output outputs; + + private FakeQuantWithMinMaxVars(Operation operation) { + super(operation); + int outputIdx = 0; + outputs = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxVars operation. - * + * * @param scope current scope - * @param inputs - * @param min - * @param max - * @param options carries optional attributes values + * @param inputs the inputs value + * @param min the min value + * @param max the max value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVars */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxVars create(Scope scope, Operand inputs, Operand min, Operand max, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxVars create(Scope scope, Operand inputs, + Operand min, Operand max, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxVars", scope.makeOpName("FakeQuantWithMinMaxVars")); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(min.asOutput()); @@ -127,40 +102,72 @@ public static FakeQuantWithMinMaxVars create(Scope scope, Operand inpu } return new FakeQuantWithMinMaxVars(opBuilder.build()); } - + /** - * @param numBits + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. */ public static Options numBits(Long numBits) { return new Options().numBits(numBits); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** + * Gets outputs. + * + * @return outputs. */ public Output outputs() { return outputs; } - + @Override public Output asOutput() { return outputs; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxVars"; - - private Output outputs; - - private FakeQuantWithMinMaxVars(Operation operation) { - super(operation); - int outputIdx = 0; - outputs = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVars} + */ + public static class Options { + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsGradient.java index fb18431f99b..d5809fa3abc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsGradient.java @@ -30,51 +30,46 @@ /** * Compute gradients for a FakeQuantWithMinMaxVars operation. */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxVarsGradient extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsGradient} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numBits The bitwidth of the quantization; between 2 and 8, inclusive. - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxVarsGradient"; + + private Output backpropsWrtInput; + + private Output backpropWrtMin; + + private Output backpropWrtMax; + + private FakeQuantWithMinMaxVarsGradient(Operation operation) { + super(operation); + int outputIdx = 0; + backpropsWrtInput = operation.output(outputIdx++); + backpropWrtMin = operation.output(outputIdx++); + backpropWrtMax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxVarsGradient operation. - * + * * @param scope current scope * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxVars operation. * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation. * min, max: Quantization interval, scalar floats. - * @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 * @return a new instance of FakeQuantWithMinMaxVarsGradient */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxVarsGradient create(Scope scope, Operand gradients, Operand inputs, Operand min, Operand max, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxVarsGradient create(Scope scope, Operand gradients, + Operand inputs, Operand min, Operand max, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxVarsGradient", scope.makeOpName("FakeQuantWithMinMaxVarsGradient")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(inputs.asOutput()); @@ -93,57 +88,88 @@ public static FakeQuantWithMinMaxVarsGradient create(Scope scope, Operand= min && inputs <= max)`. + * {@code gradients * (inputs >= min && inputs <= max)}. + * @return backpropsWrtInput. */ public Output backpropsWrtInput() { return backpropsWrtInput; } - + /** + * Gets backpropWrtMin. * Backpropagated gradients w.r.t. min parameter: - * `sum(gradients * (inputs < min))`. + * {@code sum(gradients * (inputs < min))}. + * @return backpropWrtMin. */ public Output backpropWrtMin() { return backpropWrtMin; } - + /** + * Gets backpropWrtMax. * Backpropagated gradients w.r.t. max parameter: - * `sum(gradients * (inputs > max))`. + * {@code sum(gradients * (inputs > max))}. + * @return backpropWrtMax. */ public Output backpropWrtMax() { return backpropWrtMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxVarsGradient"; - - private Output backpropsWrtInput; - private Output backpropWrtMin; - private Output backpropWrtMax; - - private FakeQuantWithMinMaxVarsGradient(Operation operation) { - super(operation); - int outputIdx = 0; - backpropsWrtInput = operation.output(outputIdx++); - backpropWrtMin = operation.output(outputIdx++); - backpropWrtMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsGradient} + */ + public static class Options { + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the numBits option. + * + * @param numBits The bitwidth of the quantization; between 2 and 8, inclusive. + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannel.java index af1d2c287b1..953271d9129 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannel.java @@ -29,88 +29,63 @@ /** * Fake-quantize the 'inputs' tensor of type float via per-channel floats - *

- * Fake-quantize the `inputs` tensor of type float per-channel and one of the - * shapes: `[d]`, `[b, d]` `[b, h, w, d]` via per-channel floats `min` and `max` - * of shape `[d]` to `outputs` tensor of same shape as `inputs`. - *

- * Attributes + * Fake-quantize the {@code inputs} tensor of type float per-channel and one of the + * shapes: {@code [d]}, {@code [b, d]} {@code [b, h, w, d]} via per-channel floats {@code min} and {@code max} + * of shape {@code [d]} to {@code outputs} tensor of same shape as {@code inputs}. + *

Attributes *

    - *
  • - * `[min; max]` define the clamping range for the `inputs` data. - *
  • - *
  • - * `inputs` values are quantized into the quantization range ( - * `[0; 2^num_bits - 1]` when `narrow_range` is false and `[1; 2^num_bits - 1]` - * when it is true) and then de-quantized and output as floats in `[min; max]` - * interval. - *
  • - *
  • - * `num_bits` is the bitwidth of the quantization; between 2 and 16, inclusive. - *
  • + *
  • {@code [min; max]} define the clamping range for the {@code inputs} data.
  • + *
  • {@code inputs} values are quantized into the quantization range ( + * {@code [0; 2^num_bits - 1]} when {@code narrow_range} is false and {@code [1; 2^num_bits - 1]} + * when it is true) and then de-quantized and output as floats in {@code [min; max]} + * interval.
  • + *
  • {@code num_bits} is the bitwidth of the quantization; between 2 and 16, inclusive.
  • *
- * Before quantization, `min` and `max` values are adjusted with the following + *

Before quantization, {@code min} and {@code max} values are adjusted with the following * logic. - * It is suggested to have `min <= 0 <= max`. If `0` is not in the range of values, + * It is suggested to have {@code min <= 0 <= max}. If {@code 0} is not in the range of values, * the behavior can be unexpected: *

    - *
  • - * If `0 < min < max`: `min_adj = 0` and `max_adj = max - min`. - *
  • - *
  • - * If `min < max < 0`: `min_adj = min - max` and `max_adj = 0`. - *
  • - *
  • - * If `min <= 0 <= max`: `scale = (max - min) / (2^num_bits - 1) `, - * `min_adj = scale * round(min / scale)` and `max_adj = max + min_adj - min`. - *
  • + *
  • If {@code 0 < min < max}: {@code min_adj = 0} and {@code max_adj = max - min}.
  • + *
  • If {@code min < max < 0}: {@code min_adj = min - max} and {@code max_adj = 0}.
  • + *
  • If {@code min <= 0 <= max}: {@code scale = (max - min) / (2^num_bits - 1) }, + * {@code min_adj = scale * round(min / scale)} and {@code max_adj = max + min_adj - min}.
  • *
- * This operation has a gradient and thus allows for training `min` and `max` + *

This operation has a gradient and thus allows for training {@code min} and {@code max} * values. */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxVarsPerChannel extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannel} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxVarsPerChannel"; + + private Output outputs; + + private FakeQuantWithMinMaxVarsPerChannel(Operation operation) { + super(operation); + int outputIdx = 0; + outputs = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxVarsPerChannel operation. - * + * * @param scope current scope - * @param inputs - * @param min - * @param max - * @param options carries optional attributes values + * @param inputs the inputs value + * @param min the min value + * @param max the max value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsPerChannel */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxVarsPerChannel create(Scope scope, Operand inputs, Operand min, Operand max, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxVarsPerChannel create(Scope scope, Operand inputs, + Operand min, Operand max, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxVarsPerChannel", scope.makeOpName("FakeQuantWithMinMaxVarsPerChannel")); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(min.asOutput()); @@ -128,40 +103,72 @@ public static FakeQuantWithMinMaxVarsPerChannel create(Scope scope, Operand outputs() { return outputs; } - + @Override public Output asOutput() { return outputs; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxVarsPerChannel"; - - private Output outputs; - - private FakeQuantWithMinMaxVarsPerChannel(Operation operation) { - super(operation); - int outputIdx = 0; - outputs = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannel} + */ + public static class Options { + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannelGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannelGradient.java index 24e1ec13e1c..0f5748301cf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannelGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/FakeQuantWithMinMaxVarsPerChannelGradient.java @@ -30,53 +30,49 @@ /** * Compute gradients for a FakeQuantWithMinMaxVarsPerChannel operation. */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class FakeQuantWithMinMaxVarsPerChannelGradient extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannelGradient} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numBits The bitwidth of the quantization; between 2 and 16, inclusive. - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - private Long numBits; - private Boolean narrowRange; - - private Options() { - } + public static final String OP_NAME = "FakeQuantWithMinMaxVarsPerChannelGradient"; + + private Output backpropsWrtInput; + + private Output backpropWrtMin; + + private Output backpropWrtMax; + + private FakeQuantWithMinMaxVarsPerChannelGradient(Operation operation) { + super(operation); + int outputIdx = 0; + backpropsWrtInput = operation.output(outputIdx++); + backpropWrtMin = operation.output(outputIdx++); + backpropWrtMax = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new FakeQuantWithMinMaxVarsPerChannelGradient operation. - * + * * @param scope current scope * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxVars operation, - * shape one of: `[d]`, `[b, d]`, `[b, h, w, d]`. + * shape one of: {@code [d]}, {@code [b, d]}, {@code [b, h, w, d]}. * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation, shape - * same as `gradients`. - * min, max: Quantization interval, floats of shape `[d]`. - * @param min - * @param max - * @param options carries optional attributes values + * same as {@code gradients}. + * min, max: Quantization interval, floats of shape {@code [d]}. + * @param min the min value + * @param max the max value + * @param options carries optional attribute values * @return a new instance of FakeQuantWithMinMaxVarsPerChannelGradient */ - @Endpoint(describeByClass = true) - public static FakeQuantWithMinMaxVarsPerChannelGradient create(Scope scope, Operand gradients, Operand inputs, Operand min, Operand max, Options... options) { + @Endpoint( + describeByClass = true + ) + public static FakeQuantWithMinMaxVarsPerChannelGradient create(Scope scope, + Operand gradients, Operand inputs, Operand min, + Operand max, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FakeQuantWithMinMaxVarsPerChannelGradient", scope.makeOpName("FakeQuantWithMinMaxVarsPerChannelGradient")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(inputs.asOutput()); @@ -95,58 +91,89 @@ public static FakeQuantWithMinMaxVarsPerChannelGradient create(Scope scope, Oper } return new FakeQuantWithMinMaxVarsPerChannelGradient(opBuilder.build()); } - + /** + * Sets the numBits option. + * * @param numBits The bitwidth of the quantization; between 2 and 16, inclusive. + * @return this Options instance. */ public static Options numBits(Long numBits) { return new Options().numBits(numBits); } - + /** + * Sets the narrowRange option. + * * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** + * Gets backpropsWrtInput. * Backpropagated gradients w.r.t. inputs, shape same as - * `inputs`: - * `gradients * (inputs >= min && inputs <= max)`. + * {@code inputs}: + * {@code gradients * (inputs >= min && inputs <= max)}. + * @return backpropsWrtInput. */ public Output backpropsWrtInput() { return backpropsWrtInput; } - + /** - * Backpropagated gradients w.r.t. min parameter, shape `[d]`: - * `sum_per_d(gradients * (inputs < min))`. + * Gets backpropWrtMin. + * Backpropagated gradients w.r.t. min parameter, shape {@code [d]}: + * {@code sum_per_d(gradients * (inputs < min))}. + * @return backpropWrtMin. */ public Output backpropWrtMin() { return backpropWrtMin; } - + /** - * Backpropagated gradients w.r.t. max parameter, shape `[d]`: - * `sum_per_d(gradients * (inputs > max))`. + * Gets backpropWrtMax. + * Backpropagated gradients w.r.t. max parameter, shape {@code [d]}: + * {@code sum_per_d(gradients * (inputs > max))}. + * @return backpropWrtMax. */ public Output backpropWrtMax() { return backpropWrtMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FakeQuantWithMinMaxVarsPerChannelGradient"; - - private Output backpropsWrtInput; - private Output backpropWrtMin; - private Output backpropWrtMax; - - private FakeQuantWithMinMaxVarsPerChannelGradient(Operation operation) { - super(operation); - int outputIdx = 0; - backpropsWrtInput = operation.output(outputIdx++); - backpropWrtMin = operation.output(outputIdx++); - backpropWrtMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannelGradient} + */ + public static class Options { + private Long numBits; + + private Boolean narrowRange; + + private Options() { + } + + /** + * Sets the numBits option. + * + * @param numBits The bitwidth of the quantization; between 2 and 16, inclusive. + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange Whether to quantize into 2^num_bits - 1 distinct values. + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Quantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Quantize.java index edab6594b2c..2302b6530c5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Quantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Quantize.java @@ -27,200 +27,150 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Quantize the 'input' tensor of type float to 'output' tensor of type 'T'. - *

* [min_range, max_range] are scalar floats that specify the range for * the 'input' data. The 'mode' attribute controls exactly which calculations are * used to convert the float values to their quantized equivalents. The * 'round_mode' attribute controls which rounding tie-breaking algorithm is used * when rounding float values to their quantized equivalents. - *

- * In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: - *

{@code
+ * 

In 'MIN_COMBINED' mode, each value of the tensor will undergo the following: + *

  * out[i] = (in[i] - min_range) * range(T) / (max_range - min_range)
  * if T == qint8: out[i] -= (range(T) + 1) / 2.0
- * }
- * here `range(T) = numeric_limits::max() - numeric_limits::min()` - *

- * MIN_COMBINED Mode Example - *

- * Assume the input is type float and has a possible range of [0.0, 6.0] and the + *

+ *

here {@code range(T) = numeric_limits::max() - numeric_limits::min()} + *

MIN_COMBINED Mode Example + *

Assume the input is type float and has a possible range of [0.0, 6.0] and the * output type is quint8 ([0, 255]). The min_range and max_range values should be * specified as 0.0 and 6.0. Quantizing from float to quint8 will multiply each * value of the input by 255/6 and cast to quint8. - *

- * If the output type was qint8 ([-128, 127]), the operation will additionally + *

If the output type was qint8 ([-128, 127]), the operation will additionally * subtract each value by 128 prior to casting, so that the range of values aligns * with the range of qint8. - *

- * If the mode is 'MIN_FIRST', then this approach is used: - *

{@code
- * num_discrete_values = 1 << (# of bits in T)
+ * 

If the mode is 'MIN_FIRST', then this approach is used: + *

+ * num_discrete_values = 1 << (# of bits in T)
  * range_adjust = num_discrete_values / (num_discrete_values - 1)
  * range = (range_max - range_min) * range_adjust
  * range_scale = num_discrete_values / range
  * quantized = round(input * range_scale) - round(range_min * range_scale) +
- *   numeric_limits::min()
- * quantized = max(quantized, numeric_limits::min())
- * quantized = min(quantized, numeric_limits::max())
- * }
- * The biggest difference between this and MIN_COMBINED is that the minimum range + * numeric_limits<T>::min() + * quantized = max(quantized, numeric_limits<T>::min()) + * quantized = min(quantized, numeric_limits<T>::max()) + *
+ *

The biggest difference between this and MIN_COMBINED is that the minimum range * is rounded first, before it's subtracted from the rounded value. With * MIN_COMBINED, a small bias is introduced where repeated iterations of quantizing * and dequantizing will introduce a larger and larger error. - *

- * SCALED mode Example - *

- * `SCALED` mode matches the quantization approach used in - * `QuantizeAndDequantize{V2|V3}`. - *

- * If the mode is `SCALED`, the quantization is performed by multiplying each + *

SCALED mode Example + *

{@code SCALED} mode matches the quantization approach used in + * {@code QuantizeAndDequantize{V2|V3}}. + *

If the mode is {@code SCALED}, the quantization is performed by multiplying each * input value by a scaling_factor. - * The scaling_factor is determined from `min_range` and `max_range` to be as large - * as possible such that the range from `min_range` to `max_range` is representable + * The scaling_factor is determined from {@code min_range} and {@code max_range} to be as large + * as possible such that the range from {@code min_range} to {@code max_range} is representable * within values of type T. - *

{@code
- *   const int min_T = std::numeric_limits::min();
- *   const int max_T = std::numeric_limits::max();
- *   const float max_float = std::numeric_limits::max();
- * 
+ * 
+ *
+ *   const int min_T = std::numeric_limits<T>::min();
+ *   const int max_T = std::numeric_limits<T>::max();
+ *   const float max_float = std::numeric_limits<float>::max();
+ *
  *   const float scale_factor_from_min_side =
- *       (min_T * min_range > 0) ? min_T / min_range : max_float;
+ *       (min_T * min_range > 0) ? min_T / min_range : max_float;
  *   const float scale_factor_from_max_side =
- *       (max_T * max_range > 0) ? max_T / max_range : max_float;
- * 
+ *       (max_T * max_range > 0) ? max_T / max_range : max_float;
+ *
  *   const float scale_factor = std::min(scale_factor_from_min_side,
  *                                       scale_factor_from_max_side);
- * }
- * We next use the scale_factor to adjust min_range and max_range as follows: - *
{@code
+ * 
+ *

We next use the scale_factor to adjust min_range and max_range as follows: + *

  *       min_range = min_T / scale_factor;
  *       max_range = max_T / scale_factor;
- * }
- * e.g. if T = qint8, and initially min_range = -10, and max_range = 9, we would + *
+ *

e.g. if T = qint8, and initially min_range = -10, and max_range = 9, we would * compare -128/-10.0 = 12.8 to 127/9.0 = 14.11, and set scaling_factor = 12.8 * In this case, min_range would remain -10, but max_range would be adjusted to * 127 / 12.8 = 9.921875 - *

- * So we will quantize input values in the range (-10, 9.921875) to (-128, 127). - *

- * The input tensor can now be quantized by clipping values to the range - * `min_range` to `max_range`, then multiplying by scale_factor as follows: - *

{@code
+ * 

So we will quantize input values in the range (-10, 9.921875) to (-128, 127). + *

The input tensor can now be quantized by clipping values to the range + * {@code min_range} to {@code max_range}, then multiplying by scale_factor as follows: + *

  * result = round(min(max_range, max(min_range, input)) * scale_factor)
- * }
- * The adjusted `min_range` and `max_range` are returned as outputs 2 and 3 of + *
+ *

The adjusted {@code min_range} and {@code max_range} are returned as outputs 2 and 3 of * this operation. These outputs should be used as the range for any further * calculations. - *

- * narrow_range (bool) attribute - *

- * If true, we do not use the minimum quantized value. + *

narrow_range (bool) attribute + *

If true, we do not use the minimum quantized value. * i.e. for int8 the quantized output, it would be restricted to the range * -127..127 instead of the full -128..127 range. * This is provided for compatibility with certain inference backends. * (Only applies to SCALED mode) - *

- * axis (int) attribute - *

- * An optional `axis` attribute can specify a dimension index of the input tensor, + *

axis (int) attribute + *

An optional {@code axis} attribute can specify a dimension index of the input tensor, * such that quantization ranges will be calculated and applied separately for each * slice of the tensor along that dimension. This is useful for per-channel * quantization. - *

- * If axis is specified, min_range and max_range - *

- * if `axis`=None, per-tensor quantization is performed as normal. - *

- * ensure_minimum_range (float) attribute - *

- * Ensures the minimum quantization range is at least this value. + *

If axis is specified, min_range and max_range + *

if {@code axis}=None, per-tensor quantization is performed as normal. + *

ensure_minimum_range (float) attribute + *

Ensures the minimum quantization range is at least this value. * The legacy default value for this is 0.01, but it is strongly suggested to * set it to 0 for new uses. - * - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "quantization") -public final class Quantize extends RawOp { - +@Operator( + group = "quantization" +) +public final class Quantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.quantization.Quantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param mode - */ - public Options mode(String mode) { - this.mode = mode; - return this; - } - - /** - * @param roundMode - */ - public Options roundMode(String roundMode) { - this.roundMode = roundMode; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - /** - * @param ensureMinimumRange - */ - public Options ensureMinimumRange(Float ensureMinimumRange) { - this.ensureMinimumRange = ensureMinimumRange; - return this; - } - - private String mode; - private String roundMode; - private Boolean narrowRange; - private Long axis; - private Float ensureMinimumRange; - - private Options() { - } + public static final String OP_NAME = "QuantizeV2"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + private Quantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Quantize operation. - * + * Factory method to create a class wrapping a new QuantizeV2 operation. + * * @param scope current scope - * @param input + * @param input the input value * @param minRange The minimum value of the quantization range. This value may be adjusted by the - * op depending on other parameters. The adjusted value is written to `output_min`. - * If the `axis` attribute is specified, this must be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. + * op depending on other parameters. The adjusted value is written to {@code output_min}. + * If the {@code axis} attribute is specified, this must be a 1-D tensor whose size + * matches the {@code axis} dimension of the input and output tensors. * @param maxRange The maximum value of the quantization range. This value may be adjusted by the - * op depending on other parameters. The adjusted value is written to `output_max`. - * If the `axis` attribute is specified, this must be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. - * @param T - * @param options carries optional attributes values + * op depending on other parameters. The adjusted value is written to {@code output_max}. + * If the {@code axis} attribute is specified, this must be a 1-D tensor whose size + * matches the {@code axis} dimension of the input and output tensors. + * @param T the value of the T property + * @param options carries optional attribute values + * @param data type for {@code QuantizeV2} output and operands * @return a new instance of Quantize */ - @Endpoint(describeByClass = true) - public static Quantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, Class T, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Quantize create(Scope scope, Operand input, + Operand minRange, Operand maxRange, Class T, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizeV2", scope.makeOpName("Quantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minRange.asOutput()); @@ -246,83 +196,162 @@ public static Quantize create(Scope scope, Operand(opBuilder.build()); + return new Quantize<>(opBuilder.build()); } - + /** - * @param mode + * Sets the mode option. + * + * @param mode the mode option + * @return this Options instance. */ public static Options mode(String mode) { return new Options().mode(mode); } - + /** - * @param roundMode + * Sets the roundMode option. + * + * @param roundMode the roundMode option + * @return this Options instance. */ public static Options roundMode(String roundMode) { return new Options().roundMode(roundMode); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** - * @param ensureMinimumRange + * Sets the ensureMinimumRange option. + * + * @param ensureMinimumRange the ensureMinimumRange option + * @return this Options instance. */ public static Options ensureMinimumRange(Float ensureMinimumRange) { return new Options().ensureMinimumRange(ensureMinimumRange); } - + /** + * Gets output. * The quantized data produced from the float input. + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The final quantization range minimum, used to clip input values before scaling * and rounding them to quantized values. - * If the `axis` attribute is specified, this will be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. + * If the {@code axis} attribute is specified, this will be a 1-D tensor whose size + * matches the {@code axis} dimension of the input and output tensors. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The final quantization range maximum, used to clip input values before scaling * and rounding them to quantized values. - * If the `axis` attribute is specified, this will be a 1-D tensor whose size - * matches the `axis` dimension of the input and output tensors. + * If the {@code axis} attribute is specified, this will be a 1-D tensor whose size + * matches the {@code axis} dimension of the input and output tensors. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeV2"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private Quantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.Quantize} + */ + public static class Options { + private String mode; + + private String roundMode; + + private Boolean narrowRange; + + private Long axis; + + private Float ensureMinimumRange; + + private Options() { + } + + /** + * Sets the mode option. + * + * @param mode the mode option + * @return this Options instance. + */ + public Options mode(String mode) { + this.mode = mode; + return this; + } + + /** + * Sets the roundMode option. + * + * @param roundMode the roundMode option + * @return this Options instance. + */ + public Options roundMode(String roundMode) { + this.roundMode = roundMode; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } + + /** + * Sets the ensureMinimumRange option. + * + * @param ensureMinimumRange the ensureMinimumRange option + * @return this Options instance. + */ + public Options ensureMinimumRange(Float ensureMinimumRange) { + this.ensureMinimumRange = ensureMinimumRange; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantize.java index d66ff6c4871..4fa1a9a0021 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantize.java @@ -30,74 +30,45 @@ /** * Quantizes then dequantizes a tensor. - *

* This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a * tensor, so its value can change during training. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class QuantizeAndDequantize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param signedInput - */ - public Options signedInput(Boolean signedInput) { - this.signedInput = signedInput; - return this; - } - - /** - * @param rangeGiven - */ - public Options rangeGiven(Boolean rangeGiven) { - this.rangeGiven = rangeGiven; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Boolean signedInput; - private Boolean rangeGiven; - private Boolean narrowRange; - private Long axis; - - private Options() { - } + public static final String OP_NAME = "QuantizeAndDequantizeV3"; + + private Output output; + + private QuantizeAndDequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new QuantizeAndDequantize operation. - * + * Factory method to create a class wrapping a new QuantizeAndDequantizeV3 operation. + * * @param scope current scope - * @param input - * @param inputMin - * @param inputMax - * @param numBits - * @param options carries optional attributes values + * @param input the input value + * @param inputMin the inputMin value + * @param inputMax the inputMax value + * @param numBits the numBits value + * @param options carries optional attribute values + * @param data type for {@code QuantizeAndDequantizeV3} output and operands * @return a new instance of QuantizeAndDequantize */ - @Endpoint(describeByClass = true) - public static QuantizeAndDequantize create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand numBits, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizeAndDequantize create(Scope scope, Operand input, + Operand inputMin, Operand inputMax, Operand numBits, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV3", scope.makeOpName("QuantizeAndDequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); @@ -120,56 +91,120 @@ public static QuantizeAndDequantize create(Scope scope, O } } } - return new QuantizeAndDequantize(opBuilder.build()); + return new QuantizeAndDequantize<>(opBuilder.build()); } - + /** - * @param signedInput + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. */ public static Options signedInput(Boolean signedInput) { return new Options().signedInput(signedInput); } - + /** - * @param rangeGiven + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. */ public static Options rangeGiven(Boolean rangeGiven) { return new Options().rangeGiven(rangeGiven); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeAndDequantizeV3"; - - private Output output; - - private QuantizeAndDequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantize} + */ + public static class Options { + private Boolean signedInput; + + private Boolean rangeGiven; + + private Boolean narrowRange; + + private Long axis; + + private Options() { + } + + /** + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. + */ + public Options signedInput(Boolean signedInput) { + this.signedInput = signedInput; + return this; + } + + /** + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. + */ + public Options rangeGiven(Boolean rangeGiven) { + this.rangeGiven = rangeGiven; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV3.java index d91c6d89fb4..6cb3d26c426 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV3.java @@ -30,74 +30,45 @@ /** * Quantizes then dequantizes a tensor. - *

* This is almost identical to QuantizeAndDequantizeV2, except that num_bits is a * tensor, so its value can change during training. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class QuantizeAndDequantizeV3 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV3} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param signedInput - */ - public Options signedInput(Boolean signedInput) { - this.signedInput = signedInput; - return this; - } - - /** - * @param rangeGiven - */ - public Options rangeGiven(Boolean rangeGiven) { - this.rangeGiven = rangeGiven; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Boolean signedInput; - private Boolean rangeGiven; - private Boolean narrowRange; - private Long axis; - - private Options() { - } + public static final String OP_NAME = "QuantizeAndDequantizeV3"; + + private Output output; + + private QuantizeAndDequantizeV3(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizeAndDequantizeV3 operation. - * + * * @param scope current scope - * @param input - * @param inputMin - * @param inputMax - * @param numBits - * @param options carries optional attributes values + * @param input the input value + * @param inputMin the inputMin value + * @param inputMax the inputMax value + * @param numBits the numBits value + * @param options carries optional attribute values + * @param data type for {@code QuantizeAndDequantizeV3} output and operands * @return a new instance of QuantizeAndDequantizeV3 */ - @Endpoint(describeByClass = true) - public static QuantizeAndDequantizeV3 create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand numBits, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizeAndDequantizeV3 create(Scope scope, Operand input, + Operand inputMin, Operand inputMax, Operand numBits, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV3", scope.makeOpName("QuantizeAndDequantizeV3")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); @@ -120,56 +91,120 @@ public static QuantizeAndDequantizeV3 create(Scope scope, } } } - return new QuantizeAndDequantizeV3(opBuilder.build()); + return new QuantizeAndDequantizeV3<>(opBuilder.build()); } - + /** - * @param signedInput + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. */ public static Options signedInput(Boolean signedInput) { return new Options().signedInput(signedInput); } - + /** - * @param rangeGiven + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. */ public static Options rangeGiven(Boolean rangeGiven) { return new Options().rangeGiven(rangeGiven); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeAndDequantizeV3"; - - private Output output; - - private QuantizeAndDequantizeV3(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV3} + */ + public static class Options { + private Boolean signedInput; + + private Boolean rangeGiven; + + private Boolean narrowRange; + + private Long axis; + + private Options() { + } + + /** + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. + */ + public Options signedInput(Boolean signedInput) { + this.signedInput = signedInput; + return this; + } + + /** + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. + */ + public Options rangeGiven(Boolean rangeGiven) { + this.rangeGiven = rangeGiven; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4.java index 60517531020..00f10f48024 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4.java @@ -28,92 +28,45 @@ import org.tensorflow.types.family.TNumber; /** - * Returns the gradient of `quantization.QuantizeAndDequantizeV4`. - *

+ * Returns the gradient of {@code quantization.QuantizeAndDequantizeV4}. * This is almost identical to QuantizeAndDequantizeV2, except that it returns a * gradient of 1 for inputs that are within the quantization range, or 0 otherwise. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class QuantizeAndDequantizeV4 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param signedInput - */ - public Options signedInput(Boolean signedInput) { - this.signedInput = signedInput; - return this; - } - - /** - * @param numBits - */ - public Options numBits(Long numBits) { - this.numBits = numBits; - return this; - } - - /** - * @param rangeGiven - */ - public Options rangeGiven(Boolean rangeGiven) { - this.rangeGiven = rangeGiven; - return this; - } - - /** - * @param roundMode - */ - public Options roundMode(String roundMode) { - this.roundMode = roundMode; - return this; - } - - /** - * @param narrowRange - */ - public Options narrowRange(Boolean narrowRange) { - this.narrowRange = narrowRange; - return this; - } - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Boolean signedInput; - private Long numBits; - private Boolean rangeGiven; - private String roundMode; - private Boolean narrowRange; - private Long axis; - - private Options() { - } + public static final String OP_NAME = "QuantizeAndDequantizeV4"; + + private Output output; + + private QuantizeAndDequantizeV4(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizeAndDequantizeV4 operation. - * + * * @param scope current scope - * @param input - * @param inputMin - * @param inputMax - * @param options carries optional attributes values + * @param input the input value + * @param inputMin the inputMin value + * @param inputMax the inputMax value + * @param options carries optional attribute values + * @param data type for {@code QuantizeAndDequantizeV4} output and operands * @return a new instance of QuantizeAndDequantizeV4 */ - @Endpoint(describeByClass = true) - public static QuantizeAndDequantizeV4 create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizeAndDequantizeV4 create(Scope scope, Operand input, + Operand inputMin, Operand inputMax, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV4", scope.makeOpName("QuantizeAndDequantizeV4")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); @@ -141,70 +94,166 @@ public static QuantizeAndDequantizeV4 create(Scope scope, } } } - return new QuantizeAndDequantizeV4(opBuilder.build()); + return new QuantizeAndDequantizeV4<>(opBuilder.build()); } - + /** - * @param signedInput + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. */ public static Options signedInput(Boolean signedInput) { return new Options().signedInput(signedInput); } - + /** - * @param numBits + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. */ public static Options numBits(Long numBits) { return new Options().numBits(numBits); } - + /** - * @param rangeGiven + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. */ public static Options rangeGiven(Boolean rangeGiven) { return new Options().rangeGiven(rangeGiven); } - + /** - * @param roundMode + * Sets the roundMode option. + * + * @param roundMode the roundMode option + * @return this Options instance. */ public static Options roundMode(String roundMode) { return new Options().roundMode(roundMode); } - + /** - * @param narrowRange + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. */ public static Options narrowRange(Boolean narrowRange) { return new Options().narrowRange(narrowRange); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeAndDequantizeV4"; - - private Output output; - - private QuantizeAndDequantizeV4(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4} + */ + public static class Options { + private Boolean signedInput; + + private Long numBits; + + private Boolean rangeGiven; + + private String roundMode; + + private Boolean narrowRange; + + private Long axis; + + private Options() { + } + + /** + * Sets the signedInput option. + * + * @param signedInput the signedInput option + * @return this Options instance. + */ + public Options signedInput(Boolean signedInput) { + this.signedInput = signedInput; + return this; + } + + /** + * Sets the numBits option. + * + * @param numBits the numBits option + * @return this Options instance. + */ + public Options numBits(Long numBits) { + this.numBits = numBits; + return this; + } + + /** + * Sets the rangeGiven option. + * + * @param rangeGiven the rangeGiven option + * @return this Options instance. + */ + public Options rangeGiven(Boolean rangeGiven) { + this.rangeGiven = rangeGiven; + return this; + } + + /** + * Sets the roundMode option. + * + * @param roundMode the roundMode option + * @return this Options instance. + */ + public Options roundMode(String roundMode) { + this.roundMode = roundMode; + return this; + } + + /** + * Sets the narrowRange option. + * + * @param narrowRange the narrowRange option + * @return this Options instance. + */ + public Options narrowRange(Boolean narrowRange) { + this.narrowRange = narrowRange; + return this; + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4Grad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4Grad.java index 4934e23dcab..31ee0a84208 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4Grad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeAndDequantizeV4Grad.java @@ -28,48 +28,53 @@ import org.tensorflow.types.family.TNumber; /** - * Returns the gradient of `QuantizeAndDequantizeV4`. - *

+ * Returns the gradient of {@code QuantizeAndDequantizeV4}. * Returns a gradient of 1 for inputs that are within the quantization range, * or 0 otherwise. - * - * @param data type for {@code inputBackprop()} output + * + * @param data type for {@code input_backprop} output */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class QuantizeAndDequantizeV4Grad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4Grad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param axis - */ - public Options axis(Long axis) { - this.axis = axis; - return this; - } - - private Long axis; - - private Options() { - } + public static final String OP_NAME = "QuantizeAndDequantizeV4Grad"; + + private Output inputBackprop; + + private Output inputMinBackprop; + + private Output inputMaxBackprop; + + private QuantizeAndDequantizeV4Grad(Operation operation) { + super(operation); + int outputIdx = 0; + inputBackprop = operation.output(outputIdx++); + inputMinBackprop = operation.output(outputIdx++); + inputMaxBackprop = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizeAndDequantizeV4Grad operation. - * + * * @param scope current scope - * @param gradients - * @param input - * @param inputMin - * @param inputMax - * @param options carries optional attributes values + * @param gradients the gradients value + * @param input the input value + * @param inputMin the inputMin value + * @param inputMax the inputMax value + * @param options carries optional attribute values + * @param data type for {@code QuantizeAndDequantizeV4Grad} output and operands * @return a new instance of QuantizeAndDequantizeV4Grad */ - @Endpoint(describeByClass = true) - public static QuantizeAndDequantizeV4Grad create(Scope scope, Operand gradients, Operand input, Operand inputMin, Operand inputMax, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizeAndDequantizeV4Grad create(Scope scope, + Operand gradients, Operand input, Operand inputMin, Operand inputMax, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizeAndDequantizeV4Grad", scope.makeOpName("QuantizeAndDequantizeV4Grad")); opBuilder.addInput(gradients.asOutput()); opBuilder.addInput(input.asOutput()); @@ -83,46 +88,64 @@ public static QuantizeAndDequantizeV4Grad create(Scope sc } } } - return new QuantizeAndDequantizeV4Grad(opBuilder.build()); + return new QuantizeAndDequantizeV4Grad<>(opBuilder.build()); } - + /** - * @param axis + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. */ public static Options axis(Long axis) { return new Options().axis(axis); } - + /** + * Gets inputBackprop. + * + * @return inputBackprop. */ public Output inputBackprop() { return inputBackprop; } - + /** + * Gets inputMinBackprop. + * + * @return inputMinBackprop. */ public Output inputMinBackprop() { return inputMinBackprop; } - + /** + * Gets inputMaxBackprop. + * + * @return inputMaxBackprop. */ public Output inputMaxBackprop() { return inputMaxBackprop; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeAndDequantizeV4Grad"; - - private Output inputBackprop; - private Output inputMinBackprop; - private Output inputMaxBackprop; - - private QuantizeAndDequantizeV4Grad(Operation operation) { - super(operation); - int outputIdx = 0; - inputBackprop = operation.output(outputIdx++); - inputMinBackprop = operation.output(outputIdx++); - inputMaxBackprop = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantizeV4Grad} + */ + public static class Options { + private Long axis; + + private Options() { + } + + /** + * Sets the axis option. + * + * @param axis the axis option + * @return this Options instance. + */ + public Options axis(Long axis) { + this.axis = axis; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeDownAndShrinkRange.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeDownAndShrinkRange.java index 73f23d05195..3de5b5c3f34 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeDownAndShrinkRange.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizeDownAndShrinkRange.java @@ -27,92 +27,105 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Convert the quantized 'input' tensor into a lower-precision 'output', using the - *

* actual distribution of the values to maximize the usage of the lower bit depth * and adjusting the output min and max ranges accordingly. - *

- * [input_min, input_max] are scalar floats that specify the range for the float + *

[input_min, input_max] are scalar floats that specify the range for the float * interpretation of the 'input' data. For example, if input_min is -1.0f and * input_max is 1.0f, and we are dealing with quint16 quantized data, then a 0 * value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f. - *

- * This operator tries to squeeze as much precision as possible into an output with + *

This operator tries to squeeze as much precision as possible into an output with * a lower bit depth by calculating the actual min and max values found in the * data. For example, maybe that quint16 input has no values lower than 16,384 and * none higher than 49,152. That means only half the range is actually needed, all * the float interpretations are between -0.5f and 0.5f, so if we want to compress * the data into a quint8 output, we can use that range rather than the theoretical * -1.0f to 1.0f that is suggested by the input min and max. - *

- * In practice, this is most useful for taking output from operations like + *

In practice, this is most useful for taking output from operations like * QuantizedMatMul that can produce higher bit-depth outputs than their inputs and * may have large potential output ranges, but in practice have a distribution of * input values that only uses a small fraction of the possible range. By feeding * that output into this operator, we can reduce it from 32 bits down to 8 with * minimal loss of accuracy. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "quantization") -public final class QuantizeDownAndShrinkRange extends RawOp { - +@Operator( + group = "quantization" +) +public final class QuantizeDownAndShrinkRange extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizeDownAndShrinkRange"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + private QuantizeDownAndShrinkRange(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizeDownAndShrinkRange operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @param inputMin The float value that the minimum quantized input value represents. * @param inputMax The float value that the maximum quantized input value represents. * @param outType The type of the output. Should be a lower bit depth than Tinput. + * @param data type for {@code QuantizeDownAndShrinkRange} output and operands * @return a new instance of QuantizeDownAndShrinkRange */ - @Endpoint(describeByClass = true) - public static QuantizeDownAndShrinkRange create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Class outType) { + @Endpoint( + describeByClass = true + ) + public static QuantizeDownAndShrinkRange create(Scope scope, + Operand input, Operand inputMin, Operand inputMax, + Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizeDownAndShrinkRange", scope.makeOpName("QuantizeDownAndShrinkRange")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new QuantizeDownAndShrinkRange(opBuilder.build()); + return new QuantizeDownAndShrinkRange<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The float value that the minimum quantized output value represents. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The float value that the maximum quantized output value represents. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizeDownAndShrinkRange"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private QuantizeDownAndShrinkRange(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedConcat.java index ba525886639..602bd900291 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedConcat.java @@ -32,70 +32,86 @@ /** * Concatenates quantized tensors along one dimension. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class QuantizedConcat extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "QuantizedConcat"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + private QuantizedConcat(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new QuantizedConcat operation. - * + * * @param scope current scope * @param concatDim 0-D. The dimension along which to concatenate. Must be in the * range [0, rank(values)). - * @param values The `N` Tensors to concatenate. Their ranks and types must match, - * and their sizes must match in all dimensions except `concat_dim`. + * @param values The {@code N} Tensors to concatenate. Their ranks and types must match, + * and their sizes must match in all dimensions except {@code concat_dim}. * @param inputMins The minimum scalar values for each of the input tensors. * @param inputMaxes The maximum scalar values for each of the input tensors. + * @param data type for {@code QuantizedConcat} output and operands * @return a new instance of QuantizedConcat */ - @Endpoint(describeByClass = true) - public static QuantizedConcat create(Scope scope, Operand concatDim, Iterable> values, Iterable> inputMins, Iterable> inputMaxes) { + @Endpoint( + describeByClass = true + ) + public static QuantizedConcat create(Scope scope, Operand concatDim, + Iterable> values, Iterable> inputMins, + Iterable> inputMaxes) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConcat", scope.makeOpName("QuantizedConcat")); opBuilder.addInput(concatDim.asOutput()); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder.addInputList(Operands.asOutputs(inputMins)); opBuilder.addInputList(Operands.asOutputs(inputMaxes)); opBuilder = scope.apply(opBuilder); - return new QuantizedConcat(opBuilder.build()); + return new QuantizedConcat<>(opBuilder.build()); } - + /** - * A `Tensor` with the concatenation of values stacked along the - * `concat_dim` dimension. This tensor's shape matches that of `values` except - * in `concat_dim` where it has the sum of the sizes. + * Gets output. + * A {@code Tensor} with the concatenation of values stacked along the + * {@code concat_dim} dimension. This tensor's shape matches that of {@code values} except + * in {@code concat_dim} where it has the sum of the sizes. + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The float value that the minimum quantized output value represents. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The float value that the maximum quantized output value represents. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedConcat"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private QuantizedConcat(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndDequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndDequantize.java index d603f188f71..1fc826d66d7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndDequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndDequantize.java @@ -25,72 +25,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.family.TNumber; -import org.tensorflow.types.family.TType; /** - * @param data type for {@code out()} output + * The QuantizedMatMulWithBiasAndDequantize operation + * + * @param data type for {@code out} output */ public final class QuantizedMatMulWithBiasAndDequantize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndDequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBiasAndDequantize"; + + private Output out; + + private QuantizedMatMulWithBiasAndDequantize(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndDequantize operation. - * + * * @param scope current scope - * @param a - * @param b - * @param bias - * @param minA - * @param maxA - * @param minB - * @param maxB - * @param minFreezedOutput - * @param maxFreezedOutput - * @param Toutput - * @param options carries optional attributes values + * @param a the a value + * @param b the b value + * @param bias the bias value + * @param minA the minA value + * @param maxA the maxA value + * @param minB the minB value + * @param maxB the maxB value + * @param minFreezedOutput the minFreezedOutput value + * @param maxFreezedOutput the maxFreezedOutput value + * @param Toutput the value of the Toutput property + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBiasAndDequantize} output and operands * @return a new instance of QuantizedMatMulWithBiasAndDequantize */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBiasAndDequantize create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Operand minFreezedOutput, Operand maxFreezedOutput, Class Toutput, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBiasAndDequantize create(Scope scope, + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Operand minFreezedOutput, + Operand maxFreezedOutput, Class Toutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndDequantize", scope.makeOpName("QuantizedMatMulWithBiasAndDequantize")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -116,49 +98,97 @@ public static QuantizedMatMulWithBiasAndDequantize create } } } - return new QuantizedMatMulWithBiasAndDequantize(opBuilder.build()); + return new QuantizedMatMulWithBiasAndDequantize<>(opBuilder.build()); } - + /** - * @param transposeA + * Sets the transposeA option. + * + * @param transposeA the transposeA option + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB + * Sets the transposeB option. + * + * @param transposeB the transposeB option + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param inputQuantMode + * Sets the inputQuantMode option. + * + * @param inputQuantMode the inputQuantMode option + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBiasAndDequantize"; - - private Output out; - - private QuantizedMatMulWithBiasAndDequantize(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndDequantize} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA the transposeA option + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB the transposeB option + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode the inputQuantMode option + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = inputQuantMode; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndRequantize.java index a4326a3618a..a5b19eedc25 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/QuantizedMatMulWithBiasAndRequantize.java @@ -25,71 +25,60 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code out()} output + * The QuantizedMatMulWithBiasAndRequantize operation + * + * @param data type for {@code out} output */ -public final class QuantizedMatMulWithBiasAndRequantize extends RawOp { - +public final class QuantizedMatMulWithBiasAndRequantize extends RawOp { /** - * Optional attributes for {@link org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndRequantize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param inputQuantMode - */ - public Options inputQuantMode(String inputQuantMode) { - this.inputQuantMode = inputQuantMode; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private String inputQuantMode; - - private Options() { - } + public static final String OP_NAME = "QuantizedMatMulWithBiasAndRequantize"; + + private Output out; + + private Output minOut; + + private Output maxOut; + + private QuantizedMatMulWithBiasAndRequantize(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); + minOut = operation.output(outputIdx++); + maxOut = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new QuantizedMatMulWithBiasAndRequantize operation. - * + * * @param scope current scope - * @param a - * @param b - * @param bias - * @param minA - * @param maxA - * @param minB - * @param maxB - * @param minFreezedOutput - * @param maxFreezedOutput - * @param Toutput - * @param options carries optional attributes values + * @param a the a value + * @param b the b value + * @param bias the bias value + * @param minA the minA value + * @param maxA the maxA value + * @param minB the minB value + * @param maxB the maxB value + * @param minFreezedOutput the minFreezedOutput value + * @param maxFreezedOutput the maxFreezedOutput value + * @param Toutput the value of the Toutput property + * @param options carries optional attribute values + * @param data type for {@code QuantizedMatMulWithBiasAndRequantize} output and operands * @return a new instance of QuantizedMatMulWithBiasAndRequantize */ - @Endpoint(describeByClass = true) - public static QuantizedMatMulWithBiasAndRequantize create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Operand minFreezedOutput, Operand maxFreezedOutput, Class Toutput, Options... options) { + @Endpoint( + describeByClass = true + ) + public static QuantizedMatMulWithBiasAndRequantize create(Scope scope, + Operand a, Operand b, Operand bias, + Operand minA, Operand maxA, Operand minB, + Operand maxB, Operand minFreezedOutput, + Operand maxFreezedOutput, Class Toutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndRequantize", scope.makeOpName("QuantizedMatMulWithBiasAndRequantize")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -115,60 +104,110 @@ public static QuantizedMatMulWithBiasAndRequantize create(S } } } - return new QuantizedMatMulWithBiasAndRequantize(opBuilder.build()); + return new QuantizedMatMulWithBiasAndRequantize<>(opBuilder.build()); } - + /** - * @param transposeA + * Sets the transposeA option. + * + * @param transposeA the transposeA option + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB + * Sets the transposeB option. + * + * @param transposeB the transposeB option + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param inputQuantMode + * Sets the inputQuantMode option. + * + * @param inputQuantMode the inputQuantMode option + * @return this Options instance. */ public static Options inputQuantMode(String inputQuantMode) { return new Options().inputQuantMode(inputQuantMode); } - + /** + * Gets out. + * + * @return out. */ public Output out() { return out; } - + /** + * Gets minOut. + * + * @return minOut. */ public Output minOut() { return minOut; } - + /** + * Gets maxOut. + * + * @return maxOut. */ public Output maxOut() { return maxOut; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "QuantizedMatMulWithBiasAndRequantize"; - - private Output out; - private Output minOut; - private Output maxOut; - - private QuantizedMatMulWithBiasAndRequantize(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); - minOut = operation.output(outputIdx++); - maxOut = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.quantization.QuantizedMatMulWithBiasAndRequantize} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private String inputQuantMode; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA the transposeA option + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB the transposeB option + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the inputQuantMode option. + * + * @param inputQuantMode the inputQuantMode option + * @return this Options instance. + */ + public Options inputQuantMode(String inputQuantMode) { + this.inputQuantMode = inputQuantMode; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/RequantizationRange.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/RequantizationRange.java index a38b54f2916..e226adfe73a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/RequantizationRange.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/RequantizationRange.java @@ -26,30 +26,49 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** * Computes a range that covers the actual values present in a quantized tensor. - *

- * Given a quantized tensor described by `(input, input_min, input_max)`, outputs a + * Given a quantized tensor described by {@code (input, input_min, input_max)}, outputs a * range that covers the actual values present in that tensor. This op is typically - * used to produce the `requested_output_min` and `requested_output_max` for - * `Requantize`. + * used to produce the {@code requested_output_min} and {@code requested_output_max} for + * {@code Requantize}. */ -@Operator(group = "quantization") +@Operator( + group = "quantization" +) public final class RequantizationRange extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RequantizationRange"; + + private Output outputMin; + + private Output outputMax; + + private RequantizationRange(Operation operation) { + super(operation); + int outputIdx = 0; + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RequantizationRange operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @param inputMin The float value that the minimum quantized input value represents. * @param inputMax The float value that the maximum quantized input value represents. * @return a new instance of RequantizationRange */ - @Endpoint(describeByClass = true) - public static RequantizationRange create(Scope scope, Operand input, Operand inputMin, Operand inputMax) { + @Endpoint( + describeByClass = true + ) + public static RequantizationRange create(Scope scope, Operand input, + Operand inputMin, Operand inputMax) { OperationBuilder opBuilder = scope.env().opBuilder("RequantizationRange", scope.makeOpName("RequantizationRange")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); @@ -57,31 +76,22 @@ public static RequantizationRange create(Scope scope, Operand i opBuilder = scope.apply(opBuilder); return new RequantizationRange(opBuilder.build()); } - + /** + * Gets outputMin. * The computed min output. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * the computed max output. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RequantizationRange"; - - private Output outputMin; - private Output outputMax; - - private RequantizationRange(Operation operation) { - super(operation); - int outputIdx = 0; - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Requantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Requantize.java index 6a18daf69ca..f990b3548f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Requantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/quantization/Requantize.java @@ -27,38 +27,62 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; -import org.tensorflow.types.family.TType; +import org.tensorflow.types.family.TNumber; /** - * Converts the quantized `input` tensor into a lower-precision `output`. - *

- * Converts the quantized `input` tensor into a lower-precision `output`, using the - * output range specified with `requested_output_min` and `requested_output_max`. - *

- * `[input_min, input_max]` are scalar floats that specify the range for the float - * interpretation of the `input` data. For example, if `input_min` is -1.0f and - * `input_max` is 1.0f, and we are dealing with `quint16` quantized data, then a 0 + * Converts the quantized {@code input} tensor into a lower-precision {@code output}. + * Converts the quantized {@code input} tensor into a lower-precision {@code output}, using the + * output range specified with {@code requested_output_min} and {@code requested_output_max}. + *

{@code [input_min, input_max]} are scalar floats that specify the range for the float + * interpretation of the {@code input} data. For example, if {@code input_min} is -1.0f and + * {@code input_max} is 1.0f, and we are dealing with {@code quint16} quantized data, then a 0 * value in the 16-bit data should be interpreted as -1.0f, and a 65535 means 1.0f. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "quantization") -public final class Requantize extends RawOp { - +@Operator( + group = "quantization" +) +public final class Requantize extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "Requantize"; + + private Output output; + + private Output outputMin; + + private Output outputMax; + + private Requantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + outputMin = operation.output(outputIdx++); + outputMax = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new Requantize operation. - * + * * @param scope current scope - * @param input + * @param input the input value * @param inputMin The float value that the minimum quantized input value represents. * @param inputMax The float value that the maximum quantized input value represents. * @param requestedOutputMin The float value that the minimum quantized output value represents. * @param requestedOutputMax The float value that the maximum quantized output value represents. * @param outType The type of the output. Should be a lower bit depth than Tinput. + * @param data type for {@code Requantize} output and operands * @return a new instance of Requantize */ - @Endpoint(describeByClass = true) - public static Requantize create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, Class outType) { + @Endpoint( + describeByClass = true + ) + public static Requantize create(Scope scope, + Operand input, Operand inputMin, Operand inputMax, + Operand requestedOutputMin, Operand requestedOutputMax, + Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("Requantize", scope.makeOpName("Requantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); @@ -67,41 +91,33 @@ public static Requantize create(Scope scope, Operand(opBuilder.build()); + return new Requantize<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + /** + * Gets outputMin. * The requested_output_min value is copied into this output. + * @return outputMin. */ public Output outputMin() { return outputMin; } - + /** + * Gets outputMax. * The requested_output_max value is copied into this output. + * @return outputMax. */ public Output outputMax() { return outputMax; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Requantize"; - - private Output output; - private Output outputMin; - private Output outputMax; - - private Requantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - outputMin = operation.output(outputIdx++); - outputMax = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedBincount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedBincount.java index 12ca81cf3c6..6a3aaa298c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedBincount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedBincount.java @@ -30,58 +30,57 @@ /** * 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 output()} output + * 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 data type for {@code output} output */ -@Operator(group = "ragged") +@Operator( + group = "ragged" +) public final class RaggedBincount extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.ragged.RaggedBincount} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. - */ - public Options binaryOutput(Boolean binaryOutput) { - this.binaryOutput = binaryOutput; - return this; - } - - private Boolean binaryOutput; - - private Options() { - } + public static final String OP_NAME = "RaggedBincount"; + + private Output output; + + private RaggedBincount(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RaggedBincount operation. - * + * * @param scope current scope - * @param splits 1D int64 `Tensor`. - * @param values 2D int `Tensor`. - * @param size non-negative int scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `input`, or a length-0 `Tensor`, in which case it acts as all weights + * @param splits 1D int64 {@code Tensor}. + * @param values 2D int {@code Tensor}. + * @param sizeOutput non-negative int scalar {@code Tensor}. + * @param weights is an int32, int64, float32, or float64 {@code Tensor} with the same + * shape as {@code input}, or a length-0 {@code Tensor}, in which case it acts as all weights * equal to 1. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RaggedBincount} output and operands + * @param data type for {@code RaggedBincount} output and operands * @return a new instance of RaggedBincount */ - @Endpoint(describeByClass = true) - public static RaggedBincount create(Scope scope, Operand splits, Operand values, Operand size, Operand weights, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RaggedBincount create(Scope scope, + Operand splits, Operand values, Operand sizeOutput, Operand weights, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedBincount", scope.makeOpName("RaggedBincount")); opBuilder.addInput(splits.asOutput()); opBuilder.addInput(values.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(weights.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { @@ -91,37 +90,52 @@ public static RaggedBincount create(Sc } } } - return new RaggedBincount(opBuilder.build()); + return new RaggedBincount<>(opBuilder.build()); } - + /** + * Sets the binaryOutput option. + * * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. */ public static Options binaryOutput(Boolean binaryOutput) { return new Options().binaryOutput(binaryOutput); } - + /** - * 1D `Tensor` with length equal to `size` or 2D `Tensor` with [batch_size, `size`]. + * Gets output. + * 1D {@code Tensor} with length equal to {@code size} or 2D {@code Tensor} with [batch_size, {@code size}]. * The counts or summed weights for each value in the range [0, size). + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedBincount"; - - private Output output; - - private RaggedBincount(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.ragged.RaggedBincount} + */ + public static class Options { + private Boolean binaryOutput; + + private Options() { + } + + /** + * Sets the binaryOutput option. + * + * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. + */ + public Options binaryOutput(Boolean binaryOutput) { + this.binaryOutput = binaryOutput; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCountSparseOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCountSparseOutput.java index f9701def261..20ec23bdafc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCountSparseOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCountSparseOutput.java @@ -24,61 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Performs sparse-output bin counting for a ragged tensor input. - *

- * Counts the number of times each value occurs in the input. - * - * @param data type for {@code outputValues()} output + * Counts the number of times each value occurs in the input. + * + * @param data type for {@code output_values} output */ public final class RaggedCountSparseOutput extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.ragged.RaggedCountSparseOutput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param minlength Minimum value to count. Can be set to -1 for no minimum. - */ - public Options minlength(Long minlength) { - this.minlength = minlength; - return this; - } - - /** - * @param maxlength Maximum value to count. Can be set to -1 for no maximum. - */ - public Options maxlength(Long maxlength) { - this.maxlength = maxlength; - return this; - } - - private Long minlength; - private Long maxlength; - - private Options() { - } + public static final String OP_NAME = "RaggedCountSparseOutput"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputDenseShape; + + private RaggedCountSparseOutput(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputDenseShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RaggedCountSparseOutput operation. - * + * * @param scope current scope * @param splits Tensor containing the row splits of the ragged tensor to count. * @param values Tensor containing values of the sparse tensor to count. * @param weights A Tensor of the same shape as indices containing per-index weight values. * May also be the empty tensor if no weights are used. * @param binaryOutput Whether to output the number of occurrences of each value or 1. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RaggedCountSparseOutput} output and operands * @return a new instance of RaggedCountSparseOutput */ - @Endpoint(describeByClass = true) - public static RaggedCountSparseOutput create(Scope scope, Operand splits, Operand values, Operand weights, Boolean binaryOutput, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RaggedCountSparseOutput create(Scope scope, + Operand splits, Operand values, Operand weights, + Boolean binaryOutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedCountSparseOutput", scope.makeOpName("RaggedCountSparseOutput")); opBuilder.addInput(splits.asOutput()); opBuilder.addInput(values.asOutput()); @@ -95,62 +88,93 @@ public static RaggedCountSparseOutput create(Scope scope, } } } - return new RaggedCountSparseOutput(opBuilder.build()); + return new RaggedCountSparseOutput<>(opBuilder.build()); } - + /** + * Sets the minlength option. + * * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. */ public static Options minlength(Long minlength) { return new Options().minlength(minlength); } - + /** + * Sets the maxlength option. + * * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. */ public static Options maxlength(Long maxlength) { return new Options().maxlength(maxlength); } - + /** + * Gets outputIndices. * Indices tensor for the resulting sparse tensor object. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * Values tensor for the resulting sparse tensor object. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputDenseShape. * Shape tensor for the resulting sparse tensor object. - * END - * } - * attr { - * name: "T" - * description: < outputDenseShape() { return outputDenseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedCountSparseOutput"; - - private Output outputIndices; - private Output outputValues; - private Output outputDenseShape; - - private RaggedCountSparseOutput(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputDenseShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.ragged.RaggedCountSparseOutput} + */ + public static class Options { + private Long minlength; + + private Long maxlength; + + private Options() { + } + + /** + * Sets the minlength option. + * + * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. + */ + public Options minlength(Long minlength) { + this.minlength = minlength; + return this; + } + + /** + * Sets the maxlength option. + * + * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. + */ + public Options maxlength(Long maxlength) { + this.maxlength = maxlength; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCross.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCross.java index 3ad9d57582f..7f388bb3212 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCross.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedCross.java @@ -25,23 +25,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Generates a feature cross from a list of tensors, and returns it as a - * RaggedTensor. See `tf.ragged.cross` for more details. - * - * @param data type for {@code outputValues()} output - * @param data type for {@code outputRowSplits()} output + * RaggedTensor. See {@code tf.ragged.cross} for more details. + * + * @param data type for {@code output_values} output + * + * @param data type for {@code output_row_splits} output */ public final class RaggedCross extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedCross"; + + private Output outputValues; + + private Output outputRowSplits; + + private RaggedCross(Operation operation) { + super(operation); + int outputIdx = 0; + outputValues = operation.output(outputIdx++); + outputRowSplits = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedCross operation. - * + * * @param scope current scope * @param raggedValues The values tensor for each RaggedTensor input. * @param raggedRowSplits The row_splits tensor for each RaggedTensor input. @@ -49,19 +64,28 @@ public final class RaggedCross extends RawOp * @param sparseValues The values tensor for each SparseTensor input. * @param sparseShape The dense_shape tensor for each SparseTensor input. * @param denseInputs The tf.Tensor inputs. - * @param inputOrder String specifying the tensor type for each input. The `i`th character in - * this string specifies the type of the `i`th input, and is one of: 'R' (ragged), + * @param inputOrder String specifying the tensor type for each input. The {@code i}th character in + * this string specifies the type of the {@code i}th input, and is one of: 'R' (ragged), * 'D' (dense), or 'S' (sparse). This attr is used to ensure that the crossed * values are combined in the order of the inputs from the call to tf.ragged.cross. - * @param hashedOutput - * @param numBuckets - * @param hashKey - * @param outValuesType - * @param outRowSplitsType + * @param hashedOutput the value of the hashedOutput property + * @param numBuckets the value of the numBuckets property + * @param hashKey the value of the hashKey property + * @param outValuesType the value of the outValuesType property + * @param outRowSplitsType the value of the outRowSplitsType property + * @param data type for {@code RaggedCross} output and operands + * @param data type for {@code RaggedCross} output and operands * @return a new instance of RaggedCross */ - @Endpoint(describeByClass = true) - public static RaggedCross create(Scope scope, Iterable> raggedValues, Iterable> raggedRowSplits, Iterable> sparseIndices, Iterable> sparseValues, Iterable> sparseShape, Iterable> denseInputs, String inputOrder, Boolean hashedOutput, Long numBuckets, Long hashKey, Class outValuesType, Class outRowSplitsType) { + @Endpoint( + describeByClass = true + ) + public static RaggedCross create(Scope scope, + Iterable> raggedValues, Iterable> raggedRowSplits, + Iterable> sparseIndices, Iterable> sparseValues, + Iterable> sparseShape, Iterable> denseInputs, String inputOrder, + Boolean hashedOutput, Long numBuckets, Long hashKey, Class outValuesType, + Class outRowSplitsType) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedCross", scope.makeOpName("RaggedCross")); opBuilder.addInputList(Operands.asOutputs(raggedValues)); opBuilder.addInputList(Operands.asOutputs(raggedRowSplits)); @@ -76,33 +100,24 @@ public static RaggedCross create(Scop opBuilder.setAttr("hash_key", hashKey); opBuilder.setAttr("out_values_type", Operands.toDataType(outValuesType)); opBuilder.setAttr("out_row_splits_type", Operands.toDataType(outRowSplitsType)); - return new RaggedCross(opBuilder.build()); + return new RaggedCross<>(opBuilder.build()); } - + /** - * The `values` for the returned `RaggedTensor`. + * Gets outputValues. + * The {@code values} for the returned {@code RaggedTensor}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** - * The `row_splits` for the returned `RaggedTensor`. + * Gets outputRowSplits. + * The {@code row_splits} for the returned {@code RaggedTensor}. + * @return outputRowSplits. */ public Output outputRowSplits() { return outputRowSplits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedCross"; - - private Output outputValues; - private Output outputRowSplits; - - private RaggedCross(Operation operation) { - super(operation); - int outputIdx = 0; - outputValues = operation.output(outputIdx++); - outputRowSplits = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedGather.java index 8cfbba1894d..036a5f252f2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedGather.java @@ -27,101 +27,103 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** - * Gather ragged slices from `params` axis `0` according to `indices`. - *

- * Outputs a `RaggedTensor` output composed from `output_dense_values` and - * `output_nested_splits`, such that: - *

{@code
+ * Gather ragged slices from {@code params} axis {@code 0} according to {@code indices}.
+ * Outputs a {@code RaggedTensor} output composed from {@code output_dense_values} and
+ * {@code output_nested_splits}, such that:
+ * 
  * output.shape = indices.shape + params.shape[1:]
  * output.ragged_rank = indices.shape.ndims + params.ragged_rank
  * output[i...j, d0...dn] = params[indices[i...j], d0...dn]
- * }
- * where + *
+ *

where *

    - *
  • - * `params = - * ragged.from_nested_row_splits(params_dense_values, params_nested_splits)` - * provides the values that should be gathered. - *
  • - *
  • - * `indices` ia a dense tensor with dtype `int32` or `int64`, indicating which - * values should be gathered. - *
  • - *
  • - * `output = - * ragged.from_nested_row_splits(output_dense_values, output_nested_splits)` - * is the output tensor. - *
  • + *
  • {@code params = ragged.from_nested_row_splits(params_dense_values, params_nested_splits)} + * provides the values that should be gathered.
  • + *
  • {@code indices} ia a dense tensor with dtype {@code int32} or {@code int64}, indicating which + * values should be gathered.
  • + *
  • {@code output = ragged.from_nested_row_splits(output_dense_values, output_nested_splits)} + * is the output tensor.
  • *
- * (Note: This c++ op is used to implement the higher-level python - * `tf.ragged.gather` op, which also supports ragged indices.) - * - * - * @param data type for {@code outputNestedSplits()} output - * @param data type for {@code outputDenseValues()} output + *

(Note: This c++ op is used to implement the higher-level python + * {@code tf.ragged.gather} op, which also supports ragged indices.) + * + * @param data type for {@code output_nested_splits} output + * + * @param data type for {@code output_dense_values} output */ public final class RaggedGather extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedGather"; + + private List> outputNestedSplits; + + private Output outputDenseValues; + + @SuppressWarnings("unchecked") + private RaggedGather(Operation operation) { + super(operation); + int outputIdx = 0; + int outputNestedSplitsLength = operation.outputListLength("output_nested_splits"); + outputNestedSplits = Arrays.asList((Output[]) operation.outputList(outputIdx, outputNestedSplitsLength)); + outputIdx += outputNestedSplitsLength; + outputDenseValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedGather operation. - * + * * @param scope current scope - * @param paramsNestedSplits The `nested_row_splits` tensors that define the row-partitioning for the - * `params` RaggedTensor input. - * @param paramsDenseValues The `flat_values` for the `params` RaggedTensor. There was a terminology change + * @param paramsNestedSplits The {@code nested_row_splits} tensors that define the row-partitioning for the + * {@code params} RaggedTensor input. + * @param paramsDenseValues The {@code flat_values} for the {@code params} RaggedTensor. There was a terminology change * at the python level from dense_values to flat_values, so dense_values is the * deprecated name. - * @param indices Indices in the outermost dimension of `params` of the values that should be + * @param indices Indices in the outermost dimension of {@code params} of the values that should be * gathered. - * @param OUTPUTRAGGEDRANK The ragged rank of the output RaggedTensor. `output_nested_splits` will contain - * this number of `row_splits` tensors. This value should equal - * `indices.shape.ndims + params.ragged_rank - 1`. + * @param OUTPUTRAGGEDRANK The ragged rank of the output RaggedTensor. {@code output_nested_splits} will contain + * this number of {@code row_splits} tensors. This value should equal + * {@code indices.shape.ndims + params.ragged_rank - 1}. + * @param data type for {@code RaggedGather} output and operands + * @param data type for {@code RaggedGather} output and operands * @return a new instance of RaggedGather */ - @Endpoint(describeByClass = true) - public static RaggedGather create(Scope scope, Iterable> paramsNestedSplits, Operand paramsDenseValues, Operand indices, Long OUTPUTRAGGEDRANK) { + @Endpoint( + describeByClass = true + ) + public static RaggedGather create(Scope scope, + Iterable> paramsNestedSplits, Operand paramsDenseValues, + Operand indices, Long OUTPUTRAGGEDRANK) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedGather", scope.makeOpName("RaggedGather")); opBuilder.addInputList(Operands.asOutputs(paramsNestedSplits)); opBuilder.addInput(paramsDenseValues.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("OUTPUT_RAGGED_RANK", OUTPUTRAGGEDRANK); - return new RaggedGather(opBuilder.build()); + return new RaggedGather<>(opBuilder.build()); } - + /** - * The `nested_row_splits` tensors that define the row-partitioning for the + * Gets outputNestedSplits. + * The {@code nested_row_splits} tensors that define the row-partitioning for the * returned RaggedTensor. + * @return outputNestedSplits. */ public List> outputNestedSplits() { return outputNestedSplits; } - + /** - * The `flat_values` for the returned RaggedTensor. + * Gets outputDenseValues. + * The {@code flat_values} for the returned RaggedTensor. + * @return outputDenseValues. */ public Output outputDenseValues() { return outputDenseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedGather"; - - private List> outputNestedSplits; - private Output outputDenseValues; - - @SuppressWarnings("unchecked") - private RaggedGather(Operation operation) { - super(operation); - int outputIdx = 0; - int outputNestedSplitsLength = operation.outputListLength("output_nested_splits"); - outputNestedSplits = Arrays.asList((Output[])operation.outputList(outputIdx, outputNestedSplitsLength)); - outputIdx += outputNestedSplitsLength; - outputDenseValues = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedRange.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedRange.java index 67df6a76a63..d842da7dd53 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedRange.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedRange.java @@ -25,92 +25,105 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** - * Returns a `RaggedTensor` containing the specified sequences of numbers. - *

- * - * Returns a `RaggedTensor` `result` composed from `rt_dense_values` and - * `rt_nested_splits`, such that - * `result[i] = range(starts[i], limits[i], deltas[i])`. - *

{@code
+ * Returns a {@code RaggedTensor} containing the specified sequences of numbers.
+ * Returns a {@code RaggedTensor} {@code result} composed from {@code rt_dense_values} and
+ * {@code rt_nested_splits}, such that
+ * {@code result[i] = range(starts[i], limits[i], deltas[i])}.
+ * 
  * (rt_nested_splits, rt_dense_values) = ragged_range(
  *       starts=[2, 5, 8], limits=[3, 5, 12], deltas=1)
  * result = tf.ragged.from_row_splits(rt_dense_values, rt_nested_splits)
  * print(result)
- * 
- * }
- * The input tensors `starts`, `limits`, and `deltas` may be scalars or vectors. + * <tf.RaggedTensor [[2], [], [8, 9, 10, 11]] > + *
+ *

The input tensors {@code starts}, {@code limits}, and {@code deltas} may be scalars or vectors. * The vector inputs must all have the same size. Scalar inputs are broadcast * to match the size of the vector inputs. - * - * @param data type for {@code rtNestedSplits()} output - * @param data type for {@code rtDenseValues()} output + * + * @param data type for {@code rt_nested_splits} output + * + * @param data type for {@code rt_dense_values} output */ public final class RaggedRange extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedRange"; + + private Output rtNestedSplits; + + private Output rtDenseValues; + + private RaggedRange(Operation operation) { + super(operation); + int outputIdx = 0; + rtNestedSplits = operation.output(outputIdx++); + rtDenseValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedRange operation. - * + * * @param scope current scope * @param starts The starts of each range. * @param limits The limits of each range. * @param deltas The deltas of each range. - * @param Tsplits + * @param Tsplits the value of the Tsplits property + * @param data type for {@code RaggedRange} output and operands + * @param data type for {@code RaggedRange} output and operands * @return a new instance of RaggedRange */ - @Endpoint(describeByClass = true) - public static RaggedRange create(Scope scope, Operand starts, Operand limits, Operand deltas, Class Tsplits) { + @Endpoint( + describeByClass = true + ) + public static RaggedRange create(Scope scope, + Operand starts, Operand limits, Operand deltas, Class Tsplits) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedRange", scope.makeOpName("RaggedRange")); opBuilder.addInput(starts.asOutput()); opBuilder.addInput(limits.asOutput()); opBuilder.addInput(deltas.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tsplits", Operands.toDataType(Tsplits)); - return new RaggedRange(opBuilder.build()); + return new RaggedRange<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new RaggedRange operation using default output types. - * + * Factory method to create a class wrapping a new RaggedRange operation, with the default output types. + * * @param scope current scope * @param starts The starts of each range. * @param limits The limits of each range. * @param deltas The deltas of each range. - * @return a new instance of RaggedRange + * @param data type for {@code RaggedRange} output and operands + * @return a new instance of RaggedRange, with default output types */ - @Endpoint(describeByClass = true) - public static RaggedRange create(Scope scope, Operand starts, Operand limits, Operand deltas) { + @Endpoint( + describeByClass = true + ) + public static RaggedRange create(Scope scope, Operand starts, + Operand limits, Operand deltas) { return create(scope, starts, limits, deltas, TInt64.class); } - + /** - * The `row_splits` for the returned `RaggedTensor`. + * Gets rtNestedSplits. + * The {@code row_splits} for the returned {@code RaggedTensor}. + * @return rtNestedSplits. */ public Output rtNestedSplits() { return rtNestedSplits; } - + /** - * The `flat_values` for the returned `RaggedTensor`. + * Gets rtDenseValues. + * The {@code flat_values} for the returned {@code RaggedTensor}. + * @return rtDenseValues. */ public Output rtDenseValues() { return rtDenseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedRange"; - - private Output rtNestedSplits; - private Output rtDenseValues; - - private RaggedRange(Operation operation) { - super(operation); - int outputIdx = 0; - rtNestedSplits = operation.output(outputIdx++); - rtDenseValues = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorFromVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorFromVariant.java index f58a5ca64f3..830b73899f2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorFromVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorFromVariant.java @@ -27,47 +27,69 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** - * Decodes a `variant` Tensor into a `RaggedTensor`. - *

- * Decodes the given `variant` Tensor and returns a `RaggedTensor`. The input - * could be a scalar, meaning it encodes a single `RaggedTensor` with ragged_rank - * `output_ragged_rank`. It could also have an arbitrary rank, in which case each - * element is decoded into a `RaggedTensor` with ragged_rank `input_ragged_rank` + * Decodes a {@code variant} Tensor into a {@code RaggedTensor}. + * Decodes the given {@code variant} Tensor and returns a {@code RaggedTensor}. The input + * could be a scalar, meaning it encodes a single {@code RaggedTensor} with ragged_rank + * {@code output_ragged_rank}. It could also have an arbitrary rank, in which case each + * element is decoded into a {@code RaggedTensor} with ragged_rank {@code input_ragged_rank} * and these are then stacked according to the input shape to output a single - * `RaggedTensor` with ragged_rank `output_ragged_rank`. Each `variant` element in - * the input Tensor is decoded by retrieving from the element a 1-D `variant` - * Tensor with `input_ragged_rank + 1` Tensors, corresponding to the splits and - * values of the decoded `RaggedTensor`. If `input_ragged_rank` is -1, then it is - * inferred as `output_ragged_rank` - `rank(encoded_ragged)`. See - * `RaggedTensorToVariant` for the corresponding encoding logic. - * - * - * @param data type for {@code outputNestedSplits()} output - * @param data type for {@code outputDenseValues()} output + * {@code RaggedTensor} with ragged_rank {@code output_ragged_rank}. Each {@code variant} element in + * the input Tensor is decoded by retrieving from the element a 1-D {@code variant} + * Tensor with {@code input_ragged_rank + 1} Tensors, corresponding to the splits and + * values of the decoded {@code RaggedTensor}. If {@code input_ragged_rank} is -1, then it is + * inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)}. See + * {@code RaggedTensorToVariant} for the corresponding encoding logic. + * + * @param data type for {@code output_nested_splits} output + * + * @param data type for {@code output_dense_values} output */ -public final class RaggedTensorFromVariant extends RawOp { - +public final class RaggedTensorFromVariant extends RawOp { + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedTensorFromVariant"; + + private List> outputNestedSplits; + + private Output outputDenseValues; + + @SuppressWarnings("unchecked") + private RaggedTensorFromVariant(Operation operation) { + super(operation); + int outputIdx = 0; + int outputNestedSplitsLength = operation.outputListLength("output_nested_splits"); + outputNestedSplits = Arrays.asList((Output[]) operation.outputList(outputIdx, outputNestedSplitsLength)); + outputIdx += outputNestedSplitsLength; + outputDenseValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorFromVariant operation. - * + * * @param scope current scope - * @param encodedRagged A `variant` Tensor containing encoded `RaggedTensor`s. - * @param inputRaggedRank The ragged rank of each encoded `RaggedTensor` component in the input. If set to - * -1, this is inferred as `output_ragged_rank` - `rank(encoded_ragged)` - * @param outputRaggedRank The expected ragged rank of the output `RaggedTensor`. The following must hold: - * `output_ragged_rank = rank(encoded_ragged) + input_ragged_rank`. - * @param Tvalues - * @param Tsplits + * @param encodedRagged A {@code variant} Tensor containing encoded {@code RaggedTensor}s. + * @param inputRaggedRank The ragged rank of each encoded {@code RaggedTensor} component in the input. If set to + * -1, this is inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)} + * @param outputRaggedRank The expected ragged rank of the output {@code RaggedTensor}. The following must hold: + * {@code output_ragged_rank = rank(encoded_ragged) + input_ragged_rank}. + * @param Tvalues the value of the Tvalues property + * @param Tsplits the value of the Tsplits property + * @param data type for {@code RaggedTensorFromVariant} output and operands + * @param data type for {@code RaggedTensorFromVariant} output and operands * @return a new instance of RaggedTensorFromVariant */ - @Endpoint(describeByClass = true) - public static RaggedTensorFromVariant create(Scope scope, Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, Class Tvalues, Class Tsplits) { + @Endpoint( + describeByClass = true + ) + public static RaggedTensorFromVariant create( + Scope scope, Operand encodedRagged, Long inputRaggedRank, + Long outputRaggedRank, Class Tvalues, Class Tsplits) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorFromVariant", scope.makeOpName("RaggedTensorFromVariant")); opBuilder.addInput(encodedRagged.asOutput()); opBuilder = scope.apply(opBuilder); @@ -75,54 +97,47 @@ public static RaggedTensorFromVariant opBuilder.setAttr("output_ragged_rank", outputRaggedRank); opBuilder.setAttr("Tvalues", Operands.toDataType(Tvalues)); opBuilder.setAttr("Tsplits", Operands.toDataType(Tsplits)); - return new RaggedTensorFromVariant(opBuilder.build()); + return new RaggedTensorFromVariant<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new RaggedTensorFromVariant operation using default output types. - * + * Factory method to create a class wrapping a new RaggedTensorFromVariant operation, with the default output types. + * * @param scope current scope - * @param encodedRagged A `variant` Tensor containing encoded `RaggedTensor`s. - * @param inputRaggedRank The ragged rank of each encoded `RaggedTensor` component in the input. If set to - * -1, this is inferred as `output_ragged_rank` - `rank(encoded_ragged)` - * @param outputRaggedRank The expected ragged rank of the output `RaggedTensor`. The following must hold: - * `output_ragged_rank = rank(encoded_ragged) + input_ragged_rank`. - * @param Tvalues - * @return a new instance of RaggedTensorFromVariant + * @param encodedRagged A {@code variant} Tensor containing encoded {@code RaggedTensor}s. + * @param inputRaggedRank The ragged rank of each encoded {@code RaggedTensor} component in the input. If set to + * -1, this is inferred as {@code output_ragged_rank} - {@code rank(encoded_ragged)} + * @param outputRaggedRank The expected ragged rank of the output {@code RaggedTensor}. The following must hold: + * {@code output_ragged_rank = rank(encoded_ragged) + input_ragged_rank}. + * @param Tvalues the value of the Tvalues property + * @param data type for {@code RaggedTensorFromVariant} output and operands + * @return a new instance of RaggedTensorFromVariant, with default output types */ - @Endpoint(describeByClass = true) - public static RaggedTensorFromVariant create(Scope scope, Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, Class Tvalues) { + @Endpoint( + describeByClass = true + ) + public static RaggedTensorFromVariant create(Scope scope, + Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, + Class Tvalues) { return create(scope, encodedRagged, inputRaggedRank, outputRaggedRank, Tvalues, TInt64.class); } - + /** + * Gets outputNestedSplits. * A list of one or more Tensors representing the splits of the output - * `RaggedTensor`. + * {@code RaggedTensor}. + * @return outputNestedSplits. */ - public List> outputNestedSplits() { + public List> outputNestedSplits() { return outputNestedSplits; } - + /** - * A Tensor representing the values of the output `RaggedTensor`. + * Gets outputDenseValues. + * A Tensor representing the values of the output {@code RaggedTensor}. + * @return outputDenseValues. */ - public Output outputDenseValues() { + public Output outputDenseValues() { return outputDenseValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorFromVariant"; - - private List> outputNestedSplits; - private Output outputDenseValues; - - @SuppressWarnings("unchecked") - private RaggedTensorFromVariant(Operation operation) { - super(operation); - int outputIdx = 0; - int outputNestedSplitsLength = operation.outputListLength("output_nested_splits"); - outputNestedSplits = Arrays.asList((Output[])operation.outputList(outputIdx, outputNestedSplitsLength)); - outputIdx += outputNestedSplitsLength; - outputDenseValues = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToSparse.java index a67a72e1687..8b0b91bbcf1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToSparse.java @@ -25,72 +25,83 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** - * Converts a `RaggedTensor` into a `SparseTensor` with the same values. - *

+ * Converts a {@code RaggedTensor} into a {@code SparseTensor} with the same values. * input=ragged.from_nested_row_splits(rt_dense_values, rt_nested_splits) * output=SparseTensor(indices=sparse_indices, values=sparse_values, - * dense_shape=sparse_dense_shape) - * - * @param data type for {@code sparseValues()} output + * dense_shape=sparse_dense_shape) + * + * @param data type for {@code sparse_values} output */ public final class RaggedTensorToSparse extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedTensorToSparse"; + + private Output sparseIndices; + + private Output sparseValues; + + private Output sparseDenseShape; + + private RaggedTensorToSparse(Operation operation) { + super(operation); + int outputIdx = 0; + sparseIndices = operation.output(outputIdx++); + sparseValues = operation.output(outputIdx++); + sparseDenseShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorToSparse operation. - * + * * @param scope current scope - * @param rtNestedSplits The `row_splits` for the `RaggedTensor`. - * @param rtDenseValues The `flat_values` for the `RaggedTensor`. + * @param rtNestedSplits The {@code row_splits} for the {@code RaggedTensor}. + * @param rtDenseValues The {@code flat_values} for the {@code RaggedTensor}. + * @param data type for {@code RaggedTensorToSparse} output and operands * @return a new instance of RaggedTensorToSparse */ - @Endpoint(describeByClass = true) - public static RaggedTensorToSparse create(Scope scope, Iterable> rtNestedSplits, Operand rtDenseValues) { + @Endpoint( + describeByClass = true + ) + public static RaggedTensorToSparse create(Scope scope, + Iterable> rtNestedSplits, Operand rtDenseValues) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorToSparse", scope.makeOpName("RaggedTensorToSparse")); opBuilder.addInputList(Operands.asOutputs(rtNestedSplits)); opBuilder.addInput(rtDenseValues.asOutput()); opBuilder = scope.apply(opBuilder); - return new RaggedTensorToSparse(opBuilder.build()); + return new RaggedTensorToSparse<>(opBuilder.build()); } - + /** - * The indices for the `SparseTensor`. + * Gets sparseIndices. + * The indices for the {@code SparseTensor}. + * @return sparseIndices. */ public Output sparseIndices() { return sparseIndices; } - + /** - * The values of the `SparseTensor`. + * Gets sparseValues. + * The values of the {@code SparseTensor}. + * @return sparseValues. */ public Output sparseValues() { return sparseValues; } - + /** - * `sparse_dense_shape` is a tight bounding box of the input `RaggedTensor`. + * Gets sparseDenseShape. + * {@code sparse_dense_shape} is a tight bounding box of the input {@code RaggedTensor}. + * @return sparseDenseShape. */ public Output sparseDenseShape() { return sparseDenseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorToSparse"; - - private Output sparseIndices; - private Output sparseValues; - private Output sparseDenseShape; - - private RaggedTensorToSparse(Operation operation) { - super(operation); - int outputIdx = 0; - sparseIndices = operation.output(outputIdx++); - sparseValues = operation.output(outputIdx++); - sparseDenseShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToTensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToTensor.java index 5fdddc476b7..6386ed591b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToTensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToTensor.java @@ -26,87 +26,88 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Create a dense tensor from a ragged tensor, possibly altering its shape. - *

- * The `ragged_to_dense` op creates a dense tensor from a list of row partition + * The {@code ragged_to_dense} op creates a dense tensor from a list of row partition * tensors, a value vector, and default values. If the shape is unspecified, the * minimal shape required to contain all the elements in the ragged tensor (the * natural shape) will be used. If some dimensions are left unspecified, then the * size of the natural shape is used in that dimension. - *

- * The default_value will be broadcast to the output shape. After that, the values + *

The default_value will be broadcast to the output shape. After that, the values * from the ragged tensor overwrite the default values. Note that the default_value * must have less dimensions than the value. - *

- * The row partition tensors are in the order of the dimensions. + *

The row partition tensors are in the order of the dimensions. * At present, the types can be: *

    - *
  • - * "ROW_SPLITS": the row_splits tensor from the ragged tensor. - *
  • - *
  • - * "VALUE_ROWIDS": the value_rowids tensor from the ragged tensor. - *
  • - *
  • - * "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then it - * is preceded by "FIRST_DIM_SIZE". - * - * @param data type for {@code result()} output + *
  • "ROW_SPLITS": the row_splits tensor from the ragged tensor.
  • + *
  • "VALUE_ROWIDS": the value_rowids tensor from the ragged tensor.
  • + *
  • "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then it + * is preceded by "FIRST_DIM_SIZE".
  • + *
+ * + * @param data type for {@code result} output */ public final class RaggedTensorToTensor extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedTensorToTensor"; + + private Output result; + + private RaggedTensorToTensor(Operation operation) { + super(operation); + int outputIdx = 0; + result = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorToTensor operation. - * + * * @param scope current scope * @param shape The desired shape of the the output tensor. If left unspecified (empty), * the minimal shape required to contain all the elements in the ragged tensor * (the natural shape) will be used. If some dimensions are left unspecified, then * the size of the natural shape is used in that dimension. - *

- * Note that dense dimensions cannot be modified by the shape argument. Trying to + *

Note that dense dimensions cannot be modified by the shape argument. Trying to * change the size of a dense dimension will cause the op to fail. * Examples: * natural shape: [4, 5, 6] * shape: -1 * output shape: [4, 5, 6] - *

- * natural shape: [4, 5, 6] + *

natural shape: [4, 5, 6] * shape: [3, -1, 2] * output shape: [3, 5, 2] - *

- * natural shape: [4, 5, 6] + *

natural shape: [4, 5, 6] * shape: [3, 7, 2] * output shape: [3, 7, 2] - * * @param values A 1D tensor representing the values of the ragged tensor. * @param defaultValue The default_value when the shape is larger than the ragged tensor. The * default_value is broadcast until it is the shape of the output tensor, and * then overwritten by values in the ragged tensor. The default value must be * compatible with this broadcast operation, and must have fewer dimensions than * the value tensor. - * @param rowPartitionTensors + * @param rowPartitionTensors the rowPartitionTensors value * @param rowPartitionTypes The types of the row partition tensors. At present, these can be: *

    - *
  • - * "ROW_SPLITS": the row_splits tensor from the ragged tensor. - *
  • - *
  • - * "VALUE_ROWIDS": the value_rowids tensor from the ragged tensor. - *
  • - *
  • - * "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then it - * is preceeded by "FIRST_DIM_SIZE". - * The tensors are in the order of the dimensions. + *
  • "ROW_SPLITS": the row_splits tensor from the ragged tensor.
  • + *
  • "VALUE_ROWIDS": the value_rowids tensor from the ragged tensor.
  • + *
  • "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then it + * is preceeded by "FIRST_DIM_SIZE". + * The tensors are in the order of the dimensions.
  • + *
+ * @param data type for {@code RaggedTensorToTensor} output and operands * @return a new instance of RaggedTensorToTensor */ - @Endpoint(describeByClass = true) - public static RaggedTensorToTensor create(Scope scope, Operand shape, Operand values, Operand defaultValue, Iterable> rowPartitionTensors, List rowPartitionTypes) { + @Endpoint( + describeByClass = true + ) + public static RaggedTensorToTensor create(Scope scope, + Operand shape, Operand values, Operand defaultValue, + Iterable> rowPartitionTensors, List rowPartitionTypes) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorToTensor", scope.makeOpName("RaggedTensorToTensor")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(values.asOutput()); @@ -114,33 +115,24 @@ public static RaggedTensorToTensor creat opBuilder.addInputList(Operands.asOutputs(rowPartitionTensors)); opBuilder = scope.apply(opBuilder); String[] rowPartitionTypesArray = new String[rowPartitionTypes.size()]; - for (int i = 0; i < rowPartitionTypesArray.length; ++i) { + for (int i = 0 ; i < rowPartitionTypesArray.length ; i++) { rowPartitionTypesArray[i] = rowPartitionTypes.get(i); } opBuilder.setAttr("row_partition_types", rowPartitionTypesArray); - return new RaggedTensorToTensor(opBuilder.build()); + return new RaggedTensorToTensor<>(opBuilder.build()); } - + /** + * Gets result. * The resulting dense tensor. + * @return result. */ public Output result() { return result; } - + @Override public Output asOutput() { return result; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorToTensor"; - - private Output result; - - private RaggedTensorToTensor(Operation operation) { - super(operation); - int outputIdx = 0; - result = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariant.java index fa4799f3513..52385b1cf29 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariant.java @@ -25,40 +25,53 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** - * Encodes a `RaggedTensor` into a `variant` Tensor. - *

- * - * Encodes the given `RaggedTensor` and returns a `variant` Tensor. If - * `batched_input` is True, then input `RaggedTensor` is unbatched along the - * zero-th dimension, each component `RaggedTensor` is encoded into a scalar - * `variant` Tensor, and these are stacked to return a 1-D `variant` Tensor. - * If `batched_input` is False, then the input `RaggedTensor` is encoded as is and - * a scalar `variant` Tensor is returned. A `RaggedTensor` is encoded by first - * creating a 1-D `variant` Tensor with `ragged_rank + 1` elements, containing the - * splits and values Tensors of the `RaggedTensor`. Then the 1-D `variant` Tensor - * is wrapped in a scalar `variant` Tensor. See `RaggedTensorFromVariant` for the + * Encodes a {@code RaggedTensor} into a {@code variant} Tensor. + * Encodes the given {@code RaggedTensor} and returns a {@code variant} Tensor. If + * {@code batched_input} is True, then input {@code RaggedTensor} is unbatched along the + * zero-th dimension, each component {@code RaggedTensor} is encoded into a scalar + * {@code variant} Tensor, and these are stacked to return a 1-D {@code variant} Tensor. + * If {@code batched_input} is False, then the input {@code RaggedTensor} is encoded as is and + * a scalar {@code variant} Tensor is returned. A {@code RaggedTensor} is encoded by first + * creating a 1-D {@code variant} Tensor with {@code ragged_rank + 1} elements, containing the + * splits and values Tensors of the {@code RaggedTensor}. Then the 1-D {@code variant} Tensor + * is wrapped in a scalar {@code variant} Tensor. See {@code RaggedTensorFromVariant} for the * corresponding decoding logic. - * */ public final class RaggedTensorToVariant extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedTensorToVariant"; + + private Output encodedRagged; + + @SuppressWarnings("unchecked") + private RaggedTensorToVariant(Operation operation) { + super(operation); + int outputIdx = 0; + encodedRagged = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorToVariant operation. - * + * * @param scope current scope * @param rtNestedSplits A list of one or more Tensors representing the splits of the input - * `RaggedTensor`. - * @param rtDenseValues A Tensor representing the values of the input `RaggedTensor`. - * @param batchedInput A `bool` denoting whether the input is a batched `RaggedTensor`. + * {@code RaggedTensor}. + * @param rtDenseValues A Tensor representing the values of the input {@code RaggedTensor}. + * @param batchedInput A {@code bool} denoting whether the input is a batched {@code RaggedTensor}. * @return a new instance of RaggedTensorToVariant */ - @Endpoint(describeByClass = true) - public static RaggedTensorToVariant create(Scope scope, Iterable> rtNestedSplits, Operand rtDenseValues, Boolean batchedInput) { + @Endpoint( + describeByClass = true + ) + public static RaggedTensorToVariant create(Scope scope, + Iterable> rtNestedSplits, Operand rtDenseValues, + Boolean batchedInput) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorToVariant", scope.makeOpName("RaggedTensorToVariant")); opBuilder.addInputList(Operands.asOutputs(rtNestedSplits)); opBuilder.addInput(rtDenseValues.asOutput()); @@ -66,28 +79,19 @@ public static RaggedTensorToVariant create(Scope scope, Iter opBuilder.setAttr("batched_input", batchedInput); return new RaggedTensorToVariant(opBuilder.build()); } - + /** - * A `variant` Tensor that containing encoded `RaggedTensor`. + * Gets encodedRagged. + * A {@code variant} Tensor that containing encoded {@code RaggedTensor}. + * @return encodedRagged. */ - public Output encodedRagged() { + public Output encodedRagged() { return encodedRagged; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) encodedRagged; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorToVariant"; - - private Output encodedRagged; - - private RaggedTensorToVariant(Operation operation) { - super(operation); - int outputIdx = 0; - encodedRagged = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariantGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariantGradient.java index b753910f048..ae33a6e778a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariantGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/ragged/RaggedTensorToVariantGradient.java @@ -25,65 +25,71 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** - * Helper used to compute the gradient for `RaggedTensorToVariant`. - *

+ * Helper used to compute the gradient for {@code RaggedTensorToVariant}. * Computes the gradient for the dense_values input to the RaggedTensorToVariant * op, given the variant-encoded ragged gradients of the outputs, along with * the outer row-splits and the shape of the dense-values that were provided as * inputs to the RaggedTensorToVariant op. - * - * @param data type for {@code denseValuesGrad()} output + * + * @param data type for {@code dense_values_grad} output */ public final class RaggedTensorToVariantGradient extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RaggedTensorToVariantGradient"; + + private Output denseValuesGrad; + + private RaggedTensorToVariantGradient(Operation operation) { + super(operation); + int outputIdx = 0; + denseValuesGrad = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RaggedTensorToVariantGradient operation. - * + * * @param scope current scope - * @param encodedRaggedGrad A `variant` Tensor containing encoded `RaggedTensor` gradients. + * @param encodedRaggedGrad A {@code variant} Tensor containing encoded {@code RaggedTensor} gradients. * @param rowSplits Outermost row-splits that were used as input to the RaggedTensorToVariant op. * @param denseValuesShape Shape of the dense_values that was used as an input to the * RaggedTensorToVariant op. - * @param Tvalues + * @param Tvalues the value of the Tvalues property + * @param data type for {@code RaggedTensorToVariantGradient} output and operands * @return a new instance of RaggedTensorToVariantGradient */ - @Endpoint(describeByClass = true) - public static RaggedTensorToVariantGradient create(Scope scope, Operand encodedRaggedGrad, Operand rowSplits, Operand denseValuesShape, Class Tvalues) { + @Endpoint( + describeByClass = true + ) + public static RaggedTensorToVariantGradient create(Scope scope, + Operand encodedRaggedGrad, Operand rowSplits, + Operand denseValuesShape, Class Tvalues) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorToVariantGradient", scope.makeOpName("RaggedTensorToVariantGradient")); opBuilder.addInput(encodedRaggedGrad.asOutput()); opBuilder.addInput(rowSplits.asOutput()); opBuilder.addInput(denseValuesShape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tvalues", Operands.toDataType(Tvalues)); - return new RaggedTensorToVariantGradient(opBuilder.build()); + return new RaggedTensorToVariantGradient<>(opBuilder.build()); } - + /** + * Gets denseValuesGrad. * Gradient for the dense_values of the RaggedTensorToVariant op. + * @return denseValuesGrad. */ public Output denseValuesGrad() { return denseValuesGrad; } - + @Override public Output asOutput() { return denseValuesGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RaggedTensorToVariantGradient"; - - private Output denseValuesGrad; - - private RaggedTensorToVariantGradient(Operation operation) { - super(operation); - int outputIdx = 0; - denseValuesGrad = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AllCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AllCandidateSampler.java index 5ceef808b8d..ec4700fa695 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AllCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AllCandidateSampler.java @@ -30,53 +30,40 @@ /** * 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. */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class AllCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.random.AllCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either seed or seed2 are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "AllCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + private AllCandidateSampler(Operation operation) { + super(operation); + int outputIdx = 0; + sampledCandidates = operation.output(outputIdx++); + trueExpectedCount = operation.output(outputIdx++); + sampledExpectedCount = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AllCandidateSampler operation. - * + * * @param scope current scope * @param trueClasses A batch_size * num_true matrix, in which each row contains the * IDs of the num_true target_classes in the corresponding original label. @@ -85,11 +72,14 @@ private Options() { * @param unique If unique is true, we sample with rejection, so that all sampled * candidates in a batch are unique. This requires some approximation to * estimate the post-rejection sampling probabilities. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AllCandidateSampler */ - @Endpoint(describeByClass = true) - public static AllCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AllCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, + Long numSampled, Boolean unique, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AllCandidateSampler", scope.makeOpName("AllCandidateSampler")); opBuilder.addInput(trueClasses.asOutput()); opBuilder = scope.apply(opBuilder); @@ -108,62 +98,95 @@ public static AllCandidateSampler create(Scope scope, Operand trueClasse } return new AllCandidateSampler(opBuilder.build()); } - + /** + * Sets the seed option. + * * @param seed If either seed or seed2 are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets sampledCandidates. * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. + * @return sampledCandidates. */ public Output sampledCandidates() { return sampledCandidates; } - + /** + * Gets trueExpectedCount. * A batch_size * num_true matrix, representing * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. + * @return trueExpectedCount. */ public Output trueExpectedCount() { return trueExpectedCount; } - + /** + * Gets sampledExpectedCount. * A vector of length num_sampled, for each sampled * candidate representing the number of times the candidate is expected * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. + * @return sampledExpectedCount. */ public Output sampledExpectedCount() { return sampledExpectedCount; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AllCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private AllCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.AllCandidateSampler} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousRandomSeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousRandomSeedGenerator.java index 3409545d91e..7081ec18ef8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousRandomSeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousRandomSeedGenerator.java @@ -24,52 +24,65 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** + * The AnonymousRandomSeedGenerator operation */ public final class AnonymousRandomSeedGenerator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousRandomSeedGenerator"; + + private Output handle; + + private Output deleter; + + @SuppressWarnings("unchecked") + private AnonymousRandomSeedGenerator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + deleter = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AnonymousRandomSeedGenerator operation. - * + * * @param scope current scope - * @param seed - * @param seed2 + * @param seed the seed value + * @param seed2 the seed2 value * @return a new instance of AnonymousRandomSeedGenerator */ - @Endpoint(describeByClass = true) - public static AnonymousRandomSeedGenerator create(Scope scope, Operand seed, Operand seed2) { + @Endpoint( + describeByClass = true + ) + public static AnonymousRandomSeedGenerator create(Scope scope, Operand seed, + Operand seed2) { OperationBuilder opBuilder = scope.env().opBuilder("AnonymousRandomSeedGenerator", scope.makeOpName("AnonymousRandomSeedGenerator")); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); opBuilder = scope.apply(opBuilder); return new AnonymousRandomSeedGenerator(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets deleter. + * + * @return deleter. */ - public Output deleter() { + public Output deleter() { return deleter; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousRandomSeedGenerator"; - - private Output handle; - private Output deleter; - - private AnonymousRandomSeedGenerator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousSeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousSeedGenerator.java index 56c49e0d2ef..11a128fb80a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousSeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/AnonymousSeedGenerator.java @@ -24,25 +24,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** + * The AnonymousSeedGenerator operation */ public final class AnonymousSeedGenerator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AnonymousSeedGenerator"; + + private Output handle; + + private Output deleter; + + @SuppressWarnings("unchecked") + private AnonymousSeedGenerator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + deleter = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AnonymousSeedGenerator operation. - * + * * @param scope current scope - * @param seed - * @param seed2 - * @param reshuffle + * @param seed the seed value + * @param seed2 the seed2 value + * @param reshuffle the reshuffle value * @return a new instance of AnonymousSeedGenerator */ - @Endpoint(describeByClass = true) - public static AnonymousSeedGenerator create(Scope scope, Operand seed, Operand seed2, Operand reshuffle) { + @Endpoint( + describeByClass = true + ) + public static AnonymousSeedGenerator create(Scope scope, Operand seed, + Operand seed2, Operand reshuffle) { OperationBuilder opBuilder = scope.env().opBuilder("AnonymousSeedGenerator", scope.makeOpName("AnonymousSeedGenerator")); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); @@ -50,29 +70,22 @@ public static AnonymousSeedGenerator create(Scope scope, Operand seed, O opBuilder = scope.apply(opBuilder); return new AnonymousSeedGenerator(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + /** + * Gets deleter. + * + * @return deleter. */ - public Output deleter() { + public Output deleter() { return deleter; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AnonymousSeedGenerator"; - - private Output handle; - private Output deleter; - - private AnonymousSeedGenerator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - deleter = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteRandomSeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteRandomSeedGenerator.java index 3dcd1320b52..60600eab717 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteRandomSeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteRandomSeedGenerator.java @@ -23,33 +23,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** + * The DeleteRandomSeedGenerator operation */ public final class DeleteRandomSeedGenerator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeleteRandomSeedGenerator"; + + private DeleteRandomSeedGenerator(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new DeleteRandomSeedGenerator operation. - * + * * @param scope current scope - * @param handle - * @param deleter + * @param handle the handle value + * @param deleter the deleter value * @return a new instance of DeleteRandomSeedGenerator */ - @Endpoint(describeByClass = true) - public static DeleteRandomSeedGenerator create(Scope scope, Operand handle, Operand deleter) { + @Endpoint( + describeByClass = true + ) + public static DeleteRandomSeedGenerator create(Scope scope, Operand handle, + Operand deleter) { OperationBuilder opBuilder = scope.env().opBuilder("DeleteRandomSeedGenerator", scope.makeOpName("DeleteRandomSeedGenerator")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(deleter.asOutput()); opBuilder = scope.apply(opBuilder); return new DeleteRandomSeedGenerator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteRandomSeedGenerator"; - - private DeleteRandomSeedGenerator(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteSeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteSeedGenerator.java index 7bf6ecac561..663529c7ee3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteSeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/DeleteSeedGenerator.java @@ -23,33 +23,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** + * The DeleteSeedGenerator operation */ public final class DeleteSeedGenerator extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeleteSeedGenerator"; + + private DeleteSeedGenerator(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new DeleteSeedGenerator operation. - * + * * @param scope current scope - * @param handle - * @param deleter + * @param handle the handle value + * @param deleter the deleter value * @return a new instance of DeleteSeedGenerator */ - @Endpoint(describeByClass = true) - public static DeleteSeedGenerator create(Scope scope, Operand handle, Operand deleter) { + @Endpoint( + describeByClass = true + ) + public static DeleteSeedGenerator create(Scope scope, Operand handle, + Operand deleter) { OperationBuilder opBuilder = scope.env().opBuilder("DeleteSeedGenerator", scope.makeOpName("DeleteSeedGenerator")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(deleter.asOutput()); opBuilder = scope.apply(opBuilder); return new DeleteSeedGenerator(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeleteSeedGenerator"; - - private DeleteSeedGenerator(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/LogUniformCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/LogUniformCandidateSampler.java index 4beb87660ef..617175b4152 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/LogUniformCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/LogUniformCandidateSampler.java @@ -30,53 +30,40 @@ /** * Generates labels for candidate sampling with a log-uniform 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. */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class LogUniformCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.random.LogUniformCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either seed or seed2 are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "LogUniformCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + private LogUniformCandidateSampler(Operation operation) { + super(operation); + int outputIdx = 0; + sampledCandidates = operation.output(outputIdx++); + trueExpectedCount = operation.output(outputIdx++); + sampledExpectedCount = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new LogUniformCandidateSampler operation. - * + * * @param scope current scope * @param trueClasses A batch_size * num_true matrix, in which each row contains the * IDs of the num_true target_classes in the corresponding original label. @@ -86,11 +73,14 @@ private Options() { * 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 LogUniformCandidateSampler */ - @Endpoint(describeByClass = true) - public static LogUniformCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LogUniformCandidateSampler create(Scope scope, Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LogUniformCandidateSampler", scope.makeOpName("LogUniformCandidateSampler")); opBuilder.addInput(trueClasses.asOutput()); opBuilder = scope.apply(opBuilder); @@ -110,62 +100,95 @@ public static LogUniformCandidateSampler create(Scope scope, Operand tru } return new LogUniformCandidateSampler(opBuilder.build()); } - + /** + * Sets the seed option. + * * @param seed If either seed or seed2 are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets sampledCandidates. * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. + * @return sampledCandidates. */ public Output sampledCandidates() { return sampledCandidates; } - + /** + * Gets trueExpectedCount. * A batch_size * num_true matrix, representing * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. + * @return trueExpectedCount. */ public Output trueExpectedCount() { return trueExpectedCount; } - + /** + * Gets sampledExpectedCount. * A vector of length num_sampled, for each sampled * candidate representing the number of times the candidate is expected * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. + * @return sampledExpectedCount. */ public Output sampledExpectedCount() { return sampledExpectedCount; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LogUniformCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private LogUniformCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.LogUniformCandidateSampler} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java index 2122358b803..123a5de9e16 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/Multinomial.java @@ -32,54 +32,44 @@ /** * Draws samples from a multinomial distribution. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class Multinomial extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.Multinomial} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either seed or seed2 is set to be non-zero, the internal random number - * generator is seeded by the given seed. Otherwise, a random seed is used. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "Multinomial"; + + private Output output; + + private Multinomial(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Multinomial operation. - * + * * @param scope current scope - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @param logits 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. - * @param outputDtype - * @param options carries optional attributes values + * @param outputDtype the value of the outputDtype property + * @param options carries optional attribute values + * @param data type for {@code Multinomial} output and operands * @return a new instance of Multinomial */ - @Endpoint(describeByClass = true) - public static Multinomial create(Scope scope, Operand logits, Operand numSamples, Class outputDtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Multinomial create(Scope scope, + Operand logits, Operand numSamples, Class outputDtype, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Multinomial", scope.makeOpName("Multinomial")); opBuilder.addInput(logits.asOutput()); opBuilder.addInput(numSamples.asOutput()); @@ -95,60 +85,95 @@ public static Multinomial create(Scope scope, Operand(opBuilder.build()); + return new Multinomial<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Multinomial operation using default output types. - * + * Factory method to create a class wrapping a new Multinomial operation, with the default output types. + * * @param scope current scope - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @param logits 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. - * @param options carries optional attributes values - * @return a new instance of Multinomial + * @param options carries optional attribute values + * @return a new instance of Multinomial, with default output types */ - @Endpoint(describeByClass = true) - public static Multinomial create(Scope scope, Operand logits, Operand numSamples, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Multinomial create(Scope scope, Operand logits, + Operand numSamples, Options[] options) { return create(scope, logits, numSamples, TInt64.class, options); } - + /** + * Sets the seed option. + * * @param seed If either seed or seed2 is set to be non-zero, the internal random number * generator is seeded by the given seed. Otherwise, a random seed is used. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * 2-D Tensor with shape `[batch_size, num_samples]`. Each slice `[i, :]` - * contains the drawn class labels with range `[0, num_classes)`. + * Gets output. + * 2-D Tensor with shape {@code [batch_size, num_samples]}. Each slice {@code [i, :]} + * contains the drawn class labels with range {@code [0, num_classes)}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Multinomial"; - - private Output output; - - private Multinomial(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.Multinomial} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 is set to be non-zero, the internal random number + * generator is seeded by the given seed. Otherwise, a random seed is used. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/NonDeterministicInts.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/NonDeterministicInts.java index ea189d9d7aa..9c1fa52000f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/NonDeterministicInts.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/NonDeterministicInts.java @@ -25,68 +25,75 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Non-deterministically generates some integers. - *

* This op may use some OS-provided source of non-determinism (e.g. an RNG), so each execution will give different results. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class NonDeterministicInts extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NonDeterministicInts"; + + private Output output; + + private NonDeterministicInts(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new NonDeterministicInts operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param dtype The type of the output. + * @param data type for {@code NonDeterministicInts} output and operands * @return a new instance of NonDeterministicInts */ - @Endpoint(describeByClass = true) - public static NonDeterministicInts create(Scope scope, Operand shape, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static NonDeterministicInts create(Scope scope, + Operand shape, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("NonDeterministicInts", scope.makeOpName("NonDeterministicInts")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new NonDeterministicInts(opBuilder.build()); + return new NonDeterministicInts<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new NonDeterministicInts operation using default output types. - * + * Factory method to create a class wrapping a new NonDeterministicInts operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. - * @return a new instance of NonDeterministicInts + * @return a new instance of NonDeterministicInts, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static NonDeterministicInts create(Scope scope, Operand shape) { return create(scope, shape, TInt64.class); } - + /** + * Gets output. * Non-deterministic integer values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "NonDeterministicInts"; - - private Output output; - - private NonDeterministicInts(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ParameterizedTruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ParameterizedTruncatedNormal.java index 1daadb4a445..3187c28447c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ParameterizedTruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/ParameterizedTruncatedNormal.java @@ -29,48 +29,31 @@ /** * Outputs random values from a normal distribution. The parameters may each be a - *

* scalar which applies to the entire output, or a vector of length shape[0] which * stores the parameters for each batch. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class ParameterizedTruncatedNormal extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.ParameterizedTruncatedNormal} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "ParameterizedTruncatedNormal"; + + private Output output; + + private ParameterizedTruncatedNormal(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ParameterizedTruncatedNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. Batches are indexed by the 0th dimension. * @param means The mean parameter of each batch. @@ -78,11 +61,16 @@ private Options() { * @param minvals The minimum cutoff. May be -infinity. * @param maxvals The maximum cutoff. May be +infinity, and must be more than the minval * for each batch. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ParameterizedTruncatedNormal} output and operands * @return a new instance of ParameterizedTruncatedNormal */ - @Endpoint(describeByClass = true) - public static ParameterizedTruncatedNormal create(Scope scope, Operand shape, Operand means, Operand stdevs, Operand minvals, Operand maxvals, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ParameterizedTruncatedNormal create(Scope scope, + Operand shape, Operand means, Operand stdevs, Operand minvals, + Operand maxvals, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ParameterizedTruncatedNormal", scope.makeOpName("ParameterizedTruncatedNormal")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(means.asOutput()); @@ -100,46 +88,79 @@ public static ParameterizedTruncatedNormal create(Scope s } } } - return new ParameterizedTruncatedNormal(opBuilder.build()); + return new ParameterizedTruncatedNormal<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A matrix of shape num_batches x samples_per_batch, filled with random * truncated normal values using the parameters for each row. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ParameterizedTruncatedNormal"; - - private Output output; - - private ParameterizedTruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.ParameterizedTruncatedNormal} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGamma.java index 7457dd6b1c8..da7fa82b70c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGamma.java @@ -29,59 +29,46 @@ /** * Outputs random values from the Gamma distribution(s) described by alpha. - *

* This op uses the algorithm by Marsaglia et al. to acquire samples via * transformation-rejection from pairs of uniform and normal random variables. * See http://dl.acm.org/citation.cfm?id=358414 - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class RandomGamma extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomGamma} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomGamma"; + + private Output output; + + private RandomGamma(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomGamma operation. - * + * * @param scope current scope * @param shape 1-D integer tensor. Shape of independent samples to draw from each * distribution described by the shape parameters given in alpha. - * @param alpha A tensor in which each scalar is a "shape" parameter describing the + * @param alpha A tensor in which each scalar is a "shape" parameter describing the * associated gamma distribution. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomGamma} output and operands * @return a new instance of RandomGamma */ - @Endpoint(describeByClass = true) - public static RandomGamma create(Scope scope, Operand shape, Operand alpha, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomGamma create(Scope scope, + Operand shape, Operand alpha, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomGamma", scope.makeOpName("RandomGamma")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(alpha.asOutput()); @@ -96,47 +83,80 @@ public static RandomGamma create(Scope scope, Operand(opBuilder.build()); + return new RandomGamma<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * A tensor with shape `shape + shape(alpha)`. Each slice - * `[:, ..., :, i0, i1, ...iN]` contains the samples drawn for - * `alpha[i0, i1, ...iN]`. The dtype of the output matches the dtype of alpha. + * Gets output. + * A tensor with shape {@code shape + shape(alpha)}. Each slice + * {@code [:, ..., :, i0, i1, ...iN]} contains the samples drawn for + * {@code alpha[i0, i1, ...iN]}. The dtype of the output matches the dtype of alpha. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomGamma"; - - private Output output; - - private RandomGamma(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomGamma} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGammaGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGammaGrad.java index 35f9c06d172..6daf06d2e7f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGammaGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomGammaGrad.java @@ -24,52 +24,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * Computes the derivative of a Gamma random sample w.r.t. `alpha`. - * - * @param data type for {@code output()} output + * Computes the derivative of a Gamma random sample w.r.t. {@code alpha}. + * + * @param data type for {@code output} output */ public final class RandomGammaGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RandomGammaGrad"; + + private Output output; + + private RandomGammaGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RandomGammaGrad operation. - * + * * @param scope current scope - * @param alpha - * @param sample + * @param alpha the alpha value + * @param sample the sample value + * @param data type for {@code RandomGammaGrad} output and operands * @return a new instance of RandomGammaGrad */ - @Endpoint(describeByClass = true) - public static RandomGammaGrad create(Scope scope, Operand alpha, Operand sample) { + @Endpoint( + describeByClass = true + ) + public static RandomGammaGrad create(Scope scope, Operand alpha, + Operand sample) { OperationBuilder opBuilder = scope.env().opBuilder("RandomGammaGrad", scope.makeOpName("RandomGammaGrad")); opBuilder.addInput(alpha.asOutput()); opBuilder.addInput(sample.asOutput()); opBuilder = scope.apply(opBuilder); - return new RandomGammaGrad(opBuilder.build()); + return new RandomGammaGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomGammaGrad"; - - private Output output; - - private RandomGammaGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java index 6d9632c1b73..914ab2f3a44 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomPoisson.java @@ -31,66 +31,53 @@ /** * Outputs random values from the Poisson distribution(s) described by rate. - *

- * This op uses two algorithms, depending on rate. If rate >= 10, then + * This op uses two algorithms, depending on rate. If rate >= 10, then * the algorithm by Hormann is used to acquire samples via * transformation-rejection. * See http://www.sciencedirect.com/science/article/pii/0167668793909974. - *

- * Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform + *

Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform * random variables. * See Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer * Programming, Volume 2. Addison Wesley - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class RandomPoisson extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomPoisson} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomPoissonV2"; + + private Output output; + + private RandomPoisson(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new RandomPoisson operation. - * + * Factory method to create a class wrapping a new RandomPoissonV2 operation. + * * @param scope current scope * @param shape 1-D integer tensor. Shape of independent samples to draw from each * distribution described by the shape parameters given in rate. - * @param rate A tensor in which each scalar is a "rate" parameter describing the + * @param rate A tensor in which each scalar is a "rate" parameter describing the * associated poisson distribution. - * @param dtype - * @param options carries optional attributes values + * @param dtype the value of the dtype property + * @param options carries optional attribute values + * @param data type for {@code RandomPoissonV2} output and operands * @return a new instance of RandomPoisson */ - @Endpoint(describeByClass = true) - public static RandomPoisson create(Scope scope, Operand shape, Operand rate, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomPoisson create(Scope scope, + Operand shape, Operand rate, Class dtype, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomPoissonV2", scope.makeOpName("RandomPoisson")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(rate.asOutput()); @@ -106,63 +93,99 @@ public static RandomPoisson create(Scope scope, Operand(opBuilder.build()); + return new RandomPoisson<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new RandomPoisson operation using default output types. - * + * Factory method to create a class wrapping a new RandomPoissonV2 operation, with the default output types. + * * @param scope current scope * @param shape 1-D integer tensor. Shape of independent samples to draw from each * distribution described by the shape parameters given in rate. - * @param rate A tensor in which each scalar is a "rate" parameter describing the + * @param rate A tensor in which each scalar is a "rate" parameter describing the * associated poisson distribution. - * @param options carries optional attributes values - * @return a new instance of RandomPoisson + * @param options carries optional attribute values + * @return a new instance of RandomPoisson, with default output types */ - @Endpoint(describeByClass = true) - public static RandomPoisson create(Scope scope, Operand shape, Operand rate, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomPoisson create(Scope scope, Operand shape, + Operand rate, Options[] options) { return create(scope, shape, rate, TInt64.class, options); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * A tensor with shape `shape + shape(rate)`. Each slice - * `[:, ..., :, i0, i1, ...iN]` contains the samples drawn for - * `rate[i0, i1, ...iN]`. + * Gets output. + * A tensor with shape {@code shape + shape(rate)}. Each slice + * {@code [:, ..., :, i0, i1, ...iN]} contains the samples drawn for + * {@code rate[i0, i1, ...iN]}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomPoissonV2"; - - private Output output; - - private RandomPoisson(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomPoisson} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomShuffle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomShuffle.java index 3ef940e631d..bb2a282ad00 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomShuffle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomShuffle.java @@ -29,62 +29,48 @@ /** * Randomly shuffles a tensor along its first dimension. - *

- * The tensor is shuffled along dimension 0, such that each `value[j]` is mapped - * to one and only one `output[i]`. For example, a mapping that might occur for a - * 3x2 tensor is: - *

{@code
+ * The tensor is shuffled along dimension 0, such that each {@code value[j]} is mapped
+ * to one and only one {@code output[i]}. For example, a mapping that might occur for a
+ * 3x2 tensor is:
+ * 
  * [[1, 2],       [[5, 6],
- *  [3, 4],  ==>   [1, 2],
+ *  [3, 4],  ==>   [1, 2],
  *  [5, 6]]        [3, 4]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class RandomShuffle extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomShuffle} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomShuffle"; + + private Output output; + + private RandomShuffle(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomShuffle operation. - * + * * @param scope current scope * @param value The tensor to be shuffled. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomShuffle} output and operands * @return a new instance of RandomShuffle */ - @Endpoint(describeByClass = true) - public static RandomShuffle create(Scope scope, Operand value, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomShuffle create(Scope scope, Operand value, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomShuffle", scope.makeOpName("RandomShuffle")); opBuilder.addInput(value.asOutput()); opBuilder = scope.apply(opBuilder); @@ -98,46 +84,79 @@ public static RandomShuffle create(Scope scope, Operand } } } - return new RandomShuffle(opBuilder.build()); + return new RandomShuffle<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** - * A tensor of same shape and type as `value`, shuffled along its first + * Gets output. + * A tensor of same shape and type as {@code value}, shuffled along its first * dimension. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomShuffle"; - - private Output output; - - private RandomShuffle(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomShuffle} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomStandardNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomStandardNormal.java index 5590f39e462..1cdea4ae17f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomStandardNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomStandardNormal.java @@ -30,55 +30,42 @@ /** * Outputs random values from a normal distribution. - *

* The generated values will have mean 0 and standard deviation 1. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class RandomStandardNormal extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomStandardNormal} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomStandardNormal"; + + private Output output; + + private RandomStandardNormal(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomStandardNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param dtype The type of the output. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomStandardNormal} output and operands * @return a new instance of RandomStandardNormal */ - @Endpoint(describeByClass = true) - public static RandomStandardNormal create(Scope scope, Operand shape, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomStandardNormal create(Scope scope, + Operand shape, Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomStandardNormal", scope.makeOpName("RandomStandardNormal")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); @@ -93,45 +80,78 @@ public static RandomStandardNormal create(Scope scope, Op } } } - return new RandomStandardNormal(opBuilder.build()); + return new RandomStandardNormal<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A tensor of the specified shape filled with random normal values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomStandardNormal"; - - private Output output; - - private RandomStandardNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomStandardNormal} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniform.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniform.java index ee3d57fe528..f5ad7fcc271 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniform.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniform.java @@ -30,56 +30,43 @@ /** * Outputs random values from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[0, 1)`. The + * The generated values follow a uniform distribution in the range {@code [0, 1)}. The * lower bound 0 is included in the range, while the upper bound 1 is excluded. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class RandomUniform extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomUniform} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomUniform"; + + private Output output; + + private RandomUniform(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomUniform operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param dtype The type of the output. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomUniform} output and operands * @return a new instance of RandomUniform */ - @Endpoint(describeByClass = true) - public static RandomUniform create(Scope scope, Operand shape, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomUniform create(Scope scope, + Operand shape, Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomUniform", scope.makeOpName("RandomUniform")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); @@ -94,45 +81,78 @@ public static RandomUniform create(Scope scope, Operand(opBuilder.build()); + return new RandomUniform<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A tensor of the specified shape filled with uniform random values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomUniform"; - - private Output output; - - private RandomUniform(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomUniform} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniformInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniformInt.java index fa63412d74a..d08e70a0baf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniformInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RandomUniformInt.java @@ -29,62 +29,48 @@ /** * Outputs random integers from a uniform distribution. - *

- * The generated values are uniform integers in the range `[minval, maxval)`. - * The lower bound `minval` is included in the range, while the upper bound - * `maxval` is excluded. - *

- * The random integers are slightly biased unless `maxval - minval` is an exact - * power of two. The bias is small for values of `maxval - minval` significantly - * smaller than the range of the output (either `2^32` or `2^64`). - * - * @param data type for {@code output()} output + * The generated values are uniform integers in the range {@code [minval, maxval)}. + * The lower bound {@code minval} is included in the range, while the upper bound + * {@code maxval} is excluded. + *

The random integers are slightly biased unless {@code maxval - minval} is an exact + * power of two. The bias is small for values of {@code maxval - minval} significantly + * smaller than the range of the output (either {@code 2^32} or {@code 2^64}). + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class RandomUniformInt extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RandomUniformInt} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "RandomUniformInt"; + + private Output output; + + private RandomUniformInt(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RandomUniformInt operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param minval 0-D. Inclusive lower bound on the generated integers. * @param maxval 0-D. Exclusive upper bound on the generated integers. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RandomUniformInt} output and operands * @return a new instance of RandomUniformInt */ - @Endpoint(describeByClass = true) - public static RandomUniformInt create(Scope scope, Operand shape, Operand minval, Operand maxval, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RandomUniformInt create(Scope scope, + Operand shape, Operand minval, Operand maxval, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomUniformInt", scope.makeOpName("RandomUniformInt")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(minval.asOutput()); @@ -100,45 +86,78 @@ public static RandomUniformInt create(Scope scope, Operan } } } - return new RandomUniformInt(opBuilder.build()); + return new RandomUniformInt<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A tensor of the specified shape filled with uniform random integers. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RandomUniformInt"; - - private Output output; - - private RandomUniformInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RandomUniformInt} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RecordInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RecordInput.java index e7319f4b593..9469070c11a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RecordInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RecordInput.java @@ -30,84 +30,34 @@ /** * Emits randomized records. */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class RecordInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.RecordInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param fileRandomSeed Random seeds used to produce randomized records. - */ - public Options fileRandomSeed(Long fileRandomSeed) { - this.fileRandomSeed = fileRandomSeed; - return this; - } - - /** - * @param fileShuffleShiftRatio Shifts the list of files after the list is randomly - * shuffled. - */ - public Options fileShuffleShiftRatio(Float fileShuffleShiftRatio) { - this.fileShuffleShiftRatio = fileShuffleShiftRatio; - return this; - } - - /** - * @param fileBufferSize The randomization shuffling buffer. - */ - public Options fileBufferSize(Long fileBufferSize) { - this.fileBufferSize = fileBufferSize; - return this; - } - - /** - * @param fileParallelism How many sstables are opened and concurrently iterated over. - */ - public Options fileParallelism(Long fileParallelism) { - this.fileParallelism = fileParallelism; - return this; - } - - /** - * @param batchSize The batch size. - */ - public Options batchSize(Long batchSize) { - this.batchSize = batchSize; - return this; - } - - /** - * @param compressionType The type of compression for the file. Currently ZLIB and - * GZIP are supported. Defaults to none. - */ - public Options compressionType(String compressionType) { - this.compressionType = compressionType; - return this; - } - - private Long fileRandomSeed; - private Float fileShuffleShiftRatio; - private Long fileBufferSize; - private Long fileParallelism; - private Long batchSize; - private String compressionType; - - private Options() { - } + public static final String OP_NAME = "RecordInput"; + + private Output records; + + private RecordInput(Operation operation) { + super(operation); + int outputIdx = 0; + records = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RecordInput operation. - * + * * @param scope current scope * @param filePattern Glob pattern for the data files. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of RecordInput */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RecordInput create(Scope scope, String filePattern, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RecordInput", scope.makeOpName("RecordInput")); opBuilder = scope.apply(opBuilder); @@ -136,71 +86,168 @@ public static RecordInput create(Scope scope, String filePattern, Options... opt } return new RecordInput(opBuilder.build()); } - + /** + * Sets the fileRandomSeed option. + * * @param fileRandomSeed Random seeds used to produce randomized records. + * @return this Options instance. */ public static Options fileRandomSeed(Long fileRandomSeed) { return new Options().fileRandomSeed(fileRandomSeed); } - + /** + * Sets the fileShuffleShiftRatio option. + * * @param fileShuffleShiftRatio Shifts the list of files after the list is randomly * shuffled. + * @return this Options instance. */ public static Options fileShuffleShiftRatio(Float fileShuffleShiftRatio) { return new Options().fileShuffleShiftRatio(fileShuffleShiftRatio); } - + /** + * Sets the fileBufferSize option. + * * @param fileBufferSize The randomization shuffling buffer. + * @return this Options instance. */ public static Options fileBufferSize(Long fileBufferSize) { return new Options().fileBufferSize(fileBufferSize); } - + /** + * Sets the fileParallelism option. + * * @param fileParallelism How many sstables are opened and concurrently iterated over. + * @return this Options instance. */ public static Options fileParallelism(Long fileParallelism) { return new Options().fileParallelism(fileParallelism); } - + /** + * Sets the batchSize option. + * * @param batchSize The batch size. + * @return this Options instance. */ public static Options batchSize(Long batchSize) { return new Options().batchSize(batchSize); } - + /** + * Sets the compressionType option. + * * @param compressionType The type of compression for the file. Currently ZLIB and * GZIP are supported. Defaults to none. + * @return this Options instance. */ public static Options compressionType(String compressionType) { return new Options().compressionType(compressionType); } - + /** + * Gets records. * A tensor of shape [batch_size]. + * @return records. */ public Output records() { return records; } - + @Override public Output asOutput() { return records; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RecordInput"; - - private Output records; - - private RecordInput(Operation operation) { - super(operation); - int outputIdx = 0; - records = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.RecordInput} + */ + public static class Options { + private Long fileRandomSeed; + + private Float fileShuffleShiftRatio; + + private Long fileBufferSize; + + private Long fileParallelism; + + private Long batchSize; + + private String compressionType; + + private Options() { + } + + /** + * Sets the fileRandomSeed option. + * + * @param fileRandomSeed Random seeds used to produce randomized records. + * @return this Options instance. + */ + public Options fileRandomSeed(Long fileRandomSeed) { + this.fileRandomSeed = fileRandomSeed; + return this; + } + + /** + * Sets the fileShuffleShiftRatio option. + * + * @param fileShuffleShiftRatio Shifts the list of files after the list is randomly + * shuffled. + * @return this Options instance. + */ + public Options fileShuffleShiftRatio(Float fileShuffleShiftRatio) { + this.fileShuffleShiftRatio = fileShuffleShiftRatio; + return this; + } + + /** + * Sets the fileBufferSize option. + * + * @param fileBufferSize The randomization shuffling buffer. + * @return this Options instance. + */ + public Options fileBufferSize(Long fileBufferSize) { + this.fileBufferSize = fileBufferSize; + return this; + } + + /** + * Sets the fileParallelism option. + * + * @param fileParallelism How many sstables are opened and concurrently iterated over. + * @return this Options instance. + */ + public Options fileParallelism(Long fileParallelism) { + this.fileParallelism = fileParallelism; + return this; + } + + /** + * Sets the batchSize option. + * + * @param batchSize The batch size. + * @return this Options instance. + */ + public Options batchSize(Long batchSize) { + this.batchSize = batchSize; + return this; + } + + /** + * Sets the compressionType option. + * + * @param compressionType The type of compression for the file. Currently ZLIB and + * GZIP are supported. Defaults to none. + * @return this Options instance. + */ + public Options compressionType(String compressionType) { + this.compressionType = compressionType; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngReadAndSkip.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngReadAndSkip.java index b75a3836503..d86074997b0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngReadAndSkip.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngReadAndSkip.java @@ -24,31 +24,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Advance the counter of a counter-based RNG. - *

* The state of the RNG after - * `rng_read_and_skip(n)` will be the same as that after `uniform([n])` + * {@code rng_read_and_skip(n)} will be the same as that after {@code uniform([n])} * (or any other distribution). The actual increment added to the * counter is an unspecified implementation choice. */ public final class RngReadAndSkip extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RngReadAndSkip"; + + private Output value; + + private RngReadAndSkip(Operation operation) { + super(operation); + int outputIdx = 0; + value = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RngReadAndSkip operation. - * + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param alg The RNG algorithm. * @param delta The amount of advancement. * @return a new instance of RngReadAndSkip */ - @Endpoint(describeByClass = true) - public static RngReadAndSkip create(Scope scope, Operand resource, Operand alg, Operand delta) { + @Endpoint( + describeByClass = true + ) + public static RngReadAndSkip create(Scope scope, Operand resource, + Operand alg, Operand delta) { OperationBuilder opBuilder = scope.env().opBuilder("RngReadAndSkip", scope.makeOpName("RngReadAndSkip")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(alg.asOutput()); @@ -56,27 +70,18 @@ public static RngReadAndSkip create(Scope scope, Operand resource, Operand value() { return value; } - + @Override public Output asOutput() { return value; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RngReadAndSkip"; - - private Output value; - - private RngReadAndSkip(Operation operation) { - super(operation); - int outputIdx = 0; - value = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngSkip.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngSkip.java index 72238907917..fea4eed3b24 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngSkip.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/RngSkip.java @@ -23,30 +23,40 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Advance the counter of a counter-based RNG. - *

* The state of the RNG after - * `rng_skip(n)` will be the same as that after `stateful_uniform([n])` + * {@code rng_skip(n)} will be the same as that after {@code stateful_uniform([n])} * (or any other distribution). The actual increment added to the * counter is an unspecified implementation detail. */ public final class RngSkip extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RngSkip"; + + private RngSkip(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new RngSkip operation. - * + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param delta The amount of advancement. * @return a new instance of RngSkip */ - @Endpoint(describeByClass = true) - public static RngSkip create(Scope scope, Operand resource, Operand algorithm, Operand delta) { + @Endpoint( + describeByClass = true + ) + public static RngSkip create(Scope scope, Operand resource, + Operand algorithm, Operand delta) { OperationBuilder opBuilder = scope.env().opBuilder("RngSkip", scope.makeOpName("RngSkip")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); @@ -54,11 +64,4 @@ public static RngSkip create(Scope scope, Operand resource, Operand a opBuilder = scope.apply(opBuilder); return new RngSkip(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RngSkip"; - - private RngSkip(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulRandomBinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulRandomBinomial.java index f0ca988f977..405f3be4ed5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulRandomBinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulRandomBinomial.java @@ -28,27 +28,50 @@ import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** - * @param data type for {@code output()} output + * The StatefulRandomBinomial operation + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class StatefulRandomBinomial extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatefulRandomBinomial"; + + private Output output; + + private StatefulRandomBinomial(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulRandomBinomial operation. - * + * * @param scope current scope - * @param resource - * @param algorithm - * @param shape - * @param counts - * @param probs - * @param dtype + * @param resource the resource value + * @param algorithm the algorithm value + * @param shape the shape value + * @param counts the counts value + * @param probs the probs value + * @param dtype the value of the dtype property + * @param data type for {@code StatefulRandomBinomial} output and operands + * @param data type for {@code StatefulRandomBinomial} output and operands * @return a new instance of StatefulRandomBinomial */ - @Endpoint(describeByClass = true) - public static StatefulRandomBinomial create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand counts, Operand probs, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatefulRandomBinomial create(Scope scope, + Operand resource, Operand algorithm, + Operand shape, Operand counts, Operand probs, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulRandomBinomial", scope.makeOpName("StatefulRandomBinomial")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); @@ -57,44 +80,41 @@ public static StatefulRandomBinomial c opBuilder.addInput(probs.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulRandomBinomial(opBuilder.build()); + return new StatefulRandomBinomial<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatefulRandomBinomial operation using default output types. - * + * Factory method to create a class wrapping a new StatefulRandomBinomial operation, with the default output types. + * * @param scope current scope - * @param resource - * @param algorithm - * @param shape - * @param counts - * @param probs - * @return a new instance of StatefulRandomBinomial + * @param resource the resource value + * @param algorithm the algorithm value + * @param shape the shape value + * @param counts the counts value + * @param probs the probs value + * @param data type for {@code StatefulRandomBinomial} output and operands + * @return a new instance of StatefulRandomBinomial, with default output types */ - @Endpoint(describeByClass = true) - public static StatefulRandomBinomial create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand counts, Operand probs) { + @Endpoint( + describeByClass = true + ) + public static StatefulRandomBinomial create(Scope scope, + Operand resource, Operand algorithm, + Operand shape, Operand counts, Operand probs) { return create(scope, resource, algorithm, shape, counts, probs, TInt64.class); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulRandomBinomial"; - - private Output output; - - private StatefulRandomBinomial(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulStandardNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulStandardNormal.java index f2bac599e30..920b132283c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulStandardNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulStandardNormal.java @@ -32,69 +32,82 @@ /** * Outputs random values from a normal distribution. - *

* The generated values will have mean 0 and standard deviation 1. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class StatefulStandardNormal extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new StatefulStandardNormal operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatefulStandardNormalV2"; + + private Output output; + + private StatefulStandardNormal(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StatefulStandardNormalV2 operation. + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. * @param dtype The type of the output. + * @param data type for {@code StatefulStandardNormalV2} output and operands * @return a new instance of StatefulStandardNormal */ - @Endpoint(describeByClass = true) - public static StatefulStandardNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatefulStandardNormal create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulStandardNormalV2", scope.makeOpName("StatefulStandardNormal")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulStandardNormal(opBuilder.build()); + return new StatefulStandardNormal<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatefulStandardNormal operation using default output types. - * + * Factory method to create a class wrapping a new StatefulStandardNormalV2 operation, with the default output types. + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. - * @return a new instance of StatefulStandardNormal + * @return a new instance of StatefulStandardNormal, with default output types */ - @Endpoint(describeByClass = true) - public static StatefulStandardNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape) { + @Endpoint( + describeByClass = true + ) + public static StatefulStandardNormal create(Scope scope, + Operand resource, Operand algorithm, + Operand shape) { return create(scope, resource, algorithm, shape, TFloat32.class); } - + /** + * Gets output. * A tensor of the specified shape filled with random normal values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulStandardNormalV2"; - - private Output output; - - private StatefulStandardNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulTruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulTruncatedNormal.java index 8674dbfd845..29f4c827a56 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulTruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulTruncatedNormal.java @@ -25,77 +25,87 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Outputs random values from a truncated normal distribution. - *

* The generated values follow a normal distribution with mean 0 and standard * deviation 1, except that values whose magnitude is more than 2 standard * deviations from the mean are dropped and re-picked. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class StatefulTruncatedNormal extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatefulTruncatedNormal"; + + private Output output; + + private StatefulTruncatedNormal(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulTruncatedNormal operation. - * + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. * @param dtype The type of the output. + * @param data type for {@code StatefulTruncatedNormal} output and operands * @return a new instance of StatefulTruncatedNormal */ - @Endpoint(describeByClass = true) - public static StatefulTruncatedNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatefulTruncatedNormal create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulTruncatedNormal", scope.makeOpName("StatefulTruncatedNormal")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulTruncatedNormal(opBuilder.build()); + return new StatefulTruncatedNormal<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatefulTruncatedNormal operation using default output types. - * + * Factory method to create a class wrapping a new StatefulTruncatedNormal operation, with the default output types. + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. - * @return a new instance of StatefulTruncatedNormal + * @return a new instance of StatefulTruncatedNormal, with default output types */ - @Endpoint(describeByClass = true) - public static StatefulTruncatedNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape) { + @Endpoint( + describeByClass = true + ) + public static StatefulTruncatedNormal create(Scope scope, + Operand resource, Operand algorithm, + Operand shape) { return create(scope, resource, algorithm, shape, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulTruncatedNormal"; - - private Output output; - - private StatefulTruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniform.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniform.java index b7e5f2b461d..525ec5d6db3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniform.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniform.java @@ -25,76 +25,85 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Outputs random values from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[0, 1)`. The + * The generated values follow a uniform distribution in the range {@code [0, 1)}. The * lower bound 0 is included in the range, while the upper bound 1 is excluded. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class StatefulUniform extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatefulUniform"; + + private Output output; + + private StatefulUniform(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulUniform operation. - * + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. * @param dtype The type of the output. + * @param data type for {@code StatefulUniform} output and operands * @return a new instance of StatefulUniform */ - @Endpoint(describeByClass = true) - public static StatefulUniform create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatefulUniform create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulUniform", scope.makeOpName("StatefulUniform")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulUniform(opBuilder.build()); + return new StatefulUniform<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatefulUniform operation using default output types. - * + * Factory method to create a class wrapping a new StatefulUniform operation, with the default output types. + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. - * @return a new instance of StatefulUniform + * @return a new instance of StatefulUniform, with default output types */ - @Endpoint(describeByClass = true) - public static StatefulUniform create(Scope scope, Operand resource, Operand algorithm, Operand shape) { + @Endpoint( + describeByClass = true + ) + public static StatefulUniform create(Scope scope, Operand resource, + Operand algorithm, Operand shape) { return create(scope, resource, algorithm, shape, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulUniform"; - - private Output output; - - private StatefulUniform(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformFullInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformFullInt.java index 00cd668c7e5..17c36ba762d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformFullInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformFullInt.java @@ -25,60 +25,66 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Outputs random integers from a uniform distribution. - *

- * The generated values are uniform integers covering the whole range of `dtype`. - * - * @param data type for {@code output()} output + * The generated values are uniform integers covering the whole range of {@code dtype}. + * + * @param data type for {@code output} output */ public final class StatefulUniformFullInt extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatefulUniformFullInt"; + + private Output output; + + private StatefulUniformFullInt(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulUniformFullInt operation. - * + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. * @param dtype The type of the output. + * @param data type for {@code StatefulUniformFullInt} output and operands * @return a new instance of StatefulUniformFullInt */ - @Endpoint(describeByClass = true) - public static StatefulUniformFullInt create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatefulUniformFullInt create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulUniformFullInt", scope.makeOpName("StatefulUniformFullInt")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatefulUniformFullInt(opBuilder.build()); + return new StatefulUniformFullInt<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulUniformFullInt"; - - private Output output; - - private StatefulUniformFullInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformInt.java index 880b414d875..34b12f3c48f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatefulUniformInt.java @@ -24,38 +24,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Outputs random integers from a uniform distribution. - *

- * The generated values are uniform integers in the range `[minval, maxval)`. - * The lower bound `minval` is included in the range, while the upper bound - * `maxval` is excluded. - *

- * The random integers are slightly biased unless `maxval - minval` is an exact - * power of two. The bias is small for values of `maxval - minval` significantly - * smaller than the range of the output (either `2^32` or `2^64`). - * - * @param data type for {@code output()} output + * The generated values are uniform integers in the range {@code [minval, maxval)}. + * The lower bound {@code minval} is included in the range, while the upper bound + * {@code maxval} is excluded. + *

The random integers are slightly biased unless {@code maxval - minval} is an exact + * power of two. The bias is small for values of {@code maxval - minval} significantly + * smaller than the range of the output (either {@code 2^32} or {@code 2^64}). + * + * @param data type for {@code output} output */ public final class StatefulUniformInt extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatefulUniformInt"; + + private Output output; + + private StatefulUniformInt(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatefulUniformInt operation. - * + * * @param scope current scope * @param resource The handle of the resource variable that stores the state of the RNG. * @param algorithm The RNG algorithm. * @param shape The shape of the output tensor. * @param minval Minimum value (inclusive, scalar). * @param maxval Maximum value (exclusive, scalar). + * @param data type for {@code StatefulUniformInt} output and operands * @return a new instance of StatefulUniformInt */ - @Endpoint(describeByClass = true) - public static StatefulUniformInt create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand minval, Operand maxval) { + @Endpoint( + describeByClass = true + ) + public static StatefulUniformInt create(Scope scope, + Operand resource, Operand algorithm, Operand shape, + Operand minval, Operand maxval) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulUniformInt", scope.makeOpName("StatefulUniformInt")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); @@ -63,29 +77,20 @@ public static StatefulUniformInt create(Scope scope, Operan opBuilder.addInput(minval.asOutput()); opBuilder.addInput(maxval.asOutput()); opBuilder = scope.apply(opBuilder); - return new StatefulUniformInt(opBuilder.build()); + return new StatefulUniformInt<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatefulUniformInt"; - - private Output output; - - private StatefulUniformInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessMultinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessMultinomial.java index aa8a31e7f38..d1cb7dd4542 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessMultinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessMultinomial.java @@ -32,70 +32,83 @@ /** * Draws samples from a multinomial distribution. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class StatelessMultinomial extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessMultinomial"; + + private Output output; + + private StatelessMultinomial(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessMultinomial operation. - * + * * @param scope current scope - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @param logits 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. * @param seed 2 seeds (shape [2]). - * @param outputDtype + * @param outputDtype the value of the outputDtype property + * @param data type for {@code StatelessMultinomial} output and operands * @return a new instance of StatelessMultinomial */ - @Endpoint(describeByClass = true) - public static StatelessMultinomial create(Scope scope, Operand logits, Operand numSamples, Operand seed, Class outputDtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessMultinomial create(Scope scope, + Operand logits, Operand numSamples, + Operand seed, Class outputDtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessMultinomial", scope.makeOpName("StatelessMultinomial")); opBuilder.addInput(logits.asOutput()); opBuilder.addInput(numSamples.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("output_dtype", Operands.toDataType(outputDtype)); - return new StatelessMultinomial(opBuilder.build()); + return new StatelessMultinomial<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessMultinomial operation using default output types. - * + * Factory method to create a class wrapping a new StatelessMultinomial operation, with the default output types. + * * @param scope current scope - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @param logits 2-D Tensor with shape {@code [batch_size, num_classes]}. Each slice {@code [i, :]} * represents the unnormalized log probabilities for all classes. * @param numSamples 0-D. Number of independent samples to draw for each row slice. * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessMultinomial + * @return a new instance of StatelessMultinomial, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessMultinomial create(Scope scope, Operand logits, Operand numSamples, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static StatelessMultinomial create(Scope scope, Operand logits, + Operand numSamples, Operand seed) { return create(scope, logits, numSamples, seed, TInt64.class); } - + /** - * 2-D Tensor with shape `[batch_size, num_samples]`. Each slice `[i, :]` - * contains the drawn class labels with range `[0, num_classes)`. + * Gets output. + * 2-D Tensor with shape {@code [batch_size, num_samples]}. Each slice {@code [i, :]} + * contains the drawn class labels with range {@code [0, num_classes)}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessMultinomial"; - - private Output output; - - private StatelessMultinomial(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessParameterizedTruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessParameterizedTruncatedNormal.java index 8c740f16994..6cfee4854e1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessParameterizedTruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessParameterizedTruncatedNormal.java @@ -24,17 +24,30 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** - * @param data type for {@code output()} output + * The StatelessParameterizedTruncatedNormal operation + * + * @param data type for {@code output} output */ public final class StatelessParameterizedTruncatedNormal extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessParameterizedTruncatedNormal"; + + private Output output; + + private StatelessParameterizedTruncatedNormal(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessParameterizedTruncatedNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). @@ -43,10 +56,15 @@ public final class StatelessParameterizedTruncatedNormal exte * @param minvals The minimum cutoff. May be -infinity. * @param maxvals The maximum cutoff. May be +infinity, and must be more than the minval * for each batch. + * @param data type for {@code StatelessParameterizedTruncatedNormal} output and operands * @return a new instance of StatelessParameterizedTruncatedNormal */ - @Endpoint(describeByClass = true) - public static StatelessParameterizedTruncatedNormal create(Scope scope, Operand shape, Operand seed, Operand means, Operand stddevs, Operand minvals, Operand maxvals) { + @Endpoint( + describeByClass = true + ) + public static StatelessParameterizedTruncatedNormal create(Scope scope, + Operand shape, Operand seed, Operand means, + Operand stddevs, Operand minvals, Operand maxvals) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessParameterizedTruncatedNormal", scope.makeOpName("StatelessParameterizedTruncatedNormal")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); @@ -55,30 +73,21 @@ public static StatelessParameterizedTruncatedNormal creat opBuilder.addInput(minvals.asOutput()); opBuilder.addInput(maxvals.asOutput()); opBuilder = scope.apply(opBuilder); - return new StatelessParameterizedTruncatedNormal(opBuilder.build()); + return new StatelessParameterizedTruncatedNormal<>(opBuilder.build()); } - + /** + * Gets output. * The outputs are truncated normal samples and are a deterministic function of - * `shape`, `seed`, `minvals`, `maxvals`, `means` and `stddevs`. + * {@code shape}, {@code seed}, {@code minvals}, {@code maxvals}, {@code means} and {@code stddevs}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessParameterizedTruncatedNormal"; - - private Output output; - - private StatelessParameterizedTruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomBinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomBinomial.java index 0b1e081e551..f2f8548aa7a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomBinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomBinomial.java @@ -25,36 +25,51 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Outputs deterministic pseudorandom random numbers from a binomial distribution. - *

* Outputs random values from a binomial distribution. - *

- * The outputs are a deterministic function of `shape`, `seed`, `counts`, and `probs`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code seed}, {@code counts}, and {@code probs}. + * + * @param data type for {@code output} output */ public final class StatelessRandomBinomial extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomBinomial"; + + private Output output; + + private StatelessRandomBinomial(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomBinomial operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). - * @param counts The counts of the binomial distribution. Must be broadcastable with `probs`, - * and broadcastable with the rightmost dimensions of `shape`. + * @param counts The counts of the binomial distribution. Must be broadcastable with {@code probs}, + * and broadcastable with the rightmost dimensions of {@code shape}. * @param probs The probability of success for the binomial distribution. Must be broadcastable - * with `counts` and broadcastable with the rightmost dimensions of `shape`. + * with {@code counts} and broadcastable with the rightmost dimensions of {@code shape}. * @param dtype The type of the output. + * @param data type for {@code StatelessRandomBinomial} output and operands + * @param data type for {@code StatelessRandomBinomial} output and operands * @return a new instance of StatelessRandomBinomial */ - @Endpoint(describeByClass = true) - public static StatelessRandomBinomial create(Scope scope, Operand shape, Operand seed, Operand counts, Operand probs, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomBinomial create( + Scope scope, Operand shape, Operand seed, + Operand counts, Operand probs, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomBinomial", scope.makeOpName("StatelessRandomBinomial")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); @@ -62,46 +77,42 @@ public static StatelessRandomBinomial opBuilder.addInput(probs.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomBinomial(opBuilder.build()); + return new StatelessRandomBinomial<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomBinomial operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomBinomial operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). - * @param counts The counts of the binomial distribution. Must be broadcastable with `probs`, - * and broadcastable with the rightmost dimensions of `shape`. + * @param counts The counts of the binomial distribution. Must be broadcastable with {@code probs}, + * and broadcastable with the rightmost dimensions of {@code shape}. * @param probs The probability of success for the binomial distribution. Must be broadcastable - * with `counts` and broadcastable with the rightmost dimensions of `shape`. - * @return a new instance of StatelessRandomBinomial + * with {@code counts} and broadcastable with the rightmost dimensions of {@code shape}. + * @param data type for {@code StatelessRandomBinomial} output and operands + * @return a new instance of StatelessRandomBinomial, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessRandomBinomial create(Scope scope, Operand shape, Operand seed, Operand counts, Operand probs) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomBinomial create(Scope scope, + Operand shape, Operand seed, Operand counts, + Operand probs) { return create(scope, shape, seed, counts, probs, TInt64.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomBinomial"; - - private Output output; - - private StatelessRandomBinomial(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGamma.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGamma.java index 3665612e654..b19c41fe4eb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGamma.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGamma.java @@ -24,60 +24,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Outputs deterministic pseudorandom random numbers from a gamma distribution. - *

* Outputs random values from a gamma distribution. - *

- * The outputs are a deterministic function of `shape`, `seed`, and `alpha`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code seed}, and {@code alpha}. + * + * @param data type for {@code output} output */ public final class StatelessRandomGamma extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new StatelessRandomGamma operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomGammaV2"; + + private Output output; + + private StatelessRandomGamma(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StatelessRandomGammaV2 operation. + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param alpha The concentration of the gamma distribution. Shape must match the rightmost - * dimensions of `shape`. + * dimensions of {@code shape}. + * @param data type for {@code StatelessRandomGammaV2} output and operands * @return a new instance of StatelessRandomGamma */ - @Endpoint(describeByClass = true) - public static StatelessRandomGamma create(Scope scope, Operand shape, Operand seed, Operand alpha) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomGamma create(Scope scope, + Operand shape, Operand seed, Operand alpha) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomGammaV2", scope.makeOpName("StatelessRandomGamma")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(alpha.asOutput()); opBuilder = scope.apply(opBuilder); - return new StatelessRandomGamma(opBuilder.build()); + return new StatelessRandomGamma<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomGammaV2"; - - private Output output; - - private StatelessRandomGamma(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounterAlg.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounterAlg.java index 60e4646b816..9432aa91e76 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounterAlg.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomGetKeyCounterAlg.java @@ -24,65 +24,77 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Picks the best algorithm based on device, and scrambles seed into key and counter. - *

* This op picks the best counter-based RNG algorithm based on device, and scrambles a shape-[2] seed into a key and a counter, both needed by the counter-based algorithm. The scrambling is opaque but approximately satisfies the property that different seed results in different key/counter pair (which will in turn result in different random numbers). */ public final class StatelessRandomGetKeyCounterAlg extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomGetKeyCounterAlg"; + + private Output key; + + private Output counter; + + private Output alg; + + @SuppressWarnings("unchecked") + private StatelessRandomGetKeyCounterAlg(Operation operation) { + super(operation); + int outputIdx = 0; + key = operation.output(outputIdx++); + counter = operation.output(outputIdx++); + alg = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomGetKeyCounterAlg operation. - * + * * @param scope current scope * @param seed 2 seeds (shape [2]). * @return a new instance of StatelessRandomGetKeyCounterAlg */ - @Endpoint(describeByClass = true) - public static StatelessRandomGetKeyCounterAlg create(Scope scope, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomGetKeyCounterAlg create(Scope scope, + Operand seed) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomGetKeyCounterAlg", scope.makeOpName("StatelessRandomGetKeyCounterAlg")); opBuilder.addInput(seed.asOutput()); opBuilder = scope.apply(opBuilder); return new StatelessRandomGetKeyCounterAlg(opBuilder.build()); } - + /** + * Gets key. * Key for the counter-based RNG algorithm (shape uint64[1]). + * @return key. */ - public Output key() { + public Output key() { return key; } - + /** + * Gets counter. * Counter for the counter-based RNG algorithm. Since counter size is algorithm-dependent, this output will be right-padded with zeros to reach shape uint64[2] (the current maximal counter size among algorithms). + * @return counter. */ - public Output counter() { + public Output counter() { return counter; } - + /** + * Gets alg. * The RNG algorithm (shape int32[]). + * @return alg. */ public Output alg() { return alg; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomGetKeyCounterAlg"; - - private Output key; - private Output counter; - private Output alg; - - private StatelessRandomGetKeyCounterAlg(Operation operation) { - super(operation); - int outputIdx = 0; - key = operation.output(outputIdx++); - counter = operation.output(outputIdx++); - alg = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormal.java index 21587fa0ff0..03402d96c48 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormal.java @@ -31,68 +31,78 @@ /** * Outputs deterministic pseudorandom values from a normal distribution. - *

* The generated values will have mean 0 and standard deviation 1. - *

- * The outputs are a deterministic function of `shape` and `seed`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape} and {@code seed}. + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class StatelessRandomNormal extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomNormal"; + + private Output output; + + private StatelessRandomNormal(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param dtype The type of the output. + * @param data type for {@code StatelessRandomNormal} output and operands * @return a new instance of StatelessRandomNormal */ - @Endpoint(describeByClass = true) - public static StatelessRandomNormal create(Scope scope, Operand shape, Operand seed, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomNormal create(Scope scope, + Operand shape, Operand seed, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomNormal", scope.makeOpName("StatelessRandomNormal")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomNormal(opBuilder.build()); + return new StatelessRandomNormal<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomNormal operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomNormal operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessRandomNormal + * @return a new instance of StatelessRandomNormal, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessRandomNormal create(Scope scope, Operand shape, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomNormal create(Scope scope, + Operand shape, Operand seed) { return create(scope, shape, seed, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomNormal"; - - private Output output; - - private StatelessRandomNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormalV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormalV2.java index b8dc52febf2..beae49bbea2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormalV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomNormalV2.java @@ -25,35 +25,50 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom values from a normal distribution. - *

* The generated values will have mean 0 and standard deviation 1. - *

- * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @param data type for {@code output} output */ public final class StatelessRandomNormalV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomNormalV2"; + + private Output output; + + private StatelessRandomNormalV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomNormalV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). * @param dtype The type of the output. + * @param data type for {@code StatelessRandomNormalV2} output and operands * @return a new instance of StatelessRandomNormalV2 */ - @Endpoint(describeByClass = true) - public static StatelessRandomNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomNormalV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomNormalV2", scope.makeOpName("StatelessRandomNormalV2")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); @@ -61,44 +76,39 @@ public static StatelessRandomNormalV2 create(Scope scope, opBuilder.addInput(alg.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomNormalV2(opBuilder.build()); + return new StatelessRandomNormalV2<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomNormalV2 operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomNormalV2 operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). - * @return a new instance of StatelessRandomNormalV2 + * @return a new instance of StatelessRandomNormalV2, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessRandomNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomNormalV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg) { return create(scope, shape, key, counter, alg, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomNormalV2"; - - private Output output; - - private StatelessRandomNormalV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomPoisson.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomPoisson.java index 2c0f4b988bc..024b387165b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomPoisson.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomPoisson.java @@ -25,62 +25,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Outputs deterministic pseudorandom random numbers from a Poisson distribution. - *

* Outputs random values from a Poisson distribution. - *

- * The outputs are a deterministic function of `shape`, `seed`, and `lam`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code seed}, and {@code lam}. + * + * @param data type for {@code output} output */ public final class StatelessRandomPoisson extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomPoisson"; + + private Output output; + + private StatelessRandomPoisson(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomPoisson operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param lam The rate of the Poisson distribution. Shape must match the rightmost dimensions - * of `shape`. + * of {@code shape}. * @param dtype The type of the output. + * @param data type for {@code StatelessRandomPoisson} output and operands * @return a new instance of StatelessRandomPoisson */ - @Endpoint(describeByClass = true) - public static StatelessRandomPoisson create(Scope scope, Operand shape, Operand seed, Operand lam, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomPoisson create(Scope scope, + Operand shape, Operand seed, + Operand lam, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomPoisson", scope.makeOpName("StatelessRandomPoisson")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(lam.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomPoisson(opBuilder.build()); + return new StatelessRandomPoisson<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomPoisson"; - - private Output output; - - private StatelessRandomPoisson(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniform.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniform.java index 06a468bb84f..862fd3cdd30 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniform.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniform.java @@ -31,69 +31,79 @@ /** * Outputs deterministic pseudorandom random values from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[0, 1)`. The + * The generated values follow a uniform distribution in the range {@code [0, 1)}. The * lower bound 0 is included in the range, while the upper bound 1 is excluded. - *

- * The outputs are a deterministic function of `shape` and `seed`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape} and {@code seed}. + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class StatelessRandomUniform extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomUniform"; + + private Output output; + + private StatelessRandomUniform(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniform operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param dtype The type of the output. + * @param data type for {@code StatelessRandomUniform} output and operands * @return a new instance of StatelessRandomUniform */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniform create(Scope scope, Operand shape, Operand seed, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniform create(Scope scope, + Operand shape, Operand seed, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniform", scope.makeOpName("StatelessRandomUniform")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomUniform(opBuilder.build()); + return new StatelessRandomUniform<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomUniform operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomUniform operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessRandomUniform + * @return a new instance of StatelessRandomUniform, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniform create(Scope scope, Operand shape, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniform create(Scope scope, + Operand shape, Operand seed) { return create(scope, shape, seed, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniform"; - - private Output output; - - private StatelessRandomUniform(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullInt.java index 87c2d18b556..7b3b02d9677 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullInt.java @@ -25,59 +25,63 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Outputs deterministic pseudorandom random integers from a uniform distribution. - *

- * The generated values are uniform integers covering the whole range of `dtype`. - *

- * The outputs are a deterministic function of `shape` and `seed`. - * - * @param data type for {@code output()} output + * The generated values are uniform integers covering the whole range of {@code dtype}. + *

The outputs are a deterministic function of {@code shape} and {@code seed}. + * + * @param data type for {@code output} output */ public final class StatelessRandomUniformFullInt extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomUniformFullInt"; + + private Output output; + + private StatelessRandomUniformFullInt(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformFullInt operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param dtype The type of the output. + * @param data type for {@code StatelessRandomUniformFullInt} output and operands * @return a new instance of StatelessRandomUniformFullInt */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformFullInt create(Scope scope, Operand shape, Operand seed, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformFullInt create(Scope scope, + Operand shape, Operand seed, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformFullInt", scope.makeOpName("StatelessRandomUniformFullInt")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomUniformFullInt(opBuilder.build()); + return new StatelessRandomUniformFullInt<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformFullInt"; - - private Output output; - - private StatelessRandomUniformFullInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullIntV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullIntV2.java index 8e9e2d572e2..b2334470ce2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullIntV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformFullIntV2.java @@ -25,34 +25,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom random integers from a uniform distribution. - *

- * The generated values are uniform integers covering the whole range of `dtype`. - *

- * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. - * - * @param data type for {@code output()} output + * The generated values are uniform integers covering the whole range of {@code dtype}. + *

The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @param data type for {@code output} output */ public final class StatelessRandomUniformFullIntV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomUniformFullIntV2"; + + private Output output; + + private StatelessRandomUniformFullIntV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformFullIntV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). * @param dtype The type of the output. + * @param data type for {@code StatelessRandomUniformFullIntV2} output and operands * @return a new instance of StatelessRandomUniformFullIntV2 */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformFullIntV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformFullIntV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformFullIntV2", scope.makeOpName("StatelessRandomUniformFullIntV2")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); @@ -60,29 +75,20 @@ public static StatelessRandomUniformFullIntV2 create(Scop opBuilder.addInput(alg.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomUniformFullIntV2(opBuilder.build()); + return new StatelessRandomUniformFullIntV2<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformFullIntV2"; - - private Output output; - - private StatelessRandomUniformFullIntV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformInt.java index 37b882c8c39..4233ab669e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformInt.java @@ -24,61 +24,66 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; /** * Outputs deterministic pseudorandom random integers from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[minval, maxval)`. - *

- * The outputs are a deterministic function of `shape`, `seed`, `minval`, and `maxval`. - * - * @param data type for {@code output()} output + * The generated values follow a uniform distribution in the range {@code [minval, maxval)}. + *

The outputs are a deterministic function of {@code shape}, {@code seed}, {@code minval}, and {@code maxval}. + * + * @param data type for {@code output} output */ public final class StatelessRandomUniformInt extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomUniformInt"; + + private Output output; + + private StatelessRandomUniformInt(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformInt operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param minval Minimum value (inclusive, scalar). * @param maxval Maximum value (exclusive, scalar). + * @param data type for {@code StatelessRandomUniformInt} output and operands * @return a new instance of StatelessRandomUniformInt */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformInt create(Scope scope, Operand shape, Operand seed, Operand minval, Operand maxval) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformInt create(Scope scope, + Operand shape, Operand seed, Operand minval, + Operand maxval) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformInt", scope.makeOpName("StatelessRandomUniformInt")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(minval.asOutput()); opBuilder.addInput(maxval.asOutput()); opBuilder = scope.apply(opBuilder); - return new StatelessRandomUniformInt(opBuilder.build()); + return new StatelessRandomUniformInt<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformInt"; - - private Output output; - - private StatelessRandomUniformInt(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformIntV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformIntV2.java index 885c6440764..ad8440df49b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformIntV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformIntV2.java @@ -24,24 +24,34 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom random integers from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[minval, maxval)`. - *

- * The outputs are a deterministic function of `shape`, `key`, `counter`, `alg`, `minval` and `maxval`. - * - * @param data type for {@code output()} output + * The generated values follow a uniform distribution in the range {@code [minval, maxval)}. + *

The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter}, {@code alg}, {@code minval} and {@code maxval}. + * + * @param data type for {@code output} output */ public final class StatelessRandomUniformIntV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomUniformIntV2"; + + private Output output; + + private StatelessRandomUniformIntV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformIntV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). @@ -49,10 +59,15 @@ public final class StatelessRandomUniformIntV2 extends RawOp * @param alg The RNG algorithm (shape int32[]). * @param minval Minimum value (inclusive, scalar). * @param maxval Maximum value (exclusive, scalar). + * @param data type for {@code StatelessRandomUniformIntV2} output and operands * @return a new instance of StatelessRandomUniformIntV2 */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformIntV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Operand minval, Operand maxval) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformIntV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Operand minval, Operand maxval) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformIntV2", scope.makeOpName("StatelessRandomUniformIntV2")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); @@ -61,29 +76,20 @@ public static StatelessRandomUniformIntV2 create(Scope sc opBuilder.addInput(minval.asOutput()); opBuilder.addInput(maxval.asOutput()); opBuilder = scope.apply(opBuilder); - return new StatelessRandomUniformIntV2(opBuilder.build()); + return new StatelessRandomUniformIntV2<>(opBuilder.build()); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformIntV2"; - - private Output output; - - private StatelessRandomUniformIntV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformV2.java index 0fa51757aef..2764bbbb81c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessRandomUniformV2.java @@ -25,36 +25,51 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom random values from a uniform distribution. - *

- * The generated values follow a uniform distribution in the range `[0, 1)`. The + * The generated values follow a uniform distribution in the range {@code [0, 1)}. The * lower bound 0 is included in the range, while the upper bound 1 is excluded. - *

- * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @param data type for {@code output} output */ public final class StatelessRandomUniformV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessRandomUniformV2"; + + private Output output; + + private StatelessRandomUniformV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessRandomUniformV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). * @param dtype The type of the output. + * @param data type for {@code StatelessRandomUniformV2} output and operands * @return a new instance of StatelessRandomUniformV2 */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniformV2", scope.makeOpName("StatelessRandomUniformV2")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); @@ -62,44 +77,39 @@ public static StatelessRandomUniformV2 create(Scope scope opBuilder.addInput(alg.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessRandomUniformV2(opBuilder.build()); + return new StatelessRandomUniformV2<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessRandomUniformV2 operation using default output types. - * + * Factory method to create a class wrapping a new StatelessRandomUniformV2 operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). - * @return a new instance of StatelessRandomUniformV2 + * @return a new instance of StatelessRandomUniformV2, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessRandomUniformV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg) { + @Endpoint( + describeByClass = true + ) + public static StatelessRandomUniformV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg) { return create(scope, shape, key, counter, alg, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessRandomUniformV2"; - - private Output output; - - private StatelessRandomUniformV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormal.java index 6550b77b3a9..7e69cacd5d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormal.java @@ -31,70 +31,80 @@ /** * Outputs deterministic pseudorandom values from a truncated normal distribution. - *

* The generated values follow a normal distribution with mean 0 and standard * deviation 1, except that values whose magnitude is more than 2 standard * deviations from the mean are dropped and re-picked. - *

- * The outputs are a deterministic function of `shape` and `seed`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape} and {@code seed}. + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class StatelessTruncatedNormal extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessTruncatedNormal"; + + private Output output; + + private StatelessTruncatedNormal(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessTruncatedNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param dtype The type of the output. + * @param data type for {@code StatelessTruncatedNormal} output and operands * @return a new instance of StatelessTruncatedNormal */ - @Endpoint(describeByClass = true) - public static StatelessTruncatedNormal create(Scope scope, Operand shape, Operand seed, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessTruncatedNormal create(Scope scope, + Operand shape, Operand seed, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessTruncatedNormal", scope.makeOpName("StatelessTruncatedNormal")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessTruncatedNormal(opBuilder.build()); + return new StatelessTruncatedNormal<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessTruncatedNormal operation using default output types. - * + * Factory method to create a class wrapping a new StatelessTruncatedNormal operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessTruncatedNormal + * @return a new instance of StatelessTruncatedNormal, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessTruncatedNormal create(Scope scope, Operand shape, Operand seed) { + @Endpoint( + describeByClass = true + ) + public static StatelessTruncatedNormal create(Scope scope, + Operand shape, Operand seed) { return create(scope, shape, seed, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessTruncatedNormal"; - - private Output output; - - private StatelessTruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormalV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormalV2.java index 02146b32b27..24515a7739f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormalV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/StatelessTruncatedNormalV2.java @@ -25,37 +25,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom values from a truncated normal distribution. - *

* The generated values follow a normal distribution with mean 0 and standard * deviation 1, except that values whose magnitude is more than 2 standard * deviations from the mean are dropped and re-picked. - *

- * The outputs are a deterministic function of `shape`, `key`, `counter` and `alg`. - * - * @param data type for {@code output()} output + *

The outputs are a deterministic function of {@code shape}, {@code key}, {@code counter} and {@code alg}. + * + * @param data type for {@code output} output */ public final class StatelessTruncatedNormalV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatelessTruncatedNormalV2"; + + private Output output; + + private StatelessTruncatedNormalV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatelessTruncatedNormalV2 operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). * @param dtype The type of the output. + * @param data type for {@code StatelessTruncatedNormalV2} output and operands * @return a new instance of StatelessTruncatedNormalV2 */ - @Endpoint(describeByClass = true) - public static StatelessTruncatedNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static StatelessTruncatedNormalV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessTruncatedNormalV2", scope.makeOpName("StatelessTruncatedNormalV2")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(key.asOutput()); @@ -63,44 +78,39 @@ public static StatelessTruncatedNormalV2 create(Scope sco opBuilder.addInput(alg.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new StatelessTruncatedNormalV2(opBuilder.build()); + return new StatelessTruncatedNormalV2<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new StatelessTruncatedNormalV2 operation using default output types. - * + * Factory method to create a class wrapping a new StatelessTruncatedNormalV2 operation, with the default output types. + * * @param scope current scope * @param shape The shape of the output tensor. * @param key Key for the counter-based RNG algorithm (shape uint64[1]). * @param counter Initial counter for the counter-based RNG algorithm (shape uint64[2] or uint64[1] depending on the algorithm). If a larger vector is given, only the needed portion on the left (i.e. [:N]) will be used. * @param alg The RNG algorithm (shape int32[]). - * @return a new instance of StatelessTruncatedNormalV2 + * @return a new instance of StatelessTruncatedNormalV2, with default output types */ - @Endpoint(describeByClass = true) - public static StatelessTruncatedNormalV2 create(Scope scope, Operand shape, Operand key, Operand counter, Operand alg) { + @Endpoint( + describeByClass = true + ) + public static StatelessTruncatedNormalV2 create(Scope scope, + Operand shape, Operand key, + Operand counter, Operand alg) { return create(scope, shape, key, counter, alg, TFloat32.class); } - + /** + * Gets output. * Random values with specified shape. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatelessTruncatedNormalV2"; - - private Output output; - - private StatelessTruncatedNormalV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/TruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/TruncatedNormal.java index aa2be6ce8ea..064c00c8eaf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/TruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/TruncatedNormal.java @@ -30,57 +30,44 @@ /** * Outputs random values from a truncated normal distribution. - *

* The generated values follow a normal distribution with mean 0 and standard * deviation 1, except that values whose magnitude is more than 2 standard * deviations from the mean are dropped and re-picked. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class TruncatedNormal extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.random.TruncatedNormal} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 A second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "TruncatedNormal"; + + private Output output; + + private TruncatedNormal(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TruncatedNormal operation. - * + * * @param scope current scope * @param shape The shape of the output tensor. * @param dtype The type of the output. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TruncatedNormal} output and operands * @return a new instance of TruncatedNormal */ - @Endpoint(describeByClass = true) - public static TruncatedNormal create(Scope scope, Operand shape, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TruncatedNormal create(Scope scope, + Operand shape, Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TruncatedNormal", scope.makeOpName("TruncatedNormal")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.apply(opBuilder); @@ -95,46 +82,79 @@ public static TruncatedNormal create(Scope scope, Operand } } } - return new TruncatedNormal(opBuilder.build()); + return new TruncatedNormal<>(opBuilder.build()); } - + /** - * @param seed If either `seed` or `seed2` are set to be non-zero, the random number + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets output. * A tensor of the specified shape filled with random truncated normal * values. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TruncatedNormal"; - - private Output output; - - private TruncatedNormal(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.TruncatedNormal} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either {@code seed} or {@code seed2} are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 A second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/UniformCandidateSampler.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/UniformCandidateSampler.java index 8a5a7ce3c21..acd4e26b450 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/UniformCandidateSampler.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/UniformCandidateSampler.java @@ -30,53 +30,40 @@ /** * Generates labels for candidate sampling with a uniform 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. */ -@Operator(group = "random") +@Operator( + group = "random" +) public final class UniformCandidateSampler extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.random.UniformCandidateSampler} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param seed If either seed or seed2 are set to be non-zero, the random number - * generator is seeded by the given seed. Otherwise, it is seeded by a - * random seed. - */ - public Options seed(Long seed) { - this.seed = seed; - return this; - } - - /** - * @param seed2 An second seed to avoid seed collision. - */ - public Options seed2(Long seed2) { - this.seed2 = seed2; - return this; - } - - private Long seed; - private Long seed2; - - private Options() { - } + public static final String OP_NAME = "UniformCandidateSampler"; + + private Output sampledCandidates; + + private Output trueExpectedCount; + + private Output sampledExpectedCount; + + private UniformCandidateSampler(Operation operation) { + super(operation); + int outputIdx = 0; + sampledCandidates = operation.output(outputIdx++); + trueExpectedCount = operation.output(outputIdx++); + sampledExpectedCount = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UniformCandidateSampler operation. - * + * * @param scope current scope * @param trueClasses A batch_size * num_true matrix, in which each row contains the * IDs of the num_true target_classes in the corresponding original label. @@ -86,11 +73,14 @@ private Options() { * 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 UniformCandidateSampler */ - @Endpoint(describeByClass = true) - public static UniformCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UniformCandidateSampler create(Scope scope, Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("UniformCandidateSampler", scope.makeOpName("UniformCandidateSampler")); opBuilder.addInput(trueClasses.asOutput()); opBuilder = scope.apply(opBuilder); @@ -110,62 +100,95 @@ public static UniformCandidateSampler create(Scope scope, Operand trueCl } return new UniformCandidateSampler(opBuilder.build()); } - + /** + * Sets the seed option. + * * @param seed If either seed or seed2 are set to be non-zero, the random number * generator is seeded by the given seed. Otherwise, it is seeded by a * random seed. + * @return this Options instance. */ public static Options seed(Long seed) { return new Options().seed(seed); } - + /** + * Sets the seed2 option. + * * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. */ public static Options seed2(Long seed2) { return new Options().seed2(seed2); } - + /** + * Gets sampledCandidates. * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. + * @return sampledCandidates. */ public Output sampledCandidates() { return sampledCandidates; } - + /** + * Gets trueExpectedCount. * A batch_size * num_true matrix, representing * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. + * @return trueExpectedCount. */ public Output trueExpectedCount() { return trueExpectedCount; } - + /** + * Gets sampledExpectedCount. * A vector of length num_sampled, for each sampled * candidate representing the number of times the candidate is expected * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. + * @return sampledExpectedCount. */ public Output sampledExpectedCount() { return sampledExpectedCount; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UniformCandidateSampler"; - - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; - - private UniformCandidateSampler(Operation operation) { - super(operation); - int outputIdx = 0; - sampledCandidates = operation.output(outputIdx++); - trueExpectedCount = operation.output(outputIdx++); - sampledExpectedCount = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.random.UniformCandidateSampler} + */ + public static class Options { + private Long seed; + + private Long seed2; + + private Options() { + } + + /** + * Sets the seed option. + * + * @param seed If either seed or seed2 are set to be non-zero, the random number + * generator is seeded by the given seed. Otherwise, it is seeded by a + * random seed. + * @return this Options instance. + */ + public Options seed(Long seed) { + this.seed = seed; + return this; + } + + /** + * Sets the seed2 option. + * + * @param seed2 An second seed to avoid seed collision. + * @return this Options instance. + */ + public Options seed2(Long seed2) { + this.seed2 = seed2; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/experimental/DummySeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/experimental/DummySeedGenerator.java index 8c60fc6350f..5a9a6d8b9ff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/experimental/DummySeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/random/experimental/DummySeedGenerator.java @@ -24,46 +24,53 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The DummySeedGenerator operation */ public final class DummySeedGenerator extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DummySeedGenerator"; + + private Output handle; + + @SuppressWarnings("unchecked") + private DummySeedGenerator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DummySeedGenerator operation. - * + * * @param scope current scope * @return a new instance of DummySeedGenerator */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static DummySeedGenerator create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("DummySeedGenerator", scope.makeOpName("DummySeedGenerator")); opBuilder = scope.apply(opBuilder); return new DummySeedGenerator(opBuilder.build()); } - + /** + * Gets handle. + * + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DummySeedGenerator"; - - private Output handle; - - private DummySeedGenerator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft.java index fcc3eaa813b..4aa82a29d13 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft.java @@ -28,45 +28,55 @@ import org.tensorflow.types.family.TType; /** + * The BatchFFT operation */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class BatchFft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchFft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchFFT"; + + private Output output; + + @SuppressWarnings("unchecked") + private BatchFft(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchFFT operation. + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of BatchFft */ - @Endpoint(describeByClass = true) - public static BatchFft create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static BatchFft create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchFFT", scope.makeOpName("BatchFft")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new BatchFft(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchFFT"; - - private Output output; - - private BatchFft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft2d.java index 13fc0ba9d42..d35c420a4fc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft2d.java @@ -28,45 +28,55 @@ import org.tensorflow.types.family.TType; /** + * The BatchFFT2D operation */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class BatchFft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchFft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchFFT2D"; + + private Output output; + + @SuppressWarnings("unchecked") + private BatchFft2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchFFT2D operation. + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of BatchFft2d */ - @Endpoint(describeByClass = true) - public static BatchFft2d create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static BatchFft2d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchFFT2D", scope.makeOpName("BatchFft2d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new BatchFft2d(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchFFT2D"; - - private Output output; - - private BatchFft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft3d.java index 9f28e6634f0..cec014617f6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchFft3d.java @@ -28,45 +28,55 @@ import org.tensorflow.types.family.TType; /** + * The BatchFFT3D operation */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class BatchFft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchFft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchFFT3D"; + + private Output output; + + @SuppressWarnings("unchecked") + private BatchFft3d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchFFT3D operation. + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of BatchFft3d */ - @Endpoint(describeByClass = true) - public static BatchFft3d create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static BatchFft3d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchFFT3D", scope.makeOpName("BatchFft3d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new BatchFft3d(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchFFT3D"; - - private Output output; - - private BatchFft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft.java index 282eec13ac1..ddd64123e1f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft.java @@ -28,45 +28,55 @@ import org.tensorflow.types.family.TType; /** + * The BatchIFFT operation */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class BatchIfft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchIfft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchIFFT"; + + private Output output; + + @SuppressWarnings("unchecked") + private BatchIfft(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchIFFT operation. + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of BatchIfft */ - @Endpoint(describeByClass = true) - public static BatchIfft create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static BatchIfft create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchIFFT", scope.makeOpName("BatchIfft")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new BatchIfft(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchIFFT"; - - private Output output; - - private BatchIfft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft2d.java index 318102e94ac..162d4111ec7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft2d.java @@ -28,45 +28,55 @@ import org.tensorflow.types.family.TType; /** + * The BatchIFFT2D operation */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class BatchIfft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchIfft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchIFFT2D"; + + private Output output; + + @SuppressWarnings("unchecked") + private BatchIfft2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchIFFT2D operation. + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of BatchIfft2d */ - @Endpoint(describeByClass = true) - public static BatchIfft2d create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static BatchIfft2d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchIFFT2D", scope.makeOpName("BatchIfft2d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new BatchIfft2d(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchIFFT2D"; - - private Output output; - - private BatchIfft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft3d.java index f50257f0129..a3b30fcfa99 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/BatchIfft3d.java @@ -28,45 +28,55 @@ import org.tensorflow.types.family.TType; /** + * The BatchIFFT3D operation */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class BatchIfft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new BatchIfft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "BatchIFFT3D"; + + private Output output; + + @SuppressWarnings("unchecked") + private BatchIfft3d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new BatchIFFT3D operation. + * * @param scope current scope - * @param input + * @param input the input value * @return a new instance of BatchIfft3d */ - @Endpoint(describeByClass = true) - public static BatchIfft3d create(Scope scope, Operand input) { + @Endpoint( + describeByClass = true + ) + public static BatchIfft3d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchIFFT3D", scope.makeOpName("BatchIfft3d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new BatchIfft3d(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchIFFT3D"; - - private Output output; - - private BatchIfft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft.java index 7e64778dd99..70f3d26624f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft.java @@ -29,55 +29,61 @@ /** * Fast Fourier transform. - *

* Computes the 1-dimensional discrete Fourier transform over the inner-most - * dimension of `input`. - * - * @param data type for {@code output()} output + * dimension of {@code input}. + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Fft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Fft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FFT"; + + private Output output; + + private Fft(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FFT operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code FFT} output and operands * @return a new instance of Fft */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Fft create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("FFT", scope.makeOpName("Fft")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Fft(opBuilder.build()); + return new Fft<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most - * dimension of `input` is replaced with its 1D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most + * dimension of {@code input} is replaced with its 1D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.fft - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FFT"; - - private Output output; - - private Fft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft2d.java index d8c1d3332b9..11269998d38 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft2d.java @@ -29,55 +29,61 @@ /** * 2D fast Fourier transform. - *

* Computes the 2-dimensional discrete Fourier transform over the inner-most - * 2 dimensions of `input`. - * - * @param data type for {@code output()} output + * 2 dimensions of {@code input}. + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Fft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Fft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FFT2D"; + + private Output output; + + private Fft2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FFT2D operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code FFT2D} output and operands * @return a new instance of Fft2d */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Fft2d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("FFT2D", scope.makeOpName("Fft2d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Fft2d(opBuilder.build()); + return new Fft2d<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most 2 - * dimensions of `input` are replaced with their 2D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most 2 + * dimensions of {@code input} are replaced with their 2D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.fft2 - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FFT2D"; - - private Output output; - - private Fft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft3d.java index 167e6e6dd23..034937793d3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Fft3d.java @@ -29,55 +29,61 @@ /** * 3D fast Fourier transform. - *

* Computes the 3-dimensional discrete Fourier transform over the inner-most 3 - * dimensions of `input`. - * - * @param data type for {@code output()} output + * dimensions of {@code input}. + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Fft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Fft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FFT3D"; + + private Output output; + + private Fft3d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new FFT3D operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code FFT3D} output and operands * @return a new instance of Fft3d */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Fft3d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("FFT3D", scope.makeOpName("Fft3d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Fft3d(opBuilder.build()); + return new Fft3d<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most 3 - * dimensions of `input` are replaced with their 3D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most 3 + * dimensions of {@code input} are replaced with their 3D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.fftn with 3 dimensions. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FFT3D"; - - private Output output; - - private Fft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft.java index 21b794f0731..aee45785d2b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft.java @@ -29,55 +29,61 @@ /** * Inverse fast Fourier transform. - *

* Computes the inverse 1-dimensional discrete Fourier transform over the - * inner-most dimension of `input`. - * - * @param data type for {@code output()} output + * inner-most dimension of {@code input}. + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Ifft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Ifft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IFFT"; + + private Output output; + + private Ifft(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IFFT operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code IFFT} output and operands * @return a new instance of Ifft */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ifft create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("IFFT", scope.makeOpName("Ifft")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Ifft(opBuilder.build()); + return new Ifft<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most - * dimension of `input` is replaced with its inverse 1D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most + * dimension of {@code input} is replaced with its inverse 1D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.ifft - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IFFT"; - - private Output output; - - private Ifft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft2d.java index 4a5a3063d9d..3e16e93f3b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft2d.java @@ -29,55 +29,61 @@ /** * Inverse 2D fast Fourier transform. - *

* Computes the inverse 2-dimensional discrete Fourier transform over the - * inner-most 2 dimensions of `input`. - * - * @param data type for {@code output()} output + * inner-most 2 dimensions of {@code input}. + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Ifft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Ifft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IFFT2D"; + + private Output output; + + private Ifft2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IFFT2D operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code IFFT2D} output and operands * @return a new instance of Ifft2d */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ifft2d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("IFFT2D", scope.makeOpName("Ifft2d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Ifft2d(opBuilder.build()); + return new Ifft2d<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most 2 - * dimensions of `input` are replaced with their inverse 2D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most 2 + * dimensions of {@code input} are replaced with their inverse 2D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.ifft2 - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IFFT2D"; - - private Output output; - - private Ifft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft3d.java index 24995f28a16..518b8123129 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft3d.java @@ -29,55 +29,61 @@ /** * Inverse 3D fast Fourier transform. - *

* Computes the inverse 3-dimensional discrete Fourier transform over the - * inner-most 3 dimensions of `input`. - * - * @param data type for {@code output()} output + * inner-most 3 dimensions of {@code input}. + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Ifft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Ifft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IFFT3D"; + + private Output output; + + private Ifft3d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IFFT3D operation. + * * @param scope current scope * @param input A complex tensor. + * @param data type for {@code IFFT3D} output and operands * @return a new instance of Ifft3d */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Ifft3d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("IFFT3D", scope.makeOpName("Ifft3d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Ifft3d(opBuilder.build()); + return new Ifft3d<>(opBuilder.build()); } - + /** - * A complex tensor of the same shape as `input`. The inner-most 3 - * dimensions of `input` are replaced with their inverse 3D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex tensor of the same shape as {@code input}. The inner-most 3 + * dimensions of {@code input} are replaced with their inverse 3D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.ifftn with 3 dimensions. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IFFT3D"; - - private Output output; - - private Ifft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft.java index f823a9be60c..d60e3507876 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft.java @@ -33,84 +33,92 @@ /** * Inverse real-valued fast Fourier transform. - *

* Computes the inverse 1-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most dimension of `input`. - *

- * The inner-most dimension of `input` is assumed to be the result of `RFFT`: the - * `fft_length / 2 + 1` unique components of the DFT of a real-valued signal. If - * `fft_length` is not provided, it is computed from the size of the inner-most - * dimension of `input` (`fft_length = 2 * (inner - 1)`). If the FFT length used to - * compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most dimension of {@code input}. + *

The inner-most dimension of {@code input} is assumed to be the result of {@code RFFT}: the + * {@code fft_length / 2 + 1} unique components of the DFT of a real-valued signal. If + * {@code fft_length} is not provided, it is computed from the size of the inner-most + * dimension of {@code input} ({@code fft_length = 2 * (inner - 1)}). If the FFT length used to + * compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along the axis `signal.Irfft` is computed on, if `fft_length / 2 + 1` is smaller - * than the corresponding dimension of `input`, the dimension is cropped. If it is + *

Along the axis {@code signal.Irfft} is computed on, if {@code fft_length / 2 + 1} is smaller + * than the corresponding dimension of {@code input}, the dimension is cropped. If it is * larger, the dimension is padded with zeros. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Irfft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Irfft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IRFFT"; + + private Output output; + + private Irfft(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IRFFT operation. + * * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Treal + * @param Treal the value of the Treal property + * @param data type for {@code IRFFT} output and operands * @return a new instance of Irfft */ - @Endpoint(describeByClass = true) - public static Irfft create(Scope scope, Operand input, Operand fftLength, Class Treal) { + @Endpoint( + describeByClass = true + ) + public static Irfft create(Scope scope, Operand input, + Operand fftLength, Class Treal) { OperationBuilder opBuilder = scope.env().opBuilder("IRFFT", scope.makeOpName("Irfft")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Treal", Operands.toDataType(Treal)); - return new Irfft(opBuilder.build()); + return new Irfft<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Irfft operation using default output types. - * + * Factory method to create a class wrapping a new IRFFT operation, with the default output types. + * * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @return a new instance of Irfft + * @return a new instance of Irfft, with default output types */ - @Endpoint(describeByClass = true) - public static Irfft create(Scope scope, Operand input, Operand fftLength) { + @Endpoint( + describeByClass = true + ) + public static Irfft create(Scope scope, Operand input, + Operand fftLength) { return create(scope, input, fftLength, TFloat32.class); } - + /** - * A float32 tensor of the same rank as `input`. The inner-most - * dimension of `input` is replaced with the `fft_length` samples of its inverse - * 1D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A float32 tensor of the same rank as {@code input}. The inner-most + * dimension of {@code input} is replaced with the {@code fft_length} samples of its inverse + * 1D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.irfft - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IRFFT"; - - private Output output; - - private Irfft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft2d.java index 709297f6afe..944cb75feda 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft2d.java @@ -33,85 +33,93 @@ /** * Inverse 2D real-valued fast Fourier transform. - *

* Computes the inverse 2-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most 2 dimensions of `input`. - *

- * The inner-most 2 dimensions of `input` are assumed to be the result of `RFFT2D`: - * The inner-most dimension contains the `fft_length / 2 + 1` unique components of - * the DFT of a real-valued signal. If `fft_length` is not provided, it is computed - * from the size of the inner-most 2 dimensions of `input`. If the FFT length used - * to compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most 2 dimensions of {@code input}. + *

The inner-most 2 dimensions of {@code input} are assumed to be the result of {@code RFFT2D}: + * The inner-most dimension contains the {@code fft_length / 2 + 1} unique components of + * the DFT of a real-valued signal. If {@code fft_length} is not provided, it is computed + * from the size of the inner-most 2 dimensions of {@code input}. If the FFT length used + * to compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along each axis `signal.Irfft2d` is computed on, if `fft_length` (or - * `fft_length / 2 + 1` for the inner-most dimension) is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Irfft2d} is computed on, if {@code fft_length} (or + * {@code fft_length / 2 + 1} for the inner-most dimension) is smaller than the + * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Irfft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Irfft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IRFFT2D"; + + private Output output; + + private Irfft2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IRFFT2D operation. + * * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @param Treal + * @param Treal the value of the Treal property + * @param data type for {@code IRFFT2D} output and operands * @return a new instance of Irfft2d */ - @Endpoint(describeByClass = true) - public static Irfft2d create(Scope scope, Operand input, Operand fftLength, Class Treal) { + @Endpoint( + describeByClass = true + ) + public static Irfft2d create(Scope scope, Operand input, + Operand fftLength, Class Treal) { OperationBuilder opBuilder = scope.env().opBuilder("IRFFT2D", scope.makeOpName("Irfft2d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Treal", Operands.toDataType(Treal)); - return new Irfft2d(opBuilder.build()); + return new Irfft2d<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Irfft2d operation using default output types. - * + * Factory method to create a class wrapping a new IRFFT2D operation, with the default output types. + * * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @return a new instance of Irfft2d + * @return a new instance of Irfft2d, with default output types */ - @Endpoint(describeByClass = true) - public static Irfft2d create(Scope scope, Operand input, Operand fftLength) { + @Endpoint( + describeByClass = true + ) + public static Irfft2d create(Scope scope, Operand input, + Operand fftLength) { return create(scope, input, fftLength, TFloat32.class); } - + /** - * A float32 tensor of the same rank as `input`. The inner-most 2 - * dimensions of `input` are replaced with the `fft_length` samples of their - * inverse 2D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A float32 tensor of the same rank as {@code input}. The inner-most 2 + * dimensions of {@code input} are replaced with the {@code fft_length} samples of their + * inverse 2D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.irfft2 - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IRFFT2D"; - - private Output output; - - private Irfft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft3d.java index c30315d1e7b..1e09ac9f401 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Irfft3d.java @@ -33,85 +33,93 @@ /** * Inverse 3D real-valued fast Fourier transform. - *

* Computes the inverse 3-dimensional discrete Fourier transform of a real-valued - * signal over the inner-most 3 dimensions of `input`. - *

- * The inner-most 3 dimensions of `input` are assumed to be the result of `RFFT3D`: - * The inner-most dimension contains the `fft_length / 2 + 1` unique components of - * the DFT of a real-valued signal. If `fft_length` is not provided, it is computed - * from the size of the inner-most 3 dimensions of `input`. If the FFT length used - * to compute `input` is odd, it should be provided since it cannot be inferred + * signal over the inner-most 3 dimensions of {@code input}. + *

The inner-most 3 dimensions of {@code input} are assumed to be the result of {@code RFFT3D}: + * The inner-most dimension contains the {@code fft_length / 2 + 1} unique components of + * the DFT of a real-valued signal. If {@code fft_length} is not provided, it is computed + * from the size of the inner-most 3 dimensions of {@code input}. If the FFT length used + * to compute {@code input} is odd, it should be provided since it cannot be inferred * properly. - *

- * Along each axis `signal.Irfft3d` is computed on, if `fft_length` (or - * `fft_length / 2 + 1` for the inner-most dimension) is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Irfft3d} is computed on, if {@code fft_length} (or + * {@code fft_length / 2 + 1} for the inner-most dimension) is smaller than the + * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Irfft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Irfft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "IRFFT3D"; + + private Output output; + + private Irfft3d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new IRFFT3D operation. + * * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @param Treal + * @param Treal the value of the Treal property + * @param data type for {@code IRFFT3D} output and operands * @return a new instance of Irfft3d */ - @Endpoint(describeByClass = true) - public static Irfft3d create(Scope scope, Operand input, Operand fftLength, Class Treal) { + @Endpoint( + describeByClass = true + ) + public static Irfft3d create(Scope scope, Operand input, + Operand fftLength, Class Treal) { OperationBuilder opBuilder = scope.env().opBuilder("IRFFT3D", scope.makeOpName("Irfft3d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Treal", Operands.toDataType(Treal)); - return new Irfft3d(opBuilder.build()); + return new Irfft3d<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new Irfft3d operation using default output types. - * + * Factory method to create a class wrapping a new IRFFT3D operation, with the default output types. + * * @param scope current scope * @param input A complex tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @return a new instance of Irfft3d + * @return a new instance of Irfft3d, with default output types */ - @Endpoint(describeByClass = true) - public static Irfft3d create(Scope scope, Operand input, Operand fftLength) { + @Endpoint( + describeByClass = true + ) + public static Irfft3d create(Scope scope, Operand input, + Operand fftLength) { return create(scope, input, fftLength, TFloat32.class); } - + /** - * A float32 tensor of the same rank as `input`. The inner-most 3 - * dimensions of `input` are replaced with the `fft_length` samples of their - * inverse 3D real Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A float32 tensor of the same rank as {@code input}. The inner-most 3 + * dimensions of {@code input} are replaced with the {@code fft_length} samples of their + * inverse 3D real Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.irfftn with 3 dimensions. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "IRFFT3D"; - - private Output output; - - private Irfft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft.java index 5ca4fe1c4d5..36651f98d4a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft.java @@ -32,68 +32,73 @@ /** * Real-valued fast Fourier transform. - *

* Computes the 1-dimensional discrete Fourier transform of a real-valued signal - * over the inner-most dimension of `input`. - *

- * Since the DFT of a real signal is Hermitian-symmetric, `signal.Rfft` only returns the - * `fft_length / 2 + 1` unique components of the FFT: the zero-frequency term, - * followed by the `fft_length / 2` positive-frequency terms. - *

- * Along the axis `signal.Rfft` is computed on, if `fft_length` is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + * over the inner-most dimension of {@code input}. + *

Since the DFT of a real signal is Hermitian-symmetric, {@code signal.Rfft} only returns the + * {@code fft_length / 2 + 1} unique components of the FFT: the zero-frequency term, + * followed by the {@code fft_length / 2} positive-frequency terms. + *

Along the axis {@code signal.Rfft} is computed on, if {@code fft_length} is smaller than the + * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Rfft extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Rfft operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RFFT"; + + private Output output; + + private Rfft(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RFFT operation. + * * @param scope current scope * @param input A float32 tensor. * @param fftLength An int32 tensor of shape [1]. The FFT length. - * @param Tcomplex + * @param Tcomplex the value of the Tcomplex property + * @param data type for {@code RFFT} output and operands * @return a new instance of Rfft */ - @Endpoint(describeByClass = true) - public static Rfft create(Scope scope, Operand input, Operand fftLength, Class Tcomplex) { + @Endpoint( + describeByClass = true + ) + public static Rfft create(Scope scope, Operand input, + Operand fftLength, Class Tcomplex) { OperationBuilder opBuilder = scope.env().opBuilder("RFFT", scope.makeOpName("Rfft")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tcomplex", Operands.toDataType(Tcomplex)); - return new Rfft(opBuilder.build()); + return new Rfft<>(opBuilder.build()); } - + /** - * A complex64 tensor of the same rank as `input`. The inner-most - * dimension of `input` is replaced with the `fft_length / 2 + 1` unique - * frequency components of its 1D Fourier transform. - *

- * @compatibility(numpy) + * Gets output. + * A complex64 tensor of the same rank as {@code input}. The inner-most + * dimension of {@code input} is replaced with the {@code fft_length / 2 + 1} unique + * frequency components of its 1D Fourier transform. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.rfft - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RFFT"; - - private Output output; - - private Rfft(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft2d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft2d.java index 483d26a898f..04fb89f3ec8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft2d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft2d.java @@ -32,70 +32,75 @@ /** * 2D real-valued fast Fourier transform. - *

* Computes the 2-dimensional discrete Fourier transform of a real-valued signal - * over the inner-most 2 dimensions of `input`. - *

- * Since the DFT of a real signal is Hermitian-symmetric, `signal.Rfft2d` only returns the - * `fft_length / 2 + 1` unique components of the FFT for the inner-most dimension - * of `output`: the zero-frequency term, followed by the `fft_length / 2` + * over the inner-most 2 dimensions of {@code input}. + *

Since the DFT of a real signal is Hermitian-symmetric, {@code signal.Rfft2d} only returns the + * {@code fft_length / 2 + 1} unique components of the FFT for the inner-most dimension + * of {@code output}: the zero-frequency term, followed by the {@code fft_length / 2} * positive-frequency terms. - *

- * Along each axis `signal.Rfft2d` is computed on, if `fft_length` is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Rfft2d} is computed on, if {@code fft_length} is smaller than the + * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Rfft2d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Rfft2d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RFFT2D"; + + private Output output; + + private Rfft2d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RFFT2D operation. + * * @param scope current scope * @param input A float32 tensor. * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @param Tcomplex + * @param Tcomplex the value of the Tcomplex property + * @param data type for {@code RFFT2D} output and operands * @return a new instance of Rfft2d */ - @Endpoint(describeByClass = true) - public static Rfft2d create(Scope scope, Operand input, Operand fftLength, Class Tcomplex) { + @Endpoint( + describeByClass = true + ) + public static Rfft2d create(Scope scope, Operand input, + Operand fftLength, Class Tcomplex) { OperationBuilder opBuilder = scope.env().opBuilder("RFFT2D", scope.makeOpName("Rfft2d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tcomplex", Operands.toDataType(Tcomplex)); - return new Rfft2d(opBuilder.build()); + return new Rfft2d<>(opBuilder.build()); } - + /** - * A complex64 tensor of the same rank as `input`. The inner-most 2 - * dimensions of `input` are replaced with their 2D Fourier transform. The - * inner-most dimension contains `fft_length / 2 + 1` unique frequency - * components. - *

- * @compatibility(numpy) + * Gets output. + * A complex64 tensor of the same rank as {@code input}. The inner-most 2 + * dimensions of {@code input} are replaced with their 2D Fourier transform. The + * inner-most dimension contains {@code fft_length / 2 + 1} unique frequency + * components. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.rfft2 - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RFFT2D"; - - private Output output; - - private Rfft2d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft3d.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft3d.java index cf64fceea54..7786b8003ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft3d.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Rfft3d.java @@ -32,70 +32,75 @@ /** * 3D real-valued fast Fourier transform. - *

* Computes the 3-dimensional discrete Fourier transform of a real-valued signal - * over the inner-most 3 dimensions of `input`. - *

- * Since the DFT of a real signal is Hermitian-symmetric, `signal.Rfft3d` only returns the - * `fft_length / 2 + 1` unique components of the FFT for the inner-most dimension - * of `output`: the zero-frequency term, followed by the `fft_length / 2` + * over the inner-most 3 dimensions of {@code input}. + *

Since the DFT of a real signal is Hermitian-symmetric, {@code signal.Rfft3d} only returns the + * {@code fft_length / 2 + 1} unique components of the FFT for the inner-most dimension + * of {@code output}: the zero-frequency term, followed by the {@code fft_length / 2} * positive-frequency terms. - *

- * Along each axis `signal.Rfft3d` is computed on, if `fft_length` is smaller than the - * corresponding dimension of `input`, the dimension is cropped. If it is larger, + *

Along each axis {@code signal.Rfft3d} is computed on, if {@code fft_length} is smaller than the + * corresponding dimension of {@code input}, the dimension is cropped. If it is larger, * the dimension is padded with zeros. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "signal") +@Operator( + group = "signal" +) public final class Rfft3d extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Rfft3d operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RFFT3D"; + + private Output output; + + private Rfft3d(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new RFFT3D operation. + * * @param scope current scope * @param input A float32 tensor. * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @param Tcomplex + * @param Tcomplex the value of the Tcomplex property + * @param data type for {@code RFFT3D} output and operands * @return a new instance of Rfft3d */ - @Endpoint(describeByClass = true) - public static Rfft3d create(Scope scope, Operand input, Operand fftLength, Class Tcomplex) { + @Endpoint( + describeByClass = true + ) + public static Rfft3d create(Scope scope, Operand input, + Operand fftLength, Class Tcomplex) { OperationBuilder opBuilder = scope.env().opBuilder("RFFT3D", scope.makeOpName("Rfft3d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tcomplex", Operands.toDataType(Tcomplex)); - return new Rfft3d(opBuilder.build()); + return new Rfft3d<>(opBuilder.build()); } - + /** - * A complex64 tensor of the same rank as `input`. The inner-most 3 - * dimensions of `input` are replaced with the their 3D Fourier transform. The - * inner-most dimension contains `fft_length / 2 + 1` unique frequency - * components. - *

- * @compatibility(numpy) + * Gets output. + * A complex64 tensor of the same rank as {@code input}. The inner-most 3 + * dimensions of {@code input} are replaced with the their 3D Fourier transform. The + * inner-most dimension contains {@code fft_length / 2 + 1} unique frequency + * components. + *

{@literal @}compatibility(numpy)
* Equivalent to np.fft.rfftn with 3 dimensions. - * @end_compatibility + *
{@literal @}end_compatibility + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RFFT3D"; - - private Output output; - - private Rfft3d(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddManySparseToTensorsMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddManySparseToTensorsMap.java index b1c834f44f1..69cdfdc804f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddManySparseToTensorsMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddManySparseToTensorsMap.java @@ -29,76 +29,60 @@ import org.tensorflow.types.family.TType; /** - * Add an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles. - *

- * A `SparseTensor` of rank `R` is represented by three tensors: `sparse_indices`, - * `sparse_values`, and `sparse_shape`, where - *

{@code
- * sparse_indices.shape[1] == sparse_shape.shape[0] == R}
- * An `N`-minibatch of `SparseTensor` objects is represented as a `SparseTensor` - * having a first `sparse_indices` column taking values between `[0, N)`, where - * the minibatch size `N == sparse_shape[0]`. - *

- * The input `SparseTensor` must have rank `R` greater than 1, and the first - * dimension is treated as the minibatch dimension. Elements of the `SparseTensor` + * Add an {@code N}-minibatch {@code SparseTensor} to a {@code SparseTensorsMap}, return {@code N} handles. + * A {@code SparseTensor} of rank {@code R} is represented by three tensors: {@code sparse_indices}, + * {@code sparse_values}, and {@code sparse_shape}, where + *

{@code sparse_indices.shape[1] == sparse_shape.shape[0] == R} + *

An {@code N}-minibatch of {@code SparseTensor} objects is represented as a {@code SparseTensor} + * having a first {@code sparse_indices} column taking values between {@code [0, N)}, where + * the minibatch size {@code N == sparse_shape[0]}. + *

The input {@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 stored - * `SparseTensor` objects pointed to by each row of the output `sparse_handles` - * will have rank `R-1`. - *

- * The `SparseTensor` values can then be read out as part of a minibatch by passing - * the given keys as vector elements to `TakeManySparseFromTensorsMap`. To ensure - * the correct `SparseTensorsMap` is accessed, ensure that the same - * `container` and `shared_name` are passed to that Op. If no `shared_name` - * is provided here, instead use the name of the Operation created by calling - * `sparse.AddManySparseToTensorsMap` as the `shared_name` passed to - * `TakeManySparseFromTensorsMap`. Ensure the Operations are colocated. + * {@code SparseTensor} objects pointed to by each row of the output {@code sparse_handles} + * will have rank {@code R-1}. + *

The {@code SparseTensor} values can then be read out as part of a minibatch by passing + * the given keys as vector elements to {@code TakeManySparseFromTensorsMap}. To ensure + * the correct {@code SparseTensorsMap} is accessed, ensure that the same + * {@code container} and {@code shared_name} are passed to that Op. If no {@code shared_name} + * is provided here, instead use the name of the Operation created by calling + * {@code sparse.AddManySparseToTensorsMap} as the {@code shared_name} passed to + * {@code TakeManySparseFromTensorsMap}. Ensure the Operations are colocated. */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class AddManySparseToTensorsMap extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.AddManySparseToTensorsMap} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container The container name for the `SparseTensorsMap` created by this op. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName The shared name for the `SparseTensorsMap` created by this op. - * If blank, the new Operation's unique name is used. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "AddManySparseToTensorsMap"; + + private Output sparseHandles; + + private AddManySparseToTensorsMap(Operation operation) { + super(operation); + int outputIdx = 0; + sparseHandles = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AddManySparseToTensorsMap operation. - * + * * @param scope current scope - * @param sparseIndices 2-D. The `indices` of the minibatch `SparseTensor`. - * `sparse_indices[:, 0]` must be ordered values in `[0, N)`. - * @param sparseValues 1-D. The `values` of the minibatch `SparseTensor`. - * @param sparseShape 1-D. The `shape` of the minibatch `SparseTensor`. - * The minibatch size `N == sparse_shape[0]`. - * @param options carries optional attributes values + * @param sparseIndices 2-D. The {@code indices} of the minibatch {@code SparseTensor}. + * {@code sparse_indices[:, 0]} must be ordered values in {@code [0, N)}. + * @param sparseValues 1-D. The {@code values} of the minibatch {@code SparseTensor}. + * @param sparseShape 1-D. The {@code shape} of the minibatch {@code SparseTensor}. + * The minibatch size {@code N == sparse_shape[0]}. + * @param options carries optional attribute values * @return a new instance of AddManySparseToTensorsMap */ - @Endpoint(describeByClass = true) - public static AddManySparseToTensorsMap create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AddManySparseToTensorsMap create(Scope scope, Operand sparseIndices, + Operand sparseValues, Operand sparseShape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AddManySparseToTensorsMap", scope.makeOpName("AddManySparseToTensorsMap")); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); @@ -116,43 +100,75 @@ public static AddManySparseToTensorsMap create(Scope scope, Operand spar } return new AddManySparseToTensorsMap(opBuilder.build()); } - + /** - * @param container The container name for the `SparseTensorsMap` created by this op. + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} created by this op. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName The shared name for the `SparseTensorsMap` created by this op. + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} created by this op. * If blank, the new Operation's unique name is used. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * 1-D. The handles of the `SparseTensor` now stored in the - * `SparseTensorsMap`. Shape: `[N]`. + * Gets sparseHandles. + * 1-D. The handles of the {@code SparseTensor} now stored in the + * {@code SparseTensorsMap}. Shape: {@code [N]}. + * @return sparseHandles. */ public Output sparseHandles() { return sparseHandles; } - + @Override public Output asOutput() { return sparseHandles; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AddManySparseToTensorsMap"; - - private Output sparseHandles; - - private AddManySparseToTensorsMap(Operation operation) { - super(operation); - int outputIdx = 0; - sparseHandles = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.AddManySparseToTensorsMap} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} created by this op. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} created by this op. + * If blank, the new Operation's unique name is used. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddSparseToTensorsMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddSparseToTensorsMap.java index c8313d66e85..f8e7db00640 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddSparseToTensorsMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/AddSparseToTensorsMap.java @@ -29,67 +29,52 @@ import org.tensorflow.types.family.TType; /** - * Add a `SparseTensor` to a `SparseTensorsMap` return its handle. - *

- * A `SparseTensor` is represented by three tensors: `sparse_indices`, - * `sparse_values`, and `sparse_shape`. - *

- * This operator takes the given `SparseTensor` and adds it to a container - * object (a `SparseTensorsMap`). A unique key within this container is generated - * in the form of an `int64`, and this is the value that is returned. - *

- * The `SparseTensor` can then be read out as part of a minibatch by passing - * the key as a vector element to `TakeManySparseFromTensorsMap`. To ensure - * the correct `SparseTensorsMap` is accessed, ensure that the same - * `container` and `shared_name` are passed to that Op. If no `shared_name` - * is provided here, instead use the name of the Operation created by calling - * `sparse.AddSparseToTensorsMap` as the `shared_name` passed to - * `TakeManySparseFromTensorsMap`. Ensure the Operations are colocated. + * Add a {@code SparseTensor} to a {@code SparseTensorsMap} return its handle. + * A {@code SparseTensor} is represented by three tensors: {@code sparse_indices}, + * {@code sparse_values}, and {@code sparse_shape}. + *

This operator takes the given {@code SparseTensor} and adds it to a container + * object (a {@code SparseTensorsMap}). A unique key within this container is generated + * in the form of an {@code int64}, and this is the value that is returned. + *

The {@code SparseTensor} can then be read out as part of a minibatch by passing + * the key as a vector element to {@code TakeManySparseFromTensorsMap}. To ensure + * the correct {@code SparseTensorsMap} is accessed, ensure that the same + * {@code container} and {@code shared_name} are passed to that Op. If no {@code shared_name} + * is provided here, instead use the name of the Operation created by calling + * {@code sparse.AddSparseToTensorsMap} as the {@code shared_name} passed to + * {@code TakeManySparseFromTensorsMap}. Ensure the Operations are colocated. */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class AddSparseToTensorsMap extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.AddSparseToTensorsMap} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container The container name for the `SparseTensorsMap` created by this op. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName The shared name for the `SparseTensorsMap` created by this op. - * If blank, the new Operation's unique name is used. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "AddSparseToTensorsMap"; + + private Output sparseHandle; + + private AddSparseToTensorsMap(Operation operation) { + super(operation); + int outputIdx = 0; + sparseHandle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new AddSparseToTensorsMap operation. - * + * * @param scope current scope - * @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 options carries optional attributes values + * @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 options carries optional attribute values * @return a new instance of AddSparseToTensorsMap */ - @Endpoint(describeByClass = true) - public static AddSparseToTensorsMap create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AddSparseToTensorsMap create(Scope scope, Operand sparseIndices, + Operand sparseValues, Operand sparseShape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AddSparseToTensorsMap", scope.makeOpName("AddSparseToTensorsMap")); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); @@ -107,43 +92,75 @@ public static AddSparseToTensorsMap create(Scope scope, Operand sparseIn } return new AddSparseToTensorsMap(opBuilder.build()); } - + /** - * @param container The container name for the `SparseTensorsMap` created by this op. + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} created by this op. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName The shared name for the `SparseTensorsMap` created by this op. + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} created by this op. * If blank, the new Operation's unique name is used. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * 0-D. The handle of the `SparseTensor` now stored in the - * `SparseTensorsMap`. + * Gets sparseHandle. + * 0-D. The handle of the {@code SparseTensor} now stored in the + * {@code SparseTensorsMap}. + * @return sparseHandle. */ public Output sparseHandle() { return sparseHandle; } - + @Override public Output asOutput() { return sparseHandle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AddSparseToTensorsMap"; - - private Output sparseHandle; - - private AddSparseToTensorsMap(Operation operation) { - super(operation); - int outputIdx = 0; - sparseHandle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.AddSparseToTensorsMap} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} created by this op. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} created by this op. + * If blank, the new Operation's unique name is used. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseCountSparseOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseCountSparseOutput.java index fa956a4032f..b388165cf92 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseCountSparseOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseCountSparseOutput.java @@ -24,60 +24,53 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Performs sparse-output bin counting for a tf.tensor input. - *

- * Counts the number of times each value occurs in the input. - * - * @param data type for {@code outputValues()} output + * Counts the number of times each value occurs in the input. + * + * @param data type for {@code output_values} output */ public final class DenseCountSparseOutput extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.DenseCountSparseOutput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param minlength Minimum value to count. Can be set to -1 for no minimum. - */ - public Options minlength(Long minlength) { - this.minlength = minlength; - return this; - } - - /** - * @param maxlength Maximum value to count. Can be set to -1 for no maximum. - */ - public Options maxlength(Long maxlength) { - this.maxlength = maxlength; - return this; - } - - private Long minlength; - private Long maxlength; - - private Options() { - } + public static final String OP_NAME = "DenseCountSparseOutput"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputDenseShape; + + private DenseCountSparseOutput(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputDenseShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DenseCountSparseOutput operation. - * + * * @param scope current scope * @param values Tensor containing data to count. * @param weights A Tensor of the same shape as indices containing per-index weight values. May * also be the empty tensor if no weights are used. * @param binaryOutput Whether to output the number of occurrences of each value or 1. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code DenseCountSparseOutput} output and operands * @return a new instance of DenseCountSparseOutput */ - @Endpoint(describeByClass = true) - public static DenseCountSparseOutput create(Scope scope, Operand values, Operand weights, Boolean binaryOutput, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DenseCountSparseOutput create(Scope scope, + Operand values, Operand weights, Boolean binaryOutput, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DenseCountSparseOutput", scope.makeOpName("DenseCountSparseOutput")); opBuilder.addInput(values.asOutput()); opBuilder.addInput(weights.asOutput()); @@ -93,56 +86,87 @@ public static DenseCountSparseOutput create(Scope scope, } } } - return new DenseCountSparseOutput(opBuilder.build()); + return new DenseCountSparseOutput<>(opBuilder.build()); } - + /** + * Sets the minlength option. + * * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. */ public static Options minlength(Long minlength) { return new Options().minlength(minlength); } - + /** + * Sets the maxlength option. + * * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. */ public static Options maxlength(Long maxlength) { return new Options().maxlength(maxlength); } - + /** + * Gets outputIndices. * Indices tensor for the resulting sparse tensor object. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * Values tensor for the resulting sparse tensor object. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputDenseShape. * Shape tensor for the resulting sparse tensor object. + * @return outputDenseShape. */ public Output outputDenseShape() { return outputDenseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseCountSparseOutput"; - - private Output outputIndices; - private Output outputValues; - private Output outputDenseShape; - - private DenseCountSparseOutput(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputDenseShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.DenseCountSparseOutput} + */ + public static class Options { + private Long minlength; + + private Long maxlength; + + private Options() { + } + + /** + * Sets the minlength option. + * + * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. + */ + public Options minlength(Long minlength) { + this.minlength = minlength; + return this; + } + + /** + * Sets the maxlength option. + * + * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. + */ + public Options maxlength(Long maxlength) { + this.maxlength = maxlength; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToDenseSetOperation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToDenseSetOperation.java index bb71fd48284..56c3e4f1fb4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToDenseSetOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToDenseSetOperation.java @@ -29,54 +29,57 @@ import org.tensorflow.types.family.TType; /** - * Applies set operation along last dimension of 2 `Tensor` inputs. - *

- * See SetOperationOp::SetOperationFromContext for values of `set_operation`. - *

- * Output `result` is a `SparseTensor` represented by `result_indices`, - * `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this - * has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` - * dimension contains the result of `set_operation` applied to the corresponding - * `[0...n-1]` dimension of `set`. - * - * @param data type for {@code resultValues()} output + * Applies set operation along last dimension of 2 {@code Tensor} inputs. + * See SetOperationOp::SetOperationFromContext for values of {@code set_operation}. + *

Output {@code result} is a {@code SparseTensor} represented by {@code result_indices}, + * {@code result_values}, and {@code result_shape}. For {@code set1} and {@code set2} ranked {@code n}, this + * has rank {@code n} and the same 1st {@code n-1} dimensions as {@code set1} and {@code set2}. The {@code nth} + * dimension contains the result of {@code set_operation} applied to the corresponding + * {@code [0...n-1]} dimension of {@code set}. + * + * @param data type for {@code result_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class DenseToDenseSetOperation extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.DenseToDenseSetOperation} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "DenseToDenseSetOperation"; + + private Output resultIndices; + + private Output resultValues; + + private Output resultShape; + + private DenseToDenseSetOperation(Operation operation) { + super(operation); + int outputIdx = 0; + resultIndices = operation.output(outputIdx++); + resultValues = operation.output(outputIdx++); + resultShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DenseToDenseSetOperation operation. - * + * * @param scope current scope - * @param set1 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`. - * Dimension `n` contains values in a set, duplicates are allowed but ignored. - * @param set2 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set1`. - * Dimension `n` contains values in a set, duplicates are allowed but ignored. - * @param setOperation - * @param options carries optional attributes values + * @param set1 {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set2}. + * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. + * @param set2 {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set1}. + * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. + * @param setOperation the value of the setOperation property + * @param options carries optional attribute values + * @param data type for {@code DenseToDenseSetOperation} output and operands * @return a new instance of DenseToDenseSetOperation */ - @Endpoint(describeByClass = true) - public static DenseToDenseSetOperation create(Scope scope, Operand set1, Operand set2, String setOperation, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DenseToDenseSetOperation create(Scope scope, Operand set1, + Operand set2, String setOperation, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DenseToDenseSetOperation", scope.makeOpName("DenseToDenseSetOperation")); opBuilder.addInput(set1.asOutput()); opBuilder.addInput(set2.asOutput()); @@ -89,51 +92,66 @@ public static DenseToDenseSetOperation create(Scope scope, } } } - return new DenseToDenseSetOperation(opBuilder.build()); + return new DenseToDenseSetOperation<>(opBuilder.build()); } - + /** - * @param validateIndices + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** - * 2D indices of a `SparseTensor`. + * Gets resultIndices. + * 2D indices of a {@code SparseTensor}. + * @return resultIndices. */ public Output resultIndices() { return resultIndices; } - + /** - * 1D values of a `SparseTensor`. + * Gets resultValues. + * 1D values of a {@code SparseTensor}. + * @return resultValues. */ public Output resultValues() { return resultValues; } - + /** - * 1D `Tensor` shape of a `SparseTensor`. `result_shape[0...n-1]` is - * the same as the 1st `n-1` dimensions of `set1` and `set2`, `result_shape[n]` - * is the max result set size across all `0...n-1` dimensions. + * Gets resultShape. + * 1D {@code Tensor} shape of a {@code SparseTensor}. {@code result_shape[0...n-1]} is + * the same as the 1st {@code n-1} dimensions of {@code set1} and {@code set2}, {@code result_shape[n]} + * is the max result set size across all {@code 0...n-1} dimensions. + * @return resultShape. */ public Output resultShape() { return resultShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseToDenseSetOperation"; - - private Output resultIndices; - private Output resultValues; - private Output resultShape; - - private DenseToDenseSetOperation(Operation operation) { - super(operation); - int outputIdx = 0; - resultIndices = operation.output(outputIdx++); - resultValues = operation.output(outputIdx++); - resultShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.DenseToDenseSetOperation} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = validateIndices; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToSparseSetOperation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToSparseSetOperation.java index 82da6d7902e..a960a1b9217 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToSparseSetOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DenseToSparseSetOperation.java @@ -29,67 +29,69 @@ import org.tensorflow.types.family.TType; /** - * Applies set operation along last dimension of `Tensor` and `SparseTensor`. - *

- * See SetOperationOp::SetOperationFromContext for values of `set_operation`. - *

- * Input `set2` is a `SparseTensor` represented by `set2_indices`, `set2_values`, - * and `set2_shape`. For `set2` ranked `n`, 1st `n-1` dimensions must be the same - * as `set1`. Dimension `n` contains values in a set, duplicates are allowed but + * Applies set operation along last dimension of {@code Tensor} and {@code SparseTensor}. + * See SetOperationOp::SetOperationFromContext for values of {@code set_operation}. + *

Input {@code set2} is a {@code SparseTensor} represented by {@code set2_indices}, {@code set2_values}, + * and {@code set2_shape}. For {@code set2} ranked {@code n}, 1st {@code n-1} dimensions must be the same + * as {@code set1}. Dimension {@code n} contains values in a set, duplicates are allowed but * ignored. - *

- * If `validate_indices` is `True`, this op validates the order and range of `set2` + *

If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set2} * indices. - *

- * Output `result` is a `SparseTensor` represented by `result_indices`, - * `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this - * has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` - * dimension contains the result of `set_operation` applied to the corresponding - * `[0...n-1]` dimension of `set`. - * - * @param data type for {@code resultValues()} output + *

Output {@code result} is a {@code SparseTensor} represented by {@code result_indices}, + * {@code result_values}, and {@code result_shape}. For {@code set1} and {@code set2} ranked {@code n}, this + * has rank {@code n} and the same 1st {@code n-1} dimensions as {@code set1} and {@code set2}. The {@code nth} + * dimension contains the result of {@code set_operation} applied to the corresponding + * {@code [0...n-1]} dimension of {@code set}. + * + * @param data type for {@code result_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class DenseToSparseSetOperation extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.DenseToSparseSetOperation} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "DenseToSparseSetOperation"; + + private Output resultIndices; + + private Output resultValues; + + private Output resultShape; + + private DenseToSparseSetOperation(Operation operation) { + super(operation); + int outputIdx = 0; + resultIndices = operation.output(outputIdx++); + resultValues = operation.output(outputIdx++); + resultShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new DenseToSparseSetOperation operation. - * + * * @param scope current scope - * @param set1 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`. - * Dimension `n` contains values in a set, duplicates are allowed but ignored. - * @param set2Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + * @param set1 {@code Tensor} with rank {@code n}. 1st {@code n-1} dimensions must be the same as {@code set2}. + * Dimension {@code n} contains values in a set, duplicates are allowed but ignored. + * @param set2Indices 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set2Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Shape 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must - * be the same as the 1st `n-1` dimensions of `set1`, `result_shape[n]` is the - * max set size across `n-1` dimensions. - * @param setOperation - * @param options carries optional attributes values + * @param set2Shape 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set2_shape[0...n-1]} must + * be the same as the 1st {@code n-1} dimensions of {@code set1}, {@code result_shape[n]} is the + * max set size across {@code n-1} dimensions. + * @param setOperation the value of the setOperation property + * @param options carries optional attribute values + * @param data type for {@code DenseToSparseSetOperation} output and operands * @return a new instance of DenseToSparseSetOperation */ - @Endpoint(describeByClass = true) - public static DenseToSparseSetOperation create(Scope scope, Operand set1, Operand set2Indices, Operand set2Values, Operand set2Shape, String setOperation, Options... options) { + @Endpoint( + describeByClass = true + ) + public static DenseToSparseSetOperation create(Scope scope, Operand set1, + Operand set2Indices, Operand set2Values, Operand set2Shape, + String setOperation, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DenseToSparseSetOperation", scope.makeOpName("DenseToSparseSetOperation")); opBuilder.addInput(set1.asOutput()); opBuilder.addInput(set2Indices.asOutput()); @@ -104,51 +106,66 @@ public static DenseToSparseSetOperation create(Scope scope, } } } - return new DenseToSparseSetOperation(opBuilder.build()); + return new DenseToSparseSetOperation<>(opBuilder.build()); } - + /** - * @param validateIndices + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** - * 2D indices of a `SparseTensor`. + * Gets resultIndices. + * 2D indices of a {@code SparseTensor}. + * @return resultIndices. */ public Output resultIndices() { return resultIndices; } - + /** - * 1D values of a `SparseTensor`. + * Gets resultValues. + * 1D values of a {@code SparseTensor}. + * @return resultValues. */ public Output resultValues() { return resultValues; } - + /** - * 1D `Tensor` shape of a `SparseTensor`. `result_shape[0...n-1]` is - * the same as the 1st `n-1` dimensions of `set1` and `set2`, `result_shape[n]` - * is the max result set size across all `0...n-1` dimensions. + * Gets resultShape. + * 1D {@code Tensor} shape of a {@code SparseTensor}. {@code result_shape[0...n-1]} is + * the same as the 1st {@code n-1} dimensions of {@code set1} and {@code set2}, {@code result_shape[n]} + * is the max result set size across all {@code 0...n-1} dimensions. + * @return resultShape. */ public Output resultShape() { return resultShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DenseToSparseSetOperation"; - - private Output resultIndices; - private Output resultValues; - private Output resultShape; - - private DenseToSparseSetOperation(Operation operation) { - super(operation); - int outputIdx = 0; - resultIndices = operation.output(outputIdx++); - resultValues = operation.output(outputIdx++); - resultShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.DenseToSparseSetOperation} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = validateIndices; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DeserializeSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DeserializeSparse.java index 82afc01ea47..710cee3d76a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DeserializeSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/DeserializeSparse.java @@ -30,103 +30,118 @@ import org.tensorflow.types.family.TType; /** - * Deserialize `SparseTensor` objects. - *

- * The input `serialized_sparse` must have the shape `[?, ?, ..., ?, 3]` where - * the last dimension stores serialized `SparseTensor` objects and the other N - * dimensions (N >= 0) correspond to a batch. The ranks of the original - * `SparseTensor` objects must all match. When the final `SparseTensor` is - * created, its rank is the rank of the incoming `SparseTensor` objects plus N; + * Deserialize {@code SparseTensor} objects. + * The input {@code serialized_sparse} must have the shape {@code [?, ?, ..., ?, 3]} where + * the last dimension stores serialized {@code SparseTensor} objects and the other N + * dimensions (N >= 0) correspond to a batch. The ranks of the original + * {@code SparseTensor} objects must all match. When the final {@code SparseTensor} is + * created, its rank is the rank of the incoming {@code SparseTensor} objects plus N; * the sparse tensors have been concatenated along new dimensions, one for each * batch. - *

- * The output `SparseTensor` object's shape values for the original dimensions - * are the max across the input `SparseTensor` objects' shape values for the + *

The output {@code SparseTensor} object's shape values for the original dimensions + * are the max across the input {@code SparseTensor} objects' shape values for the * corresponding dimensions. The new dimensions match the size of the batch. - *

- * 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] - * - * @param data type for {@code sparseValues()} output + * 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 sparse_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class DeserializeSparse extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "DeserializeSparse"; + + private Output sparseIndices; + + private Output sparseValues; + + private Output sparseShape; + + private DeserializeSparse(Operation operation) { + super(operation); + int outputIdx = 0; + sparseIndices = operation.output(outputIdx++); + sparseValues = operation.output(outputIdx++); + sparseShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new DeserializeSparse operation. - * + * * @param scope current scope - * @param serializedSparse The serialized `SparseTensor` objects. The last dimension + * @param serializedSparse The serialized {@code SparseTensor} objects. The last dimension * 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 DeserializeSparse} output and operands * @return a new instance of DeserializeSparse */ - @Endpoint(describeByClass = true) - public static DeserializeSparse create(Scope scope, Operand serializedSparse, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static DeserializeSparse create(Scope scope, + Operand serializedSparse, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("DeserializeSparse", scope.makeOpName("DeserializeSparse")); opBuilder.addInput(serializedSparse.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new DeserializeSparse(opBuilder.build()); + return new DeserializeSparse<>(opBuilder.build()); } - + /** + * Gets sparseIndices. + * + * @return sparseIndices. */ public Output sparseIndices() { return sparseIndices; } - + /** + * Gets sparseValues. + * + * @return sparseValues. */ public Output sparseValues() { return sparseValues; } - + /** + * Gets sparseShape. + * + * @return sparseShape. */ public Output sparseShape() { return sparseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "DeserializeSparse"; - - private Output sparseIndices; - private Output sparseValues; - private Output sparseShape; - - private DeserializeSparse(Operation operation) { - super(operation); - int outputIdx = 0; - sparseIndices = operation.output(outputIdx++); - sparseValues = operation.output(outputIdx++); - sparseShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorApplyGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorApplyGradient.java index 94e912c38f8..993fcbf4bcf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorApplyGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorApplyGradient.java @@ -30,16 +30,25 @@ /** * Applies a sparse gradient to a given accumulator. - *

* Does not add if local_step is smaller than the accumulator's * global_step. */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseAccumulatorApplyGradient extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseAccumulatorApplyGradient"; + + private SparseAccumulatorApplyGradient(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new SparseAccumulatorApplyGradient operation. - * + * * @param scope current scope * @param handle The handle to a accumulator. * @param localStep The local_step value at which the sparse gradient was computed. @@ -53,8 +62,13 @@ public final class SparseAccumulatorApplyGradient extends RawOp { * case the input is ignored during validation. * @return a new instance of SparseAccumulatorApplyGradient */ - @Endpoint(describeByClass = true) - public static SparseAccumulatorApplyGradient create(Scope scope, Operand handle, Operand localStep, Operand gradientIndices, Operand gradientValues, Operand gradientShape, Boolean hasKnownShape) { + @Endpoint( + describeByClass = true + ) + public static SparseAccumulatorApplyGradient create(Scope scope, Operand handle, + Operand localStep, Operand gradientIndices, + Operand gradientValues, Operand gradientShape, + Boolean hasKnownShape) { OperationBuilder opBuilder = scope.env().opBuilder("SparseAccumulatorApplyGradient", scope.makeOpName("SparseAccumulatorApplyGradient")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(localStep.asOutput()); @@ -65,11 +79,4 @@ public static SparseAccumulatorApplyGradient create(Scope scope, Operand * The op will blocks until sufficient (i.e., more than num_required) * gradients have been accumulated. If the accumulator has already * aggregated more than num_required gradients, it will return its * average of the accumulated gradients. Also automatically increments * the recorded global_step in the accumulator by 1, and resets the * aggregate to 0. - * - * @param data type for {@code values()} output + * + * @param data type for {@code values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseAccumulatorTakeGradient extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseAccumulatorTakeGradient"; + + private Output indices; + + private Output values; + + private Output shape; + + private SparseAccumulatorTakeGradient(Operation operation) { + super(operation); + int outputIdx = 0; + indices = operation.output(outputIdx++); + values = operation.output(outputIdx++); + shape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseAccumulatorTakeGradient operation. - * + * * @param scope current scope * @param handle The handle to a SparseConditionalAccumulator. * @param numRequired Number of gradients required before we return an aggregate. * @param dtype The data type of accumulated gradients. Needs to correspond to the type * of the accumulator. + * @param data type for {@code SparseAccumulatorTakeGradient} output and operands * @return a new instance of SparseAccumulatorTakeGradient */ - @Endpoint(describeByClass = true) - public static SparseAccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static SparseAccumulatorTakeGradient create(Scope scope, + Operand handle, Operand numRequired, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("SparseAccumulatorTakeGradient", scope.makeOpName("SparseAccumulatorTakeGradient")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numRequired.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new SparseAccumulatorTakeGradient(opBuilder.build()); + return new SparseAccumulatorTakeGradient<>(opBuilder.build()); } - + /** + * Gets indices. * Indices of the average of the accumulated sparse gradients. + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets values. * Values of the average of the accumulated sparse gradients. + * @return values. */ public Output values() { return values; } - + /** + * Gets shape. * Shape of the average of the accumulated sparse gradients. + * @return shape. */ public Output shape() { return shape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseAccumulatorTakeGradient"; - - private Output indices; - private Output values; - private Output shape; - - private SparseAccumulatorTakeGradient(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - values = operation.output(outputIdx++); - shape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAdd.java index 7ced04729a4..d7f3a908a6f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAdd.java @@ -30,43 +30,65 @@ import org.tensorflow.types.family.TType; /** - * Adds two `SparseTensor` objects to produce another `SparseTensor`. - *

- * The input `SparseTensor` objects' indices are assumed ordered in standard + * Adds two {@code SparseTensor} objects to produce another {@code SparseTensor}. + * The input {@code SparseTensor} objects' indices are assumed ordered in standard * lexicographic order. If this is not the case, before this step run - * `SparseReorder` to restore index ordering. - *

- * By default, if two values sum to zero at some index, the output `SparseTensor` + * {@code SparseReorder} to restore index ordering. + *

By default, if two values sum to zero at some index, the output {@code SparseTensor} * would still include that particular location in its index, storing a zero in the - * corresponding value slot. To override this, callers can specify `thresh`, - * indicating that if the sum has a magnitude strictly smaller than `thresh`, its + * corresponding value slot. To override this, callers can specify {@code thresh}, + * indicating that if the sum has a magnitude strictly smaller than {@code thresh}, its * corresponding value and index would then not be included. In particular, - * `thresh == 0` (default) means everything is kept and actual thresholding happens + * {@code thresh == 0} (default) means everything is kept and actual thresholding happens * only for a positive value. - *

- * In the following shapes, `nnz` is the count after taking `thresh` into account. - * - * @param data type for {@code sumValues()} output + *

In the following shapes, {@code nnz} is the count after taking {@code thresh} into account. + * + * @param data type for {@code sum_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseAdd extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseAdd"; + + private Output sumIndices; + + private Output sumValues; + + private Output sumShape; + + private SparseAdd(Operation operation) { + super(operation); + int outputIdx = 0; + sumIndices = operation.output(outputIdx++); + sumValues = operation.output(outputIdx++); + sumShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseAdd operation. - * + * * @param scope current scope - * @param aIndices 2-D. The `indices` of the first `SparseTensor`, size `[nnz, ndims]` Matrix. - * @param aValues 1-D. The `values` of the first `SparseTensor`, size `[nnz]` Vector. - * @param aShape 1-D. The `shape` of the first `SparseTensor`, size `[ndims]` Vector. - * @param bIndices 2-D. The `indices` of the second `SparseTensor`, size `[nnz, ndims]` Matrix. - * @param bValues 1-D. The `values` of the second `SparseTensor`, size `[nnz]` Vector. - * @param bShape 1-D. The `shape` of the second `SparseTensor`, size `[ndims]` Vector. + * @param aIndices 2-D. The {@code indices} of the first {@code SparseTensor}, size {@code [nnz, ndims]} Matrix. + * @param aValues 1-D. The {@code values} of the first {@code SparseTensor}, size {@code [nnz]} Vector. + * @param aShape 1-D. The {@code shape} of the first {@code SparseTensor}, size {@code [ndims]} Vector. + * @param bIndices 2-D. The {@code indices} of the second {@code SparseTensor}, size {@code [nnz, ndims]} Matrix. + * @param bValues 1-D. The {@code values} of the second {@code SparseTensor}, size {@code [nnz]} Vector. + * @param bShape 1-D. The {@code shape} of the second {@code SparseTensor}, size {@code [ndims]} Vector. * @param thresh 0-D. The magnitude threshold that determines if an output value/index * pair takes space. + * @param data type for {@code SparseAdd} output and operands * @return a new instance of SparseAdd */ - @Endpoint(describeByClass = true) - public static SparseAdd create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand bIndices, Operand bValues, Operand bShape, Operand thresh) { + @Endpoint( + describeByClass = true + ) + public static SparseAdd create(Scope scope, Operand aIndices, + Operand aValues, Operand aShape, Operand bIndices, Operand bValues, + Operand bShape, Operand thresh) { OperationBuilder opBuilder = scope.env().opBuilder("SparseAdd", scope.makeOpName("SparseAdd")); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); @@ -76,39 +98,33 @@ public static SparseAdd create(Scope scope, Operand opBuilder.addInput(bShape.asOutput()); opBuilder.addInput(thresh.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseAdd(opBuilder.build()); + return new SparseAdd<>(opBuilder.build()); } - + /** + * Gets sumIndices. + * + * @return sumIndices. */ public Output sumIndices() { return sumIndices; } - + /** + * Gets sumValues. + * + * @return sumValues. */ public Output sumValues() { return sumValues; } - + /** + * Gets sumShape. + * + * @return sumShape. */ public Output sumShape() { return sumShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseAdd"; - - private Output sumIndices; - private Output sumValues; - private Output sumShape; - - private SparseAdd(Operation operation) { - super(operation); - int outputIdx = 0; - sumIndices = operation.output(outputIdx++); - sumValues = operation.output(outputIdx++); - sumShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAddGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAddGrad.java index 19c9594386c..33c0d798313 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAddGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAddGrad.java @@ -30,66 +30,77 @@ /** * The gradient operator for the SparseAdd op. - *

* The SparseAdd op calculates A + B, where A, B, and the sum are all represented - * as `SparseTensor` objects. This op takes in the upstream gradient w.r.t. + * as {@code SparseTensor} objects. This op takes in the upstream gradient w.r.t. * non-empty values of the sum, and outputs the gradients w.r.t. the non-empty * values of A and B. - * - * @param data type for {@code aValGrad()} output + * + * @param data type for {@code a_val_grad} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseAddGrad extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseAddGrad"; + + private Output aValGrad; + + private Output bValGrad; + + private SparseAddGrad(Operation operation) { + super(operation); + int outputIdx = 0; + aValGrad = operation.output(outputIdx++); + bValGrad = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseAddGrad operation. - * + * * @param scope current scope - * @param backpropValGrad 1-D with shape `[nnz(sum)]`. The gradient with respect to + * @param backpropValGrad 1-D with shape {@code [nnz(sum)]}. The gradient with respect to * the non-empty values of the sum. - * @param aIndices 2-D. The `indices` of the `SparseTensor` A, size `[nnz(A), ndims]`. - * @param bIndices 2-D. The `indices` of the `SparseTensor` B, size `[nnz(B), ndims]`. - * @param sumIndices 2-D. The `indices` of the sum `SparseTensor`, size - * `[nnz(sum), ndims]`. + * @param aIndices 2-D. The {@code indices} of the {@code SparseTensor} A, size {@code [nnz(A), ndims]}. + * @param bIndices 2-D. The {@code indices} of the {@code SparseTensor} B, size {@code [nnz(B), ndims]}. + * @param sumIndices 2-D. The {@code indices} of the sum {@code SparseTensor}, size + * {@code [nnz(sum), ndims]}. + * @param data type for {@code SparseAddGrad} output and operands * @return a new instance of SparseAddGrad */ - @Endpoint(describeByClass = true) - public static SparseAddGrad create(Scope scope, Operand backpropValGrad, Operand aIndices, Operand bIndices, Operand sumIndices) { + @Endpoint( + describeByClass = true + ) + public static SparseAddGrad create(Scope scope, Operand backpropValGrad, + Operand aIndices, Operand bIndices, Operand sumIndices) { OperationBuilder opBuilder = scope.env().opBuilder("SparseAddGrad", scope.makeOpName("SparseAddGrad")); opBuilder.addInput(backpropValGrad.asOutput()); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(bIndices.asOutput()); opBuilder.addInput(sumIndices.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseAddGrad(opBuilder.build()); + return new SparseAddGrad<>(opBuilder.build()); } - + /** - * 1-D with shape `[nnz(A)]`. The gradient with respect to the + * Gets aValGrad. + * 1-D with shape {@code [nnz(A)]}. The gradient with respect to the * non-empty values of A. + * @return aValGrad. */ public Output aValGrad() { return aValGrad; } - + /** - * 1-D with shape `[nnz(B)]`. The gradient with respect to the + * Gets bValGrad. + * 1-D with shape {@code [nnz(B)]}. The gradient with respect to the * non-empty values of B. + * @return bValGrad. */ public Output bValGrad() { return bValGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseAddGrad"; - - private Output aValGrad; - private Output bValGrad; - - private SparseAddGrad(Operation operation) { - super(operation); - int outputIdx = 0; - aValGrad = operation.output(outputIdx++); - bValGrad = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseBincount.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseBincount.java index bea0d8b3c71..f9eb554f0fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseBincount.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseBincount.java @@ -30,60 +30,59 @@ /** * 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 output()} output + * 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 data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseBincount extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseBincount} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. - */ - public Options binaryOutput(Boolean binaryOutput) { - this.binaryOutput = binaryOutput; - return this; - } - - private Boolean binaryOutput; - - private Options() { - } + public static final String OP_NAME = "SparseBincount"; + + private Output output; + + private SparseBincount(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseBincount operation. - * + * * @param scope current scope - * @param indices 2D int64 `Tensor`. - * @param values 1D int `Tensor`. - * @param denseShape 1D int64 `Tensor`. - * @param size non-negative int scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * shape as `input`, or a length-0 `Tensor`, in which case it acts as all weights + * @param indices 2D int64 {@code Tensor}. + * @param values 1D int {@code Tensor}. + * @param denseShape 1D int64 {@code Tensor}. + * @param sizeOutput non-negative int scalar {@code Tensor}. + * @param weights is an int32, int64, float32, or float64 {@code Tensor} with the same + * shape as {@code input}, or a length-0 {@code Tensor}, in which case it acts as all weights * equal to 1. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseBincount} output and operands + * @param data type for {@code SparseBincount} output and operands * @return a new instance of SparseBincount */ - @Endpoint(describeByClass = true) - public static SparseBincount create(Scope scope, Operand indices, Operand values, Operand denseShape, Operand size, Operand weights, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseBincount create(Scope scope, + Operand indices, Operand values, Operand denseShape, Operand sizeOutput, + Operand weights, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseBincount", scope.makeOpName("SparseBincount")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(denseShape.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder.addInput(weights.asOutput()); opBuilder = scope.apply(opBuilder); if (options != null) { @@ -93,37 +92,52 @@ public static SparseBincount create(Sc } } } - return new SparseBincount(opBuilder.build()); + return new SparseBincount<>(opBuilder.build()); } - + /** + * Sets the binaryOutput option. + * * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. */ public static Options binaryOutput(Boolean binaryOutput) { return new Options().binaryOutput(binaryOutput); } - + /** - * 1D `Tensor` with length equal to `size` or 2D `Tensor` with [batch_size, `size`]. + * Gets output. + * 1D {@code Tensor} with length equal to {@code size} or 2D {@code Tensor} with [batch_size, {@code size}]. * The counts or summed weights for each value in the range [0, size). + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseBincount"; - - private Output output; - - private SparseBincount(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseBincount} + */ + public static class Options { + private Boolean binaryOutput; + + private Options() { + } + + /** + * Sets the binaryOutput option. + * + * @param binaryOutput bool; Whether the kernel should count the appearance or number of occurrences. + * @return this Options instance. + */ + public Options binaryOutput(Boolean binaryOutput) { + this.binaryOutput = binaryOutput; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConcat.java index 0b3ac3389e5..d9dd3a19d20 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConcat.java @@ -30,110 +30,121 @@ import org.tensorflow.types.family.TType; /** - * Concatenates a list of `SparseTensor` along the specified dimension. - *

+ * Concatenates a list of {@code SparseTensor} along the specified dimension. * Concatenation is with respect to the dense versions of these sparse tensors. - * It is assumed that each input is a `SparseTensor` whose elements are ordered + * It is assumed that each input is a {@code SparseTensor} whose elements are ordered * along increasing dimension number. - *

- * All inputs' shapes must match, except for the concat dimension. The - * `indices`, `values`, and `shapes` lists must have the same length. - *

- * The output shape is identical to the inputs', except along the concat + *

All inputs' shapes must match, except for the concat dimension. The + * {@code indices}, {@code values}, and {@code shapes} lists must have the same length. + *

The output shape is identical to the inputs', except along the concat * dimension, where it is the sum of the inputs' sizes along that dimension. - *

- * The output elements will be resorted to preserve the sort order along + *

The output elements will be resorted to preserve the sort order along * increasing dimension number. - *

- * This op runs in `O(M log M)` time, where `M` is the total number of non-empty + *

This op runs in {@code O(M log M)} time, where {@code M} is the total number of non-empty * values across all inputs. This is due to the need for an internal sort in * order to concatenate efficiently across an arbitrary dimension. - *

- * For example, if `concat_dim = 1` and the inputs are - *

- * sp_inputs[0]: shape = [2, 3] - * [0, 2]: "a" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * sp_inputs[1]: shape = [2, 4] - * [0, 1]: "d" - * [0, 2]: "e" - *

- * then the output will be - *

- * shape = [2, 7] - * [0, 2]: "a" - * [0, 4]: "d" - * [0, 5]: "e" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * Graphically this is equivalent to doing - *

- * [ a] concat [ d e ] = [ a d e ] - * [b c ] [ ] [b c ] - * - * @param data type for {@code outputValues()} output + *

For example, if {@code concat_dim = 1} and the inputs are + *

+ * sp_inputs[0]: shape = [2, 3]
+ * [0, 2]: "a"
+ * [1, 0]: "b"
+ * [1, 1]: "c"
+ *
+ * sp_inputs[1]: shape = [2, 4]
+ * [0, 1]: "d"
+ * [0, 2]: "e"
+ * 
+ *

then the output will be + *

+ * shape = [2, 7]
+ * [0, 2]: "a"
+ * [0, 4]: "d"
+ * [0, 5]: "e"
+ * [1, 0]: "b"
+ * [1, 1]: "c"
+ * 
+ *

Graphically this is equivalent to doing + *

+ * [    a] concat [  d e  ] = [    a   d e  ]
+ * [b c  ]        [       ]   [b c          ]
+ * 
+ * + * @param data type for {@code output_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseConcat extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseConcat"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + private SparseConcat(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseConcat operation. - * + * * @param scope current scope - * @param indices 2-D. Indices of each input `SparseTensor`. - * @param values 1-D. Non-empty values of each `SparseTensor`. - * @param shapes 1-D. Shapes of each `SparseTensor`. + * @param indices 2-D. Indices of each input {@code SparseTensor}. + * @param values 1-D. Non-empty values of each {@code SparseTensor}. + * @param shapes 1-D. Shapes of each {@code SparseTensor}. * @param concatDim Dimension to concatenate along. Must be in range [-rank, rank), - * where rank is the number of dimensions in each input `SparseTensor`. + * where rank is the number of dimensions in each input {@code SparseTensor}. + * @param data type for {@code SparseConcat} output and operands * @return a new instance of SparseConcat */ - @Endpoint(describeByClass = true) - public static SparseConcat create(Scope scope, Iterable> indices, Iterable> values, Iterable> shapes, Long concatDim) { + @Endpoint( + describeByClass = true + ) + public static SparseConcat create(Scope scope, + Iterable> indices, Iterable> values, + Iterable> shapes, Long concatDim) { OperationBuilder opBuilder = scope.env().opBuilder("SparseConcat", scope.makeOpName("SparseConcat")); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder.addInputList(Operands.asOutputs(shapes)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("concat_dim", concatDim); - return new SparseConcat(opBuilder.build()); + return new SparseConcat<>(opBuilder.build()); } - + /** - * 2-D. Indices of the concatenated `SparseTensor`. + * Gets outputIndices. + * 2-D. Indices of the concatenated {@code SparseTensor}. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** - * 1-D. Non-empty values of the concatenated `SparseTensor`. + * Gets outputValues. + * 1-D. Non-empty values of the concatenated {@code SparseTensor}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** - * 1-D. Shape of the concatenated `SparseTensor`. + * Gets outputShape. + * 1-D. Shape of the concatenated {@code SparseTensor}. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseConcat"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseConcat(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConditionalAccumulator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConditionalAccumulator.java index e012cb631c8..908b8a67212 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConditionalAccumulator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseConditionalAccumulator.java @@ -32,7 +32,6 @@ /** * A conditional accumulator for aggregating sparse gradients. - *

* The accumulator accepts gradients marked with local_step greater or * equal to the most recent global_step known to the accumulator. The * average can be extracted from the accumulator, provided sufficient @@ -40,59 +39,38 @@ * resets the aggregate to 0, and increments the global_step recorded by * the accumulator. */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseConditionalAccumulator extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseConditionalAccumulator} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this accumulator is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this accumulator will be shared under the given name - * across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param reductionType - */ - public Options reductionType(String reductionType) { - this.reductionType = reductionType; - return this; - } - - private String container; - private String sharedName; - private String reductionType; - - private Options() { - } + public static final String OP_NAME = "SparseConditionalAccumulator"; + + private Output handle; + + private SparseConditionalAccumulator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseConditionalAccumulator operation. - * + * * @param scope current scope * @param dtype The type of the value being accumulated. * @param shape The shape of the values. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseConditionalAccumulator} output and operands * @return a new instance of SparseConditionalAccumulator */ - @Endpoint(describeByClass = true) - public static SparseConditionalAccumulator create(Scope scope, Class dtype, Shape shape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseConditionalAccumulator create(Scope scope, Class dtype, + Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseConditionalAccumulator", scope.makeOpName("SparseConditionalAccumulator")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); @@ -112,50 +90,99 @@ public static SparseConditionalAccumulator create(Scope scope, } return new SparseConditionalAccumulator(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this accumulator is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this accumulator will be shared under the given name * across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param reductionType + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. */ public static Options reductionType(String reductionType) { return new Options().reductionType(reductionType); } - + /** + * Gets handle. * The handle to the accumulator. + * @return handle. */ public Output handle() { return handle; } - + @Override public Output asOutput() { return handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseConditionalAccumulator"; - - private Output handle; - - private SparseConditionalAccumulator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseConditionalAccumulator} + */ + public static class Options { + private String container; + + private String sharedName; + + private String reductionType; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this accumulator is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this accumulator will be shared under the given name + * across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. + */ + public Options reductionType(String reductionType) { + this.reductionType = reductionType; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCountSparseOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCountSparseOutput.java index 3133f02292a..945f357b277 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCountSparseOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCountSparseOutput.java @@ -24,50 +24,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TNumber; /** * Performs sparse-output bin counting for a sparse tensor input. - *

- * Counts the number of times each value occurs in the input. - * - * @param data type for {@code outputValues()} output + * Counts the number of times each value occurs in the input. + * + * @param data type for {@code output_values} output */ public final class SparseCountSparseOutput extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseCountSparseOutput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param minlength Minimum value to count. Can be set to -1 for no minimum. - */ - public Options minlength(Long minlength) { - this.minlength = minlength; - return this; - } - - /** - * @param maxlength Maximum value to count. Can be set to -1 for no maximum. - */ - public Options maxlength(Long maxlength) { - this.maxlength = maxlength; - return this; - } - - private Long minlength; - private Long maxlength; - - private Options() { - } + public static final String OP_NAME = "SparseCountSparseOutput"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputDenseShape; + + private SparseCountSparseOutput(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputDenseShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseCountSparseOutput operation. - * + * * @param scope current scope * @param indices Tensor containing the indices of the sparse tensor to count. * @param values Tensor containing values of the sparse tensor to count. @@ -75,11 +63,16 @@ private Options() { * @param weights A Tensor of the same shape as indices containing per-index weight values. * May also be the empty tensor if no weights are used. * @param binaryOutput Whether to output the number of occurrences of each value or 1. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseCountSparseOutput} output and operands * @return a new instance of SparseCountSparseOutput */ - @Endpoint(describeByClass = true) - public static SparseCountSparseOutput create(Scope scope, Operand indices, Operand values, Operand denseShape, Operand weights, Boolean binaryOutput, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseCountSparseOutput create(Scope scope, + Operand indices, Operand values, Operand denseShape, + Operand weights, Boolean binaryOutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseCountSparseOutput", scope.makeOpName("SparseCountSparseOutput")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); @@ -97,56 +90,87 @@ public static SparseCountSparseOutput create(Scope scope, } } } - return new SparseCountSparseOutput(opBuilder.build()); + return new SparseCountSparseOutput<>(opBuilder.build()); } - + /** + * Sets the minlength option. + * * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. */ public static Options minlength(Long minlength) { return new Options().minlength(minlength); } - + /** + * Sets the maxlength option. + * * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. */ public static Options maxlength(Long maxlength) { return new Options().maxlength(maxlength); } - + /** + * Gets outputIndices. * Indices tensor for the resulting sparse tensor object. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * Values tensor for the resulting sparse tensor object. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputDenseShape. * Shape tensor for the resulting sparse tensor object. + * @return outputDenseShape. */ public Output outputDenseShape() { return outputDenseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseCountSparseOutput"; - - private Output outputIndices; - private Output outputValues; - private Output outputDenseShape; - - private SparseCountSparseOutput(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputDenseShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseCountSparseOutput} + */ + public static class Options { + private Long minlength; + + private Long maxlength; + + private Options() { + } + + /** + * Sets the minlength option. + * + * @param minlength Minimum value to count. Can be set to -1 for no minimum. + * @return this Options instance. + */ + public Options minlength(Long minlength) { + this.minlength = minlength; + return this; + } + + /** + * Sets the maxlength option. + * + * @param maxlength Maximum value to count. Can be set to -1 for no maximum. + * @return this Options instance. + */ + public Options maxlength(Long maxlength) { + this.maxlength = maxlength; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCross.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCross.java index 93b76d3e56f..24c2cb32e9c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCross.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCross.java @@ -31,60 +31,83 @@ /** * Generates sparse cross from a list of sparse and dense tensors. - *

- * The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each - * representing features of one feature column. It outputs a 2D `SparseTensor` with + * The op takes two lists, one of 2D {@code SparseTensor} and one of 2D {@code Tensor}, each + * representing features of one feature column. It outputs a 2D {@code SparseTensor} with * the batchwise crosses of these features. - *

- * For example, if the inputs are - *

- * inputs[0]: SparseTensor with shape = [2, 2] - * [0, 0]: "a" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * inputs[1]: SparseTensor with shape = [2, 1] - * [0, 0]: "d" - * [1, 0]: "e" - *

- * inputs[2]: Tensor [["f"], ["g"]] - *

- * then the output will be - *

- * shape = [2, 2] - * [0, 0]: "a_X_d_X_f" - * [1, 0]: "b_X_e_X_g" - * [1, 1]: "c_X_e_X_g" - *

- * if hashed_output=true then the output will be - *

- * shape = [2, 2] - * [0, 0]: FingerprintCat64( - * Fingerprint64("f"), FingerprintCat64( - * Fingerprint64("d"), Fingerprint64("a"))) - * [1, 0]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("b"))) - * [1, 1]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("c"))) + *

For example, if the inputs are + *

+ * inputs[0]: SparseTensor with shape = [2, 2]
+ * [0, 0]: "a"
+ * [1, 0]: "b"
+ * [1, 1]: "c"
+ *
+ * inputs[1]: SparseTensor with shape = [2, 1]
+ * [0, 0]: "d"
+ * [1, 0]: "e"
+ *
+ * inputs[2]: Tensor [["f"], ["g"]]
+ * 
+ *

then the output will be + *

+ * shape = [2, 2]
+ * [0, 0]: "a_X_d_X_f"
+ * [1, 0]: "b_X_e_X_g"
+ * [1, 1]: "c_X_e_X_g"
+ * 
+ *

if hashed_output=true then the output will be + *

+ * shape = [2, 2]
+ * [0, 0]: FingerprintCat64(
+ *             Fingerprint64("f"), FingerprintCat64(
+ *                 Fingerprint64("d"), Fingerprint64("a")))
+ * [1, 0]: FingerprintCat64(
+ *             Fingerprint64("g"), FingerprintCat64(
+ *                 Fingerprint64("e"), Fingerprint64("b")))
+ * [1, 1]: FingerprintCat64(
+ *             Fingerprint64("g"), FingerprintCat64(
+ *                 Fingerprint64("e"), Fingerprint64("c")))
+ * 
*/ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseCross extends RawOp { - /** - * Factory method to create a class wrapping a new SparseCross operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseCrossV2"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + private SparseCross(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new SparseCrossV2 operation. + * * @param scope current scope - * @param indices 2-D. Indices of each input `SparseTensor`. - * @param values 1-D. values of each `SparseTensor`. - * @param shapes 1-D. Shapes of each `SparseTensor`. - * @param denseInputs 2-D. Columns represented by dense `Tensor`. + * @param indices 2-D. Indices of each input {@code SparseTensor}. + * @param values 1-D. values of each {@code SparseTensor}. + * @param shapes 1-D. Shapes of each {@code SparseTensor}. + * @param denseInputs 2-D. Columns represented by dense {@code Tensor}. * @param sep string used when joining a list of string inputs, can be used as separator later. * @return a new instance of SparseCross */ - @Endpoint(describeByClass = true) - public static SparseCross create(Scope scope, Iterable> indices, Iterable> values, Iterable> shapes, Iterable> denseInputs, Operand sep) { + @Endpoint( + describeByClass = true + ) + public static SparseCross create(Scope scope, Iterable> indices, + Iterable> values, Iterable> shapes, + Iterable> denseInputs, Operand sep) { OperationBuilder opBuilder = scope.env().opBuilder("SparseCrossV2", scope.makeOpName("SparseCross")); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(values)); @@ -94,41 +117,32 @@ public static SparseCross create(Scope scope, Iterable> indices, opBuilder = scope.apply(opBuilder); return new SparseCross(opBuilder.build()); } - + /** - * 2-D. Indices of the concatenated `SparseTensor`. + * Gets outputIndices. + * 2-D. Indices of the concatenated {@code SparseTensor}. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. Non-empty values of the concatenated or hashed - * `SparseTensor`. + * {@code SparseTensor}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** - * 1-D. Shape of the concatenated `SparseTensor`. + * Gets outputShape. + * 1-D. Shape of the concatenated {@code SparseTensor}. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseCrossV2"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseCross(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCrossHashed.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCrossHashed.java index c3a3b987da7..cf1f10e8a77 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCrossHashed.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseCrossHashed.java @@ -31,63 +31,87 @@ /** * Generates sparse cross from a list of sparse and dense tensors. - *

- * The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each - * representing features of one feature column. It outputs a 2D `SparseTensor` with + * The op takes two lists, one of 2D {@code SparseTensor} and one of 2D {@code Tensor}, each + * representing features of one feature column. It outputs a 2D {@code SparseTensor} with * the batchwise crosses of these features. - *

- * For example, if the inputs are - *

- * inputs[0]: SparseTensor with shape = [2, 2] - * [0, 0]: "a" - * [1, 0]: "b" - * [1, 1]: "c" - *

- * inputs[1]: SparseTensor with shape = [2, 1] - * [0, 0]: "d" - * [1, 0]: "e" - *

- * inputs[2]: Tensor [["f"], ["g"]] - *

- * then the output will be - *

- * shape = [2, 2] - * [0, 0]: "a_X_d_X_f" - * [1, 0]: "b_X_e_X_g" - * [1, 1]: "c_X_e_X_g" - *

- * if hashed_output=true then the output will be - *

- * shape = [2, 2] - * [0, 0]: FingerprintCat64( - * Fingerprint64("f"), FingerprintCat64( - * Fingerprint64("d"), Fingerprint64("a"))) - * [1, 0]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("b"))) - * [1, 1]: FingerprintCat64( - * Fingerprint64("g"), FingerprintCat64( - * Fingerprint64("e"), Fingerprint64("c"))) + *

For example, if the inputs are + *

+ * inputs[0]: SparseTensor with shape = [2, 2]
+ * [0, 0]: "a"
+ * [1, 0]: "b"
+ * [1, 1]: "c"
+ *
+ * inputs[1]: SparseTensor with shape = [2, 1]
+ * [0, 0]: "d"
+ * [1, 0]: "e"
+ *
+ * inputs[2]: Tensor [["f"], ["g"]]
+ * 
+ *

then the output will be + *

+ * shape = [2, 2]
+ * [0, 0]: "a_X_d_X_f"
+ * [1, 0]: "b_X_e_X_g"
+ * [1, 1]: "c_X_e_X_g"
+ * 
+ *

if hashed_output=true then the output will be + *

+ * shape = [2, 2]
+ * [0, 0]: FingerprintCat64(
+ *             Fingerprint64("f"), FingerprintCat64(
+ *                 Fingerprint64("d"), Fingerprint64("a")))
+ * [1, 0]: FingerprintCat64(
+ *             Fingerprint64("g"), FingerprintCat64(
+ *                 Fingerprint64("e"), Fingerprint64("b")))
+ * [1, 1]: FingerprintCat64(
+ *             Fingerprint64("g"), FingerprintCat64(
+ *                 Fingerprint64("e"), Fingerprint64("c")))
+ * 
*/ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseCrossHashed extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseCrossHashed"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + private SparseCrossHashed(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseCrossHashed operation. - * + * * @param scope current scope - * @param indices 2-D. Indices of each input `SparseTensor`. - * @param values 1-D. values of each `SparseTensor`. - * @param shapes 1-D. Shapes of each `SparseTensor`. - * @param denseInputs 2-D. Columns represented by dense `Tensor`. + * @param indices 2-D. Indices of each input {@code SparseTensor}. + * @param values 1-D. values of each {@code SparseTensor}. + * @param shapes 1-D. Shapes of each {@code SparseTensor}. + * @param denseInputs 2-D. Columns represented by dense {@code Tensor}. * @param numBuckets It is used if hashed_output is true. - * output = hashed_value%num_buckets if num_buckets > 0 else hashed_value. + * output = hashed_value%num_buckets if num_buckets > 0 else hashed_value. * @param strongHash boolean, if true, siphash with salt will be used instead of farmhash. * @param salt Specify the salt that will be used by the siphash function. * @return a new instance of SparseCrossHashed */ - @Endpoint(describeByClass = true) - public static SparseCrossHashed create(Scope scope, Iterable> indices, Iterable> values, Iterable> shapes, Iterable> denseInputs, Operand numBuckets, Operand strongHash, Operand salt) { + @Endpoint( + describeByClass = true + ) + public static SparseCrossHashed create(Scope scope, Iterable> indices, + Iterable> values, Iterable> shapes, + Iterable> denseInputs, Operand numBuckets, Operand strongHash, + Operand salt) { OperationBuilder opBuilder = scope.env().opBuilder("SparseCrossHashed", scope.makeOpName("SparseCrossHashed")); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(values)); @@ -99,41 +123,32 @@ public static SparseCrossHashed create(Scope scope, Iterable> in opBuilder = scope.apply(opBuilder); return new SparseCrossHashed(opBuilder.build()); } - + /** - * 2-D. Indices of the concatenated `SparseTensor`. + * Gets outputIndices. + * 2-D. Indices of the concatenated {@code SparseTensor}. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. Non-empty values of the concatenated or hashed - * `SparseTensor`. + * {@code SparseTensor}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** - * 1-D. Shape of the concatenated `SparseTensor`. + * Gets outputShape. + * 1-D. Shape of the concatenated {@code SparseTensor}. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseCrossHashed"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseCrossHashed(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseAdd.java index 600c582c56d..9056e35cc1d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseAdd.java @@ -30,63 +30,70 @@ /** * Adds up a SparseTensor and a dense Tensor, using these special rules: - *

* (1) Broadcasts the dense side to have the same shape as the sparse side, if - * eligible; + * eligible; * (2) Then, only the dense values pointed to by the indices of the SparseTensor - * participate in the cwise addition. - *

- * By these rules, the result is a logical SparseTensor with exactly the same + * participate in the cwise addition. + *

By these rules, the result is a logical SparseTensor with exactly the same * indices and shape, but possibly with different non-zero values. The output of * this Op is the resultant non-zero values. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseDenseCwiseAdd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseDenseCwiseAdd"; + + private Output output; + + private SparseDenseCwiseAdd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseDenseCwiseAdd operation. - * + * * @param scope current scope - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param spIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. - * @param spValues 1-D. `N` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. + * @param dense {@code R}-D. The dense Tensor operand. + * @param data type for {@code SparseDenseCwiseAdd} output and operands * @return a new instance of SparseDenseCwiseAdd */ - @Endpoint(describeByClass = true) - public static SparseDenseCwiseAdd create(Scope scope, Operand spIndices, Operand spValues, Operand spShape, Operand dense) { + @Endpoint( + describeByClass = true + ) + public static SparseDenseCwiseAdd create(Scope scope, + Operand spIndices, Operand spValues, Operand spShape, Operand dense) { OperationBuilder opBuilder = scope.env().opBuilder("SparseDenseCwiseAdd", scope.makeOpName("SparseDenseCwiseAdd")); opBuilder.addInput(spIndices.asOutput()); opBuilder.addInput(spValues.asOutput()); opBuilder.addInput(spShape.asOutput()); opBuilder.addInput(dense.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseDenseCwiseAdd(opBuilder.build()); + return new SparseDenseCwiseAdd<>(opBuilder.build()); } - + /** - * 1-D. The `N` values that are operated on. + * Gets output. + * 1-D. The {@code N} values that are operated on. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseDenseCwiseAdd"; - - private Output output; - - private SparseDenseCwiseAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseDiv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseDiv.java index 900f8ef6b64..10e57e9d2ef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseDiv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseDiv.java @@ -30,57 +30,65 @@ /** * Component-wise divides a SparseTensor by a dense Tensor. - *

- * Limitation: this Op only broadcasts the dense side to the sparse side, but not + * Limitation: this Op only broadcasts the dense side to the sparse side, but not * the other direction. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseDenseCwiseDiv extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseDenseCwiseDiv"; + + private Output output; + + private SparseDenseCwiseDiv(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseDenseCwiseDiv operation. - * + * * @param scope current scope - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param spIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. - * @param spValues 1-D. `N` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. + * @param dense {@code R}-D. The dense Tensor operand. + * @param data type for {@code SparseDenseCwiseDiv} output and operands * @return a new instance of SparseDenseCwiseDiv */ - @Endpoint(describeByClass = true) - public static SparseDenseCwiseDiv create(Scope scope, Operand spIndices, Operand spValues, Operand spShape, Operand dense) { + @Endpoint( + describeByClass = true + ) + public static SparseDenseCwiseDiv create(Scope scope, + Operand spIndices, Operand spValues, Operand spShape, Operand dense) { OperationBuilder opBuilder = scope.env().opBuilder("SparseDenseCwiseDiv", scope.makeOpName("SparseDenseCwiseDiv")); opBuilder.addInput(spIndices.asOutput()); opBuilder.addInput(spValues.asOutput()); opBuilder.addInput(spShape.asOutput()); opBuilder.addInput(dense.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseDenseCwiseDiv(opBuilder.build()); + return new SparseDenseCwiseDiv<>(opBuilder.build()); } - + /** - * 1-D. The `N` values that are operated on. + * Gets output. + * 1-D. The {@code N} values that are operated on. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseDenseCwiseDiv"; - - private Output output; - - private SparseDenseCwiseDiv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseMul.java index 85e13890111..87fe9de55e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseDenseCwiseMul.java @@ -30,61 +30,68 @@ /** * Component-wise multiplies a SparseTensor by a dense Tensor. - *

* The output locations corresponding to the implicitly zero elements in the sparse * tensor will be zero (i.e., will not take up storage space), regardless of the - * contents of the dense tensor (even if it's +/-INF and that INF0 == NaN). - *

- * Limitation*: this Op only broadcasts the dense side to the sparse side, but not + * contents of the dense tensor (even if it's +/-INF and that INF*0 == NaN). + *

Limitation: this Op only broadcasts the dense side to the sparse side, but not * the other direction. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseDenseCwiseMul extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseDenseCwiseMul"; + + private Output output; + + private SparseDenseCwiseMul(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseDenseCwiseMul operation. - * + * * @param scope current scope - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param spIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. - * @param spValues 1-D. `N` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code N} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. + * @param dense {@code R}-D. The dense Tensor operand. + * @param data type for {@code SparseDenseCwiseMul} output and operands * @return a new instance of SparseDenseCwiseMul */ - @Endpoint(describeByClass = true) - public static SparseDenseCwiseMul create(Scope scope, Operand spIndices, Operand spValues, Operand spShape, Operand dense) { + @Endpoint( + describeByClass = true + ) + public static SparseDenseCwiseMul create(Scope scope, + Operand spIndices, Operand spValues, Operand spShape, Operand dense) { OperationBuilder opBuilder = scope.env().opBuilder("SparseDenseCwiseMul", scope.makeOpName("SparseDenseCwiseMul")); opBuilder.addInput(spIndices.asOutput()); opBuilder.addInput(spValues.asOutput()); opBuilder.addInput(spShape.asOutput()); opBuilder.addInput(dense.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseDenseCwiseMul(opBuilder.build()); + return new SparseDenseCwiseMul<>(opBuilder.build()); } - + /** - * 1-D. The `N` values that are operated on. + * Gets output. + * 1-D. The {@code N} values that are operated on. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseDenseCwiseMul"; - - private Output output; - - private SparseDenseCwiseMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRows.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRows.java index 47a7d90793e..b175002e7e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRows.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRows.java @@ -30,115 +30,132 @@ import org.tensorflow.types.family.TType; /** - * Fills empty rows in the input 2-D `SparseTensor` with a default value. - *

- * The input `SparseTensor` is represented via the tuple of inputs - * (`indices`, `values`, `dense_shape`). The output `SparseTensor` has the - * same `dense_shape` but with indices `output_indices` and values - * `output_values`. - *

- * This op inserts a single entry for every row that doesn't have any values. - * The index is created as `[row, 0, ..., 0]` and the inserted value - * is `default_value`. - *

- * For example, suppose `sp_input` has shape `[5, 6]` and non-empty values: - *

- * [0, 1]: a - * [0, 3]: b - * [2, 0]: c - * [3, 1]: d - *

- * Rows 1 and 4 are empty, so the output will be of shape `[5, 6]` with values: - *

- * [0, 1]: a - * [0, 3]: b - * [1, 0]: default_value - * [2, 0]: c - * [3, 1]: d - * [4, 0]: default_value - *

- * The output `SparseTensor` will be in row-major order and will have the + * Fills empty rows in the input 2-D {@code SparseTensor} with a default value. + * The input {@code SparseTensor} is represented via the tuple of inputs + * ({@code indices}, {@code values}, {@code dense_shape}). The output {@code SparseTensor} has the + * same {@code dense_shape} but with indices {@code output_indices} and values + * {@code output_values}. + *

This op inserts a single entry for every row that doesn't have any values. + * The index is created as {@code [row, 0, ..., 0]} and the inserted value + * is {@code default_value}. + *

For example, suppose {@code sp_input} has shape {@code [5, 6]} and non-empty values: + *

+ * [0, 1]: a
+ * [0, 3]: b
+ * [2, 0]: c
+ * [3, 1]: d
+ * 
+ *

Rows 1 and 4 are empty, so the output will be of shape {@code [5, 6]} with values: + *

+ * [0, 1]: a
+ * [0, 3]: b
+ * [1, 0]: default_value
+ * [2, 0]: c
+ * [3, 1]: d
+ * [4, 0]: default_value
+ * 
+ *

The output {@code SparseTensor} will be in row-major order and will have the * same shape as the input. - *

- * This op also returns an indicator vector shaped `[dense_shape[0]]` such that - *

- * empty_row_indicator[i] = True iff row i was an empty row. - *

- * And a reverse index map vector shaped `[indices.shape[0]]` that is used during + *

This op also returns an indicator vector shaped {@code [dense_shape[0]]} such that + *

+ * empty_row_indicator[i] = True iff row i was an empty row.
+ * 
+ *

And a reverse index map vector shaped {@code [indices.shape[0]]} that is used during * backpropagation, - *

- * reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :] - * - * @param data type for {@code outputValues()} output + *

+ * reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]
+ * 
+ * + * @param data type for {@code output_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseFillEmptyRows extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseFillEmptyRows"; + + private Output outputIndices; + + private Output outputValues; + + private Output emptyRowIndicator; + + private Output reverseIndexMap; + + private SparseFillEmptyRows(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + emptyRowIndicator = operation.output(outputIdx++); + reverseIndexMap = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseFillEmptyRows operation. - * + * * @param scope current scope * @param indices 2-D. the indices of the sparse tensor. * @param values 1-D. the values of the sparse tensor. * @param denseShape 1-D. the shape of the sparse tensor. - * @param defaultValue 0-D. default value to insert into location `[row, 0, ..., 0]` - * for rows missing from the input sparse tensor. + * @param defaultValue 0-D. default value to insert into location {@code [row, 0, ..., 0]} + * for rows missing from the input sparse tensor. * output indices: 2-D. the indices of the filled sparse tensor. + * @param data type for {@code SparseFillEmptyRows} output and operands * @return a new instance of SparseFillEmptyRows */ - @Endpoint(describeByClass = true) - public static SparseFillEmptyRows create(Scope scope, Operand indices, Operand values, Operand denseShape, Operand defaultValue) { + @Endpoint( + describeByClass = true + ) + public static SparseFillEmptyRows create(Scope scope, + Operand indices, Operand values, Operand denseShape, + Operand defaultValue) { OperationBuilder opBuilder = scope.env().opBuilder("SparseFillEmptyRows", scope.makeOpName("SparseFillEmptyRows")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(denseShape.asOutput()); opBuilder.addInput(defaultValue.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseFillEmptyRows(opBuilder.build()); + return new SparseFillEmptyRows<>(opBuilder.build()); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. the values of the filled sparse tensor. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets emptyRowIndicator. * 1-D. whether the dense row was missing in the * input sparse tensor. + * @return emptyRowIndicator. */ public Output emptyRowIndicator() { return emptyRowIndicator; } - + /** + * Gets reverseIndexMap. * 1-D. a map from the input indices to the output indices. + * @return reverseIndexMap. */ public Output reverseIndexMap() { return reverseIndexMap; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseFillEmptyRows"; - - private Output outputIndices; - private Output outputValues; - private Output emptyRowIndicator; - private Output reverseIndexMap; - - private SparseFillEmptyRows(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - emptyRowIndicator = operation.output(outputIdx++); - reverseIndexMap = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRowsGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRowsGrad.java index e776ff51246..4e4056ad334 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRowsGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseFillEmptyRowsGrad.java @@ -30,62 +30,72 @@ /** * The gradient of SparseFillEmptyRows. - *

- * Takes vectors reverse_index_map, shaped `[N]`, and grad_values, - * shaped `[N_full]`, where `N_full >= N` and copies data into either - * `d_values` or `d_default_value`. Here `d_values` is shaped `[N]` and - * `d_default_value` is a scalar. - *

- * d_values[j] = grad_values[reverse_index_map[j]] - * d_default_value = sum_{k : 0 .. N_full - 1} ( - * grad_values[k] * 1{k not in reverse_index_map}) - * - * @param data type for {@code dValues()} output + * Takes vectors reverse_index_map, shaped {@code [N]}, and grad_values, + * shaped {@code [N_full]}, where {@code N_full >= N} and copies data into either + * {@code d_values} or {@code d_default_value}. Here {@code d_values} is shaped {@code [N]} and + * {@code d_default_value} is a scalar. + *

d_values[j] = grad_values[reverse_index_map[j]] + * d_default_value = sum_{k : 0 .. N_full - 1} ( + * grad_values[k] * 1{k not in reverse_index_map}) + * + * @param data type for {@code d_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseFillEmptyRowsGrad extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseFillEmptyRowsGrad"; + + private Output dValues; + + private Output dDefaultValue; + + private SparseFillEmptyRowsGrad(Operation operation) { + super(operation); + int outputIdx = 0; + dValues = operation.output(outputIdx++); + dDefaultValue = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseFillEmptyRowsGrad operation. - * + * * @param scope current scope * @param reverseIndexMap 1-D. The reverse index map from SparseFillEmptyRows. * @param gradValues 1-D. The gradients from backprop. + * @param data type for {@code SparseFillEmptyRowsGrad} output and operands * @return a new instance of SparseFillEmptyRowsGrad */ - @Endpoint(describeByClass = true) - public static SparseFillEmptyRowsGrad create(Scope scope, Operand reverseIndexMap, Operand gradValues) { + @Endpoint( + describeByClass = true + ) + public static SparseFillEmptyRowsGrad create(Scope scope, + Operand reverseIndexMap, Operand gradValues) { OperationBuilder opBuilder = scope.env().opBuilder("SparseFillEmptyRowsGrad", scope.makeOpName("SparseFillEmptyRowsGrad")); opBuilder.addInput(reverseIndexMap.asOutput()); opBuilder.addInput(gradValues.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseFillEmptyRowsGrad(opBuilder.build()); + return new SparseFillEmptyRowsGrad<>(opBuilder.build()); } - + /** + * Gets dValues. * 1-D. The backprop into values. + * @return dValues. */ public Output dValues() { return dValues; } - + /** + * Gets dDefaultValue. * 0-D. The backprop into default_value. + * @return dDefaultValue. */ public Output dDefaultValue() { return dDefaultValue; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseFillEmptyRowsGrad"; - - private Output dValues; - private Output dDefaultValue; - - private SparseFillEmptyRowsGrad(Operation operation) { - super(operation); - int outputIdx = 0; - dValues = operation.output(outputIdx++); - dDefaultValue = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseMatMul.java index ce1216ea5e1..143221bf47d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseMatMul.java @@ -29,78 +29,47 @@ import org.tensorflow.types.family.TNumber; /** - * Multiply matrix "a" by matrix "b". - *

- * The inputs must be two-dimensional matrices and the inner dimension of "a" must - * match the outer dimension of "b". Both "a" and "b" must be `Tensor`s not - * `SparseTensor`s. This op is optimized for the case where at least one of "a" or - * "b" is sparse, in the sense that they have a large proportion of zero values. + * Multiply matrix "a" by matrix "b". + * The inputs must be two-dimensional matrices and the inner dimension of "a" must + * match the outer dimension of "b". Both "a" and "b" must be {@code Tensor}s not + * {@code SparseTensor}s. This op is optimized for the case where at least one of "a" or + * "b" is sparse, in the sense that they have a large proportion of zero values. * The breakeven for using this versus a dense matrix multiply on one platform was * 30% zero values in the sparse matrix. - *

- * The gradient computation of this operation will only take advantage of sparsity + *

The gradient computation of this operation will only take advantage of sparsity * in the input gradient when that gradient comes from a Relu. */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseMatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param transposeA - */ - public Options transposeA(Boolean transposeA) { - this.transposeA = transposeA; - return this; - } - - /** - * @param transposeB - */ - public Options transposeB(Boolean transposeB) { - this.transposeB = transposeB; - return this; - } - - /** - * @param aIsSparse - */ - public Options aIsSparse(Boolean aIsSparse) { - this.aIsSparse = aIsSparse; - return this; - } - - /** - * @param bIsSparse - */ - public Options bIsSparse(Boolean bIsSparse) { - this.bIsSparse = bIsSparse; - return this; - } - - private Boolean transposeA; - private Boolean transposeB; - private Boolean aIsSparse; - private Boolean bIsSparse; - - private Options() { - } + public static final String OP_NAME = "SparseMatMul"; + + private Output product; + + private SparseMatMul(Operation operation) { + super(operation); + int outputIdx = 0; + product = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseMatMul operation. - * + * * @param scope current scope - * @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 * @return a new instance of SparseMatMul */ - @Endpoint(describeByClass = true) - public static SparseMatMul create(Scope scope, Operand a, Operand b, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseMatMul create(Scope scope, Operand a, + Operand b, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseMatMul", scope.makeOpName("SparseMatMul")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -123,54 +92,118 @@ public static SparseMatMul create(Scope scope, Operand a, Ope } return new SparseMatMul(opBuilder.build()); } - + /** - * @param transposeA + * Sets the transposeA option. + * + * @param transposeA the transposeA option + * @return this Options instance. */ public static Options transposeA(Boolean transposeA) { return new Options().transposeA(transposeA); } - + /** - * @param transposeB + * Sets the transposeB option. + * + * @param transposeB the transposeB option + * @return this Options instance. */ public static Options transposeB(Boolean transposeB) { return new Options().transposeB(transposeB); } - + /** - * @param aIsSparse + * Sets the aIsSparse option. + * + * @param aIsSparse the aIsSparse option + * @return this Options instance. */ public static Options aIsSparse(Boolean aIsSparse) { return new Options().aIsSparse(aIsSparse); } - + /** - * @param bIsSparse + * Sets the bIsSparse option. + * + * @param bIsSparse the bIsSparse option + * @return this Options instance. */ public static Options bIsSparse(Boolean bIsSparse) { return new Options().bIsSparse(bIsSparse); } - + /** + * Gets product. + * + * @return product. */ public Output product() { return product; } - + @Override public Output asOutput() { return product; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseMatMul"; - - private Output product; - - private SparseMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseMatMul} + */ + public static class Options { + private Boolean transposeA; + + private Boolean transposeB; + + private Boolean aIsSparse; + + private Boolean bIsSparse; + + private Options() { + } + + /** + * Sets the transposeA option. + * + * @param transposeA the transposeA option + * @return this Options instance. + */ + public Options transposeA(Boolean transposeA) { + this.transposeA = transposeA; + return this; + } + + /** + * Sets the transposeB option. + * + * @param transposeB the transposeB option + * @return this Options instance. + */ + public Options transposeB(Boolean transposeB) { + this.transposeB = transposeB; + return this; + } + + /** + * Sets the aIsSparse option. + * + * @param aIsSparse the aIsSparse option + * @return this Options instance. + */ + public Options aIsSparse(Boolean aIsSparse) { + this.aIsSparse = aIsSparse; + return this; + } + + /** + * Sets the bIsSparse option. + * + * @param bIsSparse the bIsSparse option + * @return this Options instance. + */ + public Options bIsSparse(Boolean bIsSparse) { + this.bIsSparse = bIsSparse; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMax.java index 190f06c2dbf..e903970abdf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMax.java @@ -31,58 +31,55 @@ /** * Computes the max of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_max()`. In particular, this Op also returns a dense `Tensor` + * {@code tf.reduce_max()}. In particular, this Op also returns a dense {@code Tensor} * instead of a sparse one. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

If {@code reduction_axes} has no entries, all dimensions are reduced, and a tensor * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseReduceMax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "SparseReduceMax"; + + private Output output; + + private SparseReduceMax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseReduceMax operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. - * @param inputValues 1-D. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceMax} output and operands * @return a new instance of SparseReduceMax */ - @Endpoint(describeByClass = true) - public static SparseReduceMax create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseReduceMax create(Scope scope, + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseReduceMax", scope.makeOpName("SparseReduceMax")); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); @@ -96,36 +93,51 @@ public static SparseReduceMax create(Scope scope, Operand } } } - return new SparseReduceMax(opBuilder.build()); + return new SparseReduceMax<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** - * `R-K`-D. The reduced Tensor. + * Gets output. + * {@code R-K}-D. The reduced Tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReduceMax"; - - private Output output; - - private SparseReduceMax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMax} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMaxSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMaxSparse.java index ae36fcb07e3..7861f41c263 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMaxSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceMaxSparse.java @@ -31,58 +31,61 @@ /** * Computes the max of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_max()`. In contrast to SparseReduceMax, this Op returns a + * {@code tf.reduce_max()}. In contrast to SparseReduceMax, this Op returns a * SparseTensor. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

If {@code reduction_axes} has no entries, all dimensions are reduced, and a tensor * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. - * - * @param data type for {@code outputValues()} output + * + * @param data type for {@code output_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseReduceMaxSparse extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMaxSparse} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "SparseReduceMaxSparse"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + private SparseReduceMaxSparse(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseReduceMaxSparse operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. - * @param inputValues 1-D. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceMaxSparse} output and operands * @return a new instance of SparseReduceMaxSparse */ - @Endpoint(describeByClass = true) - public static SparseReduceMaxSparse create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseReduceMaxSparse create(Scope scope, + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseReduceMaxSparse", scope.makeOpName("SparseReduceMaxSparse")); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); @@ -96,46 +99,64 @@ public static SparseReduceMaxSparse create(Scope scope, O } } } - return new SparseReduceMaxSparse(opBuilder.build()); + return new SparseReduceMaxSparse<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. + * + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputShape. + * + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReduceMaxSparse"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseReduceMaxSparse(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMaxSparse} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSum.java index 03243c81939..60edd502866 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSum.java @@ -31,58 +31,55 @@ /** * Computes the sum of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_sum()`. In particular, this Op also returns a dense `Tensor` + * {@code tf.reduce_sum()}. In particular, this Op also returns a dense {@code Tensor} * instead of a sparse one. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

If {@code reduction_axes} has no entries, all dimensions are reduced, and a tensor * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseReduceSum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "SparseReduceSum"; + + private Output output; + + private SparseReduceSum(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseReduceSum operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. - * @param inputValues 1-D. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceSum} output and operands * @return a new instance of SparseReduceSum */ - @Endpoint(describeByClass = true) - public static SparseReduceSum create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseReduceSum create(Scope scope, + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseReduceSum", scope.makeOpName("SparseReduceSum")); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); @@ -96,36 +93,51 @@ public static SparseReduceSum create(Scope scope, Operand(opBuilder.build()); + return new SparseReduceSum<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** - * `R-K`-D. The reduced Tensor. + * Gets output. + * {@code R-K}-D. The reduced Tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReduceSum"; - - private Output output; - - private SparseReduceSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSum} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSumSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSumSparse.java index d328616e8d1..5aa1b160680 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSumSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReduceSumSparse.java @@ -31,58 +31,61 @@ /** * Computes the sum of elements across dimensions of a SparseTensor. - *

* This Op takes a SparseTensor and is the sparse counterpart to - * `tf.reduce_sum()`. In contrast to SparseReduceSum, this Op returns a + * {@code tf.reduce_sum()}. In contrast to SparseReduceSum, this Op returns a * SparseTensor. - *

- * Reduces `sp_input` along the dimensions given in `reduction_axes`. Unless - * `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in - * `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained + *

Reduces {@code sp_input} along the dimensions given in {@code reduction_axes}. Unless + * {@code keep_dims} is true, the rank of the tensor is reduced by 1 for each entry in + * {@code reduction_axes}. If {@code keep_dims} is true, the reduced dimensions are retained * with length 1. - *

- * If `reduction_axes` has no entries, all dimensions are reduced, and a tensor + *

If {@code reduction_axes} has no entries, all dimensions are reduced, and a tensor * with a single element is returned. Additionally, the axes can be negative, * which are interpreted according to the indexing rules in Python. - * - * @param data type for {@code outputValues()} output + * + * @param data type for {@code output_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseReduceSumSparse extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSumSparse} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If true, retain reduced dimensions with length 1. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - private Boolean keepDims; - - private Options() { - } + public static final String OP_NAME = "SparseReduceSumSparse"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + private SparseReduceSumSparse(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseReduceSumSparse operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. - * @param inputValues 1-D. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. - * @param options carries optional attributes values + * @param reductionAxes 1-D. Length-{@code K} vector containing the reduction axes. + * @param options carries optional attribute values + * @param data type for {@code SparseReduceSumSparse} output and operands * @return a new instance of SparseReduceSumSparse */ - @Endpoint(describeByClass = true) - public static SparseReduceSumSparse create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseReduceSumSparse create(Scope scope, + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseReduceSumSparse", scope.makeOpName("SparseReduceSumSparse")); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); @@ -96,46 +99,64 @@ public static SparseReduceSumSparse create(Scope scope, Ope } } } - return new SparseReduceSumSparse(opBuilder.build()); + return new SparseReduceSumSparse<>(opBuilder.build()); } - + /** + * Sets the keepDims option. + * * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. */ public static Options keepDims(Boolean keepDims) { return new Options().keepDims(keepDims); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. + * + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputShape. + * + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReduceSumSparse"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseReduceSumSparse(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSumSparse} + */ + public static class Options { + private Boolean keepDims; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If true, retain reduced dimensions with length 1. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReorder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReorder.java index 66de5ab2f40..bb63b87263d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReorder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReorder.java @@ -30,66 +30,75 @@ /** * Reorders a SparseTensor into the canonical, row-major ordering. - *

* Note that by convention, all sparse ops preserve the canonical ordering along * increasing dimension number. The only time ordering can be violated is during * manual manipulation of the indices and values vectors to add entries. - *

- * Reordering does not affect the shape of the SparseTensor. - *

- * If the tensor has rank `R` and `N` non-empty values, `input_indices` has - * shape `[N, R]`, input_values has length `N`, and input_shape has length `R`. - * - * @param data type for {@code outputValues()} output + *

Reordering does not affect the shape of the SparseTensor. + *

If the tensor has rank {@code R} and {@code N} non-empty values, {@code input_indices} has + * shape {@code [N, R]}, input_values has length {@code N}, and input_shape has length {@code R}. + * + * @param data type for {@code output_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseReorder extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseReorder"; + + private Output outputIndices; + + private Output outputValues; + + private SparseReorder(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseReorder operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param inputIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, possibly not in canonical ordering. - * @param inputValues 1-D. `N` non-empty values corresponding to `input_indices`. + * @param inputValues 1-D. {@code N} non-empty values corresponding to {@code input_indices}. * @param inputShape 1-D. Shape of the input SparseTensor. + * @param data type for {@code SparseReorder} output and operands * @return a new instance of SparseReorder */ - @Endpoint(describeByClass = true) - public static SparseReorder create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape) { + @Endpoint( + describeByClass = true + ) + public static SparseReorder create(Scope scope, Operand inputIndices, + Operand inputValues, Operand inputShape) { OperationBuilder opBuilder = scope.env().opBuilder("SparseReorder", scope.makeOpName("SparseReorder")); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputValues.asOutput()); opBuilder.addInput(inputShape.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseReorder(opBuilder.build()); + return new SparseReorder<>(opBuilder.build()); } - + /** - * 2-D. `N x R` matrix with the same indices as input_indices, but + * Gets outputIndices. + * 2-D. {@code N x R} matrix with the same indices as input_indices, but * in canonical row-major ordering. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** - * 1-D. `N` non-empty values corresponding to `output_indices`. + * Gets outputValues. + * 1-D. {@code N} non-empty values corresponding to {@code output_indices}. + * @return outputValues. */ public Output outputValues() { return outputValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReorder"; - - private Output outputIndices; - private Output outputValues; - - private SparseReorder(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReshape.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReshape.java index 9c79e07f447..06e3b505ae5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReshape.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseReshape.java @@ -29,38 +29,54 @@ /** * Reshapes a SparseTensor to represent values in a new dense shape. - *

* This operation has the same semantics as reshape on the represented dense - * tensor. The `input_indices` are recomputed based on the requested `new_shape`. - *

- * If one component of `new_shape` is the special value -1, the size of that + * tensor. The {@code input_indices} are recomputed based on the requested {@code new_shape}. + *

If one component of {@code new_shape} is the special value -1, the size of that * dimension is computed so that the total dense size remains constant. At - * most one component of `new_shape` can be -1. The number of dense elements - * implied by `new_shape` must be the same as the number of dense elements - * originally implied by `input_shape`. - *

- * Reshaping does not affect the order of values in the SparseTensor. - *

- * If the input tensor has rank `R_in` and `N` non-empty values, and `new_shape` - * has length `R_out`, then `input_indices` has shape `[N, R_in]`, - * `input_shape` has length `R_in`, `output_indices` has shape `[N, R_out]`, and - * `output_shape` has length `R_out`. + * most one component of {@code new_shape} can be -1. The number of dense elements + * implied by {@code new_shape} must be the same as the number of dense elements + * originally implied by {@code input_shape}. + *

Reshaping does not affect the order of values in the SparseTensor. + *

If the input tensor has rank {@code R_in} and {@code N} non-empty values, and {@code new_shape} + * has length {@code R_out}, then {@code input_indices} has shape {@code [N, R_in]}, + * {@code input_shape} has length {@code R_in}, {@code output_indices} has shape {@code [N, R_out]}, and + * {@code output_shape} has length {@code R_out}. */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseReshape extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseReshape"; + + private Output outputIndices; + + private Output outputShape; + + private SparseReshape(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseReshape operation. - * + * * @param scope current scope - * @param inputIndices 2-D. `N x R_in` matrix with the indices of non-empty values in a + * @param inputIndices 2-D. {@code N x R_in} matrix with the indices of non-empty values in a * SparseTensor. - * @param inputShape 1-D. `R_in` vector with the input SparseTensor's dense shape. - * @param newShape 1-D. `R_out` vector with the requested new dense shape. + * @param inputShape 1-D. {@code R_in} vector with the input SparseTensor's dense shape. + * @param newShape 1-D. {@code R_out} vector with the requested new dense shape. * @return a new instance of SparseReshape */ - @Endpoint(describeByClass = true) - public static SparseReshape create(Scope scope, Operand inputIndices, Operand inputShape, Operand newShape) { + @Endpoint( + describeByClass = true + ) + public static SparseReshape create(Scope scope, Operand inputIndices, + Operand inputShape, Operand newShape) { OperationBuilder opBuilder = scope.env().opBuilder("SparseReshape", scope.makeOpName("SparseReshape")); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputShape.asOutput()); @@ -68,34 +84,25 @@ public static SparseReshape create(Scope scope, Operand inputIndices, Op opBuilder = scope.apply(opBuilder); return new SparseReshape(opBuilder.build()); } - + /** - * 2-D. `N x R_out` matrix with the updated indices of non-empty + * Gets outputIndices. + * 2-D. {@code N x R_out} matrix with the updated indices of non-empty * values in the output SparseTensor. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** - * 1-D. `R_out` vector with the full dense shape of the output - * SparseTensor. This is the same as `new_shape` but with any -1 dimensions + * Gets outputShape. + * 1-D. {@code R_out} vector with the full dense shape of the output + * SparseTensor. This is the same as {@code new_shape} but with any -1 dimensions * filled in. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseReshape"; - - private Output outputIndices; - private Output outputShape; - - private SparseReshape(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMean.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMean.java index 496dfc994de..6a47dd27947 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMean.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMean.java @@ -29,57 +29,64 @@ /** * Computes the mean along sparse segments of a tensor. - *

- * See `tf.sparse.segment_sum` for usage examples. - *

- * Like `SegmentMean`, but `segment_ids` can have rank less than `data`'s first - * dimension, selecting a subset of dimension 0, specified by `indices`. - * - * @param data type for {@code output()} output + * See {@code tf.sparse.segment_sum} for usage examples. + *

Like {@code SegmentMean}, but {@code segment_ids} can have rank less than {@code data}'s first + * dimension, selecting a subset of dimension 0, specified by {@code indices}. + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSegmentMean extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentMean"; + + private Output output; + + private SparseSegmentMean(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentMean operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @param data the data value + * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @param data type for {@code SparseSegmentMean} output and operands * @return a new instance of SparseSegmentMean */ - @Endpoint(describeByClass = true) - public static SparseSegmentMean create(Scope scope, Operand data, Operand indices, Operand segmentIds) { + @Endpoint( + describeByClass = true + ) + public static SparseSegmentMean create(Scope scope, Operand data, + Operand indices, Operand segmentIds) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentMean", scope.makeOpName("SparseSegmentMean")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSegmentMean(opBuilder.build()); + return new SparseSegmentMean<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentMean"; - - private Output output; - - private SparseSegmentMean(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanGrad.java index 2b9aa410096..f6b1f87a832 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanGrad.java @@ -30,55 +30,65 @@ /** * Computes gradients for SparseSegmentMean. - *

- * Returns tensor "output" with same shape as grad, except for dimension 0 whose + * Returns tensor "output" with same shape as grad, except for dimension 0 whose * value is output_dim0. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSegmentMeanGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentMeanGrad"; + + private Output output; + + private SparseSegmentMeanGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentMeanGrad operation. - * + * * @param scope current scope * @param grad gradient propagated to the SparseSegmentMean op. * @param indices indices passed to the corresponding SparseSegmentMean op. * @param segmentIds segment_ids passed to the corresponding SparseSegmentMean op. - * @param outputDim0 dimension 0 of "data" passed to SparseSegmentMean op. + * @param outputDim0 dimension 0 of "data" passed to SparseSegmentMean op. + * @param data type for {@code SparseSegmentMeanGrad} output and operands * @return a new instance of SparseSegmentMeanGrad */ - @Endpoint(describeByClass = true) - public static SparseSegmentMeanGrad create(Scope scope, Operand grad, Operand indices, Operand segmentIds, Operand outputDim0) { + @Endpoint( + describeByClass = true + ) + public static SparseSegmentMeanGrad create(Scope scope, Operand grad, + Operand indices, Operand segmentIds, + Operand outputDim0) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentMeanGrad", scope.makeOpName("SparseSegmentMeanGrad")); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(outputDim0.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSegmentMeanGrad(opBuilder.build()); + return new SparseSegmentMeanGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentMeanGrad"; - - private Output output; - - private SparseSegmentMeanGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanWithNumSegments.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanWithNumSegments.java index e2d79025981..b39c32e74f3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanWithNumSegments.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentMeanWithNumSegments.java @@ -29,61 +29,69 @@ /** * Computes the mean along sparse segments of a tensor. - *

- * Like `SparseSegmentMean`, but allows missing ids in `segment_ids`. If an id is - * missing, the `output` tensor at that position will be zeroed. - *

- * Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + * Like {@code SparseSegmentMean}, but allows missing ids in {@code segment_ids}. If an id is + * missing, the {@code output} tensor at that position will be zeroed. + *

Read + * the section on segmentation * for an explanation of segments. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSegmentMeanWithNumSegments extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentMeanWithNumSegments"; + + private Output output; + + private SparseSegmentMeanWithNumSegments(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentMeanWithNumSegments operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @param data the data value + * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @param numSegments Should equal the number of distinct segment IDs. + * @param data type for {@code SparseSegmentMeanWithNumSegments} output and operands * @return a new instance of SparseSegmentMeanWithNumSegments */ - @Endpoint(describeByClass = true) - public static SparseSegmentMeanWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, Operand numSegments) { + @Endpoint( + describeByClass = true + ) + public static SparseSegmentMeanWithNumSegments create(Scope scope, + Operand data, Operand indices, Operand segmentIds, + Operand numSegments) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentMeanWithNumSegments", scope.makeOpName("SparseSegmentMeanWithNumSegments")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSegmentMeanWithNumSegments(opBuilder.build()); + return new SparseSegmentMeanWithNumSegments<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which has size - * `num_segments`. + * {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentMeanWithNumSegments"; - - private Output output; - - private SparseSegmentMeanWithNumSegments(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtN.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtN.java index f9768aa67bd..ed7eae4bcce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtN.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtN.java @@ -29,57 +29,63 @@ /** * Computes the sum along sparse segments of a tensor divided by the sqrt of N. - *

* N is the size of the segment being reduced. - *

- * See `tf.sparse.segment_sum` for usage examples. - * - * - * @param data type for {@code output()} output + *

See {@code tf.sparse.segment_sum} for usage examples. + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSegmentSqrtN extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSqrtN"; + + private Output output; + + private SparseSegmentSqrtN(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentSqrtN operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @param data the data value + * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @param data type for {@code SparseSegmentSqrtN} output and operands * @return a new instance of SparseSegmentSqrtN */ - @Endpoint(describeByClass = true) - public static SparseSegmentSqrtN create(Scope scope, Operand data, Operand indices, Operand segmentIds) { + @Endpoint( + describeByClass = true + ) + public static SparseSegmentSqrtN create(Scope scope, Operand data, + Operand indices, Operand segmentIds) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSqrtN", scope.makeOpName("SparseSegmentSqrtN")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSegmentSqrtN(opBuilder.build()); + return new SparseSegmentSqrtN<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSqrtN"; - - private Output output; - - private SparseSegmentSqrtN(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNGrad.java index 8d43bc92976..7322722e355 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNGrad.java @@ -30,55 +30,65 @@ /** * Computes gradients for SparseSegmentSqrtN. - *

- * Returns tensor "output" with same shape as grad, except for dimension 0 whose + * Returns tensor "output" with same shape as grad, except for dimension 0 whose * value is output_dim0. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSegmentSqrtNGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSqrtNGrad"; + + private Output output; + + private SparseSegmentSqrtNGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentSqrtNGrad operation. - * + * * @param scope current scope * @param grad gradient propagated to the SparseSegmentSqrtN op. * @param indices indices passed to the corresponding SparseSegmentSqrtN op. * @param segmentIds segment_ids passed to the corresponding SparseSegmentSqrtN op. - * @param outputDim0 dimension 0 of "data" passed to SparseSegmentSqrtN op. + * @param outputDim0 dimension 0 of "data" passed to SparseSegmentSqrtN op. + * @param data type for {@code SparseSegmentSqrtNGrad} output and operands * @return a new instance of SparseSegmentSqrtNGrad */ - @Endpoint(describeByClass = true) - public static SparseSegmentSqrtNGrad create(Scope scope, Operand grad, Operand indices, Operand segmentIds, Operand outputDim0) { + @Endpoint( + describeByClass = true + ) + public static SparseSegmentSqrtNGrad create(Scope scope, Operand grad, + Operand indices, Operand segmentIds, + Operand outputDim0) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSqrtNGrad", scope.makeOpName("SparseSegmentSqrtNGrad")); opBuilder.addInput(grad.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(outputDim0.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSegmentSqrtNGrad(opBuilder.build()); + return new SparseSegmentSqrtNGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSqrtNGrad"; - - private Output output; - - private SparseSegmentSqrtNGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNWithNumSegments.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNWithNumSegments.java index 569c2d40534..f3d8174ea8b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNWithNumSegments.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSqrtNWithNumSegments.java @@ -29,63 +29,70 @@ /** * Computes the sum along sparse segments of a tensor divided by the sqrt of N. - *

* N is the size of the segment being reduced. - *

- * Like `SparseSegmentSqrtN`, but allows missing ids in `segment_ids`. If an id is - * missing, the `output` tensor at that position will be zeroed. - *

- * Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) + *

Like {@code SparseSegmentSqrtN}, but allows missing ids in {@code segment_ids}. If an id is + * missing, the {@code output} tensor at that position will be zeroed. + *

Read + * the section on segmentation * for an explanation of segments. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSegmentSqrtNWithNumSegments extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSqrtNWithNumSegments"; + + private Output output; + + private SparseSegmentSqrtNWithNumSegments(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentSqrtNWithNumSegments operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @param data the data value + * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @param numSegments Should equal the number of distinct segment IDs. + * @param data type for {@code SparseSegmentSqrtNWithNumSegments} output and operands * @return a new instance of SparseSegmentSqrtNWithNumSegments */ - @Endpoint(describeByClass = true) - public static SparseSegmentSqrtNWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, Operand numSegments) { + @Endpoint( + describeByClass = true + ) + public static SparseSegmentSqrtNWithNumSegments create(Scope scope, + Operand data, Operand indices, Operand segmentIds, + Operand numSegments) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSqrtNWithNumSegments", scope.makeOpName("SparseSegmentSqrtNWithNumSegments")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSegmentSqrtNWithNumSegments(opBuilder.build()); + return new SparseSegmentSqrtNWithNumSegments<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSqrtNWithNumSegments"; - - private Output output; - - private SparseSegmentSqrtNWithNumSegments(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSum.java index 04e00d71648..80a224d44b1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSum.java @@ -29,82 +29,87 @@ /** * Computes the sum along sparse 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. - *

- * Like `SegmentSum`, but `segment_ids` can have rank less than `data`'s first - * dimension, selecting a subset of dimension 0, specified by `indices`. - *

- * For example: - *

{@code
+ * 

Like {@code SegmentSum}, but {@code segment_ids} can have rank less than {@code data}'s first + * dimension, selecting a subset of dimension 0, specified by {@code indices}. + *

For example: + *

  * c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
- * 
+ *
  * # Select two rows, one segment.
  * tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))
- * # => [[0 0 0 0]]
- * 
+ * # => [[0 0 0 0]]
+ *
  * # Select two rows, two segment.
  * tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))
- * # => [[ 1  2  3  4]
+ * # => [[ 1  2  3  4]
  * #     [-1 -2 -3 -4]]
- * 
+ *
  * # Select all rows, two segments.
  * tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))
- * # => [[0 0 0 0]
+ * # => [[0 0 0 0]
  * #     [5 6 7 8]]
- * 
+ *
  * # Which is equivalent to:
  * tf.segment_sum(c, tf.constant([0, 0, 1]))
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSegmentSum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSum"; + + private Output output; + + private SparseSegmentSum(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentSum operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @param data the data value + * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @param data type for {@code SparseSegmentSum} output and operands * @return a new instance of SparseSegmentSum */ - @Endpoint(describeByClass = true) - public static SparseSegmentSum create(Scope scope, Operand data, Operand indices, Operand segmentIds) { + @Endpoint( + describeByClass = true + ) + public static SparseSegmentSum create(Scope scope, Operand data, + Operand indices, Operand segmentIds) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSum", scope.makeOpName("SparseSegmentSum")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSegmentSum(opBuilder.build()); + return new SparseSegmentSum<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `k`, the number of segments. + * has size {@code k}, the number of segments. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSum"; - - private Output output; - - private SparseSegmentSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumWithNumSegments.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumWithNumSegments.java index 0dca626c528..5a704742473 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumWithNumSegments.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSegmentSumWithNumSegments.java @@ -29,82 +29,88 @@ /** * Computes the sum along sparse segments of a tensor. - *

- * Like `SparseSegmentSum`, but allows missing ids in `segment_ids`. If an id is - * missing, the `output` tensor at that position will be zeroed. - *

- * Read - * [the section on segmentation](https://tensorflow.org/api_docs/python/tf/sparse#Segmentation) + * Like {@code SparseSegmentSum}, but allows missing ids in {@code segment_ids}. If an id is + * missing, the {@code output} tensor at that position will be zeroed. + *

Read + * the section on segmentation * for an explanation of segments. - *

- * For example: - *

{@code
+ * 

For example: + *

  * c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
- * 
+ *
  * tf.sparse_segment_sum_with_num_segments(
  *     c, tf.constant([0, 1]), tf.constant([0, 0]), num_segments=3)
- * # => [[0 0 0 0]
+ * # => [[0 0 0 0]
  * #     [0 0 0 0]
  * #     [0 0 0 0]]
- * 
+ *
  * tf.sparse_segment_sum_with_num_segments(c,
  *                                         tf.constant([0, 1]),
  *                                         tf.constant([0, 2],
  *                                         num_segments=4))
- * # => [[ 1  2  3  4]
+ * # => [[ 1  2  3  4]
  * #     [ 0  0  0  0]
  * #     [-1 -2 -3 -4]
  * #     [ 0  0  0  0]]
- * }
- * - * - * @param data type for {@code output()} output + *
+ * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSegmentSumWithNumSegments extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSegmentSumWithNumSegments"; + + private Output output; + + private SparseSegmentSumWithNumSegments(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSegmentSumWithNumSegments operation. - * + * * @param scope current scope - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @param data the data value + * @param indices A 1-D tensor. Has same rank as {@code segment_ids}. * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @param numSegments Should equal the number of distinct segment IDs. + * @param data type for {@code SparseSegmentSumWithNumSegments} output and operands * @return a new instance of SparseSegmentSumWithNumSegments */ - @Endpoint(describeByClass = true) - public static SparseSegmentSumWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, Operand numSegments) { + @Endpoint( + describeByClass = true + ) + public static SparseSegmentSumWithNumSegments create(Scope scope, + Operand data, Operand indices, Operand segmentIds, + Operand numSegments) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSegmentSumWithNumSegments", scope.makeOpName("SparseSegmentSumWithNumSegments")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(segmentIds.asOutput()); opBuilder.addInput(numSegments.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSegmentSumWithNumSegments(opBuilder.build()); + return new SparseSegmentSumWithNumSegments<>(opBuilder.build()); } - + /** + * Gets output. * Has same shape as data, except for dimension 0 which - * has size `num_segments`. + * has size {@code num_segments}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSegmentSumWithNumSegments"; - - private Output output; - - private SparseSegmentSumWithNumSegments(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSlice.java index cca3f77b72e..0c4d117518b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSlice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSlice.java @@ -29,88 +29,104 @@ import org.tensorflow.types.family.TType; /** - * Slice a `SparseTensor` based on the `start` and `size`. - *

+ * Slice a {@code SparseTensor} based on the {@code start} and {@code size}. * For example, if the input is - *

- * input_tensor = shape = [2, 7] - * [ a d e ] - * [b c ] - *

- * Graphically the output tensors are: - *

- * sparse_slice([0, 0], [2, 4]) = shape = [2, 4] - * [ a ] - * [b c ] - *

- * sparse_slice([0, 4], [2, 3]) = shape = [2, 3] - * [ d e ] - * [ ] - * - * @param data type for {@code outputValues()} output + *

+ * input_tensor = shape = [2, 7]
+ * [    a   d e  ]
+ * [b c          ]
+ * 
+ *

Graphically the output tensors are: + *

+ * sparse_slice([0, 0], [2, 4]) = shape = [2, 4]
+ * [    a  ]
+ * [b c    ]
+ *
+ * sparse_slice([0, 4], [2, 3]) = shape = [2, 3]
+ * [ d e  ]
+ * [      ]
+ * 
+ * + * @param data type for {@code output_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSlice extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSlice"; + + private Output outputIndices; + + private Output outputValues; + + private Output outputShape; + + private SparseSlice(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + outputShape = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSlice operation. - * + * * @param scope current scope * @param indices 2-D tensor represents the indices of the sparse tensor. * @param values 1-D tensor represents the values of the sparse tensor. * @param shape 1-D. tensor represents the shape of the sparse tensor. * @param start 1-D. tensor represents the start of the slice. - * @param size 1-D. tensor represents the size of the slice. + * @param sizeOutput 1-D. tensor represents the size of the slice. * output indices: A list of 1-D tensors represents the indices of the output * sparse tensors. + * @param data type for {@code SparseSlice} output and operands * @return a new instance of SparseSlice */ - @Endpoint(describeByClass = true) - public static SparseSlice create(Scope scope, Operand indices, Operand values, Operand shape, Operand start, Operand size) { + @Endpoint( + describeByClass = true + ) + public static SparseSlice create(Scope scope, Operand indices, + Operand values, Operand shape, Operand start, Operand sizeOutput) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSlice", scope.makeOpName("SparseSlice")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(start.asOutput()); - opBuilder.addInput(size.asOutput()); + opBuilder.addInput(sizeOutput.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSlice(opBuilder.build()); + return new SparseSlice<>(opBuilder.build()); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * A list of 1-D tensors represents the values of the output sparse * tensors. + * @return outputValues. */ public Output outputValues() { return outputValues; } - + /** + * Gets outputShape. * A list of 1-D tensors represents the shape of the output sparse * tensors. + * @return outputShape. */ public Output outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSlice"; - - private Output outputIndices; - private Output outputValues; - private Output outputShape; - - private SparseSlice(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - outputShape = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSliceGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSliceGrad.java index be3ffd7b15c..f66672e967a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSliceGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSliceGrad.java @@ -30,58 +30,66 @@ /** * The gradient operator for the SparseSlice op. - *

* This op takes in the upstream gradient w.r.t. non-empty values of - * the sliced `SparseTensor`, and outputs the gradients w.r.t. - * the non-empty values of input `SparseTensor`. - * - * @param data type for {@code valGrad()} output + * the sliced {@code SparseTensor}, and outputs the gradients w.r.t. + * the non-empty values of input {@code SparseTensor}. + * + * @param data type for {@code val_grad} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSliceGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSliceGrad"; + + private Output valGrad; + + private SparseSliceGrad(Operation operation) { + super(operation); + int outputIdx = 0; + valGrad = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSliceGrad operation. - * + * * @param scope current scope * @param backpropValGrad 1-D. The gradient with respect to - * the non-empty values of the sliced `SparseTensor`. - * @param inputIndices 2-D. The `indices` of the input `SparseTensor`. + * the non-empty values of the sliced {@code SparseTensor}. + * @param inputIndices 2-D. The {@code indices} of the input {@code SparseTensor}. * @param inputStart 1-D. tensor represents the start of the slice. - * @param outputIndices 2-D. The `indices` of the sliced `SparseTensor`. + * @param outputIndices 2-D. The {@code indices} of the sliced {@code SparseTensor}. + * @param data type for {@code SparseSliceGrad} output and operands * @return a new instance of SparseSliceGrad */ - @Endpoint(describeByClass = true) - public static SparseSliceGrad create(Scope scope, Operand backpropValGrad, Operand inputIndices, Operand inputStart, Operand outputIndices) { + @Endpoint( + describeByClass = true + ) + public static SparseSliceGrad create(Scope scope, Operand backpropValGrad, + Operand inputIndices, Operand inputStart, Operand outputIndices) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSliceGrad", scope.makeOpName("SparseSliceGrad")); opBuilder.addInput(backpropValGrad.asOutput()); opBuilder.addInput(inputIndices.asOutput()); opBuilder.addInput(inputStart.asOutput()); opBuilder.addInput(outputIndices.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSliceGrad(opBuilder.build()); + return new SparseSliceGrad<>(opBuilder.build()); } - + /** - * 1-D. The gradient with respect to the non-empty values of input `SparseTensor`. + * Gets valGrad. + * 1-D. The gradient with respect to the non-empty values of input {@code SparseTensor}. + * @return valGrad. */ public Output valGrad() { return valGrad; } - + @Override public Output asOutput() { return valGrad; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSliceGrad"; - - private Output valGrad; - - private SparseSliceGrad(Operation operation) { - super(operation); - int outputIdx = 0; - valGrad = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSoftmax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSoftmax.java index 252a00e838b..8278006e830 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSoftmax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSoftmax.java @@ -29,69 +29,74 @@ import org.tensorflow.types.family.TNumber; /** - * Applies softmax to a batched N-D `SparseTensor`. - *

- * The inputs represent an N-D SparseTensor with logical shape `[..., B, C]` - * (where `N >= 2`), and with indices sorted in the canonical lexicographic order. - *

- * This op is equivalent to applying the normal `tf.nn.softmax()` to each innermost - * logical submatrix with shape `[B, C]`, but with the catch that the implicitly - * zero elements do not participate. Specifically, the algorithm is equivalent + * Applies softmax to a batched N-D {@code SparseTensor}. + * The inputs represent an N-D SparseTensor with logical shape {@code [..., B, C]} + * (where {@code N >= 2}), and with indices sorted in the canonical lexicographic order. + *

This op is equivalent to applying the normal {@code tf.nn.softmax()} to each innermost + * logical submatrix with shape {@code [B, C]}, but with the catch that the implicitly + * zero elements do not participate. Specifically, the algorithm is equivalent * to the following: - *

- * (1) Applies `tf.nn.softmax()` to a densified view of each innermost submatrix - * with shape `[B, C]`, along the size-C dimension; - * (2) Masks out the original implicitly-zero locations; - * (3) Renormalizes the remaining elements. - *

- * Hence, the `SparseTensor` result has exactly the same non-zero indices and + *

(1) Applies {@code tf.nn.softmax()} to a densified view of each innermost submatrix + * with shape {@code [B, C]}, along the size-C dimension; + * (2) Masks out the original implicitly-zero locations; + * (3) Renormalizes the remaining elements. + *

Hence, the {@code SparseTensor} result has exactly the same non-zero indices and * shape. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSoftmax extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSoftmax"; + + private Output output; + + private SparseSoftmax(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSoftmax operation. - * + * * @param scope current scope - * @param spIndices 2-D. `NNZ x R` matrix with the indices of non-empty values in a + * @param spIndices 2-D. {@code NNZ x R} matrix with the indices of non-empty values in a * SparseTensor, in canonical ordering. - * @param spValues 1-D. `NNZ` non-empty values corresponding to `sp_indices`. + * @param spValues 1-D. {@code NNZ} non-empty values corresponding to {@code sp_indices}. * @param spShape 1-D. Shape of the input SparseTensor. + * @param data type for {@code SparseSoftmax} output and operands * @return a new instance of SparseSoftmax */ - @Endpoint(describeByClass = true) - public static SparseSoftmax create(Scope scope, Operand spIndices, Operand spValues, Operand spShape) { + @Endpoint( + describeByClass = true + ) + public static SparseSoftmax create(Scope scope, Operand spIndices, + Operand spValues, Operand spShape) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSoftmax", scope.makeOpName("SparseSoftmax")); opBuilder.addInput(spIndices.asOutput()); opBuilder.addInput(spValues.asOutput()); opBuilder.addInput(spShape.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSoftmax(opBuilder.build()); + return new SparseSoftmax<>(opBuilder.build()); } - + /** - * 1-D. The `NNZ` values for the result `SparseTensor`. + * Gets output. + * 1-D. The {@code NNZ} values for the result {@code SparseTensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSoftmax"; - - private Output output; - - private SparseSoftmax(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMaximum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMaximum.java index 8886a6fda12..ec699a3a53c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMaximum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMaximum.java @@ -30,29 +30,50 @@ /** * Returns the element-wise max of two SparseTensors. - *

* Assumes the two SparseTensors have the same shape, i.e., no broadcasting. - * - * @param data type for {@code outputValues()} output + * + * @param data type for {@code output_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSparseMaximum extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSparseMaximum"; + + private Output outputIndices; + + private Output outputValues; + + private SparseSparseMaximum(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSparseMaximum operation. - * + * * @param scope current scope - * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param aIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, in the canonical lexicographic ordering. - * @param aValues 1-D. `N` non-empty values corresponding to `a_indices`. + * @param aValues 1-D. {@code N} non-empty values corresponding to {@code a_indices}. * @param aShape 1-D. Shape of the input SparseTensor. - * @param bIndices counterpart to `a_indices` for the other operand. - * @param bValues counterpart to `a_values` for the other operand; must be of the same dtype. - * @param bShape counterpart to `a_shape` for the other operand; the two shapes must be equal. + * @param bIndices counterpart to {@code a_indices} for the other operand. + * @param bValues counterpart to {@code a_values} for the other operand; must be of the same dtype. + * @param bShape counterpart to {@code a_shape} for the other operand; the two shapes must be equal. + * @param data type for {@code SparseSparseMaximum} output and operands * @return a new instance of SparseSparseMaximum */ - @Endpoint(describeByClass = true) - public static SparseSparseMaximum create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand bIndices, Operand bValues, Operand bShape) { + @Endpoint( + describeByClass = true + ) + public static SparseSparseMaximum create(Scope scope, + Operand aIndices, Operand aValues, Operand aShape, + Operand bIndices, Operand bValues, Operand bShape) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSparseMaximum", scope.makeOpName("SparseSparseMaximum")); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); @@ -61,33 +82,24 @@ public static SparseSparseMaximum create(Scope scope, Ope opBuilder.addInput(bValues.asOutput()); opBuilder.addInput(bShape.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSparseMaximum(opBuilder.build()); + return new SparseSparseMaximum<>(opBuilder.build()); } - + /** + * Gets outputIndices. * 2-D. The indices of the output SparseTensor. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. The values of the output SparseTensor. + * @return outputValues. */ public Output outputValues() { return outputValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSparseMaximum"; - - private Output outputIndices; - private Output outputValues; - - private SparseSparseMaximum(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMinimum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMinimum.java index 4ac7a7b9dbc..8483cbae9c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMinimum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSparseMinimum.java @@ -30,29 +30,50 @@ /** * Returns the element-wise min of two SparseTensors. - *

* Assumes the two SparseTensors have the same shape, i.e., no broadcasting. - * - * @param data type for {@code outputValues()} output + * + * @param data type for {@code output_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSparseMinimum extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSparseMinimum"; + + private Output outputIndices; + + private Output outputValues; + + private SparseSparseMinimum(Operation operation) { + super(operation); + int outputIdx = 0; + outputIndices = operation.output(outputIdx++); + outputValues = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseSparseMinimum operation. - * + * * @param scope current scope - * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param aIndices 2-D. {@code N x R} matrix with the indices of non-empty values in a * SparseTensor, in the canonical lexicographic ordering. - * @param aValues 1-D. `N` non-empty values corresponding to `a_indices`. + * @param aValues 1-D. {@code N} non-empty values corresponding to {@code a_indices}. * @param aShape 1-D. Shape of the input SparseTensor. - * @param bIndices counterpart to `a_indices` for the other operand. - * @param bValues counterpart to `a_values` for the other operand; must be of the same dtype. - * @param bShape counterpart to `a_shape` for the other operand; the two shapes must be equal. + * @param bIndices counterpart to {@code a_indices} for the other operand. + * @param bValues counterpart to {@code a_values} for the other operand; must be of the same dtype. + * @param bShape counterpart to {@code a_shape} for the other operand; the two shapes must be equal. + * @param data type for {@code SparseSparseMinimum} output and operands * @return a new instance of SparseSparseMinimum */ - @Endpoint(describeByClass = true) - public static SparseSparseMinimum create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand bIndices, Operand bValues, Operand bShape) { + @Endpoint( + describeByClass = true + ) + public static SparseSparseMinimum create(Scope scope, + Operand aIndices, Operand aValues, Operand aShape, + Operand bIndices, Operand bValues, Operand bShape) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSparseMinimum", scope.makeOpName("SparseSparseMinimum")); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); @@ -61,33 +82,24 @@ public static SparseSparseMinimum create(Scope scope, Opera opBuilder.addInput(bValues.asOutput()); opBuilder.addInput(bShape.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseSparseMinimum(opBuilder.build()); + return new SparseSparseMinimum<>(opBuilder.build()); } - + /** + * Gets outputIndices. * 2-D. The indices of the output SparseTensor. + * @return outputIndices. */ public Output outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * 1-D. The values of the output SparseTensor. + * @return outputValues. */ public Output outputValues() { return outputValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSparseMinimum"; - - private Output outputIndices; - private Output outputValues; - - private SparseSparseMinimum(Operation operation) { - super(operation); - int outputIdx = 0; - outputIndices = operation.output(outputIdx++); - outputValues = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSplit.java index 3ca435ff577..bc7eccb7dbf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseSplit.java @@ -31,47 +31,78 @@ import org.tensorflow.types.family.TType; /** - * Split a `SparseTensor` into `num_split` tensors along one dimension. - *

- * If the `shape[split_dim]` is not an integer multiple of `num_split`. Slices - * `[0 : shape[split_dim] % num_split]` gets one extra dimension. - * For example, if `split_dim = 1` and `num_split = 2` and the input is - *

- * input_tensor = shape = [2, 7] - * [ a d e ] - * [b c ] - *

- * Graphically the output tensors are: - *

- * output_tensor[0] = shape = [2, 4] - * [ a ] - * [b c ] - *

- * output_tensor[1] = shape = [2, 3] - * [ d e ] - * [ ] - * - * @param data type for {@code outputValues()} output + * Split a {@code SparseTensor} into {@code num_split} tensors along one dimension. + * If the {@code shape[split_dim]} is not an integer multiple of {@code num_split}. Slices + * {@code [0 : shape[split_dim] % num_split]} gets one extra dimension. + * For example, if {@code split_dim = 1} and {@code num_split = 2} and the input is + *

+ * input_tensor = shape = [2, 7]
+ * [    a   d e  ]
+ * [b c          ]
+ * 
+ *

Graphically the output tensors are: + *

+ * output_tensor[0] = shape = [2, 4]
+ * [    a  ]
+ * [b c    ]
+ *
+ * output_tensor[1] = shape = [2, 3]
+ * [ d e  ]
+ * [      ]
+ * 
+ * + * @param data type for {@code output_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseSplit extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseSplit"; + + private List> outputIndices; + + private List> outputValues; + + private List> outputShape; + + @SuppressWarnings("unchecked") + private SparseSplit(Operation operation) { + super(operation); + int outputIdx = 0; + int outputIndicesLength = operation.outputListLength("output_indices"); + outputIndices = Arrays.asList((Output[]) operation.outputList(outputIdx, outputIndicesLength)); + outputIdx += outputIndicesLength; + int outputValuesLength = operation.outputListLength("output_values"); + outputValues = Arrays.asList((Output[]) operation.outputList(outputIdx, outputValuesLength)); + outputIdx += outputValuesLength; + int outputShapeLength = operation.outputListLength("output_shape"); + outputShape = Arrays.asList((Output[]) operation.outputList(outputIdx, outputShapeLength)); + outputIdx += outputShapeLength; + } + /** * Factory method to create a class wrapping a new SparseSplit operation. - * + * * @param scope current scope * @param splitDim 0-D. The dimension along which to split. Must be in the range - * `[0, rank(shape))`. + * {@code [0, rank(shape))}. * @param indices 2-D tensor represents the indices of the sparse tensor. * @param values 1-D tensor represents the values of the sparse tensor. * @param shape 1-D. tensor represents the shape of the sparse tensor. * output indices: A list of 1-D tensors represents the indices of the output * sparse tensors. * @param numSplit The number of ways to split. + * @param data type for {@code SparseSplit} output and operands * @return a new instance of SparseSplit */ - @Endpoint(describeByClass = true) - public static SparseSplit create(Scope scope, Operand splitDim, Operand indices, Operand values, Operand shape, Long numSplit) { + @Endpoint( + describeByClass = true + ) + public static SparseSplit create(Scope scope, Operand splitDim, + Operand indices, Operand values, Operand shape, Long numSplit) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSplit", scope.makeOpName("SparseSplit")); opBuilder.addInput(splitDim.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -79,50 +110,35 @@ public static SparseSplit create(Scope scope, Operand(opBuilder.build()); + return new SparseSplit<>(opBuilder.build()); } - + /** + * Gets outputIndices. + * + * @return outputIndices. */ public List> outputIndices() { return outputIndices; } - + /** + * Gets outputValues. * A list of 1-D tensors represents the values of the output sparse * tensors. + * @return outputValues. */ public List> outputValues() { return outputValues; } - + /** + * Gets outputShape. * A list of 1-D tensors represents the shape of the output sparse * tensors. + * @return outputShape. */ public List> outputShape() { return outputShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseSplit"; - - private List> outputIndices; - private List> outputValues; - private List> outputShape; - - @SuppressWarnings("unchecked") - private SparseSplit(Operation operation) { - super(operation); - int outputIdx = 0; - int outputIndicesLength = operation.outputListLength("output_indices"); - outputIndices = Arrays.asList((Output[])operation.outputList(outputIdx, outputIndicesLength)); - outputIdx += outputIndicesLength; - int outputValuesLength = operation.outputListLength("output_values"); - outputValues = Arrays.asList((Output[])operation.outputList(outputIdx, outputValuesLength)); - outputIdx += outputValuesLength; - int outputShapeLength = operation.outputListLength("output_shape"); - outputShape = Arrays.asList((Output[])operation.outputList(outputIdx, outputShapeLength)); - outputIdx += outputShapeLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseAdd.java index f104606ea34..3131109d49f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseAdd.java @@ -29,55 +29,65 @@ import org.tensorflow.types.family.TType; /** - * Adds up a `SparseTensor` and a dense `Tensor`, producing a dense `Tensor`. - *

- * This Op does not require `a_indices` be sorted in standard lexicographic order. - * - * @param data type for {@code output()} output + * Adds up a {@code SparseTensor} and a dense {@code Tensor}, producing a dense {@code Tensor}. + * This Op does not require {@code a_indices} be sorted in standard lexicographic order. + * + * @param data type for {@code output} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseTensorDenseAdd extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SparseTensorDenseAdd"; + + private Output output; + + private SparseTensorDenseAdd(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SparseTensorDenseAdd operation. - * + * * @param scope current scope - * @param aIndices 2-D. The `indices` of the `SparseTensor`, with shape `[nnz, ndims]`. - * @param aValues 1-D. The `values` of the `SparseTensor`, with shape `[nnz]`. - * @param aShape 1-D. The `shape` of the `SparseTensor`, with shape `[ndims]`. - * @param b `ndims`-D Tensor. With shape `a_shape`. + * @param aIndices 2-D. The {@code indices} of the {@code SparseTensor}, with shape {@code [nnz, ndims]}. + * @param aValues 1-D. The {@code values} of the {@code SparseTensor}, with shape {@code [nnz]}. + * @param aShape 1-D. The {@code shape} of the {@code SparseTensor}, with shape {@code [ndims]}. + * @param b {@code ndims}-D Tensor. With shape {@code a_shape}. + * @param data type for {@code SparseTensorDenseAdd} output and operands + * @param data type for {@code SparseTensorDenseAdd} output and operands * @return a new instance of SparseTensorDenseAdd */ - @Endpoint(describeByClass = true) - public static SparseTensorDenseAdd create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand b) { + @Endpoint( + describeByClass = true + ) + public static SparseTensorDenseAdd create(Scope scope, + Operand aIndices, Operand aValues, Operand aShape, Operand b) { OperationBuilder opBuilder = scope.env().opBuilder("SparseTensorDenseAdd", scope.makeOpName("SparseTensorDenseAdd")); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); opBuilder.addInput(aShape.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder = scope.apply(opBuilder); - return new SparseTensorDenseAdd(opBuilder.build()); + return new SparseTensorDenseAdd<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseTensorDenseAdd"; - - private Output output; - - private SparseTensorDenseAdd(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseMatMul.java index 076dd63a78d..e11260f527e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseTensorDenseMatMul.java @@ -30,66 +30,53 @@ import org.tensorflow.types.family.TType; /** - * Multiply SparseTensor (of rank 2) "A" by dense matrix "B". - *

+ * Multiply SparseTensor (of rank 2) "A" by dense matrix "B". * No validity checking is performed on the indices of A. However, the following * input format is recommended for optimal behavior: - *

- * if adjoint_a == false: - * A should be sorted in lexicographically increasing order. Use SparseReorder - * if you're not sure. + *

if adjoint_a == false: + * A should be sorted in lexicographically increasing order. Use SparseReorder + * if you're not sure. * if adjoint_a == true: - * A should be sorted in order of increasing dimension 1 (i.e., "column major" - * order instead of "row major" order). - * - * @param data type for {@code product()} output + * A should be sorted in order of increasing dimension 1 (i.e., "column major" + * order instead of "row major" order). + * + * @param data type for {@code product} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseTensorDenseMatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseTensorDenseMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjointA Use the adjoint of A in the matrix multiply. If A is complex, this - * is transpose(conj(A)). Otherwise it's transpose(A). - */ - public Options adjointA(Boolean adjointA) { - this.adjointA = adjointA; - return this; - } - - /** - * @param adjointB Use the adjoint of B in the matrix multiply. If B is complex, this - * is transpose(conj(B)). Otherwise it's transpose(B). - */ - public Options adjointB(Boolean adjointB) { - this.adjointB = adjointB; - return this; - } - - private Boolean adjointA; - private Boolean adjointB; - - private Options() { - } + public static final String OP_NAME = "SparseTensorDenseMatMul"; + + private Output product; + + private SparseTensorDenseMatMul(Operation operation) { + super(operation); + int outputIdx = 0; + product = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseTensorDenseMatMul operation. - * + * * @param scope current scope - * @param aIndices 2-D. The `indices` of the `SparseTensor`, size `[nnz, 2]` Matrix. - * @param aValues 1-D. The `values` of the `SparseTensor`, size `[nnz]` Vector. - * @param aShape 1-D. The `shape` of the `SparseTensor`, size `[2]` Vector. + * @param aIndices 2-D. The {@code indices} of the {@code SparseTensor}, size {@code [nnz, 2]} Matrix. + * @param aValues 1-D. The {@code values} of the {@code SparseTensor}, size {@code [nnz]} Vector. + * @param aShape 1-D. The {@code shape} of the {@code SparseTensor}, size {@code [2]} Vector. * @param b 2-D. A dense Matrix. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseTensorDenseMatMul} output and operands * @return a new instance of SparseTensorDenseMatMul */ - @Endpoint(describeByClass = true) - public static SparseTensorDenseMatMul create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand b, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseTensorDenseMatMul create(Scope scope, + Operand aIndices, Operand aValues, Operand aShape, Operand b, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseTensorDenseMatMul", scope.makeOpName("SparseTensorDenseMatMul")); opBuilder.addInput(aIndices.asOutput()); opBuilder.addInput(aValues.asOutput()); @@ -106,44 +93,78 @@ public static SparseTensorDenseMatMul create(Scope scope, O } } } - return new SparseTensorDenseMatMul(opBuilder.build()); + return new SparseTensorDenseMatMul<>(opBuilder.build()); } - + /** + * Sets the adjointA option. + * * @param adjointA Use the adjoint of A in the matrix multiply. If A is complex, this * is transpose(conj(A)). Otherwise it's transpose(A). + * @return this Options instance. */ public static Options adjointA(Boolean adjointA) { return new Options().adjointA(adjointA); } - + /** + * Sets the adjointB option. + * * @param adjointB Use the adjoint of B in the matrix multiply. If B is complex, this * is transpose(conj(B)). Otherwise it's transpose(B). + * @return this Options instance. */ public static Options adjointB(Boolean adjointB) { return new Options().adjointB(adjointB); } - + /** + * Gets product. + * + * @return product. */ public Output product() { return product; } - + @Override public Output asOutput() { return product; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseTensorDenseMatMul"; - - private Output product; - - private SparseTensorDenseMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseTensorDenseMatMul} + */ + public static class Options { + private Boolean adjointA; + + private Boolean adjointB; + + private Options() { + } + + /** + * Sets the adjointA option. + * + * @param adjointA Use the adjoint of A in the matrix multiply. If A is complex, this + * is transpose(conj(A)). Otherwise it's transpose(A). + * @return this Options instance. + */ + public Options adjointA(Boolean adjointA) { + this.adjointA = adjointA; + return this; + } + + /** + * Sets the adjointB option. + * + * @param adjointB Use the adjoint of B in the matrix multiply. If B is complex, this + * is transpose(conj(B)). Otherwise it's transpose(B). + * @return this Options instance. + */ + public Options adjointB(Boolean adjointB) { + this.adjointB = adjointB; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToDense.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToDense.java index 11dccb5873a..559fe3b7819 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToDense.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToDense.java @@ -30,66 +30,64 @@ /** * Converts a sparse representation into a dense tensor. - *

- * Builds an array `dense` with shape `output_shape` such that - *

{@code
+ * Builds an array {@code dense} with shape {@code output_shape} such that
+ * 
  * # If sparse_indices is scalar
  * dense[i] = (i == sparse_indices ? sparse_values : default_value)
- * 
+ *
  * # If sparse_indices is a vector, then for each i
  * dense[sparse_indices[i]] = sparse_values[i]
- * 
+ *
  * # If sparse_indices is an n by d matrix, then for each i in [0, n)
  * dense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i]
- * }
- * All other values in `dense` are set to `default_value`. If `sparse_values` is a + *
+ *

All other values in {@code dense} are set to {@code default_value}. If {@code sparse_values} is a * scalar, all sparse indices are set to this single value. - *

- * Indices should be sorted in lexicographic order, and indices must not - * contain any repeats. If `validate_indices` is true, these properties + *

Indices should be sorted in lexicographic order, and indices must not + * contain any repeats. If {@code validate_indices} is true, these properties * are checked during execution. - * - * @param data type for {@code dense()} output + * + * @param data type for {@code dense} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseToDense extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseToDense} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices If true, indices are checked to make sure they are sorted in - * lexicographic order and that there are no repeats. - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "SparseToDense"; + + private Output dense; + + private SparseToDense(Operation operation) { + super(operation); + int outputIdx = 0; + dense = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseToDense operation. - * + * * @param scope current scope - * @param sparseIndices 0-D, 1-D, or 2-D. `sparse_indices[i]` contains the complete - * index where `sparse_values[i]` will be placed. + * @param sparseIndices 0-D, 1-D, or 2-D. {@code sparse_indices[i]} contains the complete + * index where {@code sparse_values[i]} will be placed. * @param outputShape 1-D. Shape of the dense output tensor. - * @param sparseValues 1-D. Values corresponding to each row of `sparse_indices`, + * @param sparseValues 1-D. Values corresponding to each row of {@code sparse_indices}, * or a scalar value to be used for all sparse indices. * @param defaultValue Scalar value to set for indices not specified in - * `sparse_indices`. - * @param options carries optional attributes values + * {@code sparse_indices}. + * @param options carries optional attribute values + * @param data type for {@code SparseToDense} output and operands + * @param data type for {@code SparseToDense} output and operands * @return a new instance of SparseToDense */ - @Endpoint(describeByClass = true) - public static SparseToDense create(Scope scope, Operand sparseIndices, Operand outputShape, Operand sparseValues, Operand defaultValue, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseToDense create(Scope scope, + Operand sparseIndices, Operand outputShape, Operand sparseValues, + Operand defaultValue, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseToDense", scope.makeOpName("SparseToDense")); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(outputShape.asOutput()); @@ -103,37 +101,53 @@ public static SparseToDense create(Scope } } } - return new SparseToDense(opBuilder.build()); + return new SparseToDense<>(opBuilder.build()); } - + /** + * Sets the validateIndices option. + * * @param validateIndices If true, indices are checked to make sure they are sorted in * lexicographic order and that there are no repeats. + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** - * Dense output tensor of shape `output_shape`. + * Gets dense. + * Dense output tensor of shape {@code output_shape}. + * @return dense. */ public Output dense() { return dense; } - + @Override public Output asOutput() { return dense; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseToDense"; - - private Output dense; - - private SparseToDense(Operation operation) { - super(operation); - int outputIdx = 0; - dense = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseToDense} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices If true, indices are checked to make sure they are sorted in + * lexicographic order and that there are no repeats. + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = validateIndices; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToSparseSetOperation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToSparseSetOperation.java index 68d17c8eeca..8e1ee3ffd54 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToSparseSetOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseToSparseSetOperation.java @@ -29,80 +29,81 @@ import org.tensorflow.types.family.TType; /** - * Applies set operation along last dimension of 2 `SparseTensor` inputs. - *

- * See SetOperationOp::SetOperationFromContext for values of `set_operation`. - *

- * If `validate_indices` is `True`, `sparse.SparseToSparseSetOperation` validates the - * order and range of `set1` and `set2` indices. - *

- * Input `set1` is a `SparseTensor` represented by `set1_indices`, `set1_values`, - * and `set1_shape`. For `set1` ranked `n`, 1st `n-1` dimensions must be the same - * as `set2`. Dimension `n` contains values in a set, duplicates are allowed but + * Applies set operation along last dimension of 2 {@code SparseTensor} inputs. + * See SetOperationOp::SetOperationFromContext for values of {@code set_operation}. + *

If {@code validate_indices} is {@code True}, {@code sparse.SparseToSparseSetOperation} validates the + * order and range of {@code set1} and {@code set2} indices. + *

Input {@code set1} is a {@code SparseTensor} represented by {@code set1_indices}, {@code set1_values}, + * and {@code set1_shape}. For {@code set1} ranked {@code n}, 1st {@code n-1} dimensions must be the same + * as {@code set2}. Dimension {@code n} contains values in a set, duplicates are allowed but * ignored. - *

- * Input `set2` is a `SparseTensor` represented by `set2_indices`, `set2_values`, - * and `set2_shape`. For `set2` ranked `n`, 1st `n-1` dimensions must be the same - * as `set1`. Dimension `n` contains values in a set, duplicates are allowed but + *

Input {@code set2} is a {@code SparseTensor} represented by {@code set2_indices}, {@code set2_values}, + * and {@code set2_shape}. For {@code set2} ranked {@code n}, 1st {@code n-1} dimensions must be the same + * as {@code set1}. Dimension {@code n} contains values in a set, duplicates are allowed but * ignored. - *

- * If `validate_indices` is `True`, this op validates the order and range of `set1` - * and `set2` indices. - *

- * Output `result` is a `SparseTensor` represented by `result_indices`, - * `result_values`, and `result_shape`. For `set1` and `set2` ranked `n`, this - * has rank `n` and the same 1st `n-1` dimensions as `set1` and `set2`. The `nth` - * dimension contains the result of `set_operation` applied to the corresponding - * `[0...n-1]` dimension of `set`. - * - * @param data type for {@code resultValues()} output + *

If {@code validate_indices} is {@code True}, this op validates the order and range of {@code set1} + * and {@code set2} indices. + *

Output {@code result} is a {@code SparseTensor} represented by {@code result_indices}, + * {@code result_values}, and {@code result_shape}. For {@code set1} and {@code set2} ranked {@code n}, this + * has rank {@code n} and the same 1st {@code n-1} dimensions as {@code set1} and {@code set2}. The {@code nth} + * dimension contains the result of {@code set_operation} applied to the corresponding + * {@code [0...n-1]} dimension of {@code set}. + * + * @param data type for {@code result_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class SparseToSparseSetOperation extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.SparseToSparseSetOperation} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param validateIndices - */ - public Options validateIndices(Boolean validateIndices) { - this.validateIndices = validateIndices; - return this; - } - - private Boolean validateIndices; - - private Options() { - } + public static final String OP_NAME = "SparseToSparseSetOperation"; + + private Output resultIndices; + + private Output resultValues; + + private Output resultShape; + + private SparseToSparseSetOperation(Operation operation) { + super(operation); + int outputIdx = 0; + resultIndices = operation.output(outputIdx++); + resultValues = operation.output(outputIdx++); + resultShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseToSparseSetOperation operation. - * + * * @param scope current scope - * @param set1Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + * @param set1Indices 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major * order. - * @param set1Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set1Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major * order. - * @param set1Shape 1D `Tensor`, shape of a `SparseTensor`. `set1_shape[0...n-1]` must - * be the same as `set2_shape[0...n-1]`, `set1_shape[n]` is the - * max set size across `0...n-1` dimensions. - * @param set2Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + * @param set1Shape 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set1_shape[0...n-1]} must + * be the same as {@code set2_shape[0...n-1]}, {@code set1_shape[n]} is the + * max set size across {@code 0...n-1} dimensions. + * @param set2Indices 2D {@code Tensor}, indices of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set2Values 1D {@code Tensor}, values of a {@code SparseTensor}. Must be in row-major * order. - * @param set2Shape 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must - * be the same as `set1_shape[0...n-1]`, `set2_shape[n]` is the - * max set size across `0...n-1` dimensions. - * @param setOperation - * @param options carries optional attributes values + * @param set2Shape 1D {@code Tensor}, shape of a {@code SparseTensor}. {@code set2_shape[0...n-1]} must + * be the same as {@code set1_shape[0...n-1]}, {@code set2_shape[n]} is the + * max set size across {@code 0...n-1} dimensions. + * @param setOperation the value of the setOperation property + * @param options carries optional attribute values + * @param data type for {@code SparseToSparseSetOperation} output and operands * @return a new instance of SparseToSparseSetOperation */ - @Endpoint(describeByClass = true) - public static SparseToSparseSetOperation create(Scope scope, Operand set1Indices, Operand set1Values, Operand set1Shape, Operand set2Indices, Operand set2Values, Operand set2Shape, String setOperation, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseToSparseSetOperation create(Scope scope, + Operand set1Indices, Operand set1Values, Operand set1Shape, + Operand set2Indices, Operand set2Values, Operand set2Shape, + String setOperation, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseToSparseSetOperation", scope.makeOpName("SparseToSparseSetOperation")); opBuilder.addInput(set1Indices.asOutput()); opBuilder.addInput(set1Values.asOutput()); @@ -119,51 +120,66 @@ public static SparseToSparseSetOperation create(Scope scope } } } - return new SparseToSparseSetOperation(opBuilder.build()); + return new SparseToSparseSetOperation<>(opBuilder.build()); } - + /** - * @param validateIndices + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. */ public static Options validateIndices(Boolean validateIndices) { return new Options().validateIndices(validateIndices); } - + /** - * 2D indices of a `SparseTensor`. + * Gets resultIndices. + * 2D indices of a {@code SparseTensor}. + * @return resultIndices. */ public Output resultIndices() { return resultIndices; } - + /** - * 1D values of a `SparseTensor`. + * Gets resultValues. + * 1D values of a {@code SparseTensor}. + * @return resultValues. */ public Output resultValues() { return resultValues; } - + /** - * 1D `Tensor` shape of a `SparseTensor`. `result_shape[0...n-1]` is - * the same as the 1st `n-1` dimensions of `set1` and `set2`, `result_shape[n]` - * is the max result set size across all `0...n-1` dimensions. + * Gets resultShape. + * 1D {@code Tensor} shape of a {@code SparseTensor}. {@code result_shape[0...n-1]} is + * the same as the 1st {@code n-1} dimensions of {@code set1} and {@code set2}, {@code result_shape[n]} + * is the max result set size across all {@code 0...n-1} dimensions. + * @return resultShape. */ public Output resultShape() { return resultShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseToSparseSetOperation"; - - private Output resultIndices; - private Output resultValues; - private Output resultShape; - - private SparseToSparseSetOperation(Operation operation) { - super(operation); - int outputIdx = 0; - resultIndices = operation.output(outputIdx++); - resultValues = operation.output(outputIdx++); - resultShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.SparseToSparseSetOperation} + */ + public static class Options { + private Boolean validateIndices; + + private Options() { + } + + /** + * Sets the validateIndices option. + * + * @param validateIndices the validateIndices option + * @return this Options instance. + */ + public Options validateIndices(Boolean validateIndices) { + this.validateIndices = validateIndices; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/TakeManySparseFromTensorsMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/TakeManySparseFromTensorsMap.java index a18674e8c4c..92a51d8e3c3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/TakeManySparseFromTensorsMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/TakeManySparseFromTensorsMap.java @@ -30,43 +30,39 @@ import org.tensorflow.types.family.TType; /** - * Read `SparseTensors` from a `SparseTensorsMap` and concatenate them. - *

- * The input `sparse_handles` must be an `int64` matrix of shape `[N, 1]` where - * `N` is the minibatch size and the rows correspond to the output handles of - * `AddSparseToTensorsMap` or `AddManySparseToTensorsMap`. The ranks of the - * original `SparseTensor` objects that went into the given input ops must all - * match. When the final `SparseTensor` is created, it has rank one - * higher than the ranks of the incoming `SparseTensor` objects + * Read {@code SparseTensors} from a {@code SparseTensorsMap} and concatenate them. + * The input {@code sparse_handles} must be an {@code int64} matrix of shape {@code [N, 1]} where + * {@code N} is the minibatch size and the rows correspond to the output handles of + * {@code AddSparseToTensorsMap} or {@code AddManySparseToTensorsMap}. The ranks of the + * original {@code SparseTensor} objects that went into the given input ops 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 on the left). - *

- * 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 handles represent an input, which is a `[2, 3]` matrix - * representing two original `SparseTensor` objects: - *

{@code
+ * step run {@code SparseReorder} to restore index ordering.
+ * 

For example, if the handles represent an input, which is a {@code [2, 3]} matrix + * representing two original {@code SparseTensor} objects: + *

  *     index = [ 0]
  *             [10]
  *             [20]
  *     values = [1, 2, 3]
  *     shape = [50]
- * }
- * and - *
{@code
+ * 
+ *

and + *

  *     index = [ 2]
  *             [10]
  *     values = [4, 5]
  *     shape = [30]
- * }
- * then the final `SparseTensor` will be: - *
{@code
+ * 
+ *

then the final {@code SparseTensor} will be: + *

  *     index = [0  0]
  *             [0 10]
  *             [0 20]
@@ -74,57 +70,50 @@
  *             [1 10]
  *     values = [1, 2, 3, 4, 5]
  *     shape = [2 50]
- * }
- * - * - * @param data type for {@code sparseValues()} output + *
+ * + * @param data type for {@code sparse_values} output */ -@Operator(group = "sparse") +@Operator( + group = "sparse" +) public final class TakeManySparseFromTensorsMap extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.sparse.TakeManySparseFromTensorsMap} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container The container name for the `SparseTensorsMap` read by this op. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName The shared name for the `SparseTensorsMap` read by this op. - * It should not be blank; rather the `shared_name` or unique Operation name - * of the Op that created the original `SparseTensorsMap` should be used. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - private String container; - private String sharedName; - - private Options() { - } + public static final String OP_NAME = "TakeManySparseFromTensorsMap"; + + private Output sparseIndices; + + private Output sparseValues; + + private Output sparseShape; + + private TakeManySparseFromTensorsMap(Operation operation) { + super(operation); + int outputIdx = 0; + sparseIndices = operation.output(outputIdx++); + sparseValues = operation.output(outputIdx++); + sparseShape = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TakeManySparseFromTensorsMap operation. - * + * * @param scope current scope - * @param sparseHandles 1-D, The `N` serialized `SparseTensor` objects. - * Shape: `[N]`. - * @param dtype The `dtype` of the `SparseTensor` objects stored in the - * `SparseTensorsMap`. - * @param options carries optional attributes values + * @param sparseHandles 1-D, The {@code N} serialized {@code SparseTensor} objects. + * Shape: {@code [N]}. + * @param dtype The {@code dtype} of the {@code SparseTensor} objects stored in the + * {@code SparseTensorsMap}. + * @param options carries optional attribute values + * @param data type for {@code TakeManySparseFromTensorsMap} output and operands * @return a new instance of TakeManySparseFromTensorsMap */ - @Endpoint(describeByClass = true) - public static TakeManySparseFromTensorsMap create(Scope scope, Operand sparseHandles, Class dtype, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TakeManySparseFromTensorsMap create(Scope scope, + Operand sparseHandles, Class dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TakeManySparseFromTensorsMap", scope.makeOpName("TakeManySparseFromTensorsMap")); opBuilder.addInput(sparseHandles.asOutput()); opBuilder = scope.apply(opBuilder); @@ -139,58 +128,91 @@ public static TakeManySparseFromTensorsMap create(Scope sco } } } - return new TakeManySparseFromTensorsMap(opBuilder.build()); + return new TakeManySparseFromTensorsMap<>(opBuilder.build()); } - + /** - * @param container The container name for the `SparseTensorsMap` read by this op. + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} read by this op. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** - * @param sharedName The shared name for the `SparseTensorsMap` read by this op. - * It should not be blank; rather the `shared_name` or unique Operation name - * of the Op that created the original `SparseTensorsMap` should be used. + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} read by this op. + * It should not be blank; rather the {@code shared_name} or unique Operation name + * of the Op that created the original {@code SparseTensorsMap} should be used. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * 2-D. The `indices` of the minibatch `SparseTensor`. + * Gets sparseIndices. + * 2-D. The {@code indices} of the minibatch {@code SparseTensor}. + * @return sparseIndices. */ public Output sparseIndices() { return sparseIndices; } - + /** - * 1-D. The `values` of the minibatch `SparseTensor`. + * Gets sparseValues. + * 1-D. The {@code values} of the minibatch {@code SparseTensor}. + * @return sparseValues. */ public Output sparseValues() { return sparseValues; } - + /** - * 1-D. The `shape` of the minibatch `SparseTensor`. + * Gets sparseShape. + * 1-D. The {@code shape} of the minibatch {@code SparseTensor}. + * @return sparseShape. */ public Output sparseShape() { return sparseShape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TakeManySparseFromTensorsMap"; - - private Output sparseIndices; - private Output sparseValues; - private Output sparseShape; - - private TakeManySparseFromTensorsMap(Operation operation) { - super(operation); - int outputIdx = 0; - sparseIndices = operation.output(outputIdx++); - sparseValues = operation.output(outputIdx++); - sparseShape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.sparse.TakeManySparseFromTensorsMap} + */ + public static class Options { + private String container; + + private String sharedName; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container The container name for the {@code SparseTensorsMap} read by this op. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName The shared name for the {@code SparseTensorsMap} read by this op. + * It should not be blank; rather the {@code shared_name} or unique Operation name + * of the Op that created the original {@code SparseTensorsMap} should be used. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Join.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Join.java index 9d2247185e7..8e0f658be2a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Join.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Join.java @@ -30,48 +30,48 @@ /** * Joins the strings in the given list of string tensors into one tensor; - *

* with the given separator (default is an empty separator). - *

- * Examples: - *

- * >>> s = ["hello", "world", "tensorflow"] - * >>> tf.strings.join(s, " ") - * + *

Examples: + *

+ *
+ *
+ *

s = ["hello", "world", "tensorflow"] + * tf.strings.join(s, " ") + * <tf.Tensor: shape=(), dtype=string, numpy=b'hello world tensorflow'> + *

+ *
+ *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class Join extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.Join} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param separator string, an optional join separator. - */ - public Options separator(String separator) { - this.separator = separator; - return this; - } - - private String separator; - - private Options() { - } + public static final String OP_NAME = "StringJoin"; + + private Output output; + + private Join(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Join operation. - * + * Factory method to create a class wrapping a new StringJoin operation. + * * @param scope current scope * @param inputs A list of string tensors. The tensors must all have the same shape, * or be scalars. Scalars may be mixed in; these will be broadcast to the shape * of non-scalar inputs. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Join */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Join create(Scope scope, Iterable> inputs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringJoin", scope.makeOpName("Join")); opBuilder.addInputList(Operands.asOutputs(inputs)); @@ -85,33 +85,49 @@ public static Join create(Scope scope, Iterable> inputs, Option } return new Join(opBuilder.build()); } - + /** + * Sets the separator option. + * * @param separator string, an optional join separator. + * @return this Options instance. */ public static Options separator(String separator) { return new Options().separator(separator); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringJoin"; - - private Output output; - - private Join(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.Join} + */ + public static class Options { + private String separator; + + private Options() { + } + + /** + * Sets the separator option. + * + * @param separator string, an optional join separator. + * @return this Options instance. + */ + public Options separator(String separator) { + this.separator = separator; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Lower.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Lower.java index 2d3e8393e40..aca6e8ed033 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Lower.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Lower.java @@ -29,44 +29,44 @@ /** * Converts all uppercase characters into their respective lowercase replacements. - *

* Example: - *

- * >>> tf.strings.lower("CamelCase string and ALL CAPS") - * - * + *

+ *
+ *
+ *

tf.strings.lower("CamelCase string and ALL CAPS") + * <tf.Tensor: shape=(), dtype=string, numpy=b'camelcase string and all caps'> + *

+ *
+ *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class Lower extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.Lower} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param encoding - */ - public Options encoding(String encoding) { - this.encoding = encoding; - return this; - } - - private String encoding; - - private Options() { - } + public static final String OP_NAME = "StringLower"; + + private Output output; + + private Lower(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Lower operation. - * + * Factory method to create a class wrapping a new StringLower operation. + * * @param scope current scope - * @param input - * @param options carries optional attributes values + * @param input the input value + * @param options carries optional attribute values * @return a new instance of Lower */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Lower create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringLower", scope.makeOpName("Lower")); opBuilder.addInput(input.asOutput()); @@ -80,33 +80,49 @@ public static Lower create(Scope scope, Operand input, Options... optio } return new Lower(opBuilder.build()); } - + /** - * @param encoding + * Sets the encoding option. + * + * @param encoding the encoding option + * @return this Options instance. */ public static Options encoding(String encoding) { return new Options().encoding(encoding); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringLower"; - - private Output output; - - private Lower(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.Lower} + */ + public static class Options { + private String encoding; + + private Options() { + } + + /** + * Sets the encoding option. + * + * @param encoding the encoding option + * @return this Options instance. + */ + public Options encoding(String encoding) { + this.encoding = encoding; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ReduceJoin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ReduceJoin.java index 6ea85330626..f468b2937bc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ReduceJoin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ReduceJoin.java @@ -30,75 +30,61 @@ /** * Joins a string Tensor across the given dimensions. - *

* Computes the string join across dimensions in the given string Tensor of shape - * `[\\(d_0, d_1, ..., d_{n-1}\\)]`. Returns a new Tensor created by joining the input + * {@code [\\(d_0, d_1, ..., d_{n-1}\\)]}. Returns a new Tensor created by joining the input * strings with the given separator (default: empty string). Negative indices are - * counted backwards from the end, with `-1` being equivalent to `n - 1`. If - * indices are not specified, joins across all dimensions beginning from `n - 1` - * through `0`. - *

- * For example: - *

{@code
- * # tensor `a` is [["a", "b"], ["c", "d"]]
- * tf.reduce_join(a, 0) ==> ["ac", "bd"]
- * tf.reduce_join(a, 1) ==> ["ab", "cd"]
- * tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"]
- * tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"]
- * tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]]
- * tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]]
- * tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"]
- * tf.reduce_join(a, [0, 1]) ==> "acbd"
- * tf.reduce_join(a, [1, 0]) ==> "abcd"
- * tf.reduce_join(a, []) ==> [["a", "b"], ["c", "d"]]
- * tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd"
- * }
- * + * counted backwards from the end, with {@code -1} being equivalent to {@code n - 1}. If + * indices are not specified, joins across all dimensions beginning from {@code n - 1} + * through {@code 0}. + *

For example: + *

+ * # tensor `a` is [["a", "b"], ["c", "d"]]
+ * tf.reduce_join(a, 0) ==> ["ac", "bd"]
+ * tf.reduce_join(a, 1) ==> ["ab", "cd"]
+ * tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"]
+ * tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"]
+ * tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]]
+ * tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]]
+ * tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"]
+ * tf.reduce_join(a, [0, 1]) ==> "acbd"
+ * tf.reduce_join(a, [1, 0]) ==> "abcd"
+ * tf.reduce_join(a, []) ==> [["a", "b"], ["c", "d"]]
+ * tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd"
+ * 
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class ReduceJoin extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.ReduceJoin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param keepDims If `True`, retain reduced dimensions with length `1`. - */ - public Options keepDims(Boolean keepDims) { - this.keepDims = keepDims; - return this; - } - - /** - * @param separator The separator to use when joining. - */ - public Options separator(String separator) { - this.separator = separator; - return this; - } - - private Boolean keepDims; - private String separator; - - private Options() { - } + public static final String OP_NAME = "ReduceJoin"; + + private Output output; + + private ReduceJoin(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ReduceJoin operation. - * + * * @param scope current scope * @param inputs The input to be joined. All reduced indices must have non-zero size. * @param reductionIndices The dimensions to reduce over. Dimensions are reduced in the - * order specified. Omitting `reduction_indices` is equivalent to passing - * `[n-1, n-2, ..., 0]`. Negative indices from `-n` to `-1` are supported. - * @param options carries optional attributes values + * order specified. Omitting {@code reduction_indices} is equivalent to passing + * {@code [n-1, n-2, ..., 0]}. Negative indices from {@code -n} to {@code -1} are supported. + * @param options carries optional attribute values * @return a new instance of ReduceJoin */ - @Endpoint(describeByClass = true) - public static ReduceJoin create(Scope scope, Operand inputs, Operand reductionIndices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReduceJoin create(Scope scope, Operand inputs, + Operand reductionIndices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ReduceJoin", scope.makeOpName("ReduceJoin")); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(reductionIndices.asOutput()); @@ -115,42 +101,73 @@ public static ReduceJoin create(Scope scope, Operand inputs, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ReduceJoin"; - - private Output output; - - private ReduceJoin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.ReduceJoin} + */ + public static class Options { + private Boolean keepDims; + + private String separator; + + private Options() { + } + + /** + * Sets the keepDims option. + * + * @param keepDims If {@code True}, retain reduced dimensions with length {@code 1}. + * @return this Options instance. + */ + public Options keepDims(Boolean keepDims) { + this.keepDims = keepDims; + return this; + } + + /** + * Sets the separator option. + * + * @param separator The separator to use when joining. + * @return this Options instance. + */ + public Options separator(String separator) { + this.separator = separator; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexFullMatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexFullMatch.java index 04d507f29fc..91f0c94c7cd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexFullMatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexFullMatch.java @@ -30,61 +30,71 @@ /** * Check if the input matches the regex pattern. - *

* The input is a string tensor of any shape. The pattern is a scalar * string tensor which is applied to every element of the input tensor. * The boolean values (True or False) of the output tensor indicate * if the input matches the regex pattern provided. - *

- * The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) - *

- * Examples: - *

- * >>> tf.strings.regex_full_match(["TF lib", "lib TF"], ".*lib$") - * - * >>> tf.strings.regex_full_match(["TF lib", "lib TF"], ".*TF$") - * + *

The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) + *

Examples: + *

+ *
+ *
+ *

tf.strings.regex_full_match(["TF lib", "lib TF"], ".*lib$") + * <tf.Tensor: shape=(2,), dtype=bool, numpy=array([ True, False])> + * tf.strings.regex_full_match(["TF lib", "lib TF"], ".*TF$") + * <tf.Tensor: shape=(2,), dtype=bool, numpy=array([False, True])> + *

+ *
+ *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class RegexFullMatch extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RegexFullMatch"; + + private Output output; + + private RegexFullMatch(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new RegexFullMatch operation. - * + * * @param scope current scope * @param input A string tensor of the text to be processed. * @param pattern A scalar string tensor containing the regular expression to match the input. * @return a new instance of RegexFullMatch */ - @Endpoint(describeByClass = true) - public static RegexFullMatch create(Scope scope, Operand input, Operand pattern) { + @Endpoint( + describeByClass = true + ) + public static RegexFullMatch create(Scope scope, Operand input, + Operand pattern) { OperationBuilder opBuilder = scope.env().opBuilder("RegexFullMatch", scope.makeOpName("RegexFullMatch")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(pattern.asOutput()); opBuilder = scope.apply(opBuilder); return new RegexFullMatch(opBuilder.build()); } - + /** - * A bool tensor with the same shape as `input`. + * Gets output. + * A bool tensor with the same shape as {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RegexFullMatch"; - - private Output output; - - private RegexFullMatch(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexReplace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexReplace.java index 31063d7d2ba..c87bdc150fc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexReplace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/RegexReplace.java @@ -28,48 +28,43 @@ import org.tensorflow.types.TString; /** - * Replaces matches of the `pattern` regular expression in `input` with the - * replacement string provided in `rewrite`. - *

+ * Replaces matches of the {@code pattern} regular expression in {@code input} with the + * replacement string provided in {@code rewrite}. * It follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class RegexReplace extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.RegexReplace} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param replaceGlobal If True, the replacement is global (that is, all matches of the `pattern` regular - * expression in each input string are rewritten), otherwise the `rewrite` - * substitution is only made for the first `pattern` match. - */ - public Options replaceGlobal(Boolean replaceGlobal) { - this.replaceGlobal = replaceGlobal; - return this; - } - - private Boolean replaceGlobal; - - private Options() { - } + public static final String OP_NAME = "RegexReplace"; + + private Output output; + + private RegexReplace(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RegexReplace operation. - * + * * @param scope current scope * @param input The text to be processed. - * @param pattern The regular expression to be matched in the `input` strings. - * @param rewrite The rewrite string to be substituted for the `pattern` expression where it is - * matched in the `input` strings. - * @param options carries optional attributes values + * @param pattern The regular expression to be matched in the {@code input} strings. + * @param rewrite The rewrite string to be substituted for the {@code pattern} expression where it is + * matched in the {@code input} strings. + * @param options carries optional attribute values * @return a new instance of RegexReplace */ - @Endpoint(describeByClass = true) - public static RegexReplace create(Scope scope, Operand input, Operand pattern, Operand rewrite, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RegexReplace create(Scope scope, Operand input, Operand pattern, + Operand rewrite, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RegexReplace", scope.makeOpName("RegexReplace")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(pattern.asOutput()); @@ -84,36 +79,53 @@ public static RegexReplace create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RegexReplace"; - - private Output output; - - private RegexReplace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.RegexReplace} + */ + public static class Options { + private Boolean replaceGlobal; + + private Options() { + } + + /** + * Sets the replaceGlobal option. + * + * @param replaceGlobal If True, the replacement is global (that is, all matches of the {@code pattern} regular + * expression in each input string are rewritten), otherwise the {@code rewrite} + * substitution is only made for the first {@code pattern} match. + * @return this Options instance. + */ + public Options replaceGlobal(Boolean replaceGlobal) { + this.replaceGlobal = replaceGlobal; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexFullMatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexFullMatch.java index e3b7425e268..e54ef367f2c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexFullMatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexFullMatch.java @@ -24,31 +24,42 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBool; import org.tensorflow.types.TString; /** * Check if the input matches the regex pattern. - *

* The input is a string tensor of any shape. The pattern is the * regular expression to be matched with every element of the input tensor. * The boolean values (True or False) of the output tensor indicate * if the input matches the regex pattern provided. - *

- * The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) + *

The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ public final class StaticRegexFullMatch extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StaticRegexFullMatch"; + + private Output output; + + private StaticRegexFullMatch(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StaticRegexFullMatch operation. - * + * * @param scope current scope * @param input A string tensor of the text to be processed. * @param pattern The regular expression to match the input. * @return a new instance of StaticRegexFullMatch */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StaticRegexFullMatch create(Scope scope, Operand input, String pattern) { OperationBuilder opBuilder = scope.env().opBuilder("StaticRegexFullMatch", scope.makeOpName("StaticRegexFullMatch")); opBuilder.addInput(input.asOutput()); @@ -56,27 +67,18 @@ public static StaticRegexFullMatch create(Scope scope, Operand input, S opBuilder.setAttr("pattern", pattern); return new StaticRegexFullMatch(opBuilder.build()); } - + /** - * A bool tensor with the same shape as `input`. + * Gets output. + * A bool tensor with the same shape as {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StaticRegexFullMatch"; - - private Output output; - - private StaticRegexFullMatch(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexReplace.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexReplace.java index b6a4a47f641..230d9da7e8e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexReplace.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StaticRegexReplace.java @@ -24,48 +24,41 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Replaces the match of pattern in input with rewrite. - *

* It follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ public final class StaticRegexReplace extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.StaticRegexReplace} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param replaceGlobal If True, the replacement is global, otherwise the replacement - * is done only on the first match. - */ - public Options replaceGlobal(Boolean replaceGlobal) { - this.replaceGlobal = replaceGlobal; - return this; - } - - private Boolean replaceGlobal; - - private Options() { - } + public static final String OP_NAME = "StaticRegexReplace"; + + private Output output; + + private StaticRegexReplace(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StaticRegexReplace operation. - * + * * @param scope current scope * @param input The text to be processed. * @param pattern The regular expression to match the input. * @param rewrite The rewrite to be applied to the matched expression. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StaticRegexReplace */ - @Endpoint(describeByClass = true) - public static StaticRegexReplace create(Scope scope, Operand input, String pattern, String rewrite, Options... options) { + @Endpoint( + describeByClass = true + ) + public static StaticRegexReplace create(Scope scope, Operand input, String pattern, + String rewrite, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StaticRegexReplace", scope.makeOpName("StaticRegexReplace")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -80,35 +73,51 @@ public static StaticRegexReplace create(Scope scope, Operand input, Str } return new StaticRegexReplace(opBuilder.build()); } - + /** + * Sets the replaceGlobal option. + * * @param replaceGlobal If True, the replacement is global, otherwise the replacement * is done only on the first match. + * @return this Options instance. */ public static Options replaceGlobal(Boolean replaceGlobal) { return new Options().replaceGlobal(replaceGlobal); } - + /** + * Gets output. * The text after applying pattern and rewrite. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StaticRegexReplace"; - - private Output output; - - private StaticRegexReplace(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.StaticRegexReplace} + */ + public static class Options { + private Boolean replaceGlobal; + + private Options() { + } + + /** + * Sets the replaceGlobal option. + * + * @param replaceGlobal If True, the replacement is global, otherwise the replacement + * is done only on the first match. + * @return this Options instance. + */ + public Options replaceGlobal(Boolean replaceGlobal) { + this.replaceGlobal = replaceGlobal; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringFormat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringFormat.java index de8827e32e5..14df380f308 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringFormat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringFormat.java @@ -30,58 +30,36 @@ /** * Formats a string template using a list of tensors. - *

* Formats a string template using a list of tensors, pretty-printing tensor summaries. */ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class StringFormat extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.StringFormat} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param template A string, the template to format tensor summaries into. - */ - public Options template(String template) { - this.template = template; - return this; - } - - /** - * @param placeholder A string, at each placeholder in the template a subsequent tensor summary will be inserted. - */ - public Options placeholder(String placeholder) { - this.placeholder = placeholder; - return this; - } - - /** - * @param summarize When formatting the tensor summaries print the first and last summarize entries of each tensor dimension. - */ - public Options summarize(Long summarize) { - this.summarize = summarize; - return this; - } - - private String template; - private String placeholder; - private Long summarize; - - private Options() { - } + public static final String OP_NAME = "StringFormat"; + + private Output output; + + private StringFormat(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StringFormat operation. - * + * * @param scope current scope * @param inputs The list of tensors to format into the placeholder string. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StringFormat */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StringFormat create(Scope scope, Iterable> inputs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringFormat", scope.makeOpName("StringFormat")); opBuilder.addInputList(Operands.asOutputs(inputs)); @@ -101,48 +79,95 @@ public static StringFormat create(Scope scope, Iterable> inputs, Opti } return new StringFormat(opBuilder.build()); } - + /** + * Sets the template option. + * * @param template A string, the template to format tensor summaries into. + * @return this Options instance. */ public static Options template(String template) { return new Options().template(template); } - + /** + * Sets the placeholder option. + * * @param placeholder A string, at each placeholder in the template a subsequent tensor summary will be inserted. + * @return this Options instance. */ public static Options placeholder(String placeholder) { return new Options().placeholder(placeholder); } - + /** + * Sets the summarize option. + * * @param summarize When formatting the tensor summaries print the first and last summarize entries of each tensor dimension. + * @return this Options instance. */ public static Options summarize(Long summarize) { return new Options().summarize(summarize); } - + /** + * Gets output. * = The resulting string scalar. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringFormat"; - - private Output output; - - private StringFormat(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.StringFormat} + */ + public static class Options { + private String template; + + private String placeholder; + + private Long summarize; + + private Options() { + } + + /** + * Sets the template option. + * + * @param template A string, the template to format tensor summaries into. + * @return this Options instance. + */ + public Options template(String template) { + this.template = template; + return this; + } + + /** + * Sets the placeholder option. + * + * @param placeholder A string, at each placeholder in the template a subsequent tensor summary will be inserted. + * @return this Options instance. + */ + public Options placeholder(String placeholder) { + this.placeholder = placeholder; + return this; + } + + /** + * Sets the summarize option. + * + * @param summarize When formatting the tensor summaries print the first and last summarize entries of each tensor dimension. + * @return this Options instance. + */ + public Options summarize(Long summarize) { + this.summarize = summarize; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringLength.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringLength.java index d9a76aad6fe..39f5a62c604 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringLength.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringLength.java @@ -29,52 +29,48 @@ import org.tensorflow.types.TString; /** - * String lengths of `input`. - *

+ * String lengths of {@code input}. * Computes the length of each string given in the input tensor. - *

- * >>> strings = tf.constant(['Hello','TensorFlow', '\U0001F642']) - * >>> tf.strings.length(strings).numpy() # default counts bytes + *

+ *
+ *
+ *

strings = tf.constant(['Hello','TensorFlow', '\U0001F642']) + * tf.strings.length(strings).numpy() # default counts bytes * array([ 5, 10, 4], dtype=int32) - * >>> tf.strings.length(strings, unit="UTF8_CHAR").numpy() + * tf.strings.length(strings, unit="UTF8_CHAR").numpy() * array([ 5, 10, 1], dtype=int32) - * + *

+ *
+ *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class StringLength extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.StringLength} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param unit The unit that is counted to compute string length. One of: `"BYTE"` (for - * the number of bytes in each string) or `"UTF8_CHAR"` (for the number of UTF-8 - * encoded Unicode code points in each string). Results are undefined - * if `unit=UTF8_CHAR` and the `input` strings do not contain structurally - * valid UTF-8. - */ - public Options unit(String unit) { - this.unit = unit; - return this; - } - - private String unit; - - private Options() { - } + public static final String OP_NAME = "StringLength"; + + private Output output; + + private StringLength(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new StringLength operation. - * + * * @param scope current scope * @param input The strings for which to compute the length for each element. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of StringLength */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static StringLength create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringLength", scope.makeOpName("StringLength")); opBuilder.addInput(input.asOutput()); @@ -88,39 +84,58 @@ public static StringLength create(Scope scope, Operand input, Options.. } return new StringLength(opBuilder.build()); } - + /** - * @param unit The unit that is counted to compute string length. One of: `"BYTE"` (for - * the number of bytes in each string) or `"UTF8_CHAR"` (for the number of UTF-8 + * Sets the unit option. + * + * @param unit The unit that is counted to compute string length. One of: {@code "BYTE"} (for + * the number of bytes in each string) or {@code "UTF8_CHAR"} (for the number of UTF-8 * encoded Unicode code points in each string). Results are undefined - * if `unit=UTF8_CHAR` and the `input` strings do not contain structurally + * if {@code unit=UTF8_CHAR} and the {@code input} strings do not contain structurally * valid UTF-8. + * @return this Options instance. */ public static Options unit(String unit) { return new Options().unit(unit); } - + /** - * Integer tensor that has the same shape as `input`. The output contains the - * element-wise string lengths of `input`. + * Gets output. + * Integer tensor that has the same shape as {@code input}. The output contains the + * element-wise string lengths of {@code input}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringLength"; - - private Output output; - - private StringLength(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.StringLength} + */ + public static class Options { + private String unit; + + private Options() { + } + + /** + * Sets the unit option. + * + * @param unit The unit that is counted to compute string length. One of: {@code "BYTE"} (for + * the number of bytes in each string) or {@code "UTF8_CHAR"} (for the number of UTF-8 + * encoded Unicode code points in each string). Results are undefined + * if {@code unit=UTF8_CHAR} and the {@code input} strings do not contain structurally + * valid UTF-8. + * @return this Options instance. + */ + public Options unit(String unit) { + this.unit = unit; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringNGrams.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringNGrams.java index e504e164c41..ee33d1cd20f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringNGrams.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringNGrams.java @@ -31,24 +31,40 @@ /** * Creates ngrams from ragged string data. - *

* This op accepts a ragged tensor with 1 ragged dimension containing only * strings and outputs a ragged tensor with 1 ragged dimension containing ngrams * of that string, joined along the innermost axis. - * - * @param data type for {@code ngramsSplits()} output + * + * @param data type for {@code ngrams_splits} output */ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class StringNGrams extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringNGrams"; + + private Output ngrams; + + private Output ngramsSplits; + + private StringNGrams(Operation operation) { + super(operation); + int outputIdx = 0; + ngrams = operation.output(outputIdx++); + ngramsSplits = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StringNGrams operation. - * + * * @param scope current scope * @param data The values tensor of the ragged string tensor to make ngrams out of. Must be a * 1D string tensor. * @param dataSplits The splits tensor of the ragged string tensor to make ngrams out of. - * @param separator The string to append between elements of the token. Use "" for no separator. + * @param separator The string to append between elements of the token. Use "" for no separator. * @param ngramWidths The sizes of the ngrams to create. * @param leftPad The string to use to pad the left side of the ngram sequence. Only used if * pad_width != 0. @@ -56,20 +72,25 @@ public final class StringNGrams extends RawOp { * pad_width != 0. * @param padWidth The number of padding elements to add to each side of each * sequence. Note that padding will never be greater than 'ngram_widths'-1 - * regardless of this value. If `pad_width=-1`, then add `max(ngram_widths)-1` + * regardless of this value. If {@code pad_width=-1}, then add {@code max(ngram_widths)-1} * elements. - * @param preserveShortSequences + * @param preserveShortSequences the value of the preserveShortSequences property + * @param data type for {@code StringNGrams} output and operands * @return a new instance of StringNGrams */ - @Endpoint(describeByClass = true) - public static StringNGrams create(Scope scope, Operand data, Operand dataSplits, String separator, List ngramWidths, String leftPad, String rightPad, Long padWidth, Boolean preserveShortSequences) { + @Endpoint( + describeByClass = true + ) + public static StringNGrams create(Scope scope, Operand data, + Operand dataSplits, String separator, List ngramWidths, String leftPad, + String rightPad, Long padWidth, Boolean preserveShortSequences) { OperationBuilder opBuilder = scope.env().opBuilder("StringNGrams", scope.makeOpName("StringNGrams")); opBuilder.addInput(data.asOutput()); opBuilder.addInput(dataSplits.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("separator", separator); long[] ngramWidthsArray = new long[ngramWidths.size()]; - for (int i = 0; i < ngramWidthsArray.length; ++i) { + for (int i = 0 ; i < ngramWidthsArray.length ; i++) { ngramWidthsArray[i] = ngramWidths.get(i); } opBuilder.setAttr("ngram_widths", ngramWidthsArray); @@ -77,33 +98,24 @@ public static StringNGrams create(Scope scope, Operand(opBuilder.build()); + return new StringNGrams<>(opBuilder.build()); } - + /** + * Gets ngrams. * The values tensor of the output ngrams ragged tensor. + * @return ngrams. */ public Output ngrams() { return ngrams; } - + /** + * Gets ngramsSplits. * The splits tensor of the output ngrams ragged tensor. + * @return ngramsSplits. */ public Output ngramsSplits() { return ngramsSplits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringNGrams"; - - private Output ngrams; - private Output ngramsSplits; - - private StringNGrams(Operation operation) { - super(operation); - int outputIdx = 0; - ngrams = operation.output(outputIdx++); - ngramsSplits = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringSplit.java index 56d773c688e..1edadbaa03d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/StringSplit.java @@ -29,15 +29,13 @@ import org.tensorflow.types.TString; /** - * Split elements of `source` based on `sep` into a `SparseTensor`. - *

+ * Split elements of {@code source} based on {@code sep} into a {@code SparseTensor}. * Let N be the size of source (typically N will be the batch size). Split each - * element of `source` based on `sep` and return a `SparseTensor` + * element of {@code source} based on {@code sep} and return a {@code SparseTensor} * containing the split tokens. Empty tokens are ignored. - *

- * For example, N = 2, source[0] is 'hello world' and source[1] is 'a b c', + *

For example, N = 2, source[0] is 'hello world' and source[1] is 'a b c', * then the output will be - *

{@code
+ * 
  * st.indices = [0, 0;
  *               0, 1;
  *               1, 0;
@@ -45,49 +43,52 @@
  *               1, 2]
  * st.shape = [2, 3]
  * st.values = ['hello', 'world', 'a', 'b', 'c']
- * }
- * If `sep` is given, consecutive delimiters are not grouped together and are - * deemed to delimit empty strings. For example, source of `"1<>2<><>3"` and - * sep of `"<>"` returns `["1", "2", "", "3"]`. If `sep` is None or an empty + *
+ *

If {@code sep} is given, consecutive delimiters are not grouped together and are + * deemed to delimit empty strings. For example, source of {@code "1<>2<><>3"} and + * sep of {@code "<>"} returns {@code ["1", "2", "", "3"]}. If {@code sep} is None or an empty * string, consecutive whitespace are regarded as a single separator, and the * result will contain no empty strings at the startor end if the string has * leading or trailing whitespace. - *

- * Note that the above mentioned behavior matches python's str.split. + *

Note that the above mentioned behavior matches python's str.split. */ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class StringSplit extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.strings.StringSplit} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxsplit An `int`. If `maxsplit > 0`, limit of the split of the result. - */ - public Options maxsplit(Long maxsplit) { - this.maxsplit = maxsplit; - return this; - } - - private Long maxsplit; - - private Options() { - } + public static final String OP_NAME = "StringSplitV2"; + + private Output indices; + + private Output values; + + private Output shape; + + private StringSplit(Operation operation) { + super(operation); + int outputIdx = 0; + indices = operation.output(outputIdx++); + values = operation.output(outputIdx++); + shape = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new StringSplit operation. - * + * Factory method to create a class wrapping a new StringSplitV2 operation. + * * @param scope current scope - * @param input `1-D` string `Tensor`, the strings to split. - * @param sep `0-D` string `Tensor`, the delimiter character. - * @param options carries optional attributes values + * @param input {@code 1-D} string {@code Tensor}, the strings to split. + * @param sep {@code 0-D} string {@code Tensor}, the delimiter character. + * @param options carries optional attribute values * @return a new instance of StringSplit */ - @Endpoint(describeByClass = true) - public static StringSplit create(Scope scope, Operand input, Operand sep, Options... options) { + @Endpoint( + describeByClass = true + ) + public static StringSplit create(Scope scope, Operand input, Operand sep, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringSplitV2", scope.makeOpName("StringSplit")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(sep.asOutput()); @@ -101,44 +102,62 @@ public static StringSplit create(Scope scope, Operand input, Operand 0`, limit of the split of the result. + * Sets the maxsplit option. + * + * @param maxsplit An {@code int}. If {@code maxsplit > 0}, limit of the split of the result. + * @return this Options instance. */ public static Options maxsplit(Long maxsplit) { return new Options().maxsplit(maxsplit); } - + /** + * Gets indices. + * + * @return indices. */ public Output indices() { return indices; } - + /** + * Gets values. + * + * @return values. */ public Output values() { return values; } - + /** + * Gets shape. + * + * @return shape. */ public Output shape() { return shape; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringSplitV2"; - - private Output indices; - private Output values; - private Output shape; - - private StringSplit(Operation operation) { - super(operation); - int outputIdx = 0; - indices = operation.output(outputIdx++); - values = operation.output(outputIdx++); - shape = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.StringSplit} + */ + public static class Options { + private Long maxsplit; + + private Options() { + } + + /** + * Sets the maxsplit option. + * + * @param maxsplit An {@code int}. If {@code maxsplit > 0}, limit of the split of the result. + * @return this Options instance. + */ + public Options maxsplit(Long maxsplit) { + this.maxsplit = maxsplit; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Strip.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Strip.java index 39834ed61db..3506f8f0329 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Strip.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Strip.java @@ -30,49 +30,60 @@ /** * Strip leading and trailing whitespaces from the Tensor. */ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class Strip extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Strip operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringStrip"; + + private Output output; + + private Strip(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringStrip operation. + * * @param scope current scope - * @param input A string `Tensor` of any shape. + * @param input A string {@code Tensor} of any shape. * @return a new instance of Strip */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Strip create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("StringStrip", scope.makeOpName("Strip")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new Strip(opBuilder.build()); } - + /** - * A string `Tensor` of the same shape as the input. - *

- * Examples: - *

- * >>> tf.strings.strip(["\nTensorFlow", " The python library "]).numpy() + * Gets output. + * A string {@code Tensor} of the same shape as the input. + *

Examples: + *

+ *
+ *
+ *

tf.strings.strip(["\nTensorFlow", " The python library "]).numpy() * array([b'TensorFlow', b'The python library'], dtype=object) + *

+ *
+ *
+ * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringStrip"; - - private Output output; - - private Strip(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Substr.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Substr.java index 472e30bc98c..a1562de32bf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Substr.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Substr.java @@ -29,40 +29,31 @@ import org.tensorflow.types.family.TNumber; /** - * Return substrings from `Tensor` of strings. - *

- * For each string in the input `Tensor`, creates a substring starting at index - * `pos` with a total length of `len`. - *

- * If `len` defines a substring that would extend beyond the length of the input - * string, or if `len` is negative, then as many characters as possible are used. - *

- * A negative `pos` indicates distance within the string backwards from the end. - *

- * If `pos` specifies an index which is out of range for any of the input strings, - * then an `InvalidArgumentError` is thrown. - *

- * `pos` and `len` must have the same shape, otherwise a `ValueError` is thrown on + * Return substrings from {@code Tensor} of strings. + * For each string in the input {@code Tensor}, creates a substring starting at index + * {@code pos} with a total length of {@code len}. + *

If {@code len} defines a substring that would extend beyond the length of the input + * string, or if {@code len} is negative, then as many characters as possible are used. + *

A negative {@code pos} indicates distance within the string backwards from the end. + *

If {@code pos} specifies an index which is out of range for any of the input strings, + * then an {@code InvalidArgumentError} is thrown. + *

{@code pos} and {@code len} must have the same shape, otherwise a {@code ValueError} is thrown on * Op creation. - *

- * NOTE: `strings.Substr` supports broadcasting up to two dimensions. More about + *

NOTE: {@code strings.Substr} supports broadcasting up to two dimensions. More about * broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) - *

- * --- - *

- * Examples - *

- * Using scalar `pos` and `len`: - *

{@code
+ *  here 
+ * 
+ *

Examples + *

Using scalar {@code pos} and {@code len}: + *

  * input = [b'Hello', b'World']
  * position = 1
  * length = 3
- * 
+ *
  * output = [b'ell', b'orl']
- * }
- * Using `pos` and `len` with same shape as `input`: - *
{@code
+ * 
+ *

Using {@code pos} and {@code len} with same shape as {@code input}: + *

  * input = [[b'ten', b'eleven', b'twelve'],
  *          [b'thirteen', b'fourteen', b'fifteen'],
  *          [b'sixteen', b'seventeen', b'eighteen']]
@@ -72,79 +63,74 @@
  * length =   [[2, 3, 4],
  *             [4, 3, 2],
  *             [5, 5, 5]]
- * 
+ *
  * output = [[b'en', b'eve', b'lve'],
  *           [b'hirt', b'urt', b'te'],
  *           [b'ixtee', b'vente', b'hteen']]
- * }
- * Broadcasting `pos` and `len` onto `input`: - *
{@code
+ * 
+ *

Broadcasting {@code pos} and {@code len} onto {@code input}: + *

  * input = [[b'ten', b'eleven', b'twelve'],
  *          [b'thirteen', b'fourteen', b'fifteen'],
  *          [b'sixteen', b'seventeen', b'eighteen'],
  *          [b'nineteen', b'twenty', b'twentyone']]
  * position = [1, 2, 3]
  * length =   [1, 2, 3]
- * 
+ *
  * output = [[b'e', b'ev', b'lve'],
  *           [b'h', b'ur', b'tee'],
  *           [b'i', b've', b'hte'],
  *           [b'i', b'en', b'nty']]
- * }
- * Broadcasting `input` onto `pos` and `len`: - *
{@code
+ * 
+ *

Broadcasting {@code input} onto {@code pos} and {@code len}: + *

  * input = b'thirteen'
  * position = [1, 5, 7]
  * length =   [3, 2, 1]
- * 
+ *
  * output = [b'hir', b'ee', b'n']
- * }
- * Raises: - *

- * * `ValueError`: If the first argument cannot be converted to a - * Tensor of `dtype string`. - * * `InvalidArgumentError`: If indices are out of range. - * * `ValueError`: If `pos` and `len` are not the same shape. - * + *

+ *

Raises: + *

    + *
  • {@code ValueError}: If the first argument cannot be converted to a + * Tensor of {@code dtype string}.
  • + *
  • {@code InvalidArgumentError}: If indices are out of range.
  • + *
  • {@code ValueError}: If {@code pos} and {@code len} are not the same shape.
  • + *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class Substr extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.Substr} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param unit The unit that is used to create the substring. One of: `"BYTE"` (for - * defining position and length by bytes) or `"UTF8_CHAR"` (for the UTF-8 - * encoded Unicode code points). The default is `"BYTE"`. Results are undefined if - * `unit=UTF8_CHAR` and the `input` strings do not contain structurally valid - * UTF-8. - */ - public Options unit(String unit) { - this.unit = unit; - return this; - } - - private String unit; - - private Options() { - } + public static final String OP_NAME = "Substr"; + + private Output output; + + private Substr(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Substr operation. - * + * * @param scope current scope * @param input Tensor of strings * @param pos Scalar defining the position of first character in each substring * @param len Scalar defining the number of characters to include in each substring - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code Substr} output and operands * @return a new instance of Substr */ - @Endpoint(describeByClass = true) - public static Substr create(Scope scope, Operand input, Operand pos, Operand len, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Substr create(Scope scope, Operand input, + Operand pos, Operand len, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Substr", scope.makeOpName("Substr")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(pos.asOutput()); @@ -159,38 +145,57 @@ public static Substr create(Scope scope, Operand in } return new Substr(opBuilder.build()); } - + /** - * @param unit The unit that is used to create the substring. One of: `"BYTE"` (for - * defining position and length by bytes) or `"UTF8_CHAR"` (for the UTF-8 - * encoded Unicode code points). The default is `"BYTE"`. Results are undefined if - * `unit=UTF8_CHAR` and the `input` strings do not contain structurally valid + * Sets the unit option. + * + * @param unit The unit that is used to create the substring. One of: {@code "BYTE"} (for + * defining position and length by bytes) or {@code "UTF8_CHAR"} (for the UTF-8 + * encoded Unicode code points). The default is {@code "BYTE"}. Results are undefined if + * {@code unit=UTF8_CHAR} and the {@code input} strings do not contain structurally valid * UTF-8. + * @return this Options instance. */ public static Options unit(String unit) { return new Options().unit(unit); } - + /** + * Gets output. * Tensor of substrings + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Substr"; - - private Output output; - - private Substr(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.Substr} + */ + public static class Options { + private String unit; + + private Options() { + } + + /** + * Sets the unit option. + * + * @param unit The unit that is used to create the substring. One of: {@code "BYTE"} (for + * defining position and length by bytes) or {@code "UTF8_CHAR"} (for the UTF-8 + * encoded Unicode code points). The default is {@code "BYTE"}. Results are undefined if + * {@code unit=UTF8_CHAR} and the {@code input} strings do not contain structurally valid + * UTF-8. + * @return this Options instance. + */ + public Options unit(String unit) { + this.unit = unit; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucket.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucket.java index 51820eae8fd..484de33eb41 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucket.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucket.java @@ -30,26 +30,40 @@ /** * Converts each string in the input Tensor to its hash mod by a number of buckets. - *

* The hash function is deterministic on the content of the string within the * process. - *

- * Note that the hash function may change from time to time. + *

Note that the hash function may change from time to time. * This functionality will be deprecated and it's recommended to use - * `tf.string_to_hash_bucket_fast()` or `tf.string_to_hash_bucket_strong()`. + * {@code tf.string_to_hash_bucket_fast()} or {@code tf.string_to_hash_bucket_strong()}. */ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class ToHashBucket extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ToHashBucket operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringToHashBucket"; + + private Output output; + + private ToHashBucket(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringToHashBucket operation. + * * @param scope current scope - * @param stringTensor + * @param stringTensor the stringTensor value * @param numBuckets The number of buckets. * @return a new instance of ToHashBucket */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ToHashBucket create(Scope scope, Operand stringTensor, Long numBuckets) { OperationBuilder opBuilder = scope.env().opBuilder("StringToHashBucket", scope.makeOpName("ToHashBucket")); opBuilder.addInput(stringTensor.asOutput()); @@ -57,27 +71,18 @@ public static ToHashBucket create(Scope scope, Operand stringTensor, Lo opBuilder.setAttr("num_buckets", numBuckets); return new ToHashBucket(opBuilder.build()); } - + /** - * A Tensor of the same shape as the input `string_tensor`. + * Gets output. + * A Tensor of the same shape as the input {@code string_tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringToHashBucket"; - - private Output output; - - private ToHashBucket(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketFast.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketFast.java index 2b0ed1ba044..7f5c34dcef0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketFast.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketFast.java @@ -30,31 +30,50 @@ /** * Converts each string in the input Tensor to its hash mod by a number of buckets. - *

* The hash function is deterministic on the content of the string within the * process and will never change. However, it is not suitable for cryptography. * This function may be used when CPU time is scarce and inputs are trusted or * unimportant. There is a risk of adversaries constructing inputs that all hash * to the same bucket. To prevent this problem, use a strong hash function with - * `tf.string_to_hash_bucket_strong`. - *

- * Examples: - *

- * >>> tf.strings.to_hash_bucket_fast(["Hello", "TensorFlow", "2.x"], 3).numpy() + * {@code tf.string_to_hash_bucket_strong}. + *

Examples: + *

+ *
+ *
+ *

tf.strings.to_hash_bucket_fast(["Hello", "TensorFlow", "2.x"], 3).numpy() * array([0, 2, 2]) + *

+ *
+ *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class ToHashBucketFast extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ToHashBucketFast operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringToHashBucketFast"; + + private Output output; + + private ToHashBucketFast(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringToHashBucketFast operation. + * * @param scope current scope * @param input The strings to assign a hash bucket. * @param numBuckets The number of buckets. * @return a new instance of ToHashBucketFast */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ToHashBucketFast create(Scope scope, Operand input, Long numBuckets) { OperationBuilder opBuilder = scope.env().opBuilder("StringToHashBucketFast", scope.makeOpName("ToHashBucketFast")); opBuilder.addInput(input.asOutput()); @@ -62,27 +81,18 @@ public static ToHashBucketFast create(Scope scope, Operand input, Long opBuilder.setAttr("num_buckets", numBuckets); return new ToHashBucketFast(opBuilder.build()); } - + /** - * A Tensor of the same shape as the input `string_tensor`. + * Gets output. + * A Tensor of the same shape as the input {@code string_tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringToHashBucketFast"; - - private Output output; - - private ToHashBucketFast(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketStrong.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketStrong.java index 1ef7188b816..ad02539dce0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketStrong.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToHashBucketStrong.java @@ -31,32 +31,47 @@ /** * Converts each string in the input Tensor to its hash mod by a number of buckets. - *

* The hash function is deterministic on the content of the string within the - * process. The hash function is a keyed hash function, where attribute `key` - * defines the key of the hash function. `key` is an array of 2 elements. - *

- * A strong hash is important when inputs may be malicious, e.g. URLs with + * process. The hash function is a keyed hash function, where attribute {@code key} + * defines the key of the hash function. {@code key} is an array of 2 elements. + *

A strong hash is important when inputs may be malicious, e.g. URLs with * additional components. Adversaries could try to make their inputs hash to the * same bucket for a denial-of-service attack or to skew the results. A strong * hash can be used to make it difficult to find inputs with a skewed hash value * distribution over buckets. This requires that the hash function is - * seeded by a high-entropy (random) "key" unknown to the adversary. - *

- * The additional robustness comes at a cost of roughly 4x higher compute - * time than `tf.string_to_hash_bucket_fast`. - *

- * Examples: - *

- * >>> tf.strings.to_hash_bucket_strong(["Hello", "TF"], 3, [1, 2]).numpy() + * seeded by a high-entropy (random) "key" unknown to the adversary. + *

The additional robustness comes at a cost of roughly 4x higher compute + * time than {@code tf.string_to_hash_bucket_fast}. + *

Examples: + *

+ *
+ *
+ *

tf.strings.to_hash_bucket_strong(["Hello", "TF"], 3, [1, 2]).numpy() * array([2, 0]) + *

+ *
+ *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class ToHashBucketStrong extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ToHashBucketStrong operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringToHashBucketStrong"; + + private Output output; + + private ToHashBucketStrong(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringToHashBucketStrong operation. + * * @param scope current scope * @param input The strings to assign a hash bucket. * @param numBuckets The number of buckets. @@ -64,40 +79,34 @@ public final class ToHashBucketStrong extends RawOp implements Operand { * elements. * @return a new instance of ToHashBucketStrong */ - @Endpoint(describeByClass = true) - public static ToHashBucketStrong create(Scope scope, Operand input, Long numBuckets, List key) { + @Endpoint( + describeByClass = true + ) + public static ToHashBucketStrong create(Scope scope, Operand input, Long numBuckets, + List key) { OperationBuilder opBuilder = scope.env().opBuilder("StringToHashBucketStrong", scope.makeOpName("ToHashBucketStrong")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_buckets", numBuckets); long[] keyArray = new long[key.size()]; - for (int i = 0; i < keyArray.length; ++i) { + for (int i = 0 ; i < keyArray.length ; i++) { keyArray[i] = key.get(i); } opBuilder.setAttr("key", keyArray); return new ToHashBucketStrong(opBuilder.build()); } - + /** - * A Tensor of the same shape as the input `string_tensor`. + * Gets output. + * A Tensor of the same shape as the input {@code string_tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringToHashBucketStrong"; - - private Output output; - - private ToHashBucketStrong(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToNumber.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToNumber.java index 547a4f17b95..8c1fb9d77fd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToNumber.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/ToNumber.java @@ -32,71 +32,84 @@ /** * Converts each string in the input Tensor to the specified numeric type. - *

* (Note that int32 overflow results in an error while float overflow * results in a rounded value.) - *

- * Example: - *

- * >>> strings = ["5.0", "3.0", "7.0"] - * >>> tf.strings.to_number(strings) - * - * - * - * @param data type for {@code output()} output + *

Example: + *

+ *
+ *
+ *

strings = ["5.0", "3.0", "7.0"] + * tf.strings.to_number(strings) + * <tf.Tensor: shape=(3,), dtype=float32, numpy=array([5., 3., 7.], dtype=float32)> + *

+ *
+ *
+ * + * @param data type for {@code output} output */ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class ToNumber extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ToNumber operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StringToNumber"; + + private Output output; + + private ToNumber(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new StringToNumber operation. + * * @param scope current scope - * @param stringTensor - * @param outType The numeric type to interpret each string in `string_tensor` as. + * @param stringTensor the stringTensor value + * @param outType The numeric type to interpret each string in {@code string_tensor} as. + * @param data type for {@code StringToNumber} output and operands * @return a new instance of ToNumber */ - @Endpoint(describeByClass = true) - public static ToNumber create(Scope scope, Operand stringTensor, Class outType) { + @Endpoint( + describeByClass = true + ) + public static ToNumber create(Scope scope, Operand stringTensor, + Class outType) { OperationBuilder opBuilder = scope.env().opBuilder("StringToNumber", scope.makeOpName("ToNumber")); opBuilder.addInput(stringTensor.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("out_type", Operands.toDataType(outType)); - return new ToNumber(opBuilder.build()); + return new ToNumber<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new ToNumber operation using default output types. - * + * Factory method to create a class wrapping a new StringToNumber operation, with the default output types. + * * @param scope current scope - * @param stringTensor - * @return a new instance of ToNumber + * @param stringTensor the stringTensor value + * @return a new instance of ToNumber, with default output types */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ToNumber create(Scope scope, Operand stringTensor) { return create(scope, stringTensor, TFloat32.class); } - + /** - * A Tensor of the same shape as the input `string_tensor`. + * Gets output. + * A Tensor of the same shape as the input {@code string_tensor}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringToNumber"; - - private Output output; - - private ToNumber(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java index 65e5e256780..04854c17c67 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecode.java @@ -25,97 +25,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; /** - * Decodes each string in `input` into a sequence of Unicode code points. - *

+ * Decodes each string in {@code input} into a sequence of Unicode code points. * The character codepoints for all strings are returned using a single vector - * `char_values`, with strings expanded to characters in row-major order. - *

- * The `row_splits` tensor indicates where the codepoints for - * each input string begin and end within the `char_values` tensor. - * In particular, the values for the `i`th + * {@code char_values}, with strings expanded to characters in row-major order. + *

The {@code row_splits} tensor indicates where the codepoints for + * each input string begin and end within the {@code char_values} tensor. + * In particular, the values for the {@code i}th * string (in row-major order) are stored in the slice - * `[row_splits[i]:row_splits[i+1]]`. Thus: + * {@code [row_splits[i]:row_splits[i+1]]}. Thus: *

    - *
  • - * `char_values[row_splits[i]+j]` is the Unicode codepoint for the `j`th - * character in the `i`th string (in row-major order). - *
  • - *
  • - * `row_splits[i+1] - row_splits[i]` is the number of characters in the `i`th - * string (in row-major order). - * - * @param data type for {@code rowSplits()} output + *
  • {@code char_values[row_splits[i]+j]} is the Unicode codepoint for the {@code j}th + * character in the {@code i}th string (in row-major order).
  • + *
  • {@code row_splits[i+1] - row_splits[i]} is the number of characters in the {@code i}th + * string (in row-major order).
  • + *
+ * + * @param data type for {@code row_splits} output */ public final class UnicodeDecode extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnicodeDecode} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errors Error handling policy when there is invalid formatting found in the input. - * The value of 'strict' will cause the operation to produce a InvalidArgument - * error on any invalid input formatting. A value of 'replace' (the default) will - * cause the operation to replace any invalid formatting in the input with the - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to - * skip any invalid formatting in the input and produce no corresponding output - * character. - */ - public Options errors(String errors) { - this.errors = errors; - return this; - } - - /** - * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may - * be used. The default value is the default unicode replacement character is - * 0xFFFD or U+65533.) - */ - public Options replacementChar(Long replacementChar) { - this.replacementChar = replacementChar; - return this; - } - - /** - * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. - */ - public Options replaceControlCharacters(Boolean replaceControlCharacters) { - this.replaceControlCharacters = replaceControlCharacters; - return this; - } - - private String errors; - private Long replacementChar; - private Boolean replaceControlCharacters; - - private Options() { - } + public static final String OP_NAME = "UnicodeDecode"; + + private Output rowSplits; + + private Output charValues; + + private UnicodeDecode(Operation operation) { + super(operation); + int outputIdx = 0; + rowSplits = operation.output(outputIdx++); + charValues = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnicodeDecode operation. - * + * * @param scope current scope * @param input The text to be decoded. Can have any shape. Note that the output is flattened * to a vector of char values. * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported - * by ICU ucnv algorithmic converters. Examples: `"UTF-16", "US ASCII", "UTF-8"`. - * @param Tsplits - * @param options carries optional attributes values + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + * @param Tsplits the value of the Tsplits property + * @param options carries optional attribute values + * @param data type for {@code UnicodeDecode} output and operands * @return a new instance of UnicodeDecode */ - @Endpoint(describeByClass = true) - public static UnicodeDecode create(Scope scope, Operand input, String inputEncoding, Class Tsplits, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnicodeDecode create(Scope scope, Operand input, + String inputEncoding, Class Tsplits, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("UnicodeDecode", scope.makeOpName("UnicodeDecode")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -134,80 +101,140 @@ public static UnicodeDecode create(Scope scope, Operand(opBuilder.build()); + return new UnicodeDecode<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new UnicodeDecode operation using default output types. - * + * Factory method to create a class wrapping a new UnicodeDecode operation, with the default output types. + * * @param scope current scope * @param input The text to be decoded. Can have any shape. Note that the output is flattened * to a vector of char values. * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported - * by ICU ucnv algorithmic converters. Examples: `"UTF-16", "US ASCII", "UTF-8"`. - * @param options carries optional attributes values - * @return a new instance of UnicodeDecode + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + * @param options carries optional attribute values + * @return a new instance of UnicodeDecode, with default output types */ - @Endpoint(describeByClass = true) - public static UnicodeDecode create(Scope scope, Operand input, String inputEncoding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnicodeDecode create(Scope scope, Operand input, + String inputEncoding, Options[] options) { return create(scope, input, inputEncoding, TInt64.class, options); } - + /** + * Sets the errors option. + * * @param errors Error handling policy when there is invalid formatting found in the input. * The value of 'strict' will cause the operation to produce a InvalidArgument * error on any invalid input formatting. A value of 'replace' (the default) will * cause the operation to replace any invalid formatting in the input with the - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to * skip any invalid formatting in the input and produce no corresponding output * character. + * @return this Options instance. */ public static Options errors(String errors) { return new Options().errors(errors); } - + /** + * Sets the replacementChar option. + * * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may * be used. The default value is the default unicode replacement character is * 0xFFFD or U+65533.) + * @return this Options instance. */ public static Options replacementChar(Long replacementChar) { return new Options().replacementChar(replacementChar); } - + /** + * Sets the replaceControlCharacters option. + * * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. + * {@code replacement_char}. Default is false. + * @return this Options instance. */ public static Options replaceControlCharacters(Boolean replaceControlCharacters) { return new Options().replaceControlCharacters(replaceControlCharacters); } - + /** + * Gets rowSplits. * A 1D int32 tensor containing the row splits. + * @return rowSplits. */ public Output rowSplits() { return rowSplits; } - + /** + * Gets charValues. * A 1D int32 Tensor containing the decoded codepoints. + * @return charValues. */ public Output charValues() { return charValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeDecode"; - - private Output rowSplits; - private Output charValues; - - private UnicodeDecode(Operation operation) { - super(operation); - int outputIdx = 0; - rowSplits = operation.output(outputIdx++); - charValues = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnicodeDecode} + */ + public static class Options { + private String errors; + + private Long replacementChar; + + private Boolean replaceControlCharacters; + + private Options() { + } + + /** + * Sets the errors option. + * + * @param errors Error handling policy when there is invalid formatting found in the input. + * The value of 'strict' will cause the operation to produce a InvalidArgument + * error on any invalid input formatting. A value of 'replace' (the default) will + * cause the operation to replace any invalid formatting in the input with the + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to + * skip any invalid formatting in the input and produce no corresponding output + * character. + * @return this Options instance. + */ + public Options errors(String errors) { + this.errors = errors; + return this; + } + + /** + * Sets the replacementChar option. + * + * @param replacementChar The replacement character codepoint to be used in place of any invalid + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may + * be used. The default value is the default unicode replacement character is + * 0xFFFD or U+65533.) + * @return this Options instance. + */ + public Options replacementChar(Long replacementChar) { + this.replacementChar = replacementChar; + return this; + } + + /** + * Sets the replaceControlCharacters option. + * + * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the + * {@code replacement_char}. Default is false. + * @return this Options instance. + */ + public Options replaceControlCharacters(Boolean replaceControlCharacters) { + this.replaceControlCharacters = replaceControlCharacters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java index 2b10934b37a..dd0911027d2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeDecodeWithOffsets.java @@ -25,103 +25,71 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; /** - * Decodes each string in `input` into a sequence of Unicode code points. - *

+ * Decodes each string in {@code input} into a sequence of Unicode code points. * The character codepoints for all strings are returned using a single vector - * `char_values`, with strings expanded to characters in row-major order. + * {@code char_values}, with strings expanded to characters in row-major order. * Similarly, the character start byte offsets are returned using a single vector - * `char_to_byte_starts`, with strings expanded in row-major order. - *

- * The `row_splits` tensor indicates where the codepoints and start offsets for - * each input string begin and end within the `char_values` and - * `char_to_byte_starts` tensors. In particular, the values for the `i`th + * {@code char_to_byte_starts}, with strings expanded in row-major order. + *

The {@code row_splits} tensor indicates where the codepoints and start offsets for + * each input string begin and end within the {@code char_values} and + * {@code char_to_byte_starts} tensors. In particular, the values for the {@code i}th * string (in row-major order) are stored in the slice - * `[row_splits[i]:row_splits[i+1]]`. Thus: + * {@code [row_splits[i]:row_splits[i+1]]}. Thus: *

    - *
  • - * `char_values[row_splits[i]+j]` is the Unicode codepoint for the `j`th - * character in the `i`th string (in row-major order). - *
  • - *
  • - * `char_to_bytes_starts[row_splits[i]+j]` is the start byte offset for the `j`th - * character in the `i`th string (in row-major order). - *
  • - *
  • - * `row_splits[i+1] - row_splits[i]` is the number of characters in the `i`th - * string (in row-major order). - * - * @param data type for {@code rowSplits()} output + *
  • {@code char_values[row_splits[i]+j]} is the Unicode codepoint for the {@code j}th + * character in the {@code i}th string (in row-major order).
  • + *
  • {@code char_to_bytes_starts[row_splits[i]+j]} is the start byte offset for the {@code j}th + * character in the {@code i}th string (in row-major order).
  • + *
  • {@code row_splits[i+1] - row_splits[i]} is the number of characters in the {@code i}th + * string (in row-major order).
  • + *
+ * + * @param data type for {@code row_splits} output */ public final class UnicodeDecodeWithOffsets extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnicodeDecodeWithOffsets} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errors Error handling policy when there is invalid formatting found in the input. - * The value of 'strict' will cause the operation to produce a InvalidArgument - * error on any invalid input formatting. A value of 'replace' (the default) will - * cause the operation to replace any invalid formatting in the input with the - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to - * skip any invalid formatting in the input and produce no corresponding output - * character. - */ - public Options errors(String errors) { - this.errors = errors; - return this; - } - - /** - * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may - * be used. The default value is the default unicode replacement character is - * 0xFFFD or U+65533.) - */ - public Options replacementChar(Long replacementChar) { - this.replacementChar = replacementChar; - return this; - } - - /** - * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. - */ - public Options replaceControlCharacters(Boolean replaceControlCharacters) { - this.replaceControlCharacters = replaceControlCharacters; - return this; - } - - private String errors; - private Long replacementChar; - private Boolean replaceControlCharacters; - - private Options() { - } + public static final String OP_NAME = "UnicodeDecodeWithOffsets"; + + private Output rowSplits; + + private Output charValues; + + private Output charToByteStarts; + + private UnicodeDecodeWithOffsets(Operation operation) { + super(operation); + int outputIdx = 0; + rowSplits = operation.output(outputIdx++); + charValues = operation.output(outputIdx++); + charToByteStarts = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnicodeDecodeWithOffsets operation. - * + * * @param scope current scope * @param input The text to be decoded. Can have any shape. Note that the output is flattened * to a vector of char values. * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported - * by ICU ucnv algorithmic converters. Examples: `"UTF-16", "US ASCII", "UTF-8"`. - * @param Tsplits - * @param options carries optional attributes values + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + * @param Tsplits the value of the Tsplits property + * @param options carries optional attribute values + * @param data type for {@code UnicodeDecodeWithOffsets} output and operands * @return a new instance of UnicodeDecodeWithOffsets */ - @Endpoint(describeByClass = true) - public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, String inputEncoding, Class Tsplits, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnicodeDecodeWithOffsets create(Scope scope, + Operand input, String inputEncoding, Class Tsplits, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("UnicodeDecodeWithOffsets", scope.makeOpName("UnicodeDecodeWithOffsets")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -140,90 +108,150 @@ public static UnicodeDecodeWithOffsets create(Scope scope } } } - return new UnicodeDecodeWithOffsets(opBuilder.build()); + return new UnicodeDecodeWithOffsets<>(opBuilder.build()); } - + /** - * Factory method to create a class wrapping a new UnicodeDecodeWithOffsets operation using default output types. - * + * Factory method to create a class wrapping a new UnicodeDecodeWithOffsets operation, with the default output types. + * * @param scope current scope * @param input The text to be decoded. Can have any shape. Note that the output is flattened * to a vector of char values. * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported - * by ICU ucnv algorithmic converters. Examples: `"UTF-16", "US ASCII", "UTF-8"`. - * @param options carries optional attributes values - * @return a new instance of UnicodeDecodeWithOffsets + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. + * @param options carries optional attribute values + * @return a new instance of UnicodeDecodeWithOffsets, with default output types */ - @Endpoint(describeByClass = true) - public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, String inputEncoding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, + String inputEncoding, Options[] options) { return create(scope, input, inputEncoding, TInt64.class, options); } - + /** + * Sets the errors option. + * * @param errors Error handling policy when there is invalid formatting found in the input. * The value of 'strict' will cause the operation to produce a InvalidArgument * error on any invalid input formatting. A value of 'replace' (the default) will * cause the operation to replace any invalid formatting in the input with the - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to * skip any invalid formatting in the input and produce no corresponding output * character. + * @return this Options instance. */ public static Options errors(String errors) { return new Options().errors(errors); } - + /** + * Sets the replacementChar option. + * * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may * be used. The default value is the default unicode replacement character is * 0xFFFD or U+65533.) + * @return this Options instance. */ public static Options replacementChar(Long replacementChar) { return new Options().replacementChar(replacementChar); } - + /** + * Sets the replaceControlCharacters option. + * * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. + * {@code replacement_char}. Default is false. + * @return this Options instance. */ public static Options replaceControlCharacters(Boolean replaceControlCharacters) { return new Options().replaceControlCharacters(replaceControlCharacters); } - + /** + * Gets rowSplits. * A 1D int32 tensor containing the row splits. + * @return rowSplits. */ public Output rowSplits() { return rowSplits; } - + /** + * Gets charValues. * A 1D int32 Tensor containing the decoded codepoints. + * @return charValues. */ public Output charValues() { return charValues; } - + /** + * Gets charToByteStarts. * A 1D int32 Tensor containing the byte index in the input string where each - * character in `char_values` starts. + * character in {@code char_values} starts. + * @return charToByteStarts. */ public Output charToByteStarts() { return charToByteStarts; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeDecodeWithOffsets"; - - private Output rowSplits; - private Output charValues; - private Output charToByteStarts; - - private UnicodeDecodeWithOffsets(Operation operation) { - super(operation); - int outputIdx = 0; - rowSplits = operation.output(outputIdx++); - charValues = operation.output(outputIdx++); - charToByteStarts = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnicodeDecodeWithOffsets} + */ + public static class Options { + private String errors; + + private Long replacementChar; + + private Boolean replaceControlCharacters; + + private Options() { + } + + /** + * Sets the errors option. + * + * @param errors Error handling policy when there is invalid formatting found in the input. + * The value of 'strict' will cause the operation to produce a InvalidArgument + * error on any invalid input formatting. A value of 'replace' (the default) will + * cause the operation to replace any invalid formatting in the input with the + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to + * skip any invalid formatting in the input and produce no corresponding output + * character. + * @return this Options instance. + */ + public Options errors(String errors) { + this.errors = errors; + return this; + } + + /** + * Sets the replacementChar option. + * + * @param replacementChar The replacement character codepoint to be used in place of any invalid + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may + * be used. The default value is the default unicode replacement character is + * 0xFFFD or U+65533.) + * @return this Options instance. + */ + public Options replacementChar(Long replacementChar) { + this.replacementChar = replacementChar; + return this; + } + + /** + * Sets the replaceControlCharacters option. + * + * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the + * {@code replacement_char}. Default is false. + * @return this Options instance. + */ + public Options replaceControlCharacters(Boolean replaceControlCharacters) { + this.replaceControlCharacters = replaceControlCharacters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeEncode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeEncode.java index 091d598a2e8..6b10afd7927 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeEncode.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeEncode.java @@ -24,84 +24,56 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; /** * Encode a tensor of ints into unicode strings. - *

- * Returns a vector of strings, where `output[i]` is constructed by encoding the - * Unicode codepoints in `input_values[input_splits[i]:input_splits[i+1]]` - * using `output_encoding`. - *

- * --- - *

- * Example: - *

{@code
+ * Returns a vector of strings, where {@code output[i]} is constructed by encoding the
+ * Unicode codepoints in {@code input_values[input_splits[i]:input_splits[i+1]]}
+ * using {@code output_encoding}.
+ * 
+ *

Example: + *

  * input_values = [72, 101, 108, 108, 111, 87, 111, 114, 108, 100]
  * input_splits = [0, 5, 10]
  * output_encoding = 'UTF-8'
- * 
+ *
  * output = ['Hello', 'World']
- * }
- * + *
*/ public final class UnicodeEncode extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnicodeEncode} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errors Error handling policy when there is invalid formatting found in the input. - * The value of 'strict' will cause the operation to produce a InvalidArgument - * error on any invalid input formatting. A value of 'replace' (the default) will - * cause the operation to replace any invalid formatting in the input with the - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to - * skip any invalid formatting in the input and produce no corresponding output - * character. - */ - public Options errors(String errors) { - this.errors = errors; - return this; - } - - /** - * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may - * be used. The default value is the default unicode replacement character is - * 0xFFFD (U+65533). - */ - public Options replacementChar(Long replacementChar) { - this.replacementChar = replacementChar; - return this; - } - - private String errors; - private Long replacementChar; - - private Options() { - } + public static final String OP_NAME = "UnicodeEncode"; + + private Output output; + + private UnicodeEncode(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnicodeEncode operation. - * + * * @param scope current scope * @param inputValues A 1D tensor containing the unicode codepoints that should be encoded. * @param inputSplits A 1D tensor specifying how the unicode codepoints should be split into strings. - * In particular, `output[i]` is constructed by encoding the codepoints in the - * slice `input_values[input_splits[i]:input_splits[i+1]]`. - * @param outputEncoding Unicode encoding of the output strings. Valid encodings are: `"UTF-8", - * "UTF-16-BE", and "UTF-32-BE"`. - * @param options carries optional attributes values + * In particular, {@code output[i]} is constructed by encoding the codepoints in the + * slice {@code input_values[input_splits[i]:input_splits[i+1]]}. + * @param outputEncoding Unicode encoding of the output strings. Valid encodings are: {@code "UTF-8", "UTF-16-BE", and "UTF-32-BE"}. + * @param options carries optional attribute values * @return a new instance of UnicodeEncode */ - @Endpoint(describeByClass = true) - public static UnicodeEncode create(Scope scope, Operand inputValues, Operand inputSplits, String outputEncoding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnicodeEncode create(Scope scope, Operand inputValues, + Operand inputSplits, String outputEncoding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("UnicodeEncode", scope.makeOpName("UnicodeEncode")); opBuilder.addInput(inputValues.asOutput()); opBuilder.addInput(inputSplits.asOutput()); @@ -119,50 +91,90 @@ public static UnicodeEncode create(Scope scope, Operand inputValues, Ope } return new UnicodeEncode(opBuilder.build()); } - + /** + * Sets the errors option. + * * @param errors Error handling policy when there is invalid formatting found in the input. * The value of 'strict' will cause the operation to produce a InvalidArgument * error on any invalid input formatting. A value of 'replace' (the default) will * cause the operation to replace any invalid formatting in the input with the - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to * skip any invalid formatting in the input and produce no corresponding output * character. + * @return this Options instance. */ public static Options errors(String errors) { return new Options().errors(errors); } - + /** + * Sets the replacementChar option. + * * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may * be used. The default value is the default unicode replacement character is * 0xFFFD (U+65533). + * @return this Options instance. */ public static Options replacementChar(Long replacementChar) { return new Options().replacementChar(replacementChar); } - + /** + * Gets output. * The 1-D Tensor of strings encoded from the provided unicode codepoints. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeEncode"; - - private Output output; - - private UnicodeEncode(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnicodeEncode} + */ + public static class Options { + private String errors; + + private Long replacementChar; + + private Options() { + } + + /** + * Sets the errors option. + * + * @param errors Error handling policy when there is invalid formatting found in the input. + * The value of 'strict' will cause the operation to produce a InvalidArgument + * error on any invalid input formatting. A value of 'replace' (the default) will + * cause the operation to replace any invalid formatting in the input with the + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to + * skip any invalid formatting in the input and produce no corresponding output + * character. + * @return this Options instance. + */ + public Options errors(String errors) { + this.errors = errors; + return this; + } + + /** + * Sets the replacementChar option. + * + * @param replacementChar The replacement character codepoint to be used in place of any invalid + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may + * be used. The default value is the default unicode replacement character is + * 0xFFFD (U+65533). + * @return this Options instance. + */ + public Options replacementChar(Long replacementChar) { + this.replacementChar = replacementChar; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeScript.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeScript.java index a3ec471d2b4..7a2d6456e15 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeScript.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeScript.java @@ -29,64 +29,71 @@ /** * Determine the script codes of a given tensor of Unicode integer code points. - *

* This operation converts Unicode code points to script codes corresponding to * each code point. Script codes correspond to International Components for * Unicode (ICU) UScriptCode values. - *

- * See - * [ICU project docs](http://icu-project.org/apiref/icu4c/uscript_8h.html) + *

See + * ICU project docs * for more details on script codes. - *

- * For an example, see the unicode strings guide on [unicode scripts] + *

For an example, see the unicode strings guide on [unicode scripts] * (https://www.tensorflow.org/tutorials/load_data/unicode#representing_unicode). - *

- * Returns -1 (USCRIPT_INVALID_CODE) for invalid codepoints. Output shape will + *

Returns -1 (USCRIPT_INVALID_CODE) for invalid codepoints. Output shape will * match input shape. - *

- * Examples: - *

- * >>> tf.strings.unicode_script([1, 31, 38]) - * + *

Examples: + *

+ *
+ *
+ *

tf.strings.unicode_script([1, 31, 38]) + * <tf.Tensor: shape=(3,), dtype=int32, numpy=array([0, 0, 0], dtype=int32)> + *

+ *
+ *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class UnicodeScript extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "UnicodeScript"; + + private Output output; + + private UnicodeScript(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new UnicodeScript operation. - * + * * @param scope current scope * @param input A Tensor of int32 Unicode code points. * @return a new instance of UnicodeScript */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static UnicodeScript create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("UnicodeScript", scope.makeOpName("UnicodeScript")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new UnicodeScript(opBuilder.build()); } - + /** + * Gets output. * A Tensor of int32 script codes corresponding to each input code point. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeScript"; - - private Output output; - - private UnicodeScript(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeTranscode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeTranscode.java index b2f8b87a991..eea9ba6cfcd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeTranscode.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnicodeTranscode.java @@ -29,111 +29,76 @@ /** * Transcode the input text from a source encoding to a destination encoding. - *

* The input is a string tensor of any shape. The output is a string tensor of * the same shape containing the transcoded strings. Output strings are always * valid unicode. If the input contains invalid encoding positions, the - * `errors` attribute sets the policy for how to deal with them. If the default + * {@code errors} attribute sets the policy for how to deal with them. If the default * error-handling policy is used, invalid formatting will be substituted in the - * output by the `replacement_char`. If the errors policy is to `ignore`, any + * output by the {@code replacement_char}. If the errors policy is to {@code ignore}, any * invalid encoding positions in the input are skipped and not included in the - * output. If it set to `strict` then any invalid formatting will result in an + * output. If it set to {@code strict} then any invalid formatting will result in an * InvalidArgument error. - *

- * This operation can be used with `output_encoding = input_encoding` to enforce + *

This operation can be used with {@code output_encoding = input_encoding} to enforce * correct formatting for inputs even if they are already in the desired encoding. - *

- * If the input is prefixed by a Byte Order Mark needed to determine encoding + *

If the input is prefixed by a Byte Order Mark needed to determine encoding * (e.g. if the encoding is UTF-16 and the BOM indicates big-endian), then that * BOM will be consumed and not emitted into the output. If the input encoding * is marked with an explicit endianness (e.g. UTF-16-BE), then the BOM is * interpreted as a non-breaking-space and is preserved in the output (including * always for UTF-8). - *

- * The end result is that if the input is marked as an explicit endianness the + *

The end result is that if the input is marked as an explicit endianness the * transcoding is faithful to all codepoints in the source. If it is not marked * with an explicit endianness, the BOM is not considered part of the string itself * but as metadata, and so is not preserved in the output. - *

- * Examples: - *

- * >>> tf.strings.unicode_transcode(["Hello", "TensorFlow", "2.x"], "UTF-8", "UTF-16-BE") - * Examples: + *

+ *
+ *
+ *

tf.strings.unicode_transcode(["Hello", "TensorFlow", "2.x"], "UTF-8", "UTF-16-BE") + * <tf.Tensor: shape=(3,), dtype=string, numpy= * array([b'\x00H\x00e\x00l\x00l\x00o', - * b'\x00T\x00e\x00n\x00s\x00o\x00r\x00F\x00l\x00o\x00w', - * b'\x002\x00.\x00x'], dtype=object)> - * >>> tf.strings.unicode_transcode(["A", "B", "C"], "US ASCII", "UTF-8").numpy() + * b'\x00T\x00e\x00n\x00s\x00o\x00r\x00F\x00l\x00o\x00w', + * b'\x002\x00.\x00x'], dtype=object)> + * tf.strings.unicode_transcode(["A", "B", "C"], "US ASCII", "UTF-8").numpy() * array([b'A', b'B', b'C'], dtype=object) + *

+ *
+ *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class UnicodeTranscode extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnicodeTranscode} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param errors Error handling policy when there is invalid formatting found in the input. - * The value of 'strict' will cause the operation to produce a InvalidArgument - * error on any invalid input formatting. A value of 'replace' (the default) will - * cause the operation to replace any invalid formatting in the input with the - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to - * skip any invalid formatting in the input and produce no corresponding output - * character. - */ - public Options errors(String errors) { - this.errors = errors; - return this; - } - - /** - * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may - * be used. The default value is the default unicode replacement character is - * 0xFFFD or U+65533.) - *

- * Note that for UTF-8, passing a replacement character expressible in 1 byte, such - * as ' ', will preserve string alignment to the source since invalid bytes will be - * replaced with a 1-byte replacement. For UTF-16-BE and UTF-16-LE, any 1 or 2 byte - * replacement character will preserve byte alignment to the source. - */ - public Options replacementChar(Long replacementChar) { - this.replacementChar = replacementChar; - return this; - } - - /** - * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. - */ - public Options replaceControlCharacters(Boolean replaceControlCharacters) { - this.replaceControlCharacters = replaceControlCharacters; - return this; - } - - private String errors; - private Long replacementChar; - private Boolean replaceControlCharacters; - - private Options() { - } + public static final String OP_NAME = "UnicodeTranscode"; + + private Output output; + + private UnicodeTranscode(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnicodeTranscode operation. - * + * * @param scope current scope * @param input The text to be processed. Can have any shape. * @param inputEncoding Text encoding of the input strings. This is any of the encodings supported - * by ICU ucnv algorithmic converters. Examples: `"UTF-16", "US ASCII", "UTF-8"`. + * by ICU ucnv algorithmic converters. Examples: {@code "UTF-16", "US ASCII", "UTF-8"}. * @param outputEncoding The unicode encoding to use in the output. Must be one of - * `"UTF-8", "UTF-16-BE", "UTF-32-BE"`. Multi-byte encodings will be big-endian. - * @param options carries optional attributes values + * {@code "UTF-8", "UTF-16-BE", "UTF-32-BE"}. Multi-byte encodings will be big-endian. + * @param options carries optional attribute values * @return a new instance of UnicodeTranscode */ - @Endpoint(describeByClass = true) - public static UnicodeTranscode create(Scope scope, Operand input, String inputEncoding, String outputEncoding, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnicodeTranscode create(Scope scope, Operand input, String inputEncoding, + String outputEncoding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("UnicodeTranscode", scope.makeOpName("UnicodeTranscode")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -154,63 +119,123 @@ public static UnicodeTranscode create(Scope scope, Operand input, Strin } return new UnicodeTranscode(opBuilder.build()); } - + /** + * Sets the errors option. + * * @param errors Error handling policy when there is invalid formatting found in the input. * The value of 'strict' will cause the operation to produce a InvalidArgument * error on any invalid input formatting. A value of 'replace' (the default) will * cause the operation to replace any invalid formatting in the input with the - * `replacement_char` codepoint. A value of 'ignore' will cause the operation to + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to * skip any invalid formatting in the input and produce no corresponding output * character. + * @return this Options instance. */ public static Options errors(String errors) { return new Options().errors(errors); } - + /** + * Sets the replacementChar option. + * * @param replacementChar The replacement character codepoint to be used in place of any invalid - * formatting in the input when `errors='replace'`. Any valid unicode codepoint may + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may * be used. The default value is the default unicode replacement character is * 0xFFFD or U+65533.) - *

- * Note that for UTF-8, passing a replacement character expressible in 1 byte, such + *

Note that for UTF-8, passing a replacement character expressible in 1 byte, such * as ' ', will preserve string alignment to the source since invalid bytes will be * replaced with a 1-byte replacement. For UTF-16-BE and UTF-16-LE, any 1 or 2 byte * replacement character will preserve byte alignment to the source. + * @return this Options instance. */ public static Options replacementChar(Long replacementChar) { return new Options().replacementChar(replacementChar); } - + /** + * Sets the replaceControlCharacters option. + * * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the - * `replacement_char`. Default is false. + * {@code replacement_char}. Default is false. + * @return this Options instance. */ public static Options replaceControlCharacters(Boolean replaceControlCharacters) { return new Options().replaceControlCharacters(replaceControlCharacters); } - + /** - * A string tensor containing unicode text encoded using `output_encoding`. + * Gets output. + * A string tensor containing unicode text encoded using {@code output_encoding}. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnicodeTranscode"; - - private Output output; - - private UnicodeTranscode(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnicodeTranscode} + */ + public static class Options { + private String errors; + + private Long replacementChar; + + private Boolean replaceControlCharacters; + + private Options() { + } + + /** + * Sets the errors option. + * + * @param errors Error handling policy when there is invalid formatting found in the input. + * The value of 'strict' will cause the operation to produce a InvalidArgument + * error on any invalid input formatting. A value of 'replace' (the default) will + * cause the operation to replace any invalid formatting in the input with the + * {@code replacement_char} codepoint. A value of 'ignore' will cause the operation to + * skip any invalid formatting in the input and produce no corresponding output + * character. + * @return this Options instance. + */ + public Options errors(String errors) { + this.errors = errors; + return this; + } + + /** + * Sets the replacementChar option. + * + * @param replacementChar The replacement character codepoint to be used in place of any invalid + * formatting in the input when {@code errors='replace'}. Any valid unicode codepoint may + * be used. The default value is the default unicode replacement character is + * 0xFFFD or U+65533.) + *

Note that for UTF-8, passing a replacement character expressible in 1 byte, such + * as ' ', will preserve string alignment to the source since invalid bytes will be + * replaced with a 1-byte replacement. For UTF-16-BE and UTF-16-LE, any 1 or 2 byte + * replacement character will preserve byte alignment to the source. + * @return this Options instance. + */ + public Options replacementChar(Long replacementChar) { + this.replacementChar = replacementChar; + return this; + } + + /** + * Sets the replaceControlCharacters option. + * + * @param replaceControlCharacters Whether to replace the C0 control characters (00-1F) with the + * {@code replacement_char}. Default is false. + * @return this Options instance. + */ + public Options replaceControlCharacters(Boolean replaceControlCharacters) { + this.replaceControlCharacters = replaceControlCharacters; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnsortedSegmentJoin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnsortedSegmentJoin.java index 790196f34e3..27fd7951863 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnsortedSegmentJoin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/UnsortedSegmentJoin.java @@ -29,70 +29,66 @@ import org.tensorflow.types.family.TNumber; /** - * Joins the elements of `inputs` based on `segment_ids`. - *

+ * Joins the elements of {@code inputs} based on {@code segment_ids}. * Computes the string join along segments of a tensor. - * Given `segment_ids` with rank `N` and `data` with rank `N+M`: - *

- * `output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])` - *

- * where the join is over all [j1...jN] such that segment_ids[j1...jN] = i. + * Given {@code segment_ids} with rank {@code N} and {@code data} with rank {@code N+M}: + *

+ * `output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`
+ * 
+ *

where the join is over all [j1...jN] such that segment_ids[j1...jN] = i. * Strings are joined in row-major order. - *

- * For example: - *

{@code
+ * 

For example: + *

  * inputs = [['Y', 'q', 'c'], ['Y', '6', '6'], ['p', 'G', 'a']]
  * output_array = string_ops.unsorted_segment_join(inputs=inputs,
  *                                                 segment_ids=[1, 0, 1],
  *                                                 num_segments=2,
  *                                                 separator=':'))
- * # output_array ==> [['Y', '6', '6'], ['Y:p', 'q:G', 'c:a']]
- * 
- * 
+ * # output_array ==> [['Y', '6', '6'], ['Y:p', 'q:G', 'c:a']]
+ *
+ *
  * inputs = ['this', 'is', 'a', 'test']
  * output_array = string_ops.unsorted_segment_join(inputs=inputs,
  *                                                 segment_ids=[0, 0, 0, 0],
  *                                                 num_segments=1,
  *                                                 separator=':'))
- * # output_array ==> ['this:is:a:test']
- * }
- * + * # output_array ==> ['this:is:a:test'] + *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class UnsortedSegmentJoin extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.UnsortedSegmentJoin} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param separator The separator to use when joining. - */ - public Options separator(String separator) { - this.separator = separator; - return this; - } - - private String separator; - - private Options() { - } + public static final String OP_NAME = "UnsortedSegmentJoin"; + + private Output output; + + private UnsortedSegmentJoin(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new UnsortedSegmentJoin operation. - * + * * @param scope current scope * @param inputs The input to be joined. * @param segmentIds A tensor whose shape is a prefix of data.shape. Negative segment ids are not * supported. * @param numSegments A scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of UnsortedSegmentJoin */ - @Endpoint(describeByClass = true) - public static UnsortedSegmentJoin create(Scope scope, Operand inputs, Operand segmentIds, Operand numSegments, Options... options) { + @Endpoint( + describeByClass = true + ) + public static UnsortedSegmentJoin create(Scope scope, Operand inputs, + Operand segmentIds, Operand numSegments, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("UnsortedSegmentJoin", scope.makeOpName("UnsortedSegmentJoin")); opBuilder.addInput(inputs.asOutput()); opBuilder.addInput(segmentIds.asOutput()); @@ -107,33 +103,49 @@ public static UnsortedSegmentJoin create(Scope scope, Operand inputs, O } return new UnsortedSegmentJoin(opBuilder.build()); } - + /** + * Sets the separator option. + * * @param separator The separator to use when joining. + * @return this Options instance. */ public static Options separator(String separator) { return new Options().separator(separator); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "UnsortedSegmentJoin"; - - private Output output; - - private UnsortedSegmentJoin(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.UnsortedSegmentJoin} + */ + public static class Options { + private String separator; + + private Options() { + } + + /** + * Sets the separator option. + * + * @param separator The separator to use when joining. + * @return this Options instance. + */ + public Options separator(String separator) { + this.separator = separator; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Upper.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Upper.java index 6a531f4878d..f25344e697d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Upper.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/strings/Upper.java @@ -29,44 +29,44 @@ /** * Converts all lowercase characters into their respective uppercase replacements. - *

* Example: - *

- * >>> tf.strings.upper("CamelCase string and ALL CAPS") - * - * + *

+ *
+ *
+ *

tf.strings.upper("CamelCase string and ALL CAPS") + * <tf.Tensor: shape=(), dtype=string, numpy=b'CAMELCASE STRING AND ALL CAPS'> + *

+ *
+ *
*/ -@Operator(group = "strings") +@Operator( + group = "strings" +) public final class Upper extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.strings.Upper} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param encoding - */ - public Options encoding(String encoding) { - this.encoding = encoding; - return this; - } - - private String encoding; - - private Options() { - } + public static final String OP_NAME = "StringUpper"; + + private Output output; + + private Upper(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new Upper operation. - * + * Factory method to create a class wrapping a new StringUpper operation. + * * @param scope current scope - * @param input - * @param options carries optional attributes values + * @param input the input value + * @param options carries optional attribute values * @return a new instance of Upper */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Upper create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringUpper", scope.makeOpName("Upper")); opBuilder.addInput(input.asOutput()); @@ -80,33 +80,49 @@ public static Upper create(Scope scope, Operand input, Options... optio } return new Upper(opBuilder.build()); } - + /** - * @param encoding + * Sets the encoding option. + * + * @param encoding the encoding option + * @return this Options instance. */ public static Options encoding(String encoding) { return new Options().encoding(encoding); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StringUpper"; - - private Output output; - - private Upper(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.strings.Upper} + */ + public static class Options { + private String encoding; + + private Options() { + } + + /** + * Sets the encoding option. + * + * @param encoding the encoding option + * @return this Options instance. + */ + public Options encoding(String encoding) { + this.encoding = encoding; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/AudioSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/AudioSummary.java index ce960396e7b..d5642d0fac6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/AudioSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/AudioSummary.java @@ -29,57 +29,50 @@ import org.tensorflow.types.TString; /** - * Outputs a `Summary` protocol buffer with audio. - *

- * The summary has up to `max_outputs` summary values containing audio. The - * audio is built from `tensor` which must be 3-D with shape `[batch_size, - * frames, channels]` or 2-D with shape `[batch_size, frames]`. The values are - * assumed to be in the range of `[-1.0, 1.0]` with a sample rate of `sample_rate`. - *

- * The `tag` argument is a scalar `Tensor` of type `string`. It is used to - * build the `tag` of the summary values: + * Outputs a {@code Summary} protocol buffer with audio. + * The summary has up to {@code max_outputs} summary values containing audio. The + * audio is built from {@code tensor} which must be 3-D with shape {@code [batch_size, frames, channels]} or 2-D with shape {@code [batch_size, frames]}. The values are + * assumed to be in the range of {@code [-1.0, 1.0]} with a sample rate of {@code sample_rate}. + *

The {@code tag} argument is a scalar {@code Tensor} of type {@code string}. It is used to + * build the {@code tag} of the summary values: *

    - *
  • - * If `max_outputs` is 1, the summary value tag is 'tag/audio'. - *
  • - *
  • - * If `max_outputs` is greater than 1, the summary value tags are - * generated sequentially as 'tag/audio/0', 'tag/audio/1', etc. + *
  • If {@code max_outputs} is 1, the summary value tag is 'tag/audio'.
  • + *
  • If {@code max_outputs} is greater than 1, the summary value tags are + * generated sequentially as 'tag/audio/0', 'tag/audio/1', etc.
  • + *
*/ -@Operator(group = "summary") +@Operator( + group = "summary" +) public final class AudioSummary extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.summary.AudioSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxOutputs Max number of batch elements to generate audio for. - */ - public Options maxOutputs(Long maxOutputs) { - this.maxOutputs = maxOutputs; - return this; - } - - private Long maxOutputs; - - private Options() { - } + public static final String OP_NAME = "AudioSummaryV2"; + + private Output summary; + + private AudioSummary(Operation operation) { + super(operation); + int outputIdx = 0; + summary = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new AudioSummary operation. - * + * Factory method to create a class wrapping a new AudioSummaryV2 operation. + * * @param scope current scope - * @param tag Scalar. Used to build the `tag` attribute of the summary values. - * @param tensor 2-D of shape `[batch_size, frames]`. + * @param tag Scalar. Used to build the {@code tag} attribute of the summary values. + * @param tensor 2-D of shape {@code [batch_size, frames]}. * @param sampleRate The sample rate of the signal in hertz. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of AudioSummary */ - @Endpoint(describeByClass = true) - public static AudioSummary create(Scope scope, Operand tag, Operand tensor, Operand sampleRate, Options... options) { + @Endpoint( + describeByClass = true + ) + public static AudioSummary create(Scope scope, Operand tag, Operand tensor, + Operand sampleRate, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AudioSummaryV2", scope.makeOpName("AudioSummary")); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(tensor.asOutput()); @@ -94,34 +87,49 @@ public static AudioSummary create(Scope scope, Operand tag, Operand summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AudioSummaryV2"; - - private Output summary; - - private AudioSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.summary.AudioSummary} + */ + public static class Options { + private Long maxOutputs; + + private Options() { + } + + /** + * Sets the maxOutputs option. + * + * @param maxOutputs Max number of batch elements to generate audio for. + * @return this Options instance. + */ + public Options maxOutputs(Long maxOutputs) { + this.maxOutputs = maxOutputs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CloseSummaryWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CloseSummaryWriter.java index 914a83cbcb8..f9a3abf4ad0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CloseSummaryWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CloseSummaryWriter.java @@ -23,31 +23,35 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** + * The CloseSummaryWriter operation */ public final class CloseSummaryWriter extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CloseSummaryWriter"; + + private CloseSummaryWriter(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new CloseSummaryWriter operation. - * + * * @param scope current scope - * @param writer + * @param writer the writer value * @return a new instance of CloseSummaryWriter */ - @Endpoint(describeByClass = true) - public static CloseSummaryWriter create(Scope scope, Operand writer) { + @Endpoint( + describeByClass = true + ) + public static CloseSummaryWriter create(Scope scope, Operand writer) { OperationBuilder opBuilder = scope.env().opBuilder("CloseSummaryWriter", scope.makeOpName("CloseSummaryWriter")); opBuilder.addInput(writer.asOutput()); opBuilder = scope.apply(opBuilder); return new CloseSummaryWriter(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CloseSummaryWriter"; - - private CloseSummaryWriter(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryDbWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryDbWriter.java index c704ba6ab41..b8af67b0fd7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryDbWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryDbWriter.java @@ -23,26 +23,39 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** + * The CreateSummaryDbWriter operation */ public final class CreateSummaryDbWriter extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CreateSummaryDbWriter"; + + private CreateSummaryDbWriter(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new CreateSummaryDbWriter operation. - * + * * @param scope current scope - * @param writer - * @param dbUri - * @param experimentName - * @param runName - * @param userName + * @param writer the writer value + * @param dbUri the dbUri value + * @param experimentName the experimentName value + * @param runName the runName value + * @param userName the userName value * @return a new instance of CreateSummaryDbWriter */ - @Endpoint(describeByClass = true) - public static CreateSummaryDbWriter create(Scope scope, Operand writer, Operand dbUri, Operand experimentName, Operand runName, Operand userName) { + @Endpoint( + describeByClass = true + ) + public static CreateSummaryDbWriter create(Scope scope, Operand writer, + Operand dbUri, Operand experimentName, Operand runName, + Operand userName) { OperationBuilder opBuilder = scope.env().opBuilder("CreateSummaryDbWriter", scope.makeOpName("CreateSummaryDbWriter")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(dbUri.asOutput()); @@ -52,11 +65,4 @@ public static CreateSummaryDbWriter create(Scope scope, Operand writer, Opera opBuilder = scope.apply(opBuilder); return new CreateSummaryDbWriter(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CreateSummaryDbWriter"; - - private CreateSummaryDbWriter(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryFileWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryFileWriter.java index e24b292c37a..bea08375663 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryFileWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/CreateSummaryFileWriter.java @@ -23,27 +23,40 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** + * The CreateSummaryFileWriter operation */ public final class CreateSummaryFileWriter extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CreateSummaryFileWriter"; + + private CreateSummaryFileWriter(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new CreateSummaryFileWriter operation. - * + * * @param scope current scope - * @param writer - * @param logdir - * @param maxQueue - * @param flushMillis - * @param filenameSuffix + * @param writer the writer value + * @param logdir the logdir value + * @param maxQueue the maxQueue value + * @param flushMillis the flushMillis value + * @param filenameSuffix the filenameSuffix value * @return a new instance of CreateSummaryFileWriter */ - @Endpoint(describeByClass = true) - public static CreateSummaryFileWriter create(Scope scope, Operand writer, Operand logdir, Operand maxQueue, Operand flushMillis, Operand filenameSuffix) { + @Endpoint( + describeByClass = true + ) + public static CreateSummaryFileWriter create(Scope scope, Operand writer, + Operand logdir, Operand maxQueue, Operand flushMillis, + Operand filenameSuffix) { OperationBuilder opBuilder = scope.env().opBuilder("CreateSummaryFileWriter", scope.makeOpName("CreateSummaryFileWriter")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(logdir.asOutput()); @@ -53,11 +66,4 @@ public static CreateSummaryFileWriter create(Scope scope, Operand writer, Ope opBuilder = scope.apply(opBuilder); return new CreateSummaryFileWriter(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CreateSummaryFileWriter"; - - private CreateSummaryFileWriter(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/FlushSummaryWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/FlushSummaryWriter.java index 98dad5552ea..c939ad76457 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/FlushSummaryWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/FlushSummaryWriter.java @@ -23,31 +23,35 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** + * The FlushSummaryWriter operation */ public final class FlushSummaryWriter extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "FlushSummaryWriter"; + + private FlushSummaryWriter(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new FlushSummaryWriter operation. - * + * * @param scope current scope - * @param writer + * @param writer the writer value * @return a new instance of FlushSummaryWriter */ - @Endpoint(describeByClass = true) - public static FlushSummaryWriter create(Scope scope, Operand writer) { + @Endpoint( + describeByClass = true + ) + public static FlushSummaryWriter create(Scope scope, Operand writer) { OperationBuilder opBuilder = scope.env().opBuilder("FlushSummaryWriter", scope.makeOpName("FlushSummaryWriter")); opBuilder.addInput(writer.asOutput()); opBuilder = scope.apply(opBuilder); return new FlushSummaryWriter(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "FlushSummaryWriter"; - - private FlushSummaryWriter(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/HistogramSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/HistogramSummary.java index 34ed418e986..118292c93aa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/HistogramSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/HistogramSummary.java @@ -29,54 +29,60 @@ import org.tensorflow.types.family.TNumber; /** - * Outputs a `Summary` protocol buffer with a histogram. - *

+ * Outputs a {@code Summary} protocol buffer with a histogram. * The generated - * [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) - * has one summary value containing a histogram for `values`. - *

- * This op reports an `InvalidArgument` error if any value is not finite. + * {@code Summary} + * has one summary value containing a histogram for {@code values}. + *

This op reports an {@code InvalidArgument} error if any value is not finite. */ -@Operator(group = "summary") +@Operator( + group = "summary" +) public final class HistogramSummary extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "HistogramSummary"; + + private Output summary; + + private HistogramSummary(Operation operation) { + super(operation); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new HistogramSummary operation. - * + * * @param scope current scope - * @param tag Scalar. Tag to use for the `Summary.Value`. + * @param tag Scalar. Tag to use for the {@code Summary.Value}. * @param values Any shape. Values to use to build the histogram. * @return a new instance of HistogramSummary */ - @Endpoint(describeByClass = true) - public static HistogramSummary create(Scope scope, Operand tag, Operand values) { + @Endpoint( + describeByClass = true + ) + public static HistogramSummary create(Scope scope, Operand tag, + Operand values) { OperationBuilder opBuilder = scope.env().opBuilder("HistogramSummary", scope.makeOpName("HistogramSummary")); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder = scope.apply(opBuilder); return new HistogramSummary(opBuilder.build()); } - + /** - * Scalar. Serialized `Summary` protocol buffer. + * Gets summary. + * Scalar. Serialized {@code Summary} protocol buffer. + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "HistogramSummary"; - - private Output summary; - - private HistogramSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImageSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImageSummary.java index c5c4a9b30a7..deba3e6cf00 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImageSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImageSummary.java @@ -30,98 +30,75 @@ import org.tensorflow.types.family.TNumber; /** - * Outputs a `Summary` protocol buffer with images. - *

- * The summary has up to `max_images` summary values containing images. The - * images are built from `tensor` which must be 4-D with shape `[batch_size, - * height, width, channels]` and where `channels` can be: + * Outputs a {@code Summary} protocol buffer with images. + * The summary has up to {@code max_images} summary values containing images. The + * images are built from {@code tensor} which must be 4-D with shape {@code [batch_size, height, width, channels]} and where {@code channels} can be: *

    - *
  • - * 1: `tensor` is interpreted as Grayscale. - *
  • - *
  • - * 3: `tensor` is interpreted as RGB. - *
  • - *
  • - * 4: `tensor` is interpreted as RGBA. - *
  • + *
  • 1: {@code tensor} is interpreted as Grayscale.
  • + *
  • 3: {@code tensor} is interpreted as RGB.
  • + *
  • 4: {@code tensor} is interpreted as RGBA.
  • *
- * The images have the same number of channels as the input tensor. For float + *

The images have the same number of channels as the input tensor. For float * input, the values are normalized one image at a time to fit in the range - * `[0, 255]`. `uint8` values are unchanged. The op uses two different + * {@code [0, 255]}. {@code uint8} values are unchanged. The op uses two different * normalization algorithms: *

    *
  • - * If the input values are all positive, they are rescaled so the largest one - * is 255. + *

    If the input values are all positive, they are rescaled so the largest one + * is 255. *

  • *
  • - * If any input value is negative, the values are shifted so input value 0.0 - * is at 127. They are then rescaled so that either the smallest value is 0, - * or the largest one is 255. + *

    If any input value is negative, the values are shifted so input value 0.0 + * is at 127. They are then rescaled so that either the smallest value is 0, + * or the largest one is 255. *

  • *
- * The `tag` argument is a scalar `Tensor` of type `string`. It is used to - * build the `tag` of the summary values: + *

The {@code tag} argument is a scalar {@code Tensor} of type {@code string}. It is used to + * build the {@code tag} of the summary values: *

    - *
  • - * If `max_images` is 1, the summary value tag is 'tag/image'. - *
  • - *
  • - * If `max_images` is greater than 1, the summary value tags are - * generated sequentially as 'tag/image/0', 'tag/image/1', etc. - *
  • + *
  • If {@code max_images} is 1, the summary value tag is 'tag/image'.
  • + *
  • If {@code max_images} is greater than 1, the summary value tags are + * generated sequentially as 'tag/image/0', 'tag/image/1', etc.
  • *
- * The `bad_color` argument is the color to use in the generated images for - * non-finite input values. It is a `uint8` 1-D tensor of length `channels`. - * Each element must be in the range `[0, 255]` (It represents the value of a + *

The {@code bad_color} argument is the color to use in the generated images for + * non-finite input values. It is a {@code uint8} 1-D tensor of length {@code channels}. + * Each element must be in the range {@code [0, 255]} (It represents the value of a * pixel in the output image). Non-finite values in the input tensor are * replaced by this tensor in the output image. The default value is the color * red. */ -@Operator(group = "summary") +@Operator( + group = "summary" +) public final class ImageSummary extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.summary.ImageSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxImages Max number of batch elements to generate images for. - */ - public Options maxImages(Long maxImages) { - this.maxImages = maxImages; - return this; - } - - /** - * @param badColor Color to use for pixels with non-finite values. - */ - public Options badColor(Tensor badColor) { - this.badColor = badColor; - return this; - } - - private Long maxImages; - private Tensor badColor; - - private Options() { - } + public static final String OP_NAME = "ImageSummary"; + + private Output summary; + + private ImageSummary(Operation operation) { + super(operation); + int outputIdx = 0; + summary = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ImageSummary operation. - * + * * @param scope current scope - * @param tag Scalar. Used to build the `tag` attribute of the summary values. - * @param tensor 4-D of shape `[batch_size, height, width, channels]` where - * `channels` is 1, 3, or 4. - * @param options carries optional attributes values + * @param tag Scalar. Used to build the {@code tag} attribute of the summary values. + * @param tensor 4-D of shape {@code [batch_size, height, width, channels]} where + * {@code channels} is 1, 3, or 4. + * @param options carries optional attribute values * @return a new instance of ImageSummary */ - @Endpoint(describeByClass = true) - public static ImageSummary create(Scope scope, Operand tag, Operand tensor, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ImageSummary create(Scope scope, Operand tag, + Operand tensor, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ImageSummary", scope.makeOpName("ImageSummary")); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(tensor.asOutput()); @@ -138,41 +115,72 @@ public static ImageSummary create(Scope scope, Operand tag, Operand summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImageSummary"; - - private Output summary; - - private ImageSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.summary.ImageSummary} + */ + public static class Options { + private Long maxImages; + + private Tensor badColor; + + private Options() { + } + + /** + * Sets the maxImages option. + * + * @param maxImages Max number of batch elements to generate images for. + * @return this Options instance. + */ + public Options maxImages(Long maxImages) { + this.maxImages = maxImages; + return this; + } + + /** + * Sets the badColor option. + * + * @param badColor Color to use for pixels with non-finite values. + * @return this Options instance. + */ + public Options badColor(Tensor badColor) { + this.badColor = badColor; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImportEvent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImportEvent.java index 0089a7d5257..8b2e7a46176 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImportEvent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ImportEvent.java @@ -23,34 +23,39 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** + * The ImportEvent operation */ public final class ImportEvent extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ImportEvent"; + + private ImportEvent(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ImportEvent operation. - * + * * @param scope current scope - * @param writer - * @param event + * @param writer the writer value + * @param event the event value * @return a new instance of ImportEvent */ - @Endpoint(describeByClass = true) - public static ImportEvent create(Scope scope, Operand writer, Operand event) { + @Endpoint( + describeByClass = true + ) + public static ImportEvent create(Scope scope, Operand writer, + Operand event) { OperationBuilder opBuilder = scope.env().opBuilder("ImportEvent", scope.makeOpName("ImportEvent")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(event.asOutput()); opBuilder = scope.apply(opBuilder); return new ImportEvent(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ImportEvent"; - - private ImportEvent(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/MergeSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/MergeSummary.java index 96c3be8ec4e..f20f1b14f5c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/MergeSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/MergeSummary.java @@ -30,54 +30,59 @@ /** * Merges summaries. - *

* This op creates a - * [`Summary`](https://www.tensorflow.org/code/tensorflow/core/framework/summary.proto) + * {@code Summary} * protocol buffer that contains the union of all the values in the input * summaries. - *

- * When the Op is run, it reports an `InvalidArgument` error if multiple values + *

When the Op is run, it reports an {@code InvalidArgument} error if multiple values * in the summaries to merge use the same tag. */ -@Operator(group = "summary") +@Operator( + group = "summary" +) public final class MergeSummary extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "MergeSummary"; + + private Output summary; + + private MergeSummary(Operation operation) { + super(operation); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new MergeSummary operation. - * + * * @param scope current scope - * @param inputs Can be of any shape. Each must contain serialized `Summary` protocol + * @param inputs Can be of any shape. Each must contain serialized {@code Summary} protocol * buffers. * @return a new instance of MergeSummary */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static MergeSummary create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("MergeSummary", scope.makeOpName("MergeSummary")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); return new MergeSummary(opBuilder.build()); } - + /** - * Scalar. Serialized `Summary` protocol buffer. + * Gets summary. + * Scalar. Serialized {@code Summary} protocol buffer. + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MergeSummary"; - - private Output summary; - - private MergeSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ScalarSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ScalarSummary.java index 27989bc1fed..6f697366e74 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ScalarSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/ScalarSummary.java @@ -29,51 +29,58 @@ import org.tensorflow.types.family.TNumber; /** - * Outputs a `Summary` protocol buffer with scalar values. - *

- * The input `tags` and `values` must have the same shape. The generated summary - * has a summary value for each tag-value pair in `tags` and `values`. + * Outputs a {@code Summary} protocol buffer with scalar values. + * The input {@code tags} and {@code values} must have the same shape. The generated summary + * has a summary value for each tag-value pair in {@code tags} and {@code values}. */ -@Operator(group = "summary") +@Operator( + group = "summary" +) public final class ScalarSummary extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ScalarSummary"; + + private Output summary; + + private ScalarSummary(Operation operation) { + super(operation); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ScalarSummary operation. - * + * * @param scope current scope * @param tags Tags for the summary. * @param values Same shape as `tags. Values for the summary. * @return a new instance of ScalarSummary */ - @Endpoint(describeByClass = true) - public static ScalarSummary create(Scope scope, Operand tags, Operand values) { + @Endpoint( + describeByClass = true + ) + public static ScalarSummary create(Scope scope, Operand tags, + Operand values) { OperationBuilder opBuilder = scope.env().opBuilder("ScalarSummary", scope.makeOpName("ScalarSummary")); opBuilder.addInput(tags.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder = scope.apply(opBuilder); return new ScalarSummary(opBuilder.build()); } - + /** - * Scalar. Serialized `Summary` protocol buffer. + * Gets summary. + * Scalar. Serialized {@code Summary} protocol buffer. + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ScalarSummary"; - - private Output summary; - - private ScalarSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/StatsAggregatorSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/StatsAggregatorSummary.java index bf1bcf65513..c60f467b0d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/StatsAggregatorSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/StatsAggregatorSummary.java @@ -24,48 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Produces a summary of any statistics recorded by the given statistics manager. */ public final class StatsAggregatorSummary extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "StatsAggregatorSummary"; + + private Output summary; + + private StatsAggregatorSummary(Operation operation) { + super(operation); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new StatsAggregatorSummary operation. - * + * * @param scope current scope - * @param iterator + * @param iterator the iterator value * @return a new instance of StatsAggregatorSummary */ - @Endpoint(describeByClass = true) - public static StatsAggregatorSummary create(Scope scope, Operand iterator) { + @Endpoint( + describeByClass = true + ) + public static StatsAggregatorSummary create(Scope scope, Operand iterator) { OperationBuilder opBuilder = scope.env().opBuilder("StatsAggregatorSummary", scope.makeOpName("StatsAggregatorSummary")); opBuilder.addInput(iterator.asOutput()); opBuilder = scope.apply(opBuilder); return new StatsAggregatorSummary(opBuilder.build()); } - + /** + * Gets summary. + * + * @return summary. */ public Output summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "StatsAggregatorSummary"; - - private Output summary; - - private StatsAggregatorSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/SummaryWriter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/SummaryWriter.java index 459a16dc62c..98832a74fbf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/SummaryWriter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/SummaryWriter.java @@ -24,49 +24,36 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** + * The SummaryWriter operation */ public final class SummaryWriter extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.summary.SummaryWriter} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param sharedName - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param container - */ - public Options container(String container) { - this.container = container; - return this; - } - - private String sharedName; - private String container; - - private Options() { - } + public static final String OP_NAME = "SummaryWriter"; + + private Output writer; + + @SuppressWarnings("unchecked") + private SummaryWriter(Operation operation) { + super(operation); + int outputIdx = 0; + writer = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SummaryWriter operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of SummaryWriter */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SummaryWriter create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SummaryWriter", scope.makeOpName("SummaryWriter")); opBuilder = scope.apply(opBuilder); @@ -82,41 +69,73 @@ public static SummaryWriter create(Scope scope, Options... options) { } return new SummaryWriter(opBuilder.build()); } - + /** - * @param sharedName + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param container + * Sets the container option. + * + * @param container the container option + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Gets writer. + * + * @return writer. */ - public Output writer() { + public Output writer() { return writer; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) writer; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SummaryWriter"; - - private Output writer; - - private SummaryWriter(Operation operation) { - super(operation); - int outputIdx = 0; - writer = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.summary.SummaryWriter} + */ + public static class Options { + private String sharedName; + + private String container; + + private Options() { + } + + /** + * Sets the sharedName option. + * + * @param sharedName the sharedName option + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the container option. + * + * @param container the container option + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/TensorSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/TensorSummary.java index be4ceff4fb4..3b46aa41fb6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/TensorSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/TensorSummary.java @@ -29,14 +29,28 @@ import org.tensorflow.types.family.TType; /** - * Outputs a `Summary` protocol buffer with a tensor and per-plugin data. + * Outputs a {@code Summary} protocol buffer with a tensor and per-plugin data. */ -@Operator(group = "summary") +@Operator( + group = "summary" +) public final class TensorSummary extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new TensorSummary operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TensorSummaryV2"; + + private Output summary; + + private TensorSummary(Operation operation) { + super(operation); + int outputIdx = 0; + summary = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TensorSummaryV2 operation. + * * @param scope current scope * @param tag A string attached to this summary. Used for organization in TensorBoard. * @param tensor A tensor to serialize. @@ -44,8 +58,11 @@ public final class TensorSummary extends RawOp implements Operand { * data. * @return a new instance of TensorSummary */ - @Endpoint(describeByClass = true) - public static TensorSummary create(Scope scope, Operand tag, Operand tensor, Operand serializedSummaryMetadata) { + @Endpoint( + describeByClass = true + ) + public static TensorSummary create(Scope scope, Operand tag, + Operand tensor, Operand serializedSummaryMetadata) { OperationBuilder opBuilder = scope.env().opBuilder("TensorSummaryV2", scope.makeOpName("TensorSummary")); opBuilder.addInput(tag.asOutput()); opBuilder.addInput(tensor.asOutput()); @@ -53,26 +70,18 @@ public static TensorSummary create(Scope scope, Operand tag, Operand summary() { return summary; } - + @Override public Output asOutput() { return summary; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TensorSummaryV2"; - - private Output summary; - - private TensorSummary(Operation operation) { - super(operation); - int outputIdx = 0; - summary = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteAudioSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteAudioSummary.java index e905a1b0291..19dac002652 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteAudioSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteAudioSummary.java @@ -23,52 +23,44 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Writes an audio summary. - *

- * Writes encoded audio summary `tensor` at `step` with `tag` using summary `writer`. - * `sample_rate` is the audio sample rate is Hz. + * Writes encoded audio summary {@code tensor} at {@code step} with {@code tag} using summary {@code writer}. + * {@code sample_rate} is the audio sample rate is Hz. */ public final class WriteAudioSummary extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.summary.WriteAudioSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxOutputs - */ - public Options maxOutputs(Long maxOutputs) { - this.maxOutputs = maxOutputs; - return this; - } - - private Long maxOutputs; - - private Options() { - } + public static final String OP_NAME = "WriteAudioSummary"; + + private WriteAudioSummary(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new WriteAudioSummary operation. - * + * * @param scope current scope - * @param writer - * @param step - * @param tag - * @param tensor - * @param sampleRate - * @param options carries optional attributes values + * @param writer the writer value + * @param step the step value + * @param tag the tag value + * @param tensor the tensor value + * @param sampleRate the sampleRate value + * @param options carries optional attribute values * @return a new instance of WriteAudioSummary */ - @Endpoint(describeByClass = true) - public static WriteAudioSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand tensor, Operand sampleRate, Options... options) { + @Endpoint( + describeByClass = true + ) + public static WriteAudioSummary create(Scope scope, Operand writer, + Operand step, Operand tag, Operand tensor, + Operand sampleRate, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("WriteAudioSummary", scope.makeOpName("WriteAudioSummary")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); @@ -85,18 +77,35 @@ public static WriteAudioSummary create(Scope scope, Operand writer, Operand - * Writes TensorFlow graph `tensor` at `step` using summary `writer`. + * Writes TensorFlow graph {@code tensor} at {@code step} using summary {@code writer}. */ public final class WriteGraphSummary extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WriteGraphSummary"; + + private WriteGraphSummary(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new WriteGraphSummary operation. - * + * * @param scope current scope - * @param writer - * @param step - * @param tensor + * @param writer the writer value + * @param step the step value + * @param tensor the tensor value * @return a new instance of WriteGraphSummary */ - @Endpoint(describeByClass = true) - public static WriteGraphSummary create(Scope scope, Operand writer, Operand step, Operand tensor) { + @Endpoint( + describeByClass = true + ) + public static WriteGraphSummary create(Scope scope, Operand writer, + Operand step, Operand tensor) { OperationBuilder opBuilder = scope.env().opBuilder("WriteGraphSummary", scope.makeOpName("WriteGraphSummary")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); @@ -52,11 +62,4 @@ public static WriteGraphSummary create(Scope scope, Operand writer, Operand - * Writes histogram `values` at `step` with `tag` using summary `writer`. + * Writes histogram {@code values} at {@code step} with {@code tag} using summary {@code writer}. */ public final class WriteHistogramSummary extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WriteHistogramSummary"; + + private WriteHistogramSummary(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new WriteHistogramSummary operation. - * + * * @param scope current scope - * @param writer - * @param step - * @param tag - * @param values + * @param writer the writer value + * @param step the step value + * @param tag the tag value + * @param values the values value * @return a new instance of WriteHistogramSummary */ - @Endpoint(describeByClass = true) - public static WriteHistogramSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand values) { + @Endpoint( + describeByClass = true + ) + public static WriteHistogramSummary create(Scope scope, Operand writer, + Operand step, Operand tag, Operand values) { OperationBuilder opBuilder = scope.env().opBuilder("WriteHistogramSummary", scope.makeOpName("WriteHistogramSummary")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); @@ -55,11 +65,4 @@ public static WriteHistogramSummary create(Scope scope, Operand writer, Opera opBuilder = scope.apply(opBuilder); return new WriteHistogramSummary(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteHistogramSummary"; - - private WriteHistogramSummary(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteImageSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteImageSummary.java index e3be2892cd0..09cf9aeeb03 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteImageSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteImageSummary.java @@ -23,53 +23,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.TUint8; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Writes an image summary. - *

- * Writes image `tensor` at `step` with `tag` using summary `writer`. - * `tensor` is image with shape [height, width, channels]. + * Writes image {@code tensor} at {@code step} with {@code tag} using summary {@code writer}. + * {@code tensor} is image with shape [height, width, channels]. */ public final class WriteImageSummary extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.summary.WriteImageSummary} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param maxImages - */ - public Options maxImages(Long maxImages) { - this.maxImages = maxImages; - return this; - } - - private Long maxImages; - - private Options() { - } + public static final String OP_NAME = "WriteImageSummary"; + + private WriteImageSummary(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new WriteImageSummary operation. - * + * * @param scope current scope - * @param writer - * @param step - * @param tag - * @param tensor - * @param badColor - * @param options carries optional attributes values + * @param writer the writer value + * @param step the step value + * @param tag the tag value + * @param tensor the tensor value + * @param badColor the badColor value + * @param options carries optional attribute values * @return a new instance of WriteImageSummary */ - @Endpoint(describeByClass = true) - public static WriteImageSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand tensor, Operand badColor, Options... options) { + @Endpoint( + describeByClass = true + ) + public static WriteImageSummary create(Scope scope, Operand writer, + Operand step, Operand tag, Operand tensor, + Operand badColor, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("WriteImageSummary", scope.makeOpName("WriteImageSummary")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); @@ -86,18 +78,35 @@ public static WriteImageSummary create(Scope scope, Operand writer, Operand - * Writes `tensor`, a serialized proto at `step` using summary `writer`. + * Writes {@code tensor}, a serialized proto at {@code step} using summary {@code writer}. */ public final class WriteRawProtoSummary extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WriteRawProtoSummary"; + + private WriteRawProtoSummary(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new WriteRawProtoSummary operation. - * + * * @param scope current scope - * @param writer - * @param step - * @param tensor + * @param writer the writer value + * @param step the step value + * @param tensor the tensor value * @return a new instance of WriteRawProtoSummary */ - @Endpoint(describeByClass = true) - public static WriteRawProtoSummary create(Scope scope, Operand writer, Operand step, Operand tensor) { + @Endpoint( + describeByClass = true + ) + public static WriteRawProtoSummary create(Scope scope, Operand writer, + Operand step, Operand tensor) { OperationBuilder opBuilder = scope.env().opBuilder("WriteRawProtoSummary", scope.makeOpName("WriteRawProtoSummary")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); @@ -52,11 +62,4 @@ public static WriteRawProtoSummary create(Scope scope, Operand writer, Operan opBuilder = scope.apply(opBuilder); return new WriteRawProtoSummary(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteRawProtoSummary"; - - private WriteRawProtoSummary(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteScalarSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteScalarSummary.java index 5fddaff353c..ef4c70ad165 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteScalarSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteScalarSummary.java @@ -23,30 +23,40 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Writes a scalar summary. - *

- * Writes scalar `value` at `step` with `tag` using summary `writer`. + * Writes scalar {@code value} at {@code step} with {@code tag} using summary {@code writer}. */ public final class WriteScalarSummary extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WriteScalarSummary"; + + private WriteScalarSummary(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new WriteScalarSummary operation. - * + * * @param scope current scope - * @param writer - * @param step - * @param tag - * @param value + * @param writer the writer value + * @param step the step value + * @param tag the tag value + * @param value the value value * @return a new instance of WriteScalarSummary */ - @Endpoint(describeByClass = true) - public static WriteScalarSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand value) { + @Endpoint( + describeByClass = true + ) + public static WriteScalarSummary create(Scope scope, Operand writer, + Operand step, Operand tag, Operand value) { OperationBuilder opBuilder = scope.env().opBuilder("WriteScalarSummary", scope.makeOpName("WriteScalarSummary")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); @@ -55,11 +65,4 @@ public static WriteScalarSummary create(Scope scope, Operand writer, Operand< opBuilder = scope.apply(opBuilder); return new WriteScalarSummary(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WriteScalarSummary"; - - private WriteScalarSummary(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteSummary.java index 337c585a8c9..5ec67f7c2cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteSummary.java @@ -23,31 +23,41 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.TString; import org.tensorflow.types.family.TType; /** * Writes a tensor summary. - *

- * Writes `tensor` at `step` with `tag` using summary `writer`. + * Writes {@code tensor} at {@code step} with {@code tag} using summary {@code writer}. */ public final class WriteSummary extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WriteSummary"; + + private WriteSummary(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new WriteSummary operation. - * + * * @param scope current scope - * @param writer - * @param step - * @param tensor - * @param tag - * @param summaryMetadata + * @param writer the writer value + * @param step the step value + * @param tensor the tensor value + * @param tag the tag value + * @param summaryMetadata the summaryMetadata value * @return a new instance of WriteSummary */ - @Endpoint(describeByClass = true) - public static WriteSummary create(Scope scope, Operand writer, Operand step, Operand tensor, Operand tag, Operand summaryMetadata) { + @Endpoint( + describeByClass = true + ) + public static WriteSummary create(Scope scope, Operand writer, + Operand step, Operand tensor, Operand tag, + Operand summaryMetadata) { OperationBuilder opBuilder = scope.env().opBuilder("WriteSummary", scope.makeOpName("WriteSummary")); opBuilder.addInput(writer.asOutput()); opBuilder.addInput(step.asOutput()); @@ -57,11 +67,4 @@ public static WriteSummary create(Scope scope, Operand writer, Operand - * On each replica, the input is split into `split_count` blocks along - * `split_dimension` and send to the other replicas given group_assignment. After - * receiving `split_count` - 1 blocks from other replicas, we concatenate the - * blocks along `concat_dimension` as the output. - *

- * For example, suppose there are 2 TPU replicas: - * replica 0 receives input: `[[A, B]]` - * replica 1 receives input: `[[C, D]]` - *

- * group_assignment=`[[0, 1]]` + * On each replica, the input is split into {@code split_count} blocks along + * {@code split_dimension} and send to the other replicas given group_assignment. After + * receiving {@code split_count} - 1 blocks from other replicas, we concatenate the + * blocks along {@code concat_dimension} as the output. + *

For example, suppose there are 2 TPU replicas: + * replica 0 receives input: {@code [[A, B]]} + * replica 1 receives input: {@code [[C, D]]} + *

group_assignment={@code [[0, 1]]} * concat_dimension=0 * split_dimension=1 * split_count=2 - *

- * replica 0's output: `[[A], [C]]` - * replica 1's output: `[[B], [D]]` - * - * @param data type for {@code output()} output + *

replica 0's output: {@code [[A], [C]]} + * replica 1's output: {@code [[B], [D]]} + * + * @param data type for {@code output} output */ public final class AllToAll extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AllToAll"; + + private Output output; + + private AllToAll(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AllToAll operation. - * + * * @param scope current scope * @param input The local input to the sum. * @param groupAssignment An int32 tensor with shape - * [num_groups, num_replicas_per_group]. `group_assignment[i]` represents the + * [num_groups, num_replicas_per_group]. {@code group_assignment[i]} represents the * replica ids in the ith subgroup. * @param concatDimension The dimension number to concatenate. * @param splitDimension The dimension number to split. * @param splitCount The number of splits, this number must equal to the sub-group * size(group_assignment.get_shape()[1]) + * @param data type for {@code AllToAll} output and operands * @return a new instance of AllToAll */ - @Endpoint(describeByClass = true) - public static AllToAll create(Scope scope, Operand input, Operand groupAssignment, Long concatDimension, Long splitDimension, Long splitCount) { + @Endpoint( + describeByClass = true + ) + public static AllToAll create(Scope scope, Operand input, + Operand groupAssignment, Long concatDimension, Long splitDimension, Long splitCount) { OperationBuilder opBuilder = scope.env().opBuilder("AllToAll", scope.makeOpName("AllToAll")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(groupAssignment.asOutput()); @@ -75,29 +86,20 @@ public static AllToAll create(Scope scope, Operand input opBuilder.setAttr("concat_dimension", concatDimension); opBuilder.setAttr("split_dimension", splitDimension); opBuilder.setAttr("split_count", splitCount); - return new AllToAll(opBuilder.build()); + return new AllToAll<>(opBuilder.build()); } - + /** + * Gets output. * The exchanged result. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AllToAll"; - - private Output output; - - private AllToAll(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollectivePermute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollectivePermute.java index 43fe40a06dc..a0a26ad01cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollectivePermute.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CollectivePermute.java @@ -24,61 +24,65 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * An Op to permute tensors across replicated TPU instances. - *

* Each instance supplies its own input. - *

- * For example, suppose there are 4 TPU instances: `[A, B, C, D]`. Passing - * source_target_pairs=`[[0,1],[1,2],[2,3],[3,0]]` gets the outputs: - * `[D, A, B, C]`. - * - * @param data type for {@code output()} output + *

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 data type for {@code output} output */ public final class CollectivePermute extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CollectivePermute"; + + private Output output; + + private CollectivePermute(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CollectivePermute operation. - * + * * @param scope current scope * @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 */ - @Endpoint(describeByClass = true) - public static CollectivePermute create(Scope scope, Operand input, Operand sourceTargetPairs) { + @Endpoint( + describeByClass = true + ) + public static CollectivePermute create(Scope scope, Operand input, + Operand sourceTargetPairs) { OperationBuilder opBuilder = scope.env().opBuilder("CollectivePermute", scope.makeOpName("CollectivePermute")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(sourceTargetPairs.asOutput()); opBuilder = scope.apply(opBuilder); - return new CollectivePermute(opBuilder.build()); + return new CollectivePermute<>(opBuilder.build()); } - + /** + * Gets output. * The permuted input. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CollectivePermute"; - - private Output output; - - private CollectivePermute(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompilationResult.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompilationResult.java index bd0cbda42c4..64eba9c5f65 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompilationResult.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompilationResult.java @@ -24,50 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Returns the result of a TPU compilation. - *

* This operation returns the result of a TPU compilation as a serialized * CompilationResultProto, which holds a status and an error message if an error * occurred during compilation. */ public final class CompilationResult extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new CompilationResult operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUCompilationResult"; + + private Output output; + + private CompilationResult(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TPUCompilationResult operation. + * * @param scope current scope * @return a new instance of CompilationResult */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static CompilationResult create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("TPUCompilationResult", scope.makeOpName("CompilationResult")); opBuilder = scope.apply(opBuilder); return new CompilationResult(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUCompilationResult"; - - private Output output; - - private CompilationResult(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompileSucceededAssert.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompileSucceededAssert.java index bf5abddcdd2..1eea28d492e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompileSucceededAssert.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CompileSucceededAssert.java @@ -28,33 +28,36 @@ /** * Asserts that compilation succeeded. This op produces no output and closes the - *

* device during failure to ensure all pending device interactions fail. - *

- * 'compilation_status' is a serialized CompilationResultProto. + *

'compilation_status' is a serialized CompilationResultProto. */ -@Operator(group = "tpu") +@Operator( + group = "tpu" +) public final class CompileSucceededAssert extends RawOp { - /** - * Factory method to create a class wrapping a new CompileSucceededAssert operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUCompileSucceededAssert"; + + private CompileSucceededAssert(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new TPUCompileSucceededAssert operation. + * * @param scope current scope - * @param compilationStatus + * @param compilationStatus the compilationStatus value * @return a new instance of CompileSucceededAssert */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static CompileSucceededAssert create(Scope scope, Operand compilationStatus) { OperationBuilder opBuilder = scope.env().opBuilder("TPUCompileSucceededAssert", scope.makeOpName("CompileSucceededAssert")); opBuilder.addInput(compilationStatus.asOutput()); opBuilder = scope.apply(opBuilder); return new CompileSucceededAssert(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUCompileSucceededAssert"; - - private CompileSucceededAssert(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureDistributedTPU.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureDistributedTPU.java index 35853993c2e..4f2c97ca5ad 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureDistributedTPU.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureDistributedTPU.java @@ -24,78 +24,35 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Sets up the centralized structures for a distributed TPU system. */ public final class ConfigureDistributedTPU extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.ConfigureDistributedTPU} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param embeddingConfig Reserved. Do not use. - */ - public Options embeddingConfig(String embeddingConfig) { - this.embeddingConfig = embeddingConfig; - return this; - } - - /** - * @param tpuEmbeddingConfig Serialized tensorflow.tpu.TPUEmbeddingConfiguration that - * describes the embedding lookups of the program. - */ - public Options tpuEmbeddingConfig(String tpuEmbeddingConfig) { - this.tpuEmbeddingConfig = tpuEmbeddingConfig; - return this; - } - - /** - * @param isGlobalInit Reserved. Do not use. - */ - public Options isGlobalInit(Boolean isGlobalInit) { - this.isGlobalInit = isGlobalInit; - return this; - } - - /** - * @param enableWholeMeshCompilations - */ - public Options enableWholeMeshCompilations(Boolean enableWholeMeshCompilations) { - this.enableWholeMeshCompilations = enableWholeMeshCompilations; - return this; - } - - /** - * @param compilationFailureClosesChips - */ - public Options compilationFailureClosesChips(Boolean compilationFailureClosesChips) { - this.compilationFailureClosesChips = compilationFailureClosesChips; - return this; - } - - private String embeddingConfig; - private String tpuEmbeddingConfig; - private Boolean isGlobalInit; - private Boolean enableWholeMeshCompilations; - private Boolean compilationFailureClosesChips; - - private Options() { - } + public static final String OP_NAME = "ConfigureDistributedTPU"; + + private Output topology; + + private ConfigureDistributedTPU(Operation operation) { + super(operation); + int outputIdx = 0; + topology = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ConfigureDistributedTPU operation. - * + * * @param scope current scope - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ConfigureDistributedTPU */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ConfigureDistributedTPU create(Scope scope, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ConfigureDistributedTPU", scope.makeOpName("ConfigureDistributedTPU")); opBuilder = scope.apply(opBuilder); @@ -120,64 +77,144 @@ public static ConfigureDistributedTPU create(Scope scope, Options... options) { } return new ConfigureDistributedTPU(opBuilder.build()); } - + /** + * Sets the embeddingConfig option. + * * @param embeddingConfig Reserved. Do not use. + * @return this Options instance. */ public static Options embeddingConfig(String embeddingConfig) { return new Options().embeddingConfig(embeddingConfig); } - + /** + * Sets the tpuEmbeddingConfig option. + * * @param tpuEmbeddingConfig Serialized tensorflow.tpu.TPUEmbeddingConfiguration that * describes the embedding lookups of the program. + * @return this Options instance. */ public static Options tpuEmbeddingConfig(String tpuEmbeddingConfig) { return new Options().tpuEmbeddingConfig(tpuEmbeddingConfig); } - + /** + * Sets the isGlobalInit option. + * * @param isGlobalInit Reserved. Do not use. + * @return this Options instance. */ public static Options isGlobalInit(Boolean isGlobalInit) { return new Options().isGlobalInit(isGlobalInit); } - + /** - * @param enableWholeMeshCompilations + * Sets the enableWholeMeshCompilations option. + * + * @param enableWholeMeshCompilations the enableWholeMeshCompilations option + * @return this Options instance. */ public static Options enableWholeMeshCompilations(Boolean enableWholeMeshCompilations) { return new Options().enableWholeMeshCompilations(enableWholeMeshCompilations); } - + /** - * @param compilationFailureClosesChips + * Sets the compilationFailureClosesChips option. + * + * @param compilationFailureClosesChips the compilationFailureClosesChips option + * @return this Options instance. */ public static Options compilationFailureClosesChips(Boolean compilationFailureClosesChips) { return new Options().compilationFailureClosesChips(compilationFailureClosesChips); } - + /** + * Gets topology. * A serialized tensorflow.tpu.TopologyProto that describes the TPU * topology. + * @return topology. */ public Output topology() { return topology; } - + @Override public Output asOutput() { return topology; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConfigureDistributedTPU"; - - private Output topology; - - private ConfigureDistributedTPU(Operation operation) { - super(operation); - int outputIdx = 0; - topology = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.ConfigureDistributedTPU} + */ + public static class Options { + private String embeddingConfig; + + private String tpuEmbeddingConfig; + + private Boolean isGlobalInit; + + private Boolean enableWholeMeshCompilations; + + private Boolean compilationFailureClosesChips; + + private Options() { + } + + /** + * Sets the embeddingConfig option. + * + * @param embeddingConfig Reserved. Do not use. + * @return this Options instance. + */ + public Options embeddingConfig(String embeddingConfig) { + this.embeddingConfig = embeddingConfig; + return this; + } + + /** + * Sets the tpuEmbeddingConfig option. + * + * @param tpuEmbeddingConfig Serialized tensorflow.tpu.TPUEmbeddingConfiguration that + * describes the embedding lookups of the program. + * @return this Options instance. + */ + public Options tpuEmbeddingConfig(String tpuEmbeddingConfig) { + this.tpuEmbeddingConfig = tpuEmbeddingConfig; + return this; + } + + /** + * Sets the isGlobalInit option. + * + * @param isGlobalInit Reserved. Do not use. + * @return this Options instance. + */ + public Options isGlobalInit(Boolean isGlobalInit) { + this.isGlobalInit = isGlobalInit; + return this; + } + + /** + * Sets the enableWholeMeshCompilations option. + * + * @param enableWholeMeshCompilations the enableWholeMeshCompilations option + * @return this Options instance. + */ + public Options enableWholeMeshCompilations(Boolean enableWholeMeshCompilations) { + this.enableWholeMeshCompilations = enableWholeMeshCompilations; + return this; + } + + /** + * Sets the compilationFailureClosesChips option. + * + * @param compilationFailureClosesChips the compilationFailureClosesChips option + * @return this Options instance. + */ + public Options compilationFailureClosesChips(Boolean compilationFailureClosesChips) { + this.compilationFailureClosesChips = compilationFailureClosesChips; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbedding.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbedding.java index 2083167b0ec..485bd0a7ec7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbedding.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ConfigureTPUEmbedding.java @@ -22,33 +22,35 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; /** * Sets up TPUEmbedding in a distributed TPU system. */ public final class ConfigureTPUEmbedding extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ConfigureTPUEmbedding"; + + private ConfigureTPUEmbedding(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ConfigureTPUEmbedding operation. - * + * * @param scope current scope * @param config Serialized tensorflow.tpu.TPUEmbeddingConfiguration that * describes the embedding lookups of the program. * @return a new instance of ConfigureTPUEmbedding */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ConfigureTPUEmbedding create(Scope scope, String config) { OperationBuilder opBuilder = scope.env().opBuilder("ConfigureTPUEmbedding", scope.makeOpName("ConfigureTPUEmbedding")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("config", config); return new ConfigureTPUEmbedding(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConfigureTPUEmbedding"; - - private ConfigureTPUEmbedding(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CrossReplicaSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CrossReplicaSum.java index ff2cb8390be..6ac49cfc2f3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CrossReplicaSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/CrossReplicaSum.java @@ -24,63 +24,67 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TNumber; /** * An Op to sum inputs across replicated TPU instances. - *

* Each instance supplies its own input. - *

- * For example, suppose there are 8 TPU instances: `[A, B, C, D, E, F, G, H]`. - * Passing group_assignment=`[[0,2,4,6],[1,3,5,7]]` sets `A, C, E, G` as group 0, - * and `B, D, F, H` as group 1. Thus we get the outputs: - * `[A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H]`. - * - * @param data type for {@code output()} output + *

For example, suppose there are 8 TPU instances: {@code [A, B, C, D, E, F, G, H]}. + * Passing group_assignment={@code [[0,2,4,6],[1,3,5,7]]} sets {@code A, C, E, G} as group 0, + * and {@code B, D, F, H} as group 1. Thus we get the outputs: + * {@code [A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H]}. + * + * @param data type for {@code output} output */ public final class CrossReplicaSum extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "CrossReplicaSum"; + + private Output output; + + private CrossReplicaSum(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new CrossReplicaSum operation. - * + * * @param scope current scope * @param input The local input to the sum. * @param groupAssignment An int32 tensor with shape - * [num_groups, num_replicas_per_group]. `group_assignment[i]` represents the + * [num_groups, num_replicas_per_group]. {@code group_assignment[i]} represents the * replica ids in the ith subgroup. + * @param data type for {@code CrossReplicaSum} output and operands * @return a new instance of CrossReplicaSum */ - @Endpoint(describeByClass = true) - public static CrossReplicaSum create(Scope scope, Operand input, Operand groupAssignment) { + @Endpoint( + describeByClass = true + ) + public static CrossReplicaSum create(Scope scope, Operand input, + Operand groupAssignment) { OperationBuilder opBuilder = scope.env().opBuilder("CrossReplicaSum", scope.makeOpName("CrossReplicaSum")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(groupAssignment.asOutput()); opBuilder = scope.apply(opBuilder); - return new CrossReplicaSum(opBuilder.build()); + return new CrossReplicaSum<>(opBuilder.build()); } - + /** + * Gets output. * The sum of all the distributed inputs. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "CrossReplicaSum"; - - private Output output; - - private CrossReplicaSum(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EmbeddingActivations.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EmbeddingActivations.java index 88547e9358d..664d1bb6d3f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EmbeddingActivations.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EmbeddingActivations.java @@ -24,12 +24,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * An op enabling differentiation of TPU Embeddings. - *

* This op simply returns its first input, which is assumed to have been sliced * from the Tensors returned by TPUEmbeddingDequeueActivations. The presence of * this op, and its first argument being a trainable Variable, enables automatic @@ -37,10 +35,22 @@ * libraries. */ public final class EmbeddingActivations extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new EmbeddingActivations operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUEmbeddingActivations"; + + private Output output; + + private EmbeddingActivations(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TPUEmbeddingActivations operation. + * * @param scope current scope * @param embeddingVariable A trainable variable, enabling optimizers to find this op. * @param slicedActivations The embedding activations Tensor to return. @@ -50,8 +60,11 @@ public final class EmbeddingActivations extends RawOp implements Operand embeddingVariable, Operand slicedActivations, Long tableId, Long lookupId) { + @Endpoint( + describeByClass = true + ) + public static EmbeddingActivations create(Scope scope, Operand embeddingVariable, + Operand slicedActivations, Long tableId, Long lookupId) { OperationBuilder opBuilder = scope.env().opBuilder("TPUEmbeddingActivations", scope.makeOpName("EmbeddingActivations")); opBuilder.addInput(embeddingVariable.asOutput()); opBuilder.addInput(slicedActivations.asOutput()); @@ -60,26 +73,18 @@ public static EmbeddingActivations create(Scope scope, Operand embeddi opBuilder.setAttr("lookup_id", lookupId); return new EmbeddingActivations(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUEmbeddingActivations"; - - private Output output; - - private EmbeddingActivations(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingIntegerBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingIntegerBatch.java index a7457ea77de..c7108ae1d94 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingIntegerBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingIntegerBatch.java @@ -24,7 +24,6 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.TString; @@ -32,30 +31,18 @@ * An op that enqueues a list of input batch tensors to TPUEmbedding. */ public final class EnqueueTPUEmbeddingIntegerBatch extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingIntegerBatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number - * of TPU cores in the task on which the node is placed. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "EnqueueTPUEmbeddingIntegerBatch"; + + private EnqueueTPUEmbeddingIntegerBatch(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new EnqueueTPUEmbeddingIntegerBatch operation. - * + * * @param scope current scope * @param batch A list of 1D tensors, one for each embedding table, containing the * indices into the tables. @@ -63,11 +50,14 @@ private Options() { * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EnqueueTPUEmbeddingIntegerBatch */ - @Endpoint(describeByClass = true) - public static EnqueueTPUEmbeddingIntegerBatch create(Scope scope, Iterable> batch, Operand modeOverride, Options... options) { + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingIntegerBatch create(Scope scope, Iterable> batch, + Operand modeOverride, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EnqueueTPUEmbeddingIntegerBatch", scope.makeOpName("EnqueueTPUEmbeddingIntegerBatch")); opBuilder.addInputList(Operands.asOutputs(batch)); opBuilder.addInput(modeOverride.asOutput()); @@ -81,19 +71,37 @@ public static EnqueueTPUEmbeddingIntegerBatch create(Scope scope, Iterable= 0 and less than the number + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number * of TPU cores in the task on which the node is placed. + * @return this Options instance. */ public static Options deviceOrdinal(Long deviceOrdinal) { return new Options().deviceOrdinal(deviceOrdinal); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnqueueTPUEmbeddingIntegerBatch"; - - private EnqueueTPUEmbeddingIntegerBatch(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingIntegerBatch} + */ + public static class Options { + private Long deviceOrdinal; + + private Options() { + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingRaggedTensorBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingRaggedTensorBatch.java index a6256e829fa..d8cff616735 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingRaggedTensorBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingRaggedTensorBatch.java @@ -17,6 +17,7 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,70 +26,32 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; /** * Eases the porting of code that uses tf.nn.embedding_lookup(). - *

* sample_splits[i], embedding_indices[i] and aggregation_weights[i] correspond * to the ith feature. table_ids[i] indicates which embedding table to look up ith * feature. - *

- * The tensors at corresponding positions in two of the input lists, + *

The tensors at corresponding positions in two of the input lists, * embedding_indices and aggregation_weights, must have the same shape, i.e. rank 1 * with dim_size() equal to the total number of lookups into the table described by * the corresponding feature. */ public final class EnqueueTPUEmbeddingRaggedTensorBatch extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingRaggedTensorBatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number - * of TPU cores in the task on which the node is placed. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - /** - * @param combiners A list of string scalars, one for each embedding table that specify - * how to normalize the embedding activations after weighted summation. - * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have - * the sum of the weights be 0 for 'mean' or the sum of the squared weights be - * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for - * all tables. - */ - public Options combiners(List combiners) { - this.combiners = combiners; - return this; - } - - /** - * @param maxSequenceLengths - */ - public Options maxSequenceLengths(List maxSequenceLengths) { - this.maxSequenceLengths = maxSequenceLengths; - return this; - } - - private Long deviceOrdinal; - private List combiners; - private List maxSequenceLengths; - - private Options() { - } + public static final String OP_NAME = "EnqueueTPUEmbeddingRaggedTensorBatch"; + + private EnqueueTPUEmbeddingRaggedTensorBatch(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new EnqueueTPUEmbeddingRaggedTensorBatch operation. - * + * * @param scope current scope * @param sampleSplits A list of rank 1 Tensors specifying the break points for splitting * embedding_indices and aggregation_weights into rows. @@ -109,11 +72,17 @@ private Options() { * corresponding input. The ith input is looked up using table_ids[i]. The size * of the table_ids list must be equal to that of sample_indices, * embedding_indices and aggregation_weights. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EnqueueTPUEmbeddingRaggedTensorBatch */ - @Endpoint(describeByClass = true) - public static EnqueueTPUEmbeddingRaggedTensorBatch create(Scope scope, Iterable> sampleSplits, Iterable> embeddingIndices, Iterable> aggregationWeights, Operand modeOverride, List tableIds, Options... options) { + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingRaggedTensorBatch create(Scope scope, + Iterable> sampleSplits, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + List tableIds, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EnqueueTPUEmbeddingRaggedTensorBatch", scope.makeOpName("EnqueueTPUEmbeddingRaggedTensorBatch")); opBuilder.addInputList(Operands.asOutputs(sampleSplits)); opBuilder.addInputList(Operands.asOutputs(embeddingIndices)); @@ -121,7 +90,7 @@ public static EnqueueT opBuilder.addInput(modeOverride.asOutput()); opBuilder = scope.apply(opBuilder); long[] tableIdsArray = new long[tableIds.size()]; - for (int i = 0; i < tableIdsArray.length; ++i) { + for (int i = 0 ; i < tableIdsArray.length ; i++) { tableIdsArray[i] = tableIds.get(i); } opBuilder.setAttr("table_ids", tableIdsArray); @@ -132,14 +101,14 @@ public static EnqueueT } if (opts.combiners != null) { String[] combinersArray = new String[opts.combiners.size()]; - for (int i = 0; i < combinersArray.length; ++i) { + for (int i = 0 ; i < combinersArray.length ; i++) { combinersArray[i] = opts.combiners.get(i); } opBuilder.setAttr("combiners", combinersArray); } if (opts.maxSequenceLengths != null) { long[] maxSequenceLengthsArray = new long[opts.maxSequenceLengths.size()]; - for (int i = 0; i < maxSequenceLengthsArray.length; ++i) { + for (int i = 0 ; i < maxSequenceLengthsArray.length ; i++) { maxSequenceLengthsArray[i] = opts.maxSequenceLengths.get(i); } opBuilder.setAttr("max_sequence_lengths", maxSequenceLengthsArray); @@ -148,38 +117,145 @@ public static EnqueueT } return new EnqueueTPUEmbeddingRaggedTensorBatch(opBuilder.build()); } - + /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number * of TPU cores in the task on which the node is placed. + * @return this Options instance. */ public static Options deviceOrdinal(Long deviceOrdinal) { return new Options().deviceOrdinal(deviceOrdinal); } - + /** + * Sets the combiners option. + * * @param combiners A list of string scalars, one for each embedding table that specify * how to normalize the embedding activations after weighted summation. * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have * the sum of the weights be 0 for 'mean' or the sum of the squared weights be * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for * all tables. + * @return this Options instance. */ public static Options combiners(List combiners) { return new Options().combiners(combiners); } - + /** - * @param maxSequenceLengths + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public static Options combiners(String[] combiners) { + return new Options().combiners(combiners); + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. */ public static Options maxSequenceLengths(List maxSequenceLengths) { return new Options().maxSequenceLengths(maxSequenceLengths); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnqueueTPUEmbeddingRaggedTensorBatch"; - - private EnqueueTPUEmbeddingRaggedTensorBatch(Operation operation) { - super(operation); + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public static Options maxSequenceLengths(Long[] maxSequenceLengths) { + return new Options().maxSequenceLengths(maxSequenceLengths); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingRaggedTensorBatch} + */ + public static class Options { + private Long deviceOrdinal; + + private List combiners; + + private List maxSequenceLengths; + + private Options() { + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(List combiners) { + this.combiners = combiners; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(String... combiners) { + this.combiners = Arrays.asList(combiners); + return this; + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public Options maxSequenceLengths(List maxSequenceLengths) { + this.maxSequenceLengths = maxSequenceLengths; + return this; + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public Options maxSequenceLengths(Long... maxSequenceLengths) { + this.maxSequenceLengths = Arrays.asList(maxSequenceLengths); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseBatch.java index f302cf7ad5f..2f33704b828 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseBatch.java @@ -17,6 +17,7 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,62 +26,33 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; /** * An op that enqueues TPUEmbedding input indices from a SparseTensor. - *

* This Op eases the porting of code that uses embedding_lookup_sparse(), * although some Python preprocessing of the SparseTensor arguments to * embedding_lookup_sparse() is required to produce the arguments to this Op, * since only a single EnqueueTPUEmbeddingSparseBatch Op is allowed per training * step. - *

- * The tensors at corresponding positions in the three input lists + *

The tensors at corresponding positions in the three input lists * must have the same shape, i.e. rank 1 with dim_size() equal to the total * number of lookups into the table described by the corresponding table_id. */ public final class EnqueueTPUEmbeddingSparseBatch extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingSparseBatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number - * of TPU cores in the task on which the node is placed. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - /** - * @param combiners A list of string scalars, one for each embedding table that specify - * how to normalize the embedding activations after weighted summation. - * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have - * the sum of the weights be 0 for 'mean' or the sum of the squared weights be - * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for - * all tables. - */ - public Options combiners(List combiners) { - this.combiners = combiners; - return this; - } - - private Long deviceOrdinal; - private List combiners; - - private Options() { - } + public static final String OP_NAME = "EnqueueTPUEmbeddingSparseBatch"; + + private EnqueueTPUEmbeddingSparseBatch(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new EnqueueTPUEmbeddingSparseBatch operation. - * + * * @param scope current scope * @param sampleIndices A list of rank 1 Tensors specifying the training example and * feature to which the corresponding embedding_indices and aggregation_weights @@ -94,11 +66,17 @@ private Options() { * TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference', * 'training', 'backward_pass_only'}. When set to 'unspecified', the mode set * in TPUEmbeddingConfiguration is used, otherwise mode_override is used. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EnqueueTPUEmbeddingSparseBatch */ - @Endpoint(describeByClass = true) - public static EnqueueTPUEmbeddingSparseBatch create(Scope scope, Iterable> sampleIndices, Iterable> embeddingIndices, Iterable> aggregationWeights, Operand modeOverride, Options... options) { + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingSparseBatch create(Scope scope, + Iterable> sampleIndices, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EnqueueTPUEmbeddingSparseBatch", scope.makeOpName("EnqueueTPUEmbeddingSparseBatch")); opBuilder.addInputList(Operands.asOutputs(sampleIndices)); opBuilder.addInputList(Operands.asOutputs(embeddingIndices)); @@ -112,7 +90,7 @@ public static EnqueueT } if (opts.combiners != null) { String[] combinersArray = new String[opts.combiners.size()]; - for (int i = 0; i < combinersArray.length; ++i) { + for (int i = 0 ; i < combinersArray.length ; i++) { combinersArray[i] = opts.combiners.get(i); } opBuilder.setAttr("combiners", combinersArray); @@ -121,31 +99,101 @@ public static EnqueueT } return new EnqueueTPUEmbeddingSparseBatch(opBuilder.build()); } - + /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number * of TPU cores in the task on which the node is placed. + * @return this Options instance. */ public static Options deviceOrdinal(Long deviceOrdinal) { return new Options().deviceOrdinal(deviceOrdinal); } - + /** + * Sets the combiners option. + * * @param combiners A list of string scalars, one for each embedding table that specify * how to normalize the embedding activations after weighted summation. * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have * the sum of the weights be 0 for 'mean' or the sum of the squared weights be * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for * all tables. + * @return this Options instance. */ public static Options combiners(List combiners) { return new Options().combiners(combiners); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnqueueTPUEmbeddingSparseBatch"; - - private EnqueueTPUEmbeddingSparseBatch(Operation operation) { - super(operation); + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public static Options combiners(String[] combiners) { + return new Options().combiners(combiners); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingSparseBatch} + */ + public static class Options { + private Long deviceOrdinal; + + private List combiners; + + private Options() { + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(List combiners) { + this.combiners = combiners; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(String... combiners) { + this.combiners = Arrays.asList(combiners); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseTensorBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseTensorBatch.java index a482e5f5ebf..79226f5998f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseTensorBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/EnqueueTPUEmbeddingSparseTensorBatch.java @@ -17,6 +17,7 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,70 +26,32 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; import org.tensorflow.types.family.TNumber; /** * Eases the porting of code that uses tf.nn.embedding_lookup_sparse(). - *

* sample_indices[i], embedding_indices[i] and aggregation_weights[i] correspond * to the ith feature. table_ids[i] indicates which embedding table to look up ith * feature. - *

- * The tensors at corresponding positions in the three input lists (sample_indices, + *

The tensors at corresponding positions in the three input lists (sample_indices, * embedding_indices and aggregation_weights) must have the same shape, i.e. rank 1 * with dim_size() equal to the total number of lookups into the table described by * the corresponding feature. */ public final class EnqueueTPUEmbeddingSparseTensorBatch extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingSparseTensorBatch} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number - * of TPU cores in the task on which the node is placed. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - /** - * @param combiners A list of string scalars, one for each embedding table that specify - * how to normalize the embedding activations after weighted summation. - * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have - * the sum of the weights be 0 for 'mean' or the sum of the squared weights be - * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for - * all tables. - */ - public Options combiners(List combiners) { - this.combiners = combiners; - return this; - } - - /** - * @param maxSequenceLengths - */ - public Options maxSequenceLengths(List maxSequenceLengths) { - this.maxSequenceLengths = maxSequenceLengths; - return this; - } - - private Long deviceOrdinal; - private List combiners; - private List maxSequenceLengths; - - private Options() { - } + public static final String OP_NAME = "EnqueueTPUEmbeddingSparseTensorBatch"; + + private EnqueueTPUEmbeddingSparseTensorBatch(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new EnqueueTPUEmbeddingSparseTensorBatch operation. - * + * * @param scope current scope * @param sampleIndices A list of rank 1 Tensors specifying the training example to * which the corresponding embedding_indices and aggregation_weights values @@ -107,11 +70,17 @@ private Options() { * corresponding input. The ith input is looked up using table_ids[i]. The size * of the table_ids list must be equal to that of sample_indices, * embedding_indices and aggregation_weights. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of EnqueueTPUEmbeddingSparseTensorBatch */ - @Endpoint(describeByClass = true) - public static EnqueueTPUEmbeddingSparseTensorBatch create(Scope scope, Iterable> sampleIndices, Iterable> embeddingIndices, Iterable> aggregationWeights, Operand modeOverride, List tableIds, Options... options) { + @Endpoint( + describeByClass = true + ) + public static EnqueueTPUEmbeddingSparseTensorBatch create(Scope scope, + Iterable> sampleIndices, + Iterable> embeddingIndices, + Iterable> aggregationWeights, Operand modeOverride, + List tableIds, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EnqueueTPUEmbeddingSparseTensorBatch", scope.makeOpName("EnqueueTPUEmbeddingSparseTensorBatch")); opBuilder.addInputList(Operands.asOutputs(sampleIndices)); opBuilder.addInputList(Operands.asOutputs(embeddingIndices)); @@ -119,7 +88,7 @@ public static EnqueueT opBuilder.addInput(modeOverride.asOutput()); opBuilder = scope.apply(opBuilder); long[] tableIdsArray = new long[tableIds.size()]; - for (int i = 0; i < tableIdsArray.length; ++i) { + for (int i = 0 ; i < tableIdsArray.length ; i++) { tableIdsArray[i] = tableIds.get(i); } opBuilder.setAttr("table_ids", tableIdsArray); @@ -130,14 +99,14 @@ public static EnqueueT } if (opts.combiners != null) { String[] combinersArray = new String[opts.combiners.size()]; - for (int i = 0; i < combinersArray.length; ++i) { + for (int i = 0 ; i < combinersArray.length ; i++) { combinersArray[i] = opts.combiners.get(i); } opBuilder.setAttr("combiners", combinersArray); } if (opts.maxSequenceLengths != null) { long[] maxSequenceLengthsArray = new long[opts.maxSequenceLengths.size()]; - for (int i = 0; i < maxSequenceLengthsArray.length; ++i) { + for (int i = 0 ; i < maxSequenceLengthsArray.length ; i++) { maxSequenceLengthsArray[i] = opts.maxSequenceLengths.get(i); } opBuilder.setAttr("max_sequence_lengths", maxSequenceLengthsArray); @@ -146,38 +115,145 @@ public static EnqueueT } return new EnqueueTPUEmbeddingSparseTensorBatch(opBuilder.build()); } - + /** - * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number * of TPU cores in the task on which the node is placed. + * @return this Options instance. */ public static Options deviceOrdinal(Long deviceOrdinal) { return new Options().deviceOrdinal(deviceOrdinal); } - + /** + * Sets the combiners option. + * * @param combiners A list of string scalars, one for each embedding table that specify * how to normalize the embedding activations after weighted summation. * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have * the sum of the weights be 0 for 'mean' or the sum of the squared weights be * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for * all tables. + * @return this Options instance. */ public static Options combiners(List combiners) { return new Options().combiners(combiners); } - + /** - * @param maxSequenceLengths + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public static Options combiners(String[] combiners) { + return new Options().combiners(combiners); + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. */ public static Options maxSequenceLengths(List maxSequenceLengths) { return new Options().maxSequenceLengths(maxSequenceLengths); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "EnqueueTPUEmbeddingSparseTensorBatch"; - - private EnqueueTPUEmbeddingSparseTensorBatch(Operation operation) { - super(operation); + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public static Options maxSequenceLengths(Long[] maxSequenceLengths) { + return new Options().maxSequenceLengths(maxSequenceLengths); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.EnqueueTPUEmbeddingSparseTensorBatch} + */ + public static class Options { + private Long deviceOrdinal; + + private List combiners; + + private List maxSequenceLengths; + + private Options() { + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. Should be >= 0 and less than the number + * of TPU cores in the task on which the node is placed. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(List combiners) { + this.combiners = combiners; + return this; + } + + /** + * Sets the combiners option. + * + * @param combiners A list of string scalars, one for each embedding table that specify + * how to normalize the embedding activations after weighted summation. + * Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have + * the sum of the weights be 0 for 'mean' or the sum of the squared weights be + * 0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for + * all tables. + * @return this Options instance. + */ + public Options combiners(String... combiners) { + this.combiners = Arrays.asList(combiners); + return this; + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public Options maxSequenceLengths(List maxSequenceLengths) { + this.maxSequenceLengths = maxSequenceLengths; + return this; + } + + /** + * Sets the maxSequenceLengths option. + * + * @param maxSequenceLengths the maxSequenceLengths option + * @return this Options instance. + */ + public Options maxSequenceLengths(Long... maxSequenceLengths) { + this.maxSequenceLengths = Arrays.asList(maxSequenceLengths); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Execute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Execute.java index dfcb6333097..6b19286c2a5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Execute.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Execute.java @@ -34,23 +34,42 @@ /** * Op that loads and executes a TPU program on a TPU device. - *

* For the internal use of the distributed TPU compiler. */ -@Operator(group = "tpu") +@Operator( + group = "tpu" +) public final class Execute extends RawOp implements Iterable> { - /** - * Factory method to create a class wrapping a new Execute operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUExecute"; + + private List> results; + + @SuppressWarnings("unchecked") + private Execute(Operation operation) { + super(operation); + int outputIdx = 0; + int resultsLength = operation.outputListLength("results"); + results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); + outputIdx += resultsLength; + } + + /** + * Factory method to create a class wrapping a new TPUExecute operation. + * * @param scope current scope - * @param args - * @param key - * @param Tresults + * @param args the args value + * @param key the key value + * @param Tresults the value of the Tresults property * @return a new instance of Execute */ - @Endpoint(describeByClass = true) - public static Execute create(Scope scope, Iterable> args, Operand key, List> Tresults) { + @Endpoint( + describeByClass = true + ) + public static Execute create(Scope scope, Iterable> args, Operand key, + List> Tresults) { OperationBuilder opBuilder = scope.env().opBuilder("TPUExecute", scope.makeOpName("Execute")); opBuilder.addInputList(Operands.asOutputs(args)); opBuilder.addInput(key.asOutput()); @@ -58,29 +77,19 @@ public static Execute create(Scope scope, Iterable> args, Operand> results() { return results; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) results.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUExecute"; - - private List> results; - - private Execute(Operation operation) { - super(operation); - int outputIdx = 0; - int resultsLength = operation.outputListLength("results"); - results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); - outputIdx += resultsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteAndUpdateVariables.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteAndUpdateVariables.java index 74269767bd1..529aaca1b98 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteAndUpdateVariables.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ExecuteAndUpdateVariables.java @@ -34,7 +34,6 @@ /** * Op that executes a program with optional in-place variable updates. - *

* It (optionally) reads device variables, loads and executes a TPU program on a * TPU device, and then (optionally) in-place updates variables using the program * outputs, as specified in attributes device_var_reads_indices (program input @@ -43,62 +42,73 @@ * program outputs are consumed by these variables will not appear in the op * output. For the internal use of the distributed TPU compiler. */ -@Operator(group = "tpu") +@Operator( + group = "tpu" +) public final class ExecuteAndUpdateVariables extends RawOp implements Iterable> { - /** - * Factory method to create a class wrapping a new ExecuteAndUpdateVariables operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUExecuteAndUpdateVariables"; + + private List> results; + + @SuppressWarnings("unchecked") + private ExecuteAndUpdateVariables(Operation operation) { + super(operation); + int outputIdx = 0; + int resultsLength = operation.outputListLength("results"); + results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); + outputIdx += resultsLength; + } + + /** + * Factory method to create a class wrapping a new TPUExecuteAndUpdateVariables operation. + * * @param scope current scope - * @param args - * @param key - * @param Tresults - * @param deviceVarReadsIndices - * @param deviceVarUpdatesIndices + * @param args the args value + * @param key the key value + * @param Tresults the value of the Tresults property + * @param deviceVarReadsIndices the value of the deviceVarReadsIndices property + * @param deviceVarUpdatesIndices the value of the deviceVarUpdatesIndices property * @return a new instance of ExecuteAndUpdateVariables */ - @Endpoint(describeByClass = true) - public static ExecuteAndUpdateVariables create(Scope scope, Iterable> args, Operand key, List> Tresults, List deviceVarReadsIndices, List deviceVarUpdatesIndices) { + @Endpoint( + describeByClass = true + ) + public static ExecuteAndUpdateVariables create(Scope scope, Iterable> args, + Operand key, List> Tresults, List deviceVarReadsIndices, + List deviceVarUpdatesIndices) { OperationBuilder opBuilder = scope.env().opBuilder("TPUExecuteAndUpdateVariables", scope.makeOpName("ExecuteAndUpdateVariables")); opBuilder.addInputList(Operands.asOutputs(args)); opBuilder.addInput(key.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Tresults", Operands.toDataTypes(Tresults)); long[] deviceVarReadsIndicesArray = new long[deviceVarReadsIndices.size()]; - for (int i = 0; i < deviceVarReadsIndicesArray.length; ++i) { + for (int i = 0 ; i < deviceVarReadsIndicesArray.length ; i++) { deviceVarReadsIndicesArray[i] = deviceVarReadsIndices.get(i); } opBuilder.setAttr("device_var_reads_indices", deviceVarReadsIndicesArray); long[] deviceVarUpdatesIndicesArray = new long[deviceVarUpdatesIndices.size()]; - for (int i = 0; i < deviceVarUpdatesIndicesArray.length; ++i) { + for (int i = 0 ; i < deviceVarUpdatesIndicesArray.length ; i++) { deviceVarUpdatesIndicesArray[i] = deviceVarUpdatesIndices.get(i); } opBuilder.setAttr("device_var_updates_indices", deviceVarUpdatesIndicesArray); return new ExecuteAndUpdateVariables(opBuilder.build()); } - + /** + * Gets results. + * + * @return results. */ public List> results() { return results; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) results.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUExecuteAndUpdateVariables"; - - private List> results; - - private ExecuteAndUpdateVariables(Operation operation) { - super(operation); - int outputIdx = 0; - int resultsLength = operation.outputListLength("results"); - results = Arrays.asList(operation.outputList(outputIdx, resultsLength)); - outputIdx += resultsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeue.java index 325db448246..ae20158f41e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeue.java @@ -26,53 +26,59 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A placeholder op for a value that will be fed into the computation. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class InfeedDequeue extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InfeedDequeue"; + + private Output output; + + private InfeedDequeue(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new InfeedDequeue operation. - * + * * @param scope current scope * @param dtype The type of elements in the tensor. * @param shape The shape of the tensor. + * @param data type for {@code InfeedDequeue} output and operands * @return a new instance of InfeedDequeue */ - @Endpoint(describeByClass = true) - public static InfeedDequeue create(Scope scope, Class dtype, Shape shape) { + @Endpoint( + describeByClass = true + ) + public static InfeedDequeue create(Scope scope, Class dtype, + Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("InfeedDequeue", scope.makeOpName("InfeedDequeue")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); - return new InfeedDequeue(opBuilder.build()); + return new InfeedDequeue<>(opBuilder.build()); } - + /** + * Gets output. * A tensor that will be provided using the infeed mechanism. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedDequeue"; - - private Output output; - - private InfeedDequeue(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeueTuple.java index 4816ea0a306..256cd8e687f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedDequeueTuple.java @@ -29,58 +29,64 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Fetches multiple values from infeed as an XLA tuple. */ public final class InfeedDequeueTuple extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "InfeedDequeueTuple"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private InfeedDequeueTuple(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + /** * Factory method to create a class wrapping a new InfeedDequeueTuple operation. - * + * * @param scope current scope - * @param dtypes The element types of each element in `outputs`. - * @param shapes The shapes of each tensor in `outputs`. + * @param dtypes The element types of each element in {@code outputs}. + * @param shapes The shapes of each tensor in {@code outputs}. * @return a new instance of InfeedDequeueTuple */ - @Endpoint(describeByClass = true) - public static InfeedDequeueTuple create(Scope scope, List> dtypes, List shapes) { + @Endpoint( + describeByClass = true + ) + public static InfeedDequeueTuple create(Scope scope, List> dtypes, + List shapes) { OperationBuilder opBuilder = scope.env().opBuilder("InfeedDequeueTuple", scope.makeOpName("InfeedDequeueTuple")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); return new InfeedDequeueTuple(opBuilder.build()); } - + /** + * Gets outputs. * A list of tensors that will be provided using the infeed mechanism. + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedDequeueTuple"; - - private List> outputs; - - private InfeedDequeueTuple(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueue.java index f5964ccbde5..059bcacccfe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueue.java @@ -17,6 +17,7 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -25,65 +26,34 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * An op which feeds a single Tensor value into the computation. */ public final class InfeedEnqueue extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shape The shape of the tensor. - */ - public Options shape(Shape shape) { - this.shape = shape; - return this; - } - - /** - * @param layout A vector holding the requested layout in minor-to-major sequence. - * If a layout attribute is passed, but its values are all -1, the layout will - * be computed by the infeed operation. - */ - public Options layout(List layout) { - this.layout = layout; - return this; - } - - /** - * @param deviceOrdinal The TPU device to use. This should be -1 when the Op - * is running on a TPU device, and >= 0 when the Op is running on the CPU - * device. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Shape shape; - private List layout; - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "InfeedEnqueue"; + + private InfeedEnqueue(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new InfeedEnqueue operation. - * + * * @param scope current scope * @param input A tensor that will be provided using the infeed mechanism. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of InfeedEnqueue */ - @Endpoint(describeByClass = true) - public static InfeedEnqueue create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static InfeedEnqueue create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("InfeedEnqueue", scope.makeOpName("InfeedEnqueue")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -94,7 +64,7 @@ public static InfeedEnqueue create(Scope scope, Operand input, } if (opts.layout != null) { long[] layoutArray = new long[opts.layout.size()]; - for (int i = 0; i < layoutArray.length; ++i) { + for (int i = 0 ; i < layoutArray.length ; i++) { layoutArray[i] = opts.layout.get(i); } opBuilder.setAttr("layout", layoutArray); @@ -106,36 +76,114 @@ public static InfeedEnqueue create(Scope scope, Operand input, } return new InfeedEnqueue(opBuilder.build()); } - + /** + * Sets the shape option. + * * @param shape The shape of the tensor. + * @return this Options instance. */ public static Options shape(Shape shape) { return new Options().shape(shape); } - + /** + * Sets the layout option. + * * @param layout A vector holding the requested layout in minor-to-major sequence. * If a layout attribute is passed, but its values are all -1, the layout will * be computed by the infeed operation. + * @return this Options instance. */ public static Options layout(List layout) { return new Options().layout(layout); } - + + /** + * Sets the layout option. + * + * @param layout A vector holding the requested layout in minor-to-major sequence. + * If a layout attribute is passed, but its values are all -1, the layout will + * be computed by the infeed operation. + * @return this Options instance. + */ + public static Options layout(Long[] layout) { + return new Options().layout(layout); + } + /** + * Sets the deviceOrdinal option. + * * @param deviceOrdinal The TPU device to use. This should be -1 when the Op - * is running on a TPU device, and >= 0 when the Op is running on the CPU + * is running on a TPU device, and >= 0 when the Op is running on the CPU * device. + * @return this Options instance. */ public static Options deviceOrdinal(Long deviceOrdinal) { return new Options().deviceOrdinal(deviceOrdinal); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedEnqueue"; - - private InfeedEnqueue(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueue} + */ + public static class Options { + private Shape shape; + + private List layout; + + private Long deviceOrdinal; + + private Options() { + } + + /** + * Sets the shape option. + * + * @param shape The shape of the tensor. + * @return this Options instance. + */ + public Options shape(Shape shape) { + this.shape = shape; + return this; + } + + /** + * Sets the layout option. + * + * @param layout A vector holding the requested layout in minor-to-major sequence. + * If a layout attribute is passed, but its values are all -1, the layout will + * be computed by the infeed operation. + * @return this Options instance. + */ + public Options layout(List layout) { + this.layout = layout; + return this; + } + + /** + * Sets the layout option. + * + * @param layout A vector holding the requested layout in minor-to-major sequence. + * If a layout attribute is passed, but its values are all -1, the layout will + * be computed by the infeed operation. + * @return this Options instance. + */ + public Options layout(Long... layout) { + this.layout = Arrays.asList(layout); + return this; + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. This should be -1 when the Op + * is running on a TPU device, and >= 0 when the Op is running on the CPU + * device. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueuePrelinearizedBuffer.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueuePrelinearizedBuffer.java index 11c71e10f32..6883770b646 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueuePrelinearizedBuffer.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueuePrelinearizedBuffer.java @@ -23,43 +23,34 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * An op which enqueues prelinearized buffer into TPU infeed. */ public final class InfeedEnqueuePrelinearizedBuffer extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueuePrelinearizedBuffer} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deviceOrdinal The TPU device to use. This should be -1 when the Op is running on a TPU device - * and = 0 when the Op is running on the CPU device. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "InfeedEnqueuePrelinearizedBuffer"; + + private InfeedEnqueuePrelinearizedBuffer(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new InfeedEnqueuePrelinearizedBuffer operation. - * + * * @param scope current scope * @param input A variant tensor representing linearized output. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of InfeedEnqueuePrelinearizedBuffer */ - @Endpoint(describeByClass = true) - public static InfeedEnqueuePrelinearizedBuffer create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static InfeedEnqueuePrelinearizedBuffer create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("InfeedEnqueuePrelinearizedBuffer", scope.makeOpName("InfeedEnqueuePrelinearizedBuffer")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -72,19 +63,37 @@ public static InfeedEnqueuePrelinearizedBuffer create(Scope scope, Operand in } return new InfeedEnqueuePrelinearizedBuffer(opBuilder.build()); } - + /** + * Sets the deviceOrdinal option. + * * @param deviceOrdinal The TPU device to use. This should be -1 when the Op is running on a TPU device * and = 0 when the Op is running on the CPU device. + * @return this Options instance. */ public static Options deviceOrdinal(Long deviceOrdinal) { return new Options().deviceOrdinal(deviceOrdinal); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedEnqueuePrelinearizedBuffer"; - - private InfeedEnqueuePrelinearizedBuffer(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueuePrelinearizedBuffer} + */ + public static class Options { + private Long deviceOrdinal; + + private Options() { + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. This should be -1 when the Op is running on a TPU device + * and = 0 when the Op is running on the CPU device. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueueTuple.java index 694a536703f..d72e70b184e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/InfeedEnqueueTuple.java @@ -17,6 +17,7 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,62 +27,39 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; /** * Feeds multiple Tensor values into the computation as an XLA tuple. */ public final class InfeedEnqueueTuple extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueueTuple} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param layouts A vector holding the requested layout in minor-to-major sequence for - * all the tuple shapes, in the order the shapes appear in the "shapes" input. - * The layout elements for a sub-shape can be set to -1, in which case the - * corresponding layout will be computed by the infeed operation. - */ - public Options layouts(List layouts) { - this.layouts = layouts; - return this; - } - - /** - * @param deviceOrdinal The TPU device to use. This should be -1 when the Op - * is running on a TPU device, and >= 0 when the Op is running on the CPU - * device. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private List layouts; - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "InfeedEnqueueTuple"; + + private InfeedEnqueueTuple(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new InfeedEnqueueTuple operation. - * + * * @param scope current scope * @param inputs A list of tensors that will be provided using the infeed mechanism. - * @param shapes The shapes of each tensor in `inputs`. - * @param options carries optional attributes values + * @param shapes The shapes of each tensor in {@code inputs}. + * @param options carries optional attribute values * @return a new instance of InfeedEnqueueTuple */ - @Endpoint(describeByClass = true) - public static InfeedEnqueueTuple create(Scope scope, Iterable> inputs, List shapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static InfeedEnqueueTuple create(Scope scope, Iterable> inputs, + List shapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("InfeedEnqueueTuple", scope.makeOpName("InfeedEnqueueTuple")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -89,7 +67,7 @@ public static InfeedEnqueueTuple create(Scope scope, Iterable> inputs for (Options opts : options) { if (opts.layouts != null) { long[] layoutsArray = new long[opts.layouts.size()]; - for (int i = 0; i < layoutsArray.length; ++i) { + for (int i = 0 ; i < layoutsArray.length ; i++) { layoutsArray[i] = opts.layouts.get(i); } opBuilder.setAttr("layouts", layoutsArray); @@ -101,30 +79,95 @@ public static InfeedEnqueueTuple create(Scope scope, Iterable> inputs } return new InfeedEnqueueTuple(opBuilder.build()); } - + /** + * Sets the layouts option. + * * @param layouts A vector holding the requested layout in minor-to-major sequence for - * all the tuple shapes, in the order the shapes appear in the "shapes" input. + * all the tuple shapes, in the order the shapes appear in the "shapes" input. * The layout elements for a sub-shape can be set to -1, in which case the * corresponding layout will be computed by the infeed operation. + * @return this Options instance. */ public static Options layouts(List layouts) { return new Options().layouts(layouts); } - + + /** + * Sets the layouts option. + * + * @param layouts A vector holding the requested layout in minor-to-major sequence for + * all the tuple shapes, in the order the shapes appear in the "shapes" input. + * The layout elements for a sub-shape can be set to -1, in which case the + * corresponding layout will be computed by the infeed operation. + * @return this Options instance. + */ + public static Options layouts(Long[] layouts) { + return new Options().layouts(layouts); + } + /** + * Sets the deviceOrdinal option. + * * @param deviceOrdinal The TPU device to use. This should be -1 when the Op - * is running on a TPU device, and >= 0 when the Op is running on the CPU + * is running on a TPU device, and >= 0 when the Op is running on the CPU * device. + * @return this Options instance. */ public static Options deviceOrdinal(Long deviceOrdinal) { return new Options().deviceOrdinal(deviceOrdinal); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "InfeedEnqueueTuple"; - - private InfeedEnqueueTuple(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.InfeedEnqueueTuple} + */ + public static class Options { + private List layouts; + + private Long deviceOrdinal; + + private Options() { + } + + /** + * Sets the layouts option. + * + * @param layouts A vector holding the requested layout in minor-to-major sequence for + * all the tuple shapes, in the order the shapes appear in the "shapes" input. + * The layout elements for a sub-shape can be set to -1, in which case the + * corresponding layout will be computed by the infeed operation. + * @return this Options instance. + */ + public Options layouts(List layouts) { + this.layouts = layouts; + return this; + } + + /** + * Sets the layouts option. + * + * @param layouts A vector holding the requested layout in minor-to-major sequence for + * all the tuple shapes, in the order the shapes appear in the "shapes" input. + * The layout elements for a sub-shape can be set to -1, in which case the + * corresponding layout will be computed by the infeed operation. + * @return this Options instance. + */ + public Options layouts(Long... layouts) { + this.layouts = Arrays.asList(layouts); + return this; + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. This should be -1 when the Op + * is running on a TPU device, and >= 0 when the Op is running on the CPU + * device. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParameters.java index 65747b5e8fe..7a496e02efd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingADAMParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load ADAM embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,58 +34,33 @@ * executed. */ public final class LoadTPUEmbeddingADAMParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingADAMParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingADAMParameters"; + + private LoadTPUEmbeddingADAMParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingADAMParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the ADAM optimization algorithm. * @param momenta Value of momenta used in the ADAM optimization algorithm. * @param velocities Value of velocities used in the ADAM optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingADAMParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingADAMParameters create(Scope scope, Operand parameters, Operand momenta, Operand velocities, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingADAMParameters create(Scope scope, Operand parameters, + Operand momenta, Operand velocities, Long numShards, Long shardId, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingADAMParameters", scope.makeOpName("LoadTPUEmbeddingADAMParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(momenta.asOutput()); @@ -110,32 +83,81 @@ public static LoadTPUEmbeddingADAMParameters create(Scope scope, Operand * An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,59 +34,34 @@ * executed. */ public final class LoadTPUEmbeddingADAMParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingADAMParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingADAMParametersGradAccumDebug"; + + private LoadTPUEmbeddingADAMParametersGradAccumDebug(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingADAMParametersGradAccumDebug operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the ADAM optimization algorithm. * @param momenta Value of momenta used in the ADAM optimization algorithm. * @param velocities Value of velocities used in the ADAM optimization algorithm. * @param gradientAccumulators Value of gradient_accumulators used in the ADAM optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingADAMParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingADAMParametersGradAccumDebug create(Scope scope, Operand parameters, Operand momenta, Operand velocities, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingADAMParametersGradAccumDebug create(Scope scope, + Operand parameters, Operand momenta, Operand velocities, + Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingADAMParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingADAMParametersGradAccumDebug")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(momenta.asOutput()); @@ -112,32 +85,81 @@ public static LoadTPUEmbeddingADAMParametersGradAccumDebug create(Scope scope, O } return new LoadTPUEmbeddingADAMParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingADAMParametersGradAccumDebug"; - - private LoadTPUEmbeddingADAMParametersGradAccumDebug(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingADAMParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParameters.java index 988aa11983e..4369c4feca6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdadeltaParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load Adadelta embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,58 +34,33 @@ * executed. */ public final class LoadTPUEmbeddingAdadeltaParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdadeltaParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingAdadeltaParameters"; + + private LoadTPUEmbeddingAdadeltaParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingAdadeltaParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the Adadelta optimization algorithm. * @param accumulators Value of accumulators used in the Adadelta optimization algorithm. * @param updates Value of updates used in the Adadelta optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingAdadeltaParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingAdadeltaParameters create(Scope scope, Operand parameters, Operand accumulators, Operand updates, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingAdadeltaParameters create(Scope scope, Operand parameters, + Operand accumulators, Operand updates, Long numShards, Long shardId, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingAdadeltaParameters", scope.makeOpName("LoadTPUEmbeddingAdadeltaParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); @@ -110,32 +83,81 @@ public static LoadTPUEmbeddingAdadeltaParameters create(Scope scope, Operand * An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,59 +34,34 @@ * executed. */ public final class LoadTPUEmbeddingAdadeltaParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingAdadeltaParametersGradAccumDebug"; + + private LoadTPUEmbeddingAdadeltaParametersGradAccumDebug(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingAdadeltaParametersGradAccumDebug operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the Adadelta optimization algorithm. * @param accumulators Value of accumulators used in the Adadelta optimization algorithm. * @param updates Value of updates used in the Adadelta optimization algorithm. * @param gradientAccumulators Value of gradient_accumulators used in the Adadelta optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingAdadeltaParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingAdadeltaParametersGradAccumDebug create(Scope scope, Operand parameters, Operand accumulators, Operand updates, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingAdadeltaParametersGradAccumDebug create(Scope scope, + Operand parameters, Operand accumulators, Operand updates, + Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingAdadeltaParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingAdadeltaParametersGradAccumDebug")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); @@ -112,32 +85,81 @@ public static LoadTPUEmbeddingAdadeltaParametersGradAccumDebug create(Scope scop } return new LoadTPUEmbeddingAdadeltaParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingAdadeltaParametersGradAccumDebug"; - - private LoadTPUEmbeddingAdadeltaParametersGradAccumDebug(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdadeltaParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParameters.java index f5136a9b431..947c20df3a1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingAdagradParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load Adagrad embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,57 +34,31 @@ * executed. */ public final class LoadTPUEmbeddingAdagradParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdagradParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingAdagradParameters"; + + private LoadTPUEmbeddingAdagradParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingAdagradParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the Adagrad optimization algorithm. * @param accumulators Value of accumulators used in the Adagrad optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingAdagradParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingAdagradParameters create(Scope scope, Operand parameters, Operand accumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingAdagradParameters create(Scope scope, Operand parameters, + Operand accumulators, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingAdagradParameters", scope.makeOpName("LoadTPUEmbeddingAdagradParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); @@ -108,32 +80,81 @@ public static LoadTPUEmbeddingAdagradParameters create(Scope scope, Operand * An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,58 +34,33 @@ * executed. */ public final class LoadTPUEmbeddingAdagradParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdagradParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingAdagradParametersGradAccumDebug"; + + private LoadTPUEmbeddingAdagradParametersGradAccumDebug(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingAdagradParametersGradAccumDebug operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the Adagrad optimization algorithm. * @param accumulators Value of accumulators used in the Adagrad optimization algorithm. * @param gradientAccumulators Value of gradient_accumulators used in the Adagrad optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingAdagradParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingAdagradParametersGradAccumDebug create(Scope scope, Operand parameters, Operand accumulators, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingAdagradParametersGradAccumDebug create(Scope scope, + Operand parameters, Operand accumulators, + Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingAdagradParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingAdagradParametersGradAccumDebug")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); @@ -110,32 +83,81 @@ public static LoadTPUEmbeddingAdagradParametersGradAccumDebug create(Scope scope } return new LoadTPUEmbeddingAdagradParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingAdagradParametersGradAccumDebug"; - - private LoadTPUEmbeddingAdagradParametersGradAccumDebug(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingAdagradParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingCenteredRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingCenteredRMSPropParameters.java index c5bb1300a86..5eb28d70048 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingCenteredRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingCenteredRMSPropParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load centered RMSProp embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,59 +34,34 @@ * executed. */ public final class LoadTPUEmbeddingCenteredRMSPropParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingCenteredRMSPropParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingCenteredRMSPropParameters"; + + private LoadTPUEmbeddingCenteredRMSPropParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingCenteredRMSPropParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the centered RMSProp optimization algorithm. * @param ms Value of ms used in the centered RMSProp optimization algorithm. * @param mom Value of mom used in the centered RMSProp optimization algorithm. * @param mg Value of mg used in the centered RMSProp optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingCenteredRMSPropParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingCenteredRMSPropParameters create(Scope scope, Operand parameters, Operand ms, Operand mom, Operand mg, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingCenteredRMSPropParameters create(Scope scope, + Operand parameters, Operand ms, Operand mom, + Operand mg, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingCenteredRMSPropParameters", scope.makeOpName("LoadTPUEmbeddingCenteredRMSPropParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -112,32 +85,81 @@ public static LoadTPUEmbeddingCenteredRMSPropParameters create(Scope scope, Oper } return new LoadTPUEmbeddingCenteredRMSPropParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingCenteredRMSPropParameters"; - - private LoadTPUEmbeddingCenteredRMSPropParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingCenteredRMSPropParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParameters.java index 2766f2dd3c3..2716c7a612a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingFTRLParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load FTRL embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,58 +34,33 @@ * executed. */ public final class LoadTPUEmbeddingFTRLParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingFTRLParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingFTRLParameters"; + + private LoadTPUEmbeddingFTRLParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingFTRLParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the FTRL optimization algorithm. * @param accumulators Value of accumulators used in the FTRL optimization algorithm. * @param linears Value of linears used in the FTRL optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingFTRLParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingFTRLParameters create(Scope scope, Operand parameters, Operand accumulators, Operand linears, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingFTRLParameters create(Scope scope, Operand parameters, + Operand accumulators, Operand linears, Long numShards, Long shardId, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingFTRLParameters", scope.makeOpName("LoadTPUEmbeddingFTRLParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); @@ -110,32 +83,81 @@ public static LoadTPUEmbeddingFTRLParameters create(Scope scope, Operand * An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,59 +34,34 @@ * executed. */ public final class LoadTPUEmbeddingFTRLParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingFTRLParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingFTRLParametersGradAccumDebug"; + + private LoadTPUEmbeddingFTRLParametersGradAccumDebug(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingFTRLParametersGradAccumDebug operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the FTRL optimization algorithm. * @param accumulators Value of accumulators used in the FTRL optimization algorithm. * @param linears Value of linears used in the FTRL optimization algorithm. * @param gradientAccumulators Value of gradient_accumulators used in the FTRL optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingFTRLParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingFTRLParametersGradAccumDebug create(Scope scope, Operand parameters, Operand accumulators, Operand linears, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingFTRLParametersGradAccumDebug create(Scope scope, + Operand parameters, Operand accumulators, Operand linears, + Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingFTRLParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingFTRLParametersGradAccumDebug")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); @@ -112,32 +85,81 @@ public static LoadTPUEmbeddingFTRLParametersGradAccumDebug create(Scope scope, O } return new LoadTPUEmbeddingFTRLParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingFTRLParametersGradAccumDebug"; - - private LoadTPUEmbeddingFTRLParametersGradAccumDebug(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingFTRLParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMDLAdagradLightParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMDLAdagradLightParameters.java index 0a066f25c34..faa63392307 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMDLAdagradLightParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMDLAdagradLightParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load MDL Adagrad Light embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,59 +34,34 @@ * executed. */ public final class LoadTPUEmbeddingMDLAdagradLightParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMDLAdagradLightParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingMDLAdagradLightParameters"; + + private LoadTPUEmbeddingMDLAdagradLightParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingMDLAdagradLightParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the MDL Adagrad Light optimization algorithm. * @param accumulators Value of accumulators used in the MDL Adagrad Light optimization algorithm. * @param weights Value of weights used in the MDL Adagrad Light optimization algorithm. * @param benefits Value of benefits used in the MDL Adagrad Light optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingMDLAdagradLightParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingMDLAdagradLightParameters create(Scope scope, Operand parameters, Operand accumulators, Operand weights, Operand benefits, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingMDLAdagradLightParameters create(Scope scope, + Operand parameters, Operand accumulators, Operand weights, + Operand benefits, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingMDLAdagradLightParameters", scope.makeOpName("LoadTPUEmbeddingMDLAdagradLightParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); @@ -112,32 +85,81 @@ public static LoadTPUEmbeddingMDLAdagradLightParameters create(Scope scope, Oper } return new LoadTPUEmbeddingMDLAdagradLightParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingMDLAdagradLightParameters"; - - private LoadTPUEmbeddingMDLAdagradLightParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMDLAdagradLightParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParameters.java index 4f5fe8467bb..73a429740b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingMomentumParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load Momentum embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,57 +34,31 @@ * executed. */ public final class LoadTPUEmbeddingMomentumParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMomentumParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingMomentumParameters"; + + private LoadTPUEmbeddingMomentumParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingMomentumParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the Momentum optimization algorithm. * @param momenta Value of momenta used in the Momentum optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingMomentumParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingMomentumParameters create(Scope scope, Operand parameters, Operand momenta, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingMomentumParameters create(Scope scope, Operand parameters, + Operand momenta, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingMomentumParameters", scope.makeOpName("LoadTPUEmbeddingMomentumParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(momenta.asOutput()); @@ -108,32 +80,81 @@ public static LoadTPUEmbeddingMomentumParameters create(Scope scope, Operand * An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,58 +34,33 @@ * executed. */ public final class LoadTPUEmbeddingMomentumParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMomentumParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingMomentumParametersGradAccumDebug"; + + private LoadTPUEmbeddingMomentumParametersGradAccumDebug(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingMomentumParametersGradAccumDebug operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the Momentum optimization algorithm. * @param momenta Value of momenta used in the Momentum optimization algorithm. * @param gradientAccumulators Value of gradient_accumulators used in the Momentum optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingMomentumParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingMomentumParametersGradAccumDebug create(Scope scope, Operand parameters, Operand momenta, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingMomentumParametersGradAccumDebug create(Scope scope, + Operand parameters, Operand momenta, + Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingMomentumParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingMomentumParametersGradAccumDebug")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(momenta.asOutput()); @@ -110,32 +83,81 @@ public static LoadTPUEmbeddingMomentumParametersGradAccumDebug create(Scope scop } return new LoadTPUEmbeddingMomentumParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingMomentumParametersGradAccumDebug"; - - private LoadTPUEmbeddingMomentumParametersGradAccumDebug(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingMomentumParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParameters.java index 064e81fe5cc..ce4ce4ddb6a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load proximal Adagrad embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,57 +34,32 @@ * executed. */ public final class LoadTPUEmbeddingProximalAdagradParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalAdagradParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingProximalAdagradParameters"; + + private LoadTPUEmbeddingProximalAdagradParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingProximalAdagradParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the proximal Adagrad optimization algorithm. * @param accumulators Value of accumulators used in the proximal Adagrad optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingProximalAdagradParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingProximalAdagradParameters create(Scope scope, Operand parameters, Operand accumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingProximalAdagradParameters create(Scope scope, + Operand parameters, Operand accumulators, Long numShards, Long shardId, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingProximalAdagradParameters", scope.makeOpName("LoadTPUEmbeddingProximalAdagradParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); @@ -108,32 +81,81 @@ public static LoadTPUEmbeddingProximalAdagradParameters create(Scope scope, Oper } return new LoadTPUEmbeddingProximalAdagradParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalAdagradParameters"; - - private LoadTPUEmbeddingProximalAdagradParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalAdagradParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java index 318d1e53220..858ee5dbf0a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load proximal Adagrad embedding parameters with debug support. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,58 +34,33 @@ * executed. */ public final class LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug"; + + private LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the proximal Adagrad optimization algorithm. * @param accumulators Value of accumulators used in the proximal Adagrad optimization algorithm. * @param gradientAccumulators Value of gradient_accumulators used in the proximal Adagrad optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug create(Scope scope, Operand parameters, Operand accumulators, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug create(Scope scope, + Operand parameters, Operand accumulators, + Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(accumulators.asOutput()); @@ -110,32 +83,81 @@ public static LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug create(Sco } return new LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug"; - - private LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParameters.java index d7d35b46513..179616df417 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParameters.java @@ -23,64 +23,39 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** + * The LoadTPUEmbeddingProximalYogiParameters operation */ public final class LoadTPUEmbeddingProximalYogiParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalYogiParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingProximalYogiParameters"; + + private LoadTPUEmbeddingProximalYogiParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingProximalYogiParameters operation. - * + * * @param scope current scope - * @param parameters - * @param v - * @param m - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param parameters the parameters value + * @param v the v value + * @param m the m value + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingProximalYogiParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingProximalYogiParameters create(Scope scope, Operand parameters, Operand v, Operand m, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingProximalYogiParameters create(Scope scope, + Operand parameters, Operand v, Operand m, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingProximalYogiParameters", scope.makeOpName("LoadTPUEmbeddingProximalYogiParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(v.asOutput()); @@ -103,32 +78,81 @@ public static LoadTPUEmbeddingProximalYogiParameters create(Scope scope, Operand } return new LoadTPUEmbeddingProximalYogiParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalYogiParameters"; - - private LoadTPUEmbeddingProximalYogiParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalYogiParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.java index 2f70ec714d0..dc999e0b256 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingProximalYogiParametersGradAccumDebug.java @@ -23,65 +23,40 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** + * The LoadTPUEmbeddingProximalYogiParametersGradAccumDebug operation */ public final class LoadTPUEmbeddingProximalYogiParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingProximalYogiParametersGradAccumDebug"; + + private LoadTPUEmbeddingProximalYogiParametersGradAccumDebug(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingProximalYogiParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param parameters - * @param v - * @param m - * @param gradientAccumulators - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param parameters the parameters value + * @param v the v value + * @param m the m value + * @param gradientAccumulators the gradientAccumulators value + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingProximalYogiParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingProximalYogiParametersGradAccumDebug create(Scope scope, Operand parameters, Operand v, Operand m, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingProximalYogiParametersGradAccumDebug create(Scope scope, + Operand parameters, Operand v, Operand m, + Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingProximalYogiParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingProximalYogiParametersGradAccumDebug")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(v.asOutput()); @@ -105,32 +80,81 @@ public static LoadTPUEmbeddingProximalYogiParametersGradAccumDebug create(Scope } return new LoadTPUEmbeddingProximalYogiParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingProximalYogiParametersGradAccumDebug"; - - private LoadTPUEmbeddingProximalYogiParametersGradAccumDebug(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingProximalYogiParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParameters.java index 5ac3a0a58ee..98492be993a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingRMSPropParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load RMSProp embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,58 +34,33 @@ * executed. */ public final class LoadTPUEmbeddingRMSPropParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingRMSPropParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingRMSPropParameters"; + + private LoadTPUEmbeddingRMSPropParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingRMSPropParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the RMSProp optimization algorithm. * @param ms Value of ms used in the RMSProp optimization algorithm. * @param mom Value of mom used in the RMSProp optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingRMSPropParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingRMSPropParameters create(Scope scope, Operand parameters, Operand ms, Operand mom, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingRMSPropParameters create(Scope scope, Operand parameters, + Operand ms, Operand mom, Long numShards, Long shardId, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingRMSPropParameters", scope.makeOpName("LoadTPUEmbeddingRMSPropParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -110,32 +83,81 @@ public static LoadTPUEmbeddingRMSPropParameters create(Scope scope, Operand * An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,59 +34,34 @@ * executed. */ public final class LoadTPUEmbeddingRMSPropParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingRMSPropParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingRMSPropParametersGradAccumDebug"; + + private LoadTPUEmbeddingRMSPropParametersGradAccumDebug(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingRMSPropParametersGradAccumDebug operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the RMSProp optimization algorithm. * @param ms Value of ms used in the RMSProp optimization algorithm. * @param mom Value of mom used in the RMSProp optimization algorithm. * @param gradientAccumulators Value of gradient_accumulators used in the RMSProp optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingRMSPropParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingRMSPropParametersGradAccumDebug create(Scope scope, Operand parameters, Operand ms, Operand mom, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingRMSPropParametersGradAccumDebug create(Scope scope, + Operand parameters, Operand ms, Operand mom, + Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingRMSPropParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingRMSPropParametersGradAccumDebug")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -112,32 +85,81 @@ public static LoadTPUEmbeddingRMSPropParametersGradAccumDebug create(Scope scope } return new LoadTPUEmbeddingRMSPropParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingRMSPropParametersGradAccumDebug"; - - private LoadTPUEmbeddingRMSPropParametersGradAccumDebug(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingRMSPropParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParameters.java index 43bf95cb2fa..98edf6c04da 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParameters.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load SGD embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,56 +34,30 @@ * executed. */ public final class LoadTPUEmbeddingStochasticGradientDescentParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingStochasticGradientDescentParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingStochasticGradientDescentParameters"; + + private LoadTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingStochasticGradientDescentParameters operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the stochastic gradient descent optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingStochasticGradientDescentParameters */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingStochasticGradientDescentParameters create(Scope scope, Operand parameters, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingStochasticGradientDescentParameters create(Scope scope, + Operand parameters, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingStochasticGradientDescentParameters", scope.makeOpName("LoadTPUEmbeddingStochasticGradientDescentParameters")); opBuilder.addInput(parameters.asOutput()); opBuilder = scope.apply(opBuilder); @@ -106,32 +78,81 @@ public static LoadTPUEmbeddingStochasticGradientDescentParameters create(Scope s } return new LoadTPUEmbeddingStochasticGradientDescentParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingStochasticGradientDescentParameters"; - - private LoadTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingStochasticGradientDescentParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java index ed7b16f59b5..ec195d07ca1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java @@ -23,12 +23,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Load SGD embedding parameters. - *

* An op that loads optimization parameters into HBM for embedding. Must be * preceded by a ConfigureTPUEmbeddingHost op that sets up the correct * embedding table configuration. For example, this op is used to install @@ -36,57 +34,32 @@ * executed. */ public final class LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"; + + private LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug operation. - * + * * @param scope current scope * @param parameters Value of parameters used in the stochastic gradient descent optimization algorithm. * @param gradientAccumulators Value of gradient_accumulators used in the Adadelta optimization algorithm. - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug create(Scope scope, Operand parameters, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug create( + Scope scope, Operand parameters, Operand gradientAccumulators, + Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug", scope.makeOpName("LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug")); opBuilder.addInput(parameters.asOutput()); opBuilder.addInput(gradientAccumulators.asOutput()); @@ -108,32 +81,81 @@ public static LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug } return new LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"; - - private LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.LoadTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java index 1490def25ad..a3b286fd850 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OrdinalSelector.java @@ -24,51 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; /** * A TPU core selector Op. - *

* This Op produces a set of TPU cores (for warm-up) or a single TPU core * (for regular inference) to execute the TPU program on. The output is * consumed by TPUPartitionedCall. */ public final class OrdinalSelector extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new OrdinalSelector operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUOrdinalSelector"; + + private Output deviceOrdinals; + + private OrdinalSelector(Operation operation) { + super(operation); + int outputIdx = 0; + deviceOrdinals = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new TPUOrdinalSelector operation. + * * @param scope current scope * @return a new instance of OrdinalSelector */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OrdinalSelector create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("TPUOrdinalSelector", scope.makeOpName("OrdinalSelector")); opBuilder = scope.apply(opBuilder); return new OrdinalSelector(opBuilder.build()); } - + /** + * Gets deviceOrdinals. * A vector 1 or more TPU cores. + * @return deviceOrdinals. */ public Output deviceOrdinals() { return deviceOrdinals; } - + @Override public Output asOutput() { return deviceOrdinals; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUOrdinalSelector"; - - private Output deviceOrdinals; - - private OrdinalSelector(Operation operation) { - super(operation); - int outputIdx = 0; - deviceOrdinals = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeue.java index e5aa5a35ed7..a2aab40fad4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeue.java @@ -26,50 +26,43 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Retrieves a single tensor from the computation outfeed. - *

* This operation will block indefinitely until data is available. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class OutfeedDequeue extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.OutfeedDequeue} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deviceOrdinal The TPU device to use. This should be -1 when the Op - * is running on a TPU device, and >= 0 when the Op is running on the CPU - * device. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "OutfeedDequeue"; + + private Output output; + + private OutfeedDequeue(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new OutfeedDequeue operation. - * + * * @param scope current scope * @param dtype The type of elements in the tensor. * @param shape The shape of the tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code OutfeedDequeue} output and operands * @return a new instance of OutfeedDequeue */ - @Endpoint(describeByClass = true) - public static OutfeedDequeue create(Scope scope, Class dtype, Shape shape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OutfeedDequeue create(Scope scope, Class dtype, Shape shape, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeue", scope.makeOpName("OutfeedDequeue")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); @@ -81,38 +74,55 @@ public static OutfeedDequeue create(Scope scope, Class d } } } - return new OutfeedDequeue(opBuilder.build()); + return new OutfeedDequeue<>(opBuilder.build()); } - + /** + * Sets the deviceOrdinal option. + * * @param deviceOrdinal The TPU device to use. This should be -1 when the Op - * is running on a TPU device, and >= 0 when the Op is running on the CPU + * is running on a TPU device, and >= 0 when the Op is running on the CPU * device. + * @return this Options instance. */ public static Options deviceOrdinal(Long deviceOrdinal) { return new Options().deviceOrdinal(deviceOrdinal); } - + /** + * Gets output. * A tensor that will be read from the device outfeed. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedDequeue"; - - private Output output; - - private OutfeedDequeue(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.OutfeedDequeue} + */ + public static class Options { + private Long deviceOrdinal; + + private Options() { + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. This should be -1 when the Op + * is running on a TPU device, and >= 0 when the Op is running on the CPU + * device. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTuple.java index 705666e1f02..51ece781c08 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTuple.java @@ -29,54 +29,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Retrieve multiple values from the computation outfeed. - *

- * This operation will block indefinitely until data is available. Output `i` - * corresponds to XLA tuple element `i`. + * This operation will block indefinitely until data is available. Output {@code i} + * corresponds to XLA tuple element {@code i}. */ public final class OutfeedDequeueTuple extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.OutfeedDequeueTuple} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deviceOrdinal The TPU device to use. This should be -1 when the Op - * is running on a TPU device, and >= 0 when the Op is running on the CPU - * device. - */ - public Options deviceOrdinal(Long deviceOrdinal) { - this.deviceOrdinal = deviceOrdinal; - return this; - } - - private Long deviceOrdinal; - - private Options() { - } + public static final String OP_NAME = "OutfeedDequeueTuple"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private OutfeedDequeueTuple(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; } - + /** * Factory method to create a class wrapping a new OutfeedDequeueTuple operation. - * + * * @param scope current scope - * @param dtypes The element types of each element in `outputs`. - * @param shapes The shapes of each tensor in `outputs`. - * @param options carries optional attributes values + * @param dtypes The element types of each element in {@code outputs}. + * @param shapes The shapes of each tensor in {@code outputs}. + * @param options carries optional attribute values * @return a new instance of OutfeedDequeueTuple */ - @Endpoint(describeByClass = true) - public static OutfeedDequeueTuple create(Scope scope, List> dtypes, List shapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static OutfeedDequeueTuple create(Scope scope, List> dtypes, + List shapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeueTuple", scope.makeOpName("OutfeedDequeueTuple")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -89,39 +84,54 @@ public static OutfeedDequeueTuple create(Scope scope, List= 0 when the Op is running on the CPU + * is running on a TPU device, and >= 0 when the Op is running on the CPU * device. + * @return this Options instance. */ public static Options deviceOrdinal(Long deviceOrdinal) { return new Options().deviceOrdinal(deviceOrdinal); } - + /** + * Gets outputs. * A list of tensors that will be read from the outfeed. + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedDequeueTuple"; - - private List> outputs; - - private OutfeedDequeueTuple(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.OutfeedDequeueTuple} + */ + public static class Options { + private Long deviceOrdinal; + + private Options() { + } + + /** + * Sets the deviceOrdinal option. + * + * @param deviceOrdinal The TPU device to use. This should be -1 when the Op + * is running on a TPU device, and >= 0 when the Op is running on the CPU + * device. + * @return this Options instance. + */ + public Options deviceOrdinal(Long deviceOrdinal) { + this.deviceOrdinal = deviceOrdinal; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTupleV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTupleV2.java index b3eb52c50c6..e6e5f3dfaf4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTupleV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueTupleV2.java @@ -29,67 +29,72 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Retrieve multiple values from the computation outfeed. Device ordinal is a * tensor allowing dynamic outfeed. - *

- * This operation will block indefinitely until data is available. Output `i` - * corresponds to XLA tuple element `i`. + * This operation will block indefinitely until data is available. Output {@code i} + * corresponds to XLA tuple element {@code i}. */ public final class OutfeedDequeueTupleV2 extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OutfeedDequeueTupleV2"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private OutfeedDequeueTupleV2(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + /** * Factory method to create a class wrapping a new OutfeedDequeueTupleV2 operation. - * + * * @param scope current scope * @param deviceOrdinal An int scalar tensor, representing the TPU device to use. This should be -1 when - * the Op is running on a TPU device, and >= 0 when the Op is running on the CPU + * the Op is running on a TPU device, and >= 0 when the Op is running on the CPU * device. - * @param dtypes The element types of each element in `outputs`. - * @param shapes The shapes of each tensor in `outputs`. + * @param dtypes The element types of each element in {@code outputs}. + * @param shapes The shapes of each tensor in {@code outputs}. * @return a new instance of OutfeedDequeueTupleV2 */ - @Endpoint(describeByClass = true) - public static OutfeedDequeueTupleV2 create(Scope scope, Operand deviceOrdinal, List> dtypes, List shapes) { + @Endpoint( + describeByClass = true + ) + public static OutfeedDequeueTupleV2 create(Scope scope, Operand deviceOrdinal, + List> dtypes, List shapes) { OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeueTupleV2", scope.makeOpName("OutfeedDequeueTupleV2")); opBuilder.addInput(deviceOrdinal.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtypes", Operands.toDataTypes(dtypes)); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); return new OutfeedDequeueTupleV2(opBuilder.build()); } - + /** + * Gets outputs. * A list of tensors that will be read from the outfeed. + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedDequeueTupleV2"; - - private List> outputs; - - private OutfeedDequeueTupleV2(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList(operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueV2.java index a461869f5bc..1f176f35da8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedDequeueV2.java @@ -26,61 +26,66 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Retrieves a single tensor from the computation outfeed. Device ordinal is a * tensor allowing dynamic outfeed. - *

* This operation will block indefinitely until data is available. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ public final class OutfeedDequeueV2 extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OutfeedDequeueV2"; + + private Output output; + + private OutfeedDequeueV2(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new OutfeedDequeueV2 operation. - * + * * @param scope current scope * @param deviceOrdinal An int scalar tensor, representing the TPU device to use. This should be -1 when - * the Op is running on a TPU device, and >= 0 when the Op is running on the CPU + * the Op is running on a TPU device, and >= 0 when the Op is running on the CPU * device. * @param dtype The type of elements in the tensor. * @param shape The shape of the tensor. + * @param data type for {@code OutfeedDequeueV2} output and operands * @return a new instance of OutfeedDequeueV2 */ - @Endpoint(describeByClass = true) - public static OutfeedDequeueV2 create(Scope scope, Operand deviceOrdinal, Class dtype, Shape shape) { + @Endpoint( + describeByClass = true + ) + public static OutfeedDequeueV2 create(Scope scope, + Operand deviceOrdinal, Class dtype, Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeueV2", scope.makeOpName("OutfeedDequeueV2")); opBuilder.addInput(deviceOrdinal.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("shape", shape); - return new OutfeedDequeueV2(opBuilder.build()); + return new OutfeedDequeueV2<>(opBuilder.build()); } - + /** + * Gets output. * A tensor that will be read from the device outfeed. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedDequeueV2"; - - private Output output; - - private OutfeedDequeueV2(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueue.java index 27b13bcae61..0f418ed124b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueue.java @@ -23,33 +23,35 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Enqueue a Tensor on the computation outfeed. */ public final class OutfeedEnqueue extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OutfeedEnqueue"; + + private OutfeedEnqueue(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new OutfeedEnqueue operation. - * + * * @param scope current scope * @param input A tensor that will be inserted into the outfeed queue. * @return a new instance of OutfeedEnqueue */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OutfeedEnqueue create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("OutfeedEnqueue", scope.makeOpName("OutfeedEnqueue")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new OutfeedEnqueue(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedEnqueue"; - - private OutfeedEnqueue(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueueTuple.java index 8826f495013..e5d407a6560 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/OutfeedEnqueueTuple.java @@ -24,33 +24,35 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; /** * Enqueue multiple Tensor values on the computation outfeed. */ public final class OutfeedEnqueueTuple extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "OutfeedEnqueueTuple"; + + private OutfeedEnqueueTuple(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new OutfeedEnqueueTuple operation. - * + * * @param scope current scope * @param inputs A list of tensors that will be inserted into the outfeed queue as an * XLA tuple. * @return a new instance of OutfeedEnqueueTuple */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static OutfeedEnqueueTuple create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("OutfeedEnqueueTuple", scope.makeOpName("OutfeedEnqueueTuple")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); return new OutfeedEnqueueTuple(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "OutfeedEnqueueTuple"; - - private OutfeedEnqueueTuple(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedInput.java index 6d93c007546..4ecdd4eac74 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedInput.java @@ -30,42 +30,40 @@ /** * An op that groups a list of partitioned inputs together. This op - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "tpu") +@Operator( + group = "tpu" +) public final class PartitionedInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param partitionDim An integer describles which dimension is partitioned. -1 means - * those inputs are replicated. - */ - public Options partitionDim(Long partitionDim) { - this.partitionDim = partitionDim; - return this; - } - - private Long partitionDim; - - private Options() { - } + public static final String OP_NAME = "TPUPartitionedInput"; + + private Output output; + + private PartitionedInput(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new PartitionedInput operation. - * + * Factory method to create a class wrapping a new TPUPartitionedInput operation. + * * @param scope current scope * @param inputs A list of partitioned inputs which must have the same shape. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code TPUPartitionedInput} output and operands * @return a new instance of PartitionedInput */ - @Endpoint(describeByClass = true) - public static PartitionedInput create(Scope scope, Iterable> inputs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static PartitionedInput create(Scope scope, + Iterable> inputs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TPUPartitionedInput", scope.makeOpName("PartitionedInput")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); @@ -76,37 +74,53 @@ public static PartitionedInput create(Scope scope, Iterable } } } - return new PartitionedInput(opBuilder.build()); + return new PartitionedInput<>(opBuilder.build()); } - + /** + * Sets the partitionDim option. + * * @param partitionDim An integer describles which dimension is partitioned. -1 means * those inputs are replicated. + * @return this Options instance. */ public static Options partitionDim(Long partitionDim) { return new Options().partitionDim(partitionDim); } - + /** + * Gets output. * A handle which represents the full shape of partitioned tensors. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUPartitionedInput"; - - private Output output; - - private PartitionedInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedInput} + */ + public static class Options { + private Long partitionDim; + + private Options() { + } + + /** + * Sets the partitionDim option. + * + * @param partitionDim An integer describles which dimension is partitioned. -1 means + * those inputs are replicated. + * @return this Options instance. + */ + public Options partitionDim(Long partitionDim) { + this.partitionDim = partitionDim; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedOutput.java index 6d14d2fd307..3211bcd3faf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PartitionedOutput.java @@ -32,44 +32,45 @@ /** * An op that demultiplexes a tensor to be sharded by XLA to a list of partitioned - *

* outputs outside the XLA computation. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "tpu") +@Operator( + group = "tpu" +) public final class PartitionedOutput extends RawOp implements Iterable> { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedOutput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param partitionDim An integer describles which dimension is partitioned. - */ - public Options partitionDim(Long partitionDim) { - this.partitionDim = partitionDim; - return this; - } - - private Long partitionDim; - - private Options() { - } + public static final String OP_NAME = "TPUPartitionedOutput"; + + private List> output; + + @SuppressWarnings("unchecked") + private PartitionedOutput(Operation operation) { + super(operation); + int outputIdx = 0; + int outputLength = operation.outputListLength("output"); + output = Arrays.asList((Output[]) operation.outputList(outputIdx, outputLength)); + outputIdx += outputLength; } - + /** - * Factory method to create a class wrapping a new PartitionedOutput operation. - * + * Factory method to create a class wrapping a new TPUPartitionedOutput operation. + * * @param scope current scope * @param inputs A tensor which represents the full shape of partitioned tensors. - * @param numSplits - * @param options carries optional attributes values + * @param numSplits the value of the numSplits property + * @param options carries optional attribute values + * @param data type for {@code TPUPartitionedOutput} output and operands * @return a new instance of PartitionedOutput */ - @Endpoint(describeByClass = true) - public static PartitionedOutput create(Scope scope, Operand inputs, Long numSplits, Options... options) { + @Endpoint( + describeByClass = true + ) + public static PartitionedOutput create(Scope scope, Operand inputs, + Long numSplits, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TPUPartitionedOutput", scope.makeOpName("PartitionedOutput")); opBuilder.addInput(inputs.asOutput()); opBuilder = scope.apply(opBuilder); @@ -81,40 +82,52 @@ public static PartitionedOutput create(Scope scope, Operand } } } - return new PartitionedOutput(opBuilder.build()); + return new PartitionedOutput<>(opBuilder.build()); } - + /** + * Sets the partitionDim option. + * * @param partitionDim An integer describles which dimension is partitioned. + * @return this Options instance. */ public static Options partitionDim(Long partitionDim) { return new Options().partitionDim(partitionDim); } - + /** + * Gets output. * A list of partitioned inputs which must have the same shape. + * @return output. */ public List> output() { return output; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) output.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUPartitionedOutput"; - - private List> output; - - @SuppressWarnings("unchecked") - private PartitionedOutput(Operation operation) { - super(operation); - int outputIdx = 0; - int outputLength = operation.outputListLength("output"); - output = Arrays.asList((Output[])operation.outputList(outputIdx, outputLength)); - outputIdx += outputLength; + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.PartitionedOutput} + */ + public static class Options { + private Long partitionDim; + + private Options() { + } + + /** + * Sets the partitionDim option. + * + * @param partitionDim An integer describles which dimension is partitioned. + * @return this Options instance. + */ + public Options partitionDim(Long partitionDim) { + this.partitionDim = partitionDim; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Prelinearize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Prelinearize.java index 5cce51a5bf2..473b898697d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Prelinearize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/Prelinearize.java @@ -17,6 +17,7 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -26,54 +27,39 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * An op which linearizes one Tensor value to an opaque variant tensor. */ public final class Prelinearize extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.Prelinearize} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param shape The shape of the tensor. - */ - public Options shape(Shape shape) { - this.shape = shape; - return this; - } - - /** - * @param layout A vector holding the requested layout in minor-to-major sequence. If a layout - * attribute is passed but its values are all -1 the layout will be computed by - * the infeed operation. - */ - public Options layout(List layout) { - this.layout = layout; - return this; - } - - private Shape shape; - private List layout; - - private Options() { - } + public static final String OP_NAME = "Prelinearize"; + + private Output output; + + @SuppressWarnings("unchecked") + private Prelinearize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new Prelinearize operation. - * + * * @param scope current scope * @param input A tensor that will be linearized. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of Prelinearize */ - @Endpoint(describeByClass = true) - public static Prelinearize create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static Prelinearize create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Prelinearize", scope.makeOpName("Prelinearize")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -84,7 +70,7 @@ public static Prelinearize create(Scope scope, Operand input, O } if (opts.layout != null) { long[] layoutArray = new long[opts.layout.size()]; - for (int i = 0; i < layoutArray.length; ++i) { + for (int i = 0 ; i < layoutArray.length ; i++) { layoutArray[i] = opts.layout.get(i); } opBuilder.setAttr("layout", layoutArray); @@ -93,43 +79,102 @@ public static Prelinearize create(Scope scope, Operand input, O } return new Prelinearize(opBuilder.build()); } - + /** + * Sets the shape option. + * * @param shape The shape of the tensor. + * @return this Options instance. */ public static Options shape(Shape shape) { return new Options().shape(shape); } - + /** + * Sets the layout option. + * * @param layout A vector holding the requested layout in minor-to-major sequence. If a layout * attribute is passed but its values are all -1 the layout will be computed by * the infeed operation. + * @return this Options instance. */ public static Options layout(List layout) { return new Options().layout(layout); } - + + /** + * Sets the layout option. + * + * @param layout A vector holding the requested layout in minor-to-major sequence. If a layout + * attribute is passed but its values are all -1 the layout will be computed by + * the infeed operation. + * @return this Options instance. + */ + public static Options layout(Long[] layout) { + return new Options().layout(layout); + } + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "Prelinearize"; - - private Output output; - - private Prelinearize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.Prelinearize} + */ + public static class Options { + private Shape shape; + + private List layout; + + private Options() { + } + + /** + * Sets the shape option. + * + * @param shape The shape of the tensor. + * @return this Options instance. + */ + public Options shape(Shape shape) { + this.shape = shape; + return this; + } + + /** + * Sets the layout option. + * + * @param layout A vector holding the requested layout in minor-to-major sequence. If a layout + * attribute is passed but its values are all -1 the layout will be computed by + * the infeed operation. + * @return this Options instance. + */ + public Options layout(List layout) { + this.layout = layout; + return this; + } + + /** + * Sets the layout option. + * + * @param layout A vector holding the requested layout in minor-to-major sequence. If a layout + * attribute is passed but its values are all -1 the layout will be computed by + * the infeed operation. + * @return this Options instance. + */ + public Options layout(Long... layout) { + this.layout = Arrays.asList(layout); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PrelinearizeTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PrelinearizeTuple.java index 73385063175..f8d5b308265 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PrelinearizeTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/PrelinearizeTuple.java @@ -17,6 +17,7 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -27,52 +28,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * An op which linearizes multiple Tensor values to an opaque variant tensor. */ public final class PrelinearizeTuple extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.PrelinearizeTuple} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param layouts A vector holding the requested layout in minor-to-major sequence for all the - * tuple shapes in the order the shapes appear in the "shapes" input. The layout - * elements for a sub-shape can be set to -1 in which case the corresponding layout - * will be computed by the infeed operation. - */ - public Options layouts(List layouts) { - this.layouts = layouts; - return this; - } - - private List layouts; - - private Options() { - } + public static final String OP_NAME = "PrelinearizeTuple"; + + private Output output; + + @SuppressWarnings("unchecked") + private PrelinearizeTuple(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new PrelinearizeTuple operation. - * + * * @param scope current scope * @param inputs A list of tensors that will be provided using the infeed mechanism. - * @param shapes The shapes of each tensor in `inputs`. - * @param options carries optional attributes values + * @param shapes The shapes of each tensor in {@code inputs}. + * @param options carries optional attribute values * @return a new instance of PrelinearizeTuple */ - @Endpoint(describeByClass = true) - public static PrelinearizeTuple create(Scope scope, Iterable> inputs, List shapes, Options... options) { + @Endpoint( + describeByClass = true + ) + public static PrelinearizeTuple create(Scope scope, Iterable> inputs, + List shapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PrelinearizeTuple", scope.makeOpName("PrelinearizeTuple")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); Shape[] shapesArray = new Shape[shapes.size()]; - for (int i = 0; i < shapesArray.length; ++i) { + for (int i = 0 ; i < shapesArray.length ; i++) { shapesArray[i] = shapes.get(i); } opBuilder.setAttr("shapes", shapesArray); @@ -80,7 +74,7 @@ public static PrelinearizeTuple create(Scope scope, Iterable> inputs, for (Options opts : options) { if (opts.layouts != null) { long[] layoutsArray = new long[opts.layouts.size()]; - for (int i = 0; i < layoutsArray.length; ++i) { + for (int i = 0 ; i < layoutsArray.length ; i++) { layoutsArray[i] = opts.layouts.get(i); } opBuilder.setAttr("layouts", layoutsArray); @@ -89,37 +83,83 @@ public static PrelinearizeTuple create(Scope scope, Iterable> inputs, } return new PrelinearizeTuple(opBuilder.build()); } - + /** + * Sets the layouts option. + * * @param layouts A vector holding the requested layout in minor-to-major sequence for all the - * tuple shapes in the order the shapes appear in the "shapes" input. The layout + * tuple shapes in the order the shapes appear in the "shapes" input. The layout * elements for a sub-shape can be set to -1 in which case the corresponding layout * will be computed by the infeed operation. + * @return this Options instance. */ public static Options layouts(List layouts) { return new Options().layouts(layouts); } - + + /** + * Sets the layouts option. + * + * @param layouts A vector holding the requested layout in minor-to-major sequence for all the + * tuple shapes in the order the shapes appear in the "shapes" input. The layout + * elements for a sub-shape can be set to -1 in which case the corresponding layout + * will be computed by the infeed operation. + * @return this Options instance. + */ + public static Options layouts(Long[] layouts) { + return new Options().layouts(layouts); + } + /** + * Gets output. + * + * @return output. */ - public Output output() { + public Output output() { return output; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PrelinearizeTuple"; - - private Output output; - - private PrelinearizeTuple(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.PrelinearizeTuple} + */ + public static class Options { + private List layouts; + + private Options() { + } + + /** + * Sets the layouts option. + * + * @param layouts A vector holding the requested layout in minor-to-major sequence for all the + * tuple shapes in the order the shapes appear in the "shapes" input. The layout + * elements for a sub-shape can be set to -1 in which case the corresponding layout + * will be computed by the infeed operation. + * @return this Options instance. + */ + public Options layouts(List layouts) { + this.layouts = layouts; + return this; + } + + /** + * Sets the layouts option. + * + * @param layouts A vector holding the requested layout in minor-to-major sequence for all the + * tuple shapes in the order the shapes appear in the "shapes" input. The layout + * elements for a sub-shape can be set to -1 in which case the corresponding layout + * will be computed by the infeed operation. + * @return this Options instance. + */ + public Options layouts(Long... layouts) { + this.layouts = Arrays.asList(layouts); + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RecvTPUEmbeddingActivations.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RecvTPUEmbeddingActivations.java index ac19cb8fc81..059ea15ff30 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RecvTPUEmbeddingActivations.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RecvTPUEmbeddingActivations.java @@ -27,12 +27,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * An op that receives embedding activations on the TPU. - *

* The TPU system performs the embedding lookups and aggregations specified by * the arguments to TPUEmbeddingEnqueue(Integer/Sparse/SparseTensor)Batch. The * results of these aggregations are visible to the Tensorflow Graph as the @@ -41,17 +39,34 @@ * most one RecvTPUEmbeddingActivations op in the TPU graph. */ public final class RecvTPUEmbeddingActivations extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RecvTPUEmbeddingActivations"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private RecvTPUEmbeddingActivations(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + /** * Factory method to create a class wrapping a new RecvTPUEmbeddingActivations operation. - * + * * @param scope current scope * @param numOutputs The number of output activation tensors, equal to the number of * embedding tables in the model. * @param config Serialized TPUEmbeddingConfiguration proto. * @return a new instance of RecvTPUEmbeddingActivations */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static RecvTPUEmbeddingActivations create(Scope scope, Long numOutputs, String config) { OperationBuilder opBuilder = scope.env().opBuilder("RecvTPUEmbeddingActivations", scope.makeOpName("RecvTPUEmbeddingActivations")); opBuilder = scope.apply(opBuilder); @@ -59,32 +74,20 @@ public static RecvTPUEmbeddingActivations create(Scope scope, Long numOutputs, S opBuilder.setAttr("config", config); return new RecvTPUEmbeddingActivations(opBuilder.build()); } - + /** + * Gets outputs. * A TensorList of embedding activations containing one Tensor per * embedding table in the model. + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RecvTPUEmbeddingActivations"; - - private List> outputs; - - @SuppressWarnings("unchecked") - private RecvTPUEmbeddingActivations(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList((Output[])operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java index 99ef67f0fd4..06d5c6a8ce8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicateMetadata.java @@ -17,130 +17,39 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; /** * Metadata indicating how the TPU computation should be replicated. - *

- * This operation holds the metadata common to operations of a `tpu.replicate()` computation subgraph. + * This operation holds the metadata common to operations of a {@code tpu.replicate()} computation subgraph. */ public final class ReplicateMetadata extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.ReplicateMetadata} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. - */ - public Options numCoresPerReplica(Long numCoresPerReplica) { - this.numCoresPerReplica = numCoresPerReplica; - return this; - } - - /** - * @param topology TopologyProto indicating the topology of the TPU pod slice. - */ - public Options topology(String topology) { - this.topology = topology; - return this; - } - - /** - * @param useTpu Whether to place the computation on the TPU. - */ - public Options useTpu(Boolean useTpu) { - this.useTpu = useTpu; - return this; - } - - /** - * @param deviceAssignment The assignment of devices for the computation. - */ - public Options deviceAssignment(List deviceAssignment) { - this.deviceAssignment = deviceAssignment; - return this; - } - - /** - * @param computationShape DEPRECATED. Use num_cores_per_replica instead. - */ - public Options computationShape(List computationShape) { - this.computationShape = computationShape; - return this; - } - - /** - * @param hostComputeCore - */ - public Options hostComputeCore(List hostComputeCore) { - this.hostComputeCore = hostComputeCore; - return this; - } - - /** - * @param paddingMap - */ - public Options paddingMap(List paddingMap) { - this.paddingMap = paddingMap; - return this; - } - - /** - * @param stepMarkerLocation - */ - public Options stepMarkerLocation(String stepMarkerLocation) { - this.stepMarkerLocation = stepMarkerLocation; - return this; - } - - /** - * @param allowSoftPlacement - */ - public Options allowSoftPlacement(Boolean allowSoftPlacement) { - this.allowSoftPlacement = allowSoftPlacement; - return this; - } - - /** - * @param useSpmdForXlaPartitioning - */ - public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { - this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; - return this; - } - - private Long numCoresPerReplica; - private String topology; - private Boolean useTpu; - private List deviceAssignment; - private List computationShape; - private List hostComputeCore; - private List paddingMap; - private String stepMarkerLocation; - private Boolean allowSoftPlacement; - private Boolean useSpmdForXlaPartitioning; - - private Options() { - } + public static final String OP_NAME = "TPUReplicateMetadata"; + + private ReplicateMetadata(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ReplicateMetadata operation. - * + * Factory method to create a class wrapping a new TPUReplicateMetadata operation. + * * @param scope current scope * @param numReplicas Number of replicas of the computation - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of ReplicateMetadata */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ReplicateMetadata create(Scope scope, Long numReplicas, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicateMetadata", scope.makeOpName("ReplicateMetadata")); opBuilder = scope.apply(opBuilder); @@ -158,28 +67,28 @@ public static ReplicateMetadata create(Scope scope, Long numReplicas, Options... } if (opts.deviceAssignment != null) { long[] deviceAssignmentArray = new long[opts.deviceAssignment.size()]; - for (int i = 0; i < deviceAssignmentArray.length; ++i) { + for (int i = 0 ; i < deviceAssignmentArray.length ; i++) { deviceAssignmentArray[i] = opts.deviceAssignment.get(i); } opBuilder.setAttr("device_assignment", deviceAssignmentArray); } if (opts.computationShape != null) { long[] computationShapeArray = new long[opts.computationShape.size()]; - for (int i = 0; i < computationShapeArray.length; ++i) { + for (int i = 0 ; i < computationShapeArray.length ; i++) { computationShapeArray[i] = opts.computationShape.get(i); } opBuilder.setAttr("computation_shape", computationShapeArray); } if (opts.hostComputeCore != null) { String[] hostComputeCoreArray = new String[opts.hostComputeCore.size()]; - for (int i = 0; i < hostComputeCoreArray.length; ++i) { + for (int i = 0 ; i < hostComputeCoreArray.length ; i++) { hostComputeCoreArray[i] = opts.hostComputeCore.get(i); } opBuilder.setAttr("host_compute_core", hostComputeCoreArray); } if (opts.paddingMap != null) { String[] paddingMapArray = new String[opts.paddingMap.size()]; - for (int i = 0; i < paddingMapArray.length; ++i) { + for (int i = 0 ; i < paddingMapArray.length ; i++) { paddingMapArray[i] = opts.paddingMap.get(i); } opBuilder.setAttr("padding_map", paddingMapArray); @@ -197,81 +106,326 @@ public static ReplicateMetadata create(Scope scope, Long numReplicas, Options... } return new ReplicateMetadata(opBuilder.build()); } - + /** + * Sets the numCoresPerReplica option. + * * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + * @return this Options instance. */ public static Options numCoresPerReplica(Long numCoresPerReplica) { return new Options().numCoresPerReplica(numCoresPerReplica); } - + /** + * Sets the topology option. + * * @param topology TopologyProto indicating the topology of the TPU pod slice. + * @return this Options instance. */ public static Options topology(String topology) { return new Options().topology(topology); } - + /** + * Sets the useTpu option. + * * @param useTpu Whether to place the computation on the TPU. + * @return this Options instance. */ public static Options useTpu(Boolean useTpu) { return new Options().useTpu(useTpu); } - + /** + * Sets the deviceAssignment option. + * * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. */ public static Options deviceAssignment(List deviceAssignment) { return new Options().deviceAssignment(deviceAssignment); } - + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public static Options deviceAssignment(Long[] deviceAssignment) { + return new Options().deviceAssignment(deviceAssignment); + } + + /** + * Sets the computationShape option. + * * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. */ public static Options computationShape(List computationShape) { return new Options().computationShape(computationShape); } - + /** - * @param hostComputeCore + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public static Options computationShape(Long[] computationShape) { + return new Options().computationShape(computationShape); + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. */ public static Options hostComputeCore(List hostComputeCore) { return new Options().hostComputeCore(hostComputeCore); } - + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public static Options hostComputeCore(String[] hostComputeCore) { + return new Options().hostComputeCore(hostComputeCore); + } + /** - * @param paddingMap + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. */ public static Options paddingMap(List paddingMap) { return new Options().paddingMap(paddingMap); } - + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public static Options paddingMap(String[] paddingMap) { + return new Options().paddingMap(paddingMap); + } + /** - * @param stepMarkerLocation + * Sets the stepMarkerLocation option. + * + * @param stepMarkerLocation the stepMarkerLocation option + * @return this Options instance. */ public static Options stepMarkerLocation(String stepMarkerLocation) { return new Options().stepMarkerLocation(stepMarkerLocation); } - + /** - * @param allowSoftPlacement + * Sets the allowSoftPlacement option. + * + * @param allowSoftPlacement the allowSoftPlacement option + * @return this Options instance. */ public static Options allowSoftPlacement(Boolean allowSoftPlacement) { return new Options().allowSoftPlacement(allowSoftPlacement); } - + /** - * @param useSpmdForXlaPartitioning + * Sets the useSpmdForXlaPartitioning option. + * + * @param useSpmdForXlaPartitioning the useSpmdForXlaPartitioning option + * @return this Options instance. */ public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicateMetadata"; - - private ReplicateMetadata(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.ReplicateMetadata} + */ + public static class Options { + private Long numCoresPerReplica; + + private String topology; + + private Boolean useTpu; + + private List deviceAssignment; + + private List computationShape; + + private List hostComputeCore; + + private List paddingMap; + + private String stepMarkerLocation; + + private Boolean allowSoftPlacement; + + private Boolean useSpmdForXlaPartitioning; + + private Options() { + } + + /** + * Sets the numCoresPerReplica option. + * + * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + * @return this Options instance. + */ + public Options numCoresPerReplica(Long numCoresPerReplica) { + this.numCoresPerReplica = numCoresPerReplica; + return this; + } + + /** + * Sets the topology option. + * + * @param topology TopologyProto indicating the topology of the TPU pod slice. + * @return this Options instance. + */ + public Options topology(String topology) { + this.topology = topology; + return this; + } + + /** + * Sets the useTpu option. + * + * @param useTpu Whether to place the computation on the TPU. + * @return this Options instance. + */ + public Options useTpu(Boolean useTpu) { + this.useTpu = useTpu; + return this; + } + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public Options deviceAssignment(List deviceAssignment) { + this.deviceAssignment = deviceAssignment; + return this; + } + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public Options deviceAssignment(Long... deviceAssignment) { + this.deviceAssignment = Arrays.asList(deviceAssignment); + return this; + } + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public Options computationShape(List computationShape) { + this.computationShape = computationShape; + return this; + } + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public Options computationShape(Long... computationShape) { + this.computationShape = Arrays.asList(computationShape); + return this; + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public Options hostComputeCore(List hostComputeCore) { + this.hostComputeCore = hostComputeCore; + return this; + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public Options hostComputeCore(String... hostComputeCore) { + this.hostComputeCore = Arrays.asList(hostComputeCore); + return this; + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public Options paddingMap(List paddingMap) { + this.paddingMap = paddingMap; + return this; + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public Options paddingMap(String... paddingMap) { + this.paddingMap = Arrays.asList(paddingMap); + return this; + } + + /** + * Sets the stepMarkerLocation option. + * + * @param stepMarkerLocation the stepMarkerLocation option + * @return this Options instance. + */ + public Options stepMarkerLocation(String stepMarkerLocation) { + this.stepMarkerLocation = stepMarkerLocation; + return this; + } + + /** + * Sets the allowSoftPlacement option. + * + * @param allowSoftPlacement the allowSoftPlacement option + * @return this Options instance. + */ + public Options allowSoftPlacement(Boolean allowSoftPlacement) { + this.allowSoftPlacement = allowSoftPlacement; + return this; + } + + /** + * Sets the useSpmdForXlaPartitioning option. + * + * @param useSpmdForXlaPartitioning the useSpmdForXlaPartitioning option + * @return this Options instance. + */ + public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { + this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedInput.java index b6092c934ee..e581ecf060d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedInput.java @@ -25,75 +25,51 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Connects N inputs to an N-way replicated TPU computation. - *

- * This operation holds a replicated input to a `tpu.replicate()` computation subgraph. + * This operation holds a replicated input to a {@code tpu.replicate()} computation subgraph. * Each replicated input has the same shape and type alongside the output. - *

- * For example: - *

{@code
- * %a = "tf.opA"()
- * %b = "tf.opB"()
- * %replicated_input = "tf.TPUReplicatedInput"(%a, %b)
- * %computation = "tf.Computation"(%replicated_input)
- * }
- * The above computation has a replicated input of two replicas. - * - * @param data type for {@code output()} output + *

For example: + *

+ * %a = "tf.opA"()
+ * %b = "tf.opB"()
+ * %replicated_input = "tf.TPUReplicatedInput"(%a, %b)
+ * %computation = "tf.Computation"(%replicated_input)
+ * 
+ *

The above computation has a replicated input of two replicas. + * + * @param data type for {@code output} output */ public final class ReplicatedInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.ReplicatedInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param isMirroredVariable - */ - public Options isMirroredVariable(Boolean isMirroredVariable) { - this.isMirroredVariable = isMirroredVariable; - return this; - } - - /** - * @param index - */ - public Options index(Long index) { - this.index = index; - return this; - } - - /** - * @param isPacked - */ - public Options isPacked(Boolean isPacked) { - this.isPacked = isPacked; - return this; - } - - private Boolean isMirroredVariable; - private Long index; - private Boolean isPacked; - - private Options() { - } + public static final String OP_NAME = "TPUReplicatedInput"; + + private Output output; + + private ReplicatedInput(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ReplicatedInput operation. - * + * Factory method to create a class wrapping a new TPUReplicatedInput operation. + * * @param scope current scope - * @param inputs - * @param options carries optional attributes values + * @param inputs the inputs value + * @param options carries optional attribute values + * @param data type for {@code TPUReplicatedInput} output and operands * @return a new instance of ReplicatedInput */ - @Endpoint(describeByClass = true) - public static ReplicatedInput create(Scope scope, Iterable> inputs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ReplicatedInput create(Scope scope, + Iterable> inputs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedInput", scope.makeOpName("ReplicatedInput")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); @@ -110,49 +86,97 @@ public static ReplicatedInput create(Scope scope, Iterable< } } } - return new ReplicatedInput(opBuilder.build()); + return new ReplicatedInput<>(opBuilder.build()); } - + /** - * @param isMirroredVariable + * Sets the isMirroredVariable option. + * + * @param isMirroredVariable the isMirroredVariable option + * @return this Options instance. */ public static Options isMirroredVariable(Boolean isMirroredVariable) { return new Options().isMirroredVariable(isMirroredVariable); } - + /** - * @param index + * Sets the index option. + * + * @param index the index option + * @return this Options instance. */ public static Options index(Long index) { return new Options().index(index); } - + /** - * @param isPacked + * Sets the isPacked option. + * + * @param isPacked the isPacked option + * @return this Options instance. */ public static Options isPacked(Boolean isPacked) { return new Options().isPacked(isPacked); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicatedInput"; - - private Output output; - - private ReplicatedInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.ReplicatedInput} + */ + public static class Options { + private Boolean isMirroredVariable; + + private Long index; + + private Boolean isPacked; + + private Options() { + } + + /** + * Sets the isMirroredVariable option. + * + * @param isMirroredVariable the isMirroredVariable option + * @return this Options instance. + */ + public Options isMirroredVariable(Boolean isMirroredVariable) { + this.isMirroredVariable = isMirroredVariable; + return this; + } + + /** + * Sets the index option. + * + * @param index the index option + * @return this Options instance. + */ + public Options index(Long index) { + this.index = index; + return this; + } + + /** + * Sets the isPacked option. + * + * @param isPacked the isPacked option + * @return this Options instance. + */ + public Options isPacked(Boolean isPacked) { + this.isPacked = isPacked; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedOutput.java index d092faa8df9..53cbf8b412e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ReplicatedOutput.java @@ -27,66 +27,71 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Connects N outputs from an N-way replicated TPU computation. - *

- * This operation holds a replicated output from a `tpu.replicate()` computation subgraph. + * This operation holds a replicated output from a {@code tpu.replicate()} computation subgraph. * Each replicated output has the same shape and type alongside the input. - *

- * For example: - *

{@code
- * %computation = "tf.Computation"()
- * %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
- * }
- * The above computation has a replicated output of two replicas. - * - * @param data type for {@code outputs()} output + *

For example: + *

+ * %computation = "tf.Computation"()
+ * %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
+ * 
+ *

The above computation has a replicated output of two replicas. + * + * @param data type for {@code outputs} output */ public final class ReplicatedOutput extends RawOp implements Iterable> { - /** - * Factory method to create a class wrapping a new ReplicatedOutput operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUReplicatedOutput"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private ReplicatedOutput(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + + /** + * Factory method to create a class wrapping a new TPUReplicatedOutput operation. + * * @param scope current scope - * @param input - * @param numReplicas + * @param input the input value + * @param numReplicas the value of the numReplicas property + * @param data type for {@code TPUReplicatedOutput} output and operands * @return a new instance of ReplicatedOutput */ - @Endpoint(describeByClass = true) - public static ReplicatedOutput create(Scope scope, Operand input, Long numReplicas) { + @Endpoint( + describeByClass = true + ) + public static ReplicatedOutput create(Scope scope, Operand input, + Long numReplicas) { OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedOutput", scope.makeOpName("ReplicatedOutput")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_replicas", numReplicas); - return new ReplicatedOutput(opBuilder.build()); + return new ReplicatedOutput<>(opBuilder.build()); } - + /** + * Gets outputs. + * + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicatedOutput"; - - private List> outputs; - - @SuppressWarnings("unchecked") - private ReplicatedOutput(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList((Output[])operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParameters.java index 63614394c3d..acea126fd17 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParameters.java @@ -23,67 +23,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve ADAM embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingADAMParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingADAMParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingADAMParameters"; + + private Output parameters; + + private Output momenta; + + private Output velocities; + + private RetrieveTPUEmbeddingADAMParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + momenta = operation.output(outputIdx++); + velocities = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingADAMParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingADAMParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingADAMParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingADAMParameters create(Scope scope, Long numShards, Long shardId, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingADAMParameters", scope.makeOpName("RetrieveTPUEmbeddingADAMParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,61 +85,108 @@ public static RetrieveTPUEmbeddingADAMParameters create(Scope scope, Long numSha } return new RetrieveTPUEmbeddingADAMParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the ADAM optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets momenta. * Parameter momenta updated by the ADAM optimization algorithm. + * @return momenta. */ public Output momenta() { return momenta; } - + /** + * Gets velocities. * Parameter velocities updated by the ADAM optimization algorithm. + * @return velocities. */ public Output velocities() { return velocities; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingADAMParameters"; - - private Output parameters; - private Output momenta; - private Output velocities; - - private RetrieveTPUEmbeddingADAMParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - momenta = operation.output(outputIdx++); - velocities = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingADAMParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java index 06112fd6a38..ba381888271 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java @@ -23,67 +23,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve ADAM embedding parameters with debug support. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingADAMParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingADAMParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingADAMParametersGradAccumDebug"; + + private Output parameters; + + private Output momenta; + + private Output velocities; + + private Output gradientAccumulators; + + private RetrieveTPUEmbeddingADAMParametersGradAccumDebug(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + momenta = operation.output(outputIdx++); + velocities = operation.output(outputIdx++); + gradientAccumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingADAMParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingADAMParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingADAMParametersGradAccumDebug create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingADAMParametersGradAccumDebug create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingADAMParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingADAMParametersGradAccumDebug")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,70 +88,117 @@ public static RetrieveTPUEmbeddingADAMParametersGradAccumDebug create(Scope scop } return new RetrieveTPUEmbeddingADAMParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the ADAM optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets momenta. * Parameter momenta updated by the ADAM optimization algorithm. + * @return momenta. */ public Output momenta() { return momenta; } - + /** + * Gets velocities. * Parameter velocities updated by the ADAM optimization algorithm. + * @return velocities. */ public Output velocities() { return velocities; } - + /** + * Gets gradientAccumulators. * Parameter gradient_accumulators updated by the ADAM optimization algorithm. + * @return gradientAccumulators. */ public Output gradientAccumulators() { return gradientAccumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingADAMParametersGradAccumDebug"; - - private Output parameters; - private Output momenta; - private Output velocities; - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingADAMParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - momenta = operation.output(outputIdx++); - velocities = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingADAMParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParameters.java index dc1ee88d9de..17f05b8bd5e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParameters.java @@ -23,67 +23,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve Adadelta embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingAdadeltaParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdadeltaParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingAdadeltaParameters"; + + private Output parameters; + + private Output accumulators; + + private Output updates; + + private RetrieveTPUEmbeddingAdadeltaParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + updates = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdadeltaParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingAdadeltaParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingAdadeltaParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingAdadeltaParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingAdadeltaParameters", scope.makeOpName("RetrieveTPUEmbeddingAdadeltaParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,61 +85,108 @@ public static RetrieveTPUEmbeddingAdadeltaParameters create(Scope scope, Long nu } return new RetrieveTPUEmbeddingAdadeltaParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the Adadelta optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the Adadelta optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - + /** + * Gets updates. * Parameter updates updated by the Adadelta optimization algorithm. + * @return updates. */ public Output updates() { return updates; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingAdadeltaParameters"; - - private Output parameters; - private Output accumulators; - private Output updates; - - private RetrieveTPUEmbeddingAdadeltaParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - updates = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdadeltaParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java index c6749fdd3a2..c96c22897c1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java @@ -23,67 +23,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve Adadelta embedding parameters with debug support. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug"; + + private Output parameters; + + private Output accumulators; + + private Output updates; + + private Output gradientAccumulators; + + private RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + updates = operation.output(outputIdx++); + gradientAccumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug create(Scope scope, + Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,70 +88,117 @@ public static RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug create(Scope } return new RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the Adadelta optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the Adadelta optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - + /** + * Gets updates. * Parameter updates updated by the Adadelta optimization algorithm. + * @return updates. */ public Output updates() { return updates; } - + /** + * Gets gradientAccumulators. * Parameter gradient_accumulators updated by the Adadelta optimization algorithm. + * @return gradientAccumulators. */ public Output gradientAccumulators() { return gradientAccumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug"; - - private Output parameters; - private Output accumulators; - private Output updates; - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - updates = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParameters.java index bbc8f9984f1..1f7e6064936 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParameters.java @@ -23,67 +23,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve Adagrad embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingAdagradParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingAdagradParameters"; + + private Output parameters; + + private Output accumulators; + + private RetrieveTPUEmbeddingAdagradParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdagradParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingAdagradParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingAdagradParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingAdagradParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingAdagradParameters", scope.makeOpName("RetrieveTPUEmbeddingAdagradParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,52 +82,99 @@ public static RetrieveTPUEmbeddingAdagradParameters create(Scope scope, Long num } return new RetrieveTPUEmbeddingAdagradParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the Adagrad optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the Adagrad optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingAdagradParameters"; - - private Output parameters; - private Output accumulators; - - private RetrieveTPUEmbeddingAdagradParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java index b0c27d9ae36..bec9e018904 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java @@ -23,67 +23,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve Adagrad embedding parameters with debug support. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingAdagradParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingAdagradParametersGradAccumDebug"; + + private Output parameters; + + private Output accumulators; + + private Output gradientAccumulators; + + private RetrieveTPUEmbeddingAdagradParametersGradAccumDebug(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + gradientAccumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingAdagradParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingAdagradParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingAdagradParametersGradAccumDebug create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingAdagradParametersGradAccumDebug create(Scope scope, + Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingAdagradParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingAdagradParametersGradAccumDebug")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,61 +85,108 @@ public static RetrieveTPUEmbeddingAdagradParametersGradAccumDebug create(Scope s } return new RetrieveTPUEmbeddingAdagradParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the Adagrad optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the Adagrad optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - + /** + * Gets gradientAccumulators. * Parameter gradient_accumulators updated by the Adagrad optimization algorithm. + * @return gradientAccumulators. */ public Output gradientAccumulators() { return gradientAccumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingAdagradParametersGradAccumDebug"; - - private Output parameters; - private Output accumulators; - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingAdagradParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingAdagradParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingCenteredRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingCenteredRMSPropParameters.java index b23f32857b0..e5be5990a3a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingCenteredRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingCenteredRMSPropParameters.java @@ -23,67 +23,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve centered RMSProp embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingCenteredRMSPropParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingCenteredRMSPropParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingCenteredRMSPropParameters"; + + private Output parameters; + + private Output ms; + + private Output mom; + + private Output mg; + + private RetrieveTPUEmbeddingCenteredRMSPropParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + ms = operation.output(outputIdx++); + mom = operation.output(outputIdx++); + mg = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingCenteredRMSPropParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingCenteredRMSPropParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingCenteredRMSPropParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingCenteredRMSPropParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingCenteredRMSPropParameters", scope.makeOpName("RetrieveTPUEmbeddingCenteredRMSPropParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,70 +88,117 @@ public static RetrieveTPUEmbeddingCenteredRMSPropParameters create(Scope scope, } return new RetrieveTPUEmbeddingCenteredRMSPropParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the centered RMSProp optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets ms. * Parameter ms updated by the centered RMSProp optimization algorithm. + * @return ms. */ public Output ms() { return ms; } - + /** + * Gets mom. * Parameter mom updated by the centered RMSProp optimization algorithm. + * @return mom. */ public Output mom() { return mom; } - + /** + * Gets mg. * Parameter mg updated by the centered RMSProp optimization algorithm. + * @return mg. */ public Output mg() { return mg; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingCenteredRMSPropParameters"; - - private Output parameters; - private Output ms; - private Output mom; - private Output mg; - - private RetrieveTPUEmbeddingCenteredRMSPropParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - ms = operation.output(outputIdx++); - mom = operation.output(outputIdx++); - mg = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingCenteredRMSPropParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParameters.java index ea4e7d8b7cc..491e59bdc38 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParameters.java @@ -23,67 +23,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve FTRL embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingFTRLParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingFTRLParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingFTRLParameters"; + + private Output parameters; + + private Output accumulators; + + private Output linears; + + private RetrieveTPUEmbeddingFTRLParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + linears = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingFTRLParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingFTRLParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingFTRLParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingFTRLParameters create(Scope scope, Long numShards, Long shardId, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingFTRLParameters", scope.makeOpName("RetrieveTPUEmbeddingFTRLParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,61 +85,108 @@ public static RetrieveTPUEmbeddingFTRLParameters create(Scope scope, Long numSha } return new RetrieveTPUEmbeddingFTRLParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the FTRL optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the FTRL optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - + /** + * Gets linears. * Parameter linears updated by the FTRL optimization algorithm. + * @return linears. */ public Output linears() { return linears; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingFTRLParameters"; - - private Output parameters; - private Output accumulators; - private Output linears; - - private RetrieveTPUEmbeddingFTRLParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - linears = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingFTRLParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java index ae3103b45de..156e5e18788 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java @@ -23,67 +23,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve FTRL embedding parameters with debug support. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingFTRLParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingFTRLParametersGradAccumDebug"; + + private Output parameters; + + private Output accumulators; + + private Output linears; + + private Output gradientAccumulators; + + private RetrieveTPUEmbeddingFTRLParametersGradAccumDebug(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + linears = operation.output(outputIdx++); + gradientAccumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingFTRLParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingFTRLParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingFTRLParametersGradAccumDebug create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingFTRLParametersGradAccumDebug create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingFTRLParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingFTRLParametersGradAccumDebug")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,70 +88,117 @@ public static RetrieveTPUEmbeddingFTRLParametersGradAccumDebug create(Scope scop } return new RetrieveTPUEmbeddingFTRLParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the FTRL optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the FTRL optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - + /** + * Gets linears. * Parameter linears updated by the FTRL optimization algorithm. + * @return linears. */ public Output linears() { return linears; } - + /** + * Gets gradientAccumulators. * Parameter gradient_accumulators updated by the FTRL optimization algorithm. + * @return gradientAccumulators. */ public Output gradientAccumulators() { return gradientAccumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingFTRLParametersGradAccumDebug"; - - private Output parameters; - private Output accumulators; - private Output linears; - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingFTRLParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - linears = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingFTRLParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMDLAdagradLightParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMDLAdagradLightParameters.java index 6e14c023852..5b23031e101 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMDLAdagradLightParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMDLAdagradLightParameters.java @@ -23,67 +23,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve MDL Adagrad Light embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingMDLAdagradLightParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMDLAdagradLightParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingMDLAdagradLightParameters"; + + private Output parameters; + + private Output accumulators; + + private Output weights; + + private Output benefits; + + private RetrieveTPUEmbeddingMDLAdagradLightParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + weights = operation.output(outputIdx++); + benefits = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingMDLAdagradLightParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingMDLAdagradLightParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingMDLAdagradLightParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingMDLAdagradLightParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingMDLAdagradLightParameters", scope.makeOpName("RetrieveTPUEmbeddingMDLAdagradLightParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,70 +88,117 @@ public static RetrieveTPUEmbeddingMDLAdagradLightParameters create(Scope scope, } return new RetrieveTPUEmbeddingMDLAdagradLightParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the MDL Adagrad Light optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the MDL Adagrad Light optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - + /** + * Gets weights. * Parameter weights updated by the MDL Adagrad Light optimization algorithm. + * @return weights. */ public Output weights() { return weights; } - + /** + * Gets benefits. * Parameter benefits updated by the MDL Adagrad Light optimization algorithm. + * @return benefits. */ public Output benefits() { return benefits; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingMDLAdagradLightParameters"; - - private Output parameters; - private Output accumulators; - private Output weights; - private Output benefits; - - private RetrieveTPUEmbeddingMDLAdagradLightParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - weights = operation.output(outputIdx++); - benefits = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMDLAdagradLightParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParameters.java index b7c5466f9ab..ea7b81b8166 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParameters.java @@ -23,67 +23,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve Momentum embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingMomentumParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMomentumParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingMomentumParameters"; + + private Output parameters; + + private Output momenta; + + private RetrieveTPUEmbeddingMomentumParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + momenta = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingMomentumParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingMomentumParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingMomentumParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingMomentumParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingMomentumParameters", scope.makeOpName("RetrieveTPUEmbeddingMomentumParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,52 +82,99 @@ public static RetrieveTPUEmbeddingMomentumParameters create(Scope scope, Long nu } return new RetrieveTPUEmbeddingMomentumParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the Momentum optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets momenta. * Parameter momenta updated by the Momentum optimization algorithm. + * @return momenta. */ public Output momenta() { return momenta; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingMomentumParameters"; - - private Output parameters; - private Output momenta; - - private RetrieveTPUEmbeddingMomentumParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - momenta = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMomentumParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java index 730a7ca9da5..444ecb16153 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java @@ -23,67 +23,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve Momentum embedding parameters with debug support. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingMomentumParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingMomentumParametersGradAccumDebug"; + + private Output parameters; + + private Output momenta; + + private Output gradientAccumulators; + + private RetrieveTPUEmbeddingMomentumParametersGradAccumDebug(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + momenta = operation.output(outputIdx++); + gradientAccumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingMomentumParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingMomentumParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingMomentumParametersGradAccumDebug create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingMomentumParametersGradAccumDebug create(Scope scope, + Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingMomentumParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingMomentumParametersGradAccumDebug")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,61 +85,108 @@ public static RetrieveTPUEmbeddingMomentumParametersGradAccumDebug create(Scope } return new RetrieveTPUEmbeddingMomentumParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the Momentum optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets momenta. * Parameter momenta updated by the Momentum optimization algorithm. + * @return momenta. */ public Output momenta() { return momenta; } - + /** + * Gets gradientAccumulators. * Parameter gradient_accumulators updated by the Momentum optimization algorithm. + * @return gradientAccumulators. */ public Output gradientAccumulators() { return gradientAccumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingMomentumParametersGradAccumDebug"; - - private Output parameters; - private Output momenta; - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingMomentumParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - momenta = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingMomentumParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParameters.java index 97cc1e69f5a..15ac2e4bbc4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParameters.java @@ -23,67 +23,46 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve proximal Adagrad embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingProximalAdagradParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalAdagradParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingProximalAdagradParameters"; + + private Output parameters; + + private Output accumulators; + + private RetrieveTPUEmbeddingProximalAdagradParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalAdagradParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingProximalAdagradParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingProximalAdagradParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingProximalAdagradParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingProximalAdagradParameters", scope.makeOpName("RetrieveTPUEmbeddingProximalAdagradParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,52 +82,99 @@ public static RetrieveTPUEmbeddingProximalAdagradParameters create(Scope scope, } return new RetrieveTPUEmbeddingProximalAdagradParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the proximal Adagrad optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the proximal Adagrad optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingProximalAdagradParameters"; - - private Output parameters; - private Output accumulators; - - private RetrieveTPUEmbeddingProximalAdagradParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalAdagradParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java index c6c07d28081..bbf763d123e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java @@ -23,67 +23,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve proximal Adagrad embedding parameters with debug support. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug"; + + private Output parameters; + + private Output accumulators; + + private Output gradientAccumulators; + + private RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + accumulators = operation.output(outputIdx++); + gradientAccumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug create(Scope scope, + Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,61 +85,108 @@ public static RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug create } return new RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the proximal Adagrad optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets accumulators. * Parameter accumulators updated by the proximal Adagrad optimization algorithm. + * @return accumulators. */ public Output accumulators() { return accumulators; } - + /** + * Gets gradientAccumulators. * Parameter gradient_accumulators updated by the proximal Adagrad optimization algorithm. + * @return gradientAccumulators. */ public Output gradientAccumulators() { return gradientAccumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug"; - - private Output parameters; - private Output accumulators; - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - accumulators = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParameters.java index bf7af3b3084..46c27514430 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParameters.java @@ -23,61 +23,45 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** + * The RetrieveTPUEmbeddingProximalYogiParameters operation */ public final class RetrieveTPUEmbeddingProximalYogiParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalYogiParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingProximalYogiParameters"; + + private Output parameters; + + private Output v; + + private Output m; + + private RetrieveTPUEmbeddingProximalYogiParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + v = operation.output(outputIdx++); + m = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalYogiParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingProximalYogiParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingProximalYogiParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingProximalYogiParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingProximalYogiParameters", scope.makeOpName("RetrieveTPUEmbeddingProximalYogiParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -97,58 +81,108 @@ public static RetrieveTPUEmbeddingProximalYogiParameters create(Scope scope, Lon } return new RetrieveTPUEmbeddingProximalYogiParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. + * + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets v. + * + * @return v. */ public Output v() { return v; } - + /** + * Gets m. + * + * @return m. */ public Output m() { return m; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingProximalYogiParameters"; - - private Output parameters; - private Output v; - private Output m; - - private RetrieveTPUEmbeddingProximalYogiParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - v = operation.output(outputIdx++); - m = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalYogiParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.java index 109c1d82716..c3b827522d4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug.java @@ -23,61 +23,48 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** + * The RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug operation */ public final class RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug"; + + private Output parameters; + + private Output v; + + private Output m; + + private Output gradientAccumulators; + + private RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + v = operation.output(outputIdx++); + m = operation.output(outputIdx++); + gradientAccumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug create(Scope scope, + Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -97,66 +84,117 @@ public static RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug create(Sc } return new RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. + * + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets v. + * + * @return v. */ public Output v() { return v; } - + /** + * Gets m. + * + * @return m. */ public Output m() { return m; } - + /** + * Gets gradientAccumulators. + * + * @return gradientAccumulators. */ public Output gradientAccumulators() { return gradientAccumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug"; - - private Output parameters; - private Output v; - private Output m; - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - v = operation.output(outputIdx++); - m = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingProximalYogiParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParameters.java index 13a95cae5c2..bcad29d5d9e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParameters.java @@ -23,67 +23,49 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve RMSProp embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingRMSPropParameters extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingRMSPropParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingRMSPropParameters"; + + private Output parameters; + + private Output ms; + + private Output mom; + + private RetrieveTPUEmbeddingRMSPropParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + ms = operation.output(outputIdx++); + mom = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingRMSPropParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingRMSPropParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingRMSPropParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingRMSPropParameters create(Scope scope, Long numShards, + Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingRMSPropParameters", scope.makeOpName("RetrieveTPUEmbeddingRMSPropParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,61 +85,108 @@ public static RetrieveTPUEmbeddingRMSPropParameters create(Scope scope, Long num } return new RetrieveTPUEmbeddingRMSPropParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the RMSProp optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets ms. * Parameter ms updated by the RMSProp optimization algorithm. + * @return ms. */ public Output ms() { return ms; } - + /** + * Gets mom. * Parameter mom updated by the RMSProp optimization algorithm. + * @return mom. */ public Output mom() { return mom; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingRMSPropParameters"; - - private Output parameters; - private Output ms; - private Output mom; - - private RetrieveTPUEmbeddingRMSPropParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - ms = operation.output(outputIdx++); - mom = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingRMSPropParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java index 97b915ecc3b..b3e83f8ab13 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java @@ -23,67 +23,52 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve RMSProp embedding parameters with debug support. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug"; + + private Output parameters; + + private Output ms; + + private Output mom; + + private Output gradientAccumulators; + + private RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + ms = operation.output(outputIdx++); + mom = operation.output(outputIdx++); + gradientAccumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug create(Scope scope, + Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,70 +88,117 @@ public static RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug create(Scope s } return new RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the RMSProp optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets ms. * Parameter ms updated by the RMSProp optimization algorithm. + * @return ms. */ public Output ms() { return ms; } - + /** + * Gets mom. * Parameter mom updated by the RMSProp optimization algorithm. + * @return mom. */ public Output mom() { return mom; } - + /** + * Gets gradientAccumulators. * Parameter gradient_accumulators updated by the RMSProp optimization algorithm. + * @return gradientAccumulators. */ public Output gradientAccumulators() { return gradientAccumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug"; - - private Output parameters; - private Output ms; - private Output mom; - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - ms = operation.output(outputIdx++); - mom = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java index 9d9d1a5c29a..71ae453a189 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java @@ -24,67 +24,43 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve SGD embedding parameters. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingStochasticGradientDescentParameters extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingStochasticGradientDescentParameters} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingStochasticGradientDescentParameters"; + + private Output parameters; + + private RetrieveTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingStochasticGradientDescentParameters operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingStochasticGradientDescentParameters */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingStochasticGradientDescentParameters create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingStochasticGradientDescentParameters create(Scope scope, + Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingStochasticGradientDescentParameters", scope.makeOpName("RetrieveTPUEmbeddingStochasticGradientDescentParameters")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -104,48 +80,95 @@ public static RetrieveTPUEmbeddingStochasticGradientDescentParameters create(Sco } return new RetrieveTPUEmbeddingStochasticGradientDescentParameters(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the stochastic gradient descent optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + @Override public Output asOutput() { return parameters; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingStochasticGradientDescentParameters"; - - private Output parameters; - - private RetrieveTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingStochasticGradientDescentParameters} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java index 6c0ac7d76a7..95a4620110d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug.java @@ -23,67 +23,47 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Retrieve SGD embedding parameters with debug support. - *

* An op that retrieves optimization parameters from embedding to host * memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ public final class RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param tableId - */ - public Options tableId(Long tableId) { - this.tableId = tableId; - return this; - } - - /** - * @param tableName - */ - public Options tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * @param config - */ - public Options config(String config) { - this.config = config; - return this; - } - - private Long tableId; - private String tableName; - private String config; - - private Options() { - } + public static final String OP_NAME = "RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"; + + private Output parameters; + + private Output gradientAccumulators; + + private RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug( + Operation operation) { + super(operation); + int outputIdx = 0; + parameters = operation.output(outputIdx++); + gradientAccumulators = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug operation. - * + * * @param scope current scope - * @param numShards - * @param shardId - * @param options carries optional attributes values + * @param numShards the value of the numShards property + * @param shardId the value of the shardId property + * @param options carries optional attribute values * @return a new instance of RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug */ - @Endpoint(describeByClass = true) - public static RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug create(Scope scope, Long numShards, Long shardId, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug create( + Scope scope, Long numShards, Long shardId, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug", scope.makeOpName("RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_shards", numShards); @@ -103,52 +83,99 @@ public static RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDe } return new RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug(opBuilder.build()); } - + /** - * @param tableId + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. */ public static Options tableId(Long tableId) { return new Options().tableId(tableId); } - + /** - * @param tableName + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. */ public static Options tableName(String tableName) { return new Options().tableName(tableName); } - + /** - * @param config + * Sets the config option. + * + * @param config the config option + * @return this Options instance. */ public static Options config(String config) { return new Options().config(config); } - + /** + * Gets parameters. * Parameter parameters updated by the stochastic gradient descent optimization algorithm. + * @return parameters. */ public Output parameters() { return parameters; } - + /** + * Gets gradientAccumulators. * Parameter gradient_accumulators updated by the Adadelta optimization algorithm. + * @return gradientAccumulators. */ public Output gradientAccumulators() { return gradientAccumulators; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug"; - - private Output parameters; - private Output gradientAccumulators; - - private RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug(Operation operation) { - super(operation); - int outputIdx = 0; - parameters = operation.output(outputIdx++); - gradientAccumulators = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.RetrieveTPUEmbeddingStochasticGradientDescentParametersGradAccumDebug} + */ + public static class Options { + private Long tableId; + + private String tableName; + + private String config; + + private Options() { + } + + /** + * Sets the tableId option. + * + * @param tableId the tableId option + * @return this Options instance. + */ + public Options tableId(Long tableId) { + this.tableId = tableId; + return this; + } + + /** + * Sets the tableName option. + * + * @param tableName the tableName option + * @return this Options instance. + */ + public Options tableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Sets the config option. + * + * @param config the config option + * @return this Options instance. + */ + public Options config(String config) { + this.config = config; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SendTPUEmbeddingGradients.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SendTPUEmbeddingGradients.java index e46d77e7506..dd2d1fa6992 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SendTPUEmbeddingGradients.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/SendTPUEmbeddingGradients.java @@ -24,17 +24,24 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * Performs gradient updates of embedding tables. */ public final class SendTPUEmbeddingGradients extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SendTPUEmbeddingGradients"; + + private SendTPUEmbeddingGradients(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new SendTPUEmbeddingGradients operation. - * + * * @param scope current scope * @param inputs A TensorList of gradients with which to update embedding tables. * This argument has the same length and shapes as the return value of @@ -49,22 +56,57 @@ public final class SendTPUEmbeddingGradients extends RawOp { * in the configuration. If the learning rates for all tables are constant, * this list should be empty. * @param config Serialized TPUEmbeddingConfiguration proto. + * @param options carries optional attribute values * @return a new instance of SendTPUEmbeddingGradients */ - @Endpoint(describeByClass = true) - public static SendTPUEmbeddingGradients create(Scope scope, Iterable> inputs, Iterable> learningRates, String config) { + @Endpoint( + describeByClass = true + ) + public static SendTPUEmbeddingGradients create(Scope scope, Iterable> inputs, + Iterable> learningRates, String config, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SendTPUEmbeddingGradients", scope.makeOpName("SendTPUEmbeddingGradients")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder.addInputList(Operands.asOutputs(learningRates)); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("config", config); + if (options != null) { + for (Options opts : options) { + if (opts.NN != null) { + opBuilder.setAttr("NN", opts.NN); + } + } + } return new SendTPUEmbeddingGradients(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SendTPUEmbeddingGradients"; - - private SendTPUEmbeddingGradients(Operation operation) { - super(operation); + + /** + * Sets the NN option. + * + * @param NN the NN option + * @return this Options instance. + */ + public static Options NN(Long NN) { + return new Options().NN(NN); + } + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.SendTPUEmbeddingGradients} + */ + public static class Options { + private Long NN; + + private Options() { + } + + /** + * Sets the NN option. + * + * @param NN the NN option + * @return this Options instance. + */ + public Options NN(Long NN) { + this.NN = NN; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownDistributedTPU.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownDistributedTPU.java index b97a63c97f4..c710c9617e6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownDistributedTPU.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/ShutdownDistributedTPU.java @@ -22,32 +22,33 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; /** * Shuts down a running distributed TPU system. - *

* The op returns an error if no system is running. */ public final class ShutdownDistributedTPU extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ShutdownDistributedTPU"; + + private ShutdownDistributedTPU(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ShutdownDistributedTPU operation. - * + * * @param scope current scope * @return a new instance of ShutdownDistributedTPU */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ShutdownDistributedTPU create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("ShutdownDistributedTPU", scope.makeOpName("ShutdownDistributedTPU")); opBuilder = scope.apply(opBuilder); return new ShutdownDistributedTPU(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ShutdownDistributedTPU"; - - private ShutdownDistributedTPU(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCompilationResult.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCompilationResult.java index 0f6e8fdd736..760196069c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCompilationResult.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUCompilationResult.java @@ -24,50 +24,57 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Returns the result of a TPU compilation. - *

* This operation returns the result of a TPU compilation as a serialized * CompilationResultProto, which holds a status and an error message if an error * occurred during compilation. + * + * @deprecated use {@link org.tensorflow.op.tpu.CompilationResult} instead */ +@Deprecated public final class TPUCompilationResult extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUCompilationResult"; + + private Output output; + + private TPUCompilationResult(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TPUCompilationResult operation. - * + * * @param scope current scope * @return a new instance of TPUCompilationResult */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TPUCompilationResult create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("TPUCompilationResult", scope.makeOpName("TPUCompilationResult")); opBuilder = scope.apply(opBuilder); return new TPUCompilationResult(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUCompilationResult"; - - private Output output; - - private TPUCompilationResult(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUEmbeddingActivations.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUEmbeddingActivations.java index 77c2036379c..21b7820aca7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUEmbeddingActivations.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUEmbeddingActivations.java @@ -24,23 +24,36 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; /** * An op enabling differentiation of TPU Embeddings. - *

* This op simply returns its first input, which is assumed to have been sliced * from the Tensors returned by TPUEmbeddingDequeueActivations. The presence of * this op, and its first argument being a trainable Variable, enables automatic * differentiation of graphs containing embeddings via the TPU Embedding Python * libraries. + * + * @deprecated use {@link org.tensorflow.op.tpu.EmbeddingActivations} instead */ +@Deprecated public final class TPUEmbeddingActivations extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUEmbeddingActivations"; + + private Output output; + + private TPUEmbeddingActivations(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TPUEmbeddingActivations operation. - * + * * @param scope current scope * @param embeddingVariable A trainable variable, enabling optimizers to find this op. * @param slicedActivations The embedding activations Tensor to return. @@ -50,8 +63,11 @@ public final class TPUEmbeddingActivations extends RawOp implements Operand embeddingVariable, Operand slicedActivations, Long tableId, Long lookupId) { + @Endpoint( + describeByClass = true + ) + public static TPUEmbeddingActivations create(Scope scope, Operand embeddingVariable, + Operand slicedActivations, Long tableId, Long lookupId) { OperationBuilder opBuilder = scope.env().opBuilder("TPUEmbeddingActivations", scope.makeOpName("TPUEmbeddingActivations")); opBuilder.addInput(embeddingVariable.asOutput()); opBuilder.addInput(slicedActivations.asOutput()); @@ -60,26 +76,18 @@ public static TPUEmbeddingActivations create(Scope scope, Operand embe opBuilder.setAttr("lookup_id", lookupId); return new TPUEmbeddingActivations(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUEmbeddingActivations"; - - private Output output; - - private TPUEmbeddingActivations(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java index 32d9db030d3..fd9853a0e28 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicateMetadata.java @@ -17,130 +17,42 @@ package org.tensorflow.op.tpu; +import java.util.Arrays; import java.util.List; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; /** * Metadata indicating how the TPU computation should be replicated. - *

- * This operation holds the metadata common to operations of a `tpu.replicate()` computation subgraph. + * This operation holds the metadata common to operations of a {@code tpu.replicate()} computation subgraph. + * + * @deprecated use {@link org.tensorflow.op.tpu.ReplicateMetadata} instead */ +@Deprecated public final class TPUReplicateMetadata extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.TPUReplicateMetadata} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. - */ - public Options numCoresPerReplica(Long numCoresPerReplica) { - this.numCoresPerReplica = numCoresPerReplica; - return this; - } - - /** - * @param topology TopologyProto indicating the topology of the TPU pod slice. - */ - public Options topology(String topology) { - this.topology = topology; - return this; - } - - /** - * @param useTpu Whether to place the computation on the TPU. - */ - public Options useTpu(Boolean useTpu) { - this.useTpu = useTpu; - return this; - } - - /** - * @param deviceAssignment The assignment of devices for the computation. - */ - public Options deviceAssignment(List deviceAssignment) { - this.deviceAssignment = deviceAssignment; - return this; - } - - /** - * @param computationShape DEPRECATED. Use num_cores_per_replica instead. - */ - public Options computationShape(List computationShape) { - this.computationShape = computationShape; - return this; - } - - /** - * @param hostComputeCore - */ - public Options hostComputeCore(List hostComputeCore) { - this.hostComputeCore = hostComputeCore; - return this; - } - - /** - * @param paddingMap - */ - public Options paddingMap(List paddingMap) { - this.paddingMap = paddingMap; - return this; - } - - /** - * @param stepMarkerLocation - */ - public Options stepMarkerLocation(String stepMarkerLocation) { - this.stepMarkerLocation = stepMarkerLocation; - return this; - } - - /** - * @param allowSoftPlacement - */ - public Options allowSoftPlacement(Boolean allowSoftPlacement) { - this.allowSoftPlacement = allowSoftPlacement; - return this; - } - - /** - * @param useSpmdForXlaPartitioning - */ - public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { - this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; - return this; - } - - private Long numCoresPerReplica; - private String topology; - private Boolean useTpu; - private List deviceAssignment; - private List computationShape; - private List hostComputeCore; - private List paddingMap; - private String stepMarkerLocation; - private Boolean allowSoftPlacement; - private Boolean useSpmdForXlaPartitioning; - - private Options() { - } + public static final String OP_NAME = "TPUReplicateMetadata"; + + private TPUReplicateMetadata(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new TPUReplicateMetadata operation. - * + * * @param scope current scope * @param numReplicas Number of replicas of the computation - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of TPUReplicateMetadata */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static TPUReplicateMetadata create(Scope scope, Long numReplicas, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicateMetadata", scope.makeOpName("TPUReplicateMetadata")); opBuilder = scope.apply(opBuilder); @@ -158,28 +70,28 @@ public static TPUReplicateMetadata create(Scope scope, Long numReplicas, Options } if (opts.deviceAssignment != null) { long[] deviceAssignmentArray = new long[opts.deviceAssignment.size()]; - for (int i = 0; i < deviceAssignmentArray.length; ++i) { + for (int i = 0 ; i < deviceAssignmentArray.length ; i++) { deviceAssignmentArray[i] = opts.deviceAssignment.get(i); } opBuilder.setAttr("device_assignment", deviceAssignmentArray); } if (opts.computationShape != null) { long[] computationShapeArray = new long[opts.computationShape.size()]; - for (int i = 0; i < computationShapeArray.length; ++i) { + for (int i = 0 ; i < computationShapeArray.length ; i++) { computationShapeArray[i] = opts.computationShape.get(i); } opBuilder.setAttr("computation_shape", computationShapeArray); } if (opts.hostComputeCore != null) { String[] hostComputeCoreArray = new String[opts.hostComputeCore.size()]; - for (int i = 0; i < hostComputeCoreArray.length; ++i) { + for (int i = 0 ; i < hostComputeCoreArray.length ; i++) { hostComputeCoreArray[i] = opts.hostComputeCore.get(i); } opBuilder.setAttr("host_compute_core", hostComputeCoreArray); } if (opts.paddingMap != null) { String[] paddingMapArray = new String[opts.paddingMap.size()]; - for (int i = 0; i < paddingMapArray.length; ++i) { + for (int i = 0 ; i < paddingMapArray.length ; i++) { paddingMapArray[i] = opts.paddingMap.get(i); } opBuilder.setAttr("padding_map", paddingMapArray); @@ -197,81 +109,326 @@ public static TPUReplicateMetadata create(Scope scope, Long numReplicas, Options } return new TPUReplicateMetadata(opBuilder.build()); } - + /** + * Sets the numCoresPerReplica option. + * * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + * @return this Options instance. */ public static Options numCoresPerReplica(Long numCoresPerReplica) { return new Options().numCoresPerReplica(numCoresPerReplica); } - + /** + * Sets the topology option. + * * @param topology TopologyProto indicating the topology of the TPU pod slice. + * @return this Options instance. */ public static Options topology(String topology) { return new Options().topology(topology); } - + /** + * Sets the useTpu option. + * * @param useTpu Whether to place the computation on the TPU. + * @return this Options instance. */ public static Options useTpu(Boolean useTpu) { return new Options().useTpu(useTpu); } - + /** + * Sets the deviceAssignment option. + * * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. */ public static Options deviceAssignment(List deviceAssignment) { return new Options().deviceAssignment(deviceAssignment); } - + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public static Options deviceAssignment(Long[] deviceAssignment) { + return new Options().deviceAssignment(deviceAssignment); + } + + /** + * Sets the computationShape option. + * * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. */ public static Options computationShape(List computationShape) { return new Options().computationShape(computationShape); } - + /** - * @param hostComputeCore + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public static Options computationShape(Long[] computationShape) { + return new Options().computationShape(computationShape); + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. */ public static Options hostComputeCore(List hostComputeCore) { return new Options().hostComputeCore(hostComputeCore); } - + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public static Options hostComputeCore(String[] hostComputeCore) { + return new Options().hostComputeCore(hostComputeCore); + } + /** - * @param paddingMap + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. */ public static Options paddingMap(List paddingMap) { return new Options().paddingMap(paddingMap); } - + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public static Options paddingMap(String[] paddingMap) { + return new Options().paddingMap(paddingMap); + } + /** - * @param stepMarkerLocation + * Sets the stepMarkerLocation option. + * + * @param stepMarkerLocation the stepMarkerLocation option + * @return this Options instance. */ public static Options stepMarkerLocation(String stepMarkerLocation) { return new Options().stepMarkerLocation(stepMarkerLocation); } - + /** - * @param allowSoftPlacement + * Sets the allowSoftPlacement option. + * + * @param allowSoftPlacement the allowSoftPlacement option + * @return this Options instance. */ public static Options allowSoftPlacement(Boolean allowSoftPlacement) { return new Options().allowSoftPlacement(allowSoftPlacement); } - + /** - * @param useSpmdForXlaPartitioning + * Sets the useSpmdForXlaPartitioning option. + * + * @param useSpmdForXlaPartitioning the useSpmdForXlaPartitioning option + * @return this Options instance. */ public static Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { return new Options().useSpmdForXlaPartitioning(useSpmdForXlaPartitioning); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicateMetadata"; - - private TPUReplicateMetadata(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.TPUReplicateMetadata} + */ + public static class Options { + private Long numCoresPerReplica; + + private String topology; + + private Boolean useTpu; + + private List deviceAssignment; + + private List computationShape; + + private List hostComputeCore; + + private List paddingMap; + + private String stepMarkerLocation; + + private Boolean allowSoftPlacement; + + private Boolean useSpmdForXlaPartitioning; + + private Options() { + } + + /** + * Sets the numCoresPerReplica option. + * + * @param numCoresPerReplica Number of cores per replica. Used for model parallelism. + * @return this Options instance. + */ + public Options numCoresPerReplica(Long numCoresPerReplica) { + this.numCoresPerReplica = numCoresPerReplica; + return this; + } + + /** + * Sets the topology option. + * + * @param topology TopologyProto indicating the topology of the TPU pod slice. + * @return this Options instance. + */ + public Options topology(String topology) { + this.topology = topology; + return this; + } + + /** + * Sets the useTpu option. + * + * @param useTpu Whether to place the computation on the TPU. + * @return this Options instance. + */ + public Options useTpu(Boolean useTpu) { + this.useTpu = useTpu; + return this; + } + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public Options deviceAssignment(List deviceAssignment) { + this.deviceAssignment = deviceAssignment; + return this; + } + + /** + * Sets the deviceAssignment option. + * + * @param deviceAssignment The assignment of devices for the computation. + * @return this Options instance. + */ + public Options deviceAssignment(Long... deviceAssignment) { + this.deviceAssignment = Arrays.asList(deviceAssignment); + return this; + } + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public Options computationShape(List computationShape) { + this.computationShape = computationShape; + return this; + } + + /** + * Sets the computationShape option. + * + * @param computationShape DEPRECATED. Use num_cores_per_replica instead. + * @return this Options instance. + */ + public Options computationShape(Long... computationShape) { + this.computationShape = Arrays.asList(computationShape); + return this; + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public Options hostComputeCore(List hostComputeCore) { + this.hostComputeCore = hostComputeCore; + return this; + } + + /** + * Sets the hostComputeCore option. + * + * @param hostComputeCore the hostComputeCore option + * @return this Options instance. + */ + public Options hostComputeCore(String... hostComputeCore) { + this.hostComputeCore = Arrays.asList(hostComputeCore); + return this; + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public Options paddingMap(List paddingMap) { + this.paddingMap = paddingMap; + return this; + } + + /** + * Sets the paddingMap option. + * + * @param paddingMap the paddingMap option + * @return this Options instance. + */ + public Options paddingMap(String... paddingMap) { + this.paddingMap = Arrays.asList(paddingMap); + return this; + } + + /** + * Sets the stepMarkerLocation option. + * + * @param stepMarkerLocation the stepMarkerLocation option + * @return this Options instance. + */ + public Options stepMarkerLocation(String stepMarkerLocation) { + this.stepMarkerLocation = stepMarkerLocation; + return this; + } + + /** + * Sets the allowSoftPlacement option. + * + * @param allowSoftPlacement the allowSoftPlacement option + * @return this Options instance. + */ + public Options allowSoftPlacement(Boolean allowSoftPlacement) { + this.allowSoftPlacement = allowSoftPlacement; + return this; + } + + /** + * Sets the useSpmdForXlaPartitioning option. + * + * @param useSpmdForXlaPartitioning the useSpmdForXlaPartitioning option + * @return this Options instance. + */ + public Options useSpmdForXlaPartitioning(Boolean useSpmdForXlaPartitioning) { + this.useSpmdForXlaPartitioning = useSpmdForXlaPartitioning; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedInput.java index 7063310c20d..2480ab6c427 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedInput.java @@ -25,75 +25,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Connects N inputs to an N-way replicated TPU computation. - *

- * This operation holds a replicated input to a `tpu.replicate()` computation subgraph. + * This operation holds a replicated input to a {@code tpu.replicate()} computation subgraph. * Each replicated input has the same shape and type alongside the output. - *

- * For example: - *

{@code
- * %a = "tf.opA"()
- * %b = "tf.opB"()
- * %replicated_input = "tf.TPUReplicatedInput"(%a, %b)
- * %computation = "tf.Computation"(%replicated_input)
- * }
- * The above computation has a replicated input of two replicas. - * - * @param data type for {@code output()} output + *

For example: + *

+ * %a = "tf.opA"()
+ * %b = "tf.opB"()
+ * %replicated_input = "tf.TPUReplicatedInput"(%a, %b)
+ * %computation = "tf.Computation"(%replicated_input)
+ * 
+ *

The above computation has a replicated input of two replicas. + * + * @param data type for {@code output} output + * + * @deprecated use {@link org.tensorflow.op.tpu.ReplicatedInput} instead */ +@Deprecated public final class TPUReplicatedInput extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.tpu.TPUReplicatedInput} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param isMirroredVariable - */ - public Options isMirroredVariable(Boolean isMirroredVariable) { - this.isMirroredVariable = isMirroredVariable; - return this; - } - - /** - * @param index - */ - public Options index(Long index) { - this.index = index; - return this; - } - - /** - * @param isPacked - */ - public Options isPacked(Boolean isPacked) { - this.isPacked = isPacked; - return this; - } - - private Boolean isMirroredVariable; - private Long index; - private Boolean isPacked; - - private Options() { - } + public static final String OP_NAME = "TPUReplicatedInput"; + + private Output output; + + private TPUReplicatedInput(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new TPUReplicatedInput operation. - * + * * @param scope current scope - * @param inputs - * @param options carries optional attributes values + * @param inputs the inputs value + * @param options carries optional attribute values + * @param data type for {@code TPUReplicatedInput} output and operands * @return a new instance of TPUReplicatedInput */ - @Endpoint(describeByClass = true) - public static TPUReplicatedInput create(Scope scope, Iterable> inputs, Options... options) { + @Endpoint( + describeByClass = true + ) + public static TPUReplicatedInput create(Scope scope, + Iterable> inputs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedInput", scope.makeOpName("TPUReplicatedInput")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.apply(opBuilder); @@ -110,49 +89,97 @@ public static TPUReplicatedInput create(Scope scope, Iterab } } } - return new TPUReplicatedInput(opBuilder.build()); + return new TPUReplicatedInput<>(opBuilder.build()); } - + /** - * @param isMirroredVariable + * Sets the isMirroredVariable option. + * + * @param isMirroredVariable the isMirroredVariable option + * @return this Options instance. */ public static Options isMirroredVariable(Boolean isMirroredVariable) { return new Options().isMirroredVariable(isMirroredVariable); } - + /** - * @param index + * Sets the index option. + * + * @param index the index option + * @return this Options instance. */ public static Options index(Long index) { return new Options().index(index); } - + /** - * @param isPacked + * Sets the isPacked option. + * + * @param isPacked the isPacked option + * @return this Options instance. */ public static Options isPacked(Boolean isPacked) { return new Options().isPacked(isPacked); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicatedInput"; - - private Output output; - - private TPUReplicatedInput(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.tpu.TPUReplicatedInput} + */ + public static class Options { + private Boolean isMirroredVariable; + + private Long index; + + private Boolean isPacked; + + private Options() { + } + + /** + * Sets the isMirroredVariable option. + * + * @param isMirroredVariable the isMirroredVariable option + * @return this Options instance. + */ + public Options isMirroredVariable(Boolean isMirroredVariable) { + this.isMirroredVariable = isMirroredVariable; + return this; + } + + /** + * Sets the index option. + * + * @param index the index option + * @return this Options instance. + */ + public Options index(Long index) { + this.index = index; + return this; + } + + /** + * Sets the isPacked option. + * + * @param isPacked the isPacked option + * @return this Options instance. + */ + public Options isPacked(Boolean isPacked) { + this.isPacked = isPacked; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedOutput.java index b6571949586..7c2ab316647 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPUReplicatedOutput.java @@ -27,66 +27,74 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Connects N outputs from an N-way replicated TPU computation. - *

- * This operation holds a replicated output from a `tpu.replicate()` computation subgraph. + * This operation holds a replicated output from a {@code tpu.replicate()} computation subgraph. * Each replicated output has the same shape and type alongside the input. - *

- * For example: - *

{@code
- * %computation = "tf.Computation"()
- * %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
- * }
- * The above computation has a replicated output of two replicas. - * - * @param data type for {@code outputs()} output + *

For example: + *

+ * %computation = "tf.Computation"()
+ * %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
+ * 
+ *

The above computation has a replicated output of two replicas. + * + * @param data type for {@code outputs} output + * + * @deprecated use {@link org.tensorflow.op.tpu.ReplicatedOutput} instead */ +@Deprecated public final class TPUReplicatedOutput extends RawOp implements Iterable> { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TPUReplicatedOutput"; + + private List> outputs; + + @SuppressWarnings("unchecked") + private TPUReplicatedOutput(Operation operation) { + super(operation); + int outputIdx = 0; + int outputsLength = operation.outputListLength("outputs"); + outputs = Arrays.asList((Output[]) operation.outputList(outputIdx, outputsLength)); + outputIdx += outputsLength; + } + /** * Factory method to create a class wrapping a new TPUReplicatedOutput operation. - * + * * @param scope current scope - * @param input - * @param numReplicas + * @param input the input value + * @param numReplicas the value of the numReplicas property + * @param data type for {@code TPUReplicatedOutput} output and operands * @return a new instance of TPUReplicatedOutput */ - @Endpoint(describeByClass = true) - public static TPUReplicatedOutput create(Scope scope, Operand input, Long numReplicas) { + @Endpoint( + describeByClass = true + ) + public static TPUReplicatedOutput create(Scope scope, Operand input, + Long numReplicas) { OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedOutput", scope.makeOpName("TPUReplicatedOutput")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("num_replicas", numReplicas); - return new TPUReplicatedOutput(opBuilder.build()); + return new TPUReplicatedOutput<>(opBuilder.build()); } - + /** + * Gets outputs. + * + * @return outputs. */ public List> outputs() { return outputs; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) outputs.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TPUReplicatedOutput"; - - private List> outputs; - - @SuppressWarnings("unchecked") - private TPUReplicatedOutput(Operation operation) { - super(operation); - int outputIdx = 0; - int outputsLength = operation.outputListLength("outputs"); - outputs = Arrays.asList((Output[])operation.outputList(outputIdx, outputsLength)); - outputIdx += outputsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/WorkerHeartbeat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/WorkerHeartbeat.java index 507d13eab75..37657c395dd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/WorkerHeartbeat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/WorkerHeartbeat.java @@ -24,52 +24,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TString; /** * Worker heartbeat op. - *

* Heartbeats may be sent periodically to indicate the coordinator is still active, * to retrieve the current worker status and to expedite shutdown when necessary. */ public final class WorkerHeartbeat extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "WorkerHeartbeat"; + + private Output response; + + private WorkerHeartbeat(Operation operation) { + super(operation); + int outputIdx = 0; + response = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new WorkerHeartbeat operation. - * + * * @param scope current scope * @param request A string tensor containing a serialized WorkerHeartbeatRequest * @return a new instance of WorkerHeartbeat */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static WorkerHeartbeat create(Scope scope, Operand request) { OperationBuilder opBuilder = scope.env().opBuilder("WorkerHeartbeat", scope.makeOpName("WorkerHeartbeat")); opBuilder.addInput(request.asOutput()); opBuilder = scope.apply(opBuilder); return new WorkerHeartbeat(opBuilder.build()); } - + /** + * Gets response. * A string tensor containing a serialized WorkerHeartbeatResponse + * @return response. */ public Output response() { return response; } - + @Override public Output asOutput() { return response; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "WorkerHeartbeat"; - - private Output response; - - private WorkerHeartbeat(Operation operation) { - super(operation); - int outputIdx = 0; - response = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorApplyGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorApplyGradient.java index ee5fe7db4b5..a8e61a8ae00 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorApplyGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorApplyGradient.java @@ -30,23 +30,35 @@ /** * Applies a gradient to a given accumulator. - *

* Does not add if local_step is lesser than the accumulator's global_step. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class AccumulatorApplyGradient extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulatorApplyGradient"; + + private AccumulatorApplyGradient(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new AccumulatorApplyGradient operation. - * + * * @param scope current scope * @param handle The handle to a accumulator. * @param localStep The local_step value at which the gradient was computed. * @param gradient A tensor of the gradient to be accumulated. * @return a new instance of AccumulatorApplyGradient */ - @Endpoint(describeByClass = true) - public static AccumulatorApplyGradient create(Scope scope, Operand handle, Operand localStep, Operand gradient) { + @Endpoint( + describeByClass = true + ) + public static AccumulatorApplyGradient create(Scope scope, Operand handle, + Operand localStep, Operand gradient) { OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorApplyGradient", scope.makeOpName("AccumulatorApplyGradient")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(localStep.asOutput()); @@ -54,11 +66,4 @@ public static AccumulatorApplyGradient create(Scope scope, Operand hand opBuilder = scope.apply(opBuilder); return new AccumulatorApplyGradient(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulatorApplyGradient"; - - private AccumulatorApplyGradient(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorNumAccumulated.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorNumAccumulated.java index 400f8951523..9accba8bb08 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorNumAccumulated.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorNumAccumulated.java @@ -31,44 +31,51 @@ /** * Returns the number of gradients aggregated in the given accumulators. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class AccumulatorNumAccumulated extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulatorNumAccumulated"; + + private Output numAccumulated; + + private AccumulatorNumAccumulated(Operation operation) { + super(operation); + int outputIdx = 0; + numAccumulated = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AccumulatorNumAccumulated operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @return a new instance of AccumulatorNumAccumulated */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static AccumulatorNumAccumulated create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorNumAccumulated", scope.makeOpName("AccumulatorNumAccumulated")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); return new AccumulatorNumAccumulated(opBuilder.build()); } - + /** + * Gets numAccumulated. * The number of gradients aggregated in the given accumulator. + * @return numAccumulated. */ public Output numAccumulated() { return numAccumulated; } - + @Override public Output asOutput() { return numAccumulated; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulatorNumAccumulated"; - - private Output numAccumulated; - - private AccumulatorNumAccumulated(Operation operation) { - super(operation); - int outputIdx = 0; - numAccumulated = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorSetGlobalStep.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorSetGlobalStep.java index 3b4cd9c093b..a8ea01bf654 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorSetGlobalStep.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorSetGlobalStep.java @@ -29,34 +29,39 @@ /** * Updates the accumulator with a new value for global_step. - *

* Logs warning if the accumulator's value is already higher than * new_global_step. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class AccumulatorSetGlobalStep extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulatorSetGlobalStep"; + + private AccumulatorSetGlobalStep(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new AccumulatorSetGlobalStep operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @param newGlobalStep The new global_step value to set. * @return a new instance of AccumulatorSetGlobalStep */ - @Endpoint(describeByClass = true) - public static AccumulatorSetGlobalStep create(Scope scope, Operand handle, Operand newGlobalStep) { + @Endpoint( + describeByClass = true + ) + public static AccumulatorSetGlobalStep create(Scope scope, Operand handle, + Operand newGlobalStep) { OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorSetGlobalStep", scope.makeOpName("AccumulatorSetGlobalStep")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(newGlobalStep.asOutput()); opBuilder = scope.apply(opBuilder); return new AccumulatorSetGlobalStep(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulatorSetGlobalStep"; - - private AccumulatorSetGlobalStep(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorTakeGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorTakeGradient.java index ed8becceee2..b34ca228cbe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorTakeGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/AccumulatorTakeGradient.java @@ -32,58 +32,66 @@ /** * Extracts the average gradient in the given ConditionalAccumulator. - *

* The op blocks until sufficient (i.e., more than num_required) * gradients have been accumulated. If the accumulator has already * aggregated more than num_required gradients, it returns the average of * the accumulated gradients. Also automatically increments the recorded * global_step in the accumulator by 1, and resets the aggregate to 0. - * - * @param data type for {@code average()} output + * + * @param data type for {@code average} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class AccumulatorTakeGradient extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "AccumulatorTakeGradient"; + + private Output average; + + private AccumulatorTakeGradient(Operation operation) { + super(operation); + int outputIdx = 0; + average = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new AccumulatorTakeGradient operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @param numRequired Number of gradients required before we return an aggregate. * @param dtype The data type of accumulated gradients. Needs to correspond to the type * of the accumulator. + * @param data type for {@code AccumulatorTakeGradient} output and operands * @return a new instance of AccumulatorTakeGradient */ - @Endpoint(describeByClass = true) - public static AccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static AccumulatorTakeGradient create(Scope scope, + Operand handle, Operand numRequired, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorTakeGradient", scope.makeOpName("AccumulatorTakeGradient")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numRequired.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new AccumulatorTakeGradient(opBuilder.build()); + return new AccumulatorTakeGradient<>(opBuilder.build()); } - + /** + * Gets average. * The average of the accumulated gradients. + * @return average. */ public Output average() { return average; } - + @Override public Output asOutput() { return average; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "AccumulatorTakeGradient"; - - private Output average; - - private AccumulatorTakeGradient(Operation operation) { - super(operation); - int outputIdx = 0; - average = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdaMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdaMax.java index d44777f59f0..2456c6bdef6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdaMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdaMax.java @@ -24,44 +24,33 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Update '*var' according to the AdaMax algorithm. - *

- * m_t <- beta1 * m_{t-1} + (1 - beta1) * g - * v_t <- max(beta2 * v_{t-1}, abs(g)) - * variable <- variable - learning_rate / (1 - beta1^t) * m_t / (v_t + epsilon) - * - * @param data type for {@code out()} output + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * v_t <- max(beta2 * v_{t-1}, abs(g)) + * variable <- variable - learning_rate / (1 - beta1^t) * m_t / (v_t + epsilon) + * + * @param data type for {@code out} output */ public final class ApplyAdaMax extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdaMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyAdaMax"; + + private Output out; + + private ApplyAdaMax(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdaMax operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -72,11 +61,16 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdaMax} output and operands * @return a new instance of ApplyAdaMax */ - @Endpoint(describeByClass = true) - public static ApplyAdaMax create(Scope scope, Operand var, Operand m, Operand v, Operand beta1Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyAdaMax create(Scope scope, Operand var, Operand m, + Operand v, Operand beta1Power, Operand lr, Operand beta1, Operand beta2, + Operand epsilon, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdaMax", scope.makeOpName("ApplyAdaMax")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); @@ -95,38 +89,55 @@ public static ApplyAdaMax create(Scope scope, Operand va } } } - return new ApplyAdaMax(opBuilder.build()); + return new ApplyAdaMax<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdaMax"; - - private Output out; - - private ApplyAdaMax(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdaMax} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdadelta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdadelta.java index b780e2040da..5148311bfac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdadelta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdadelta.java @@ -29,40 +29,33 @@ /** * Update '*var' according to the adadelta scheme. - *

* accum = rho() * accum + (1 - rho()) * grad.square(); * update = (update_accum + epsilon).sqrt() * (accum + epsilon()).rsqrt() * grad; * update_accum = rho() * update_accum + (1 - rho()) * update.square(); * var -= update; - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyAdadelta extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdadelta} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var, accum and update_accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyAdadelta"; + + private Output out; + + private ApplyAdadelta(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdadelta operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -71,11 +64,16 @@ private Options() { * @param rho Decay factor. Must be a scalar. * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdadelta} output and operands * @return a new instance of ApplyAdadelta */ - @Endpoint(describeByClass = true) - public static ApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyAdadelta create(Scope scope, Operand var, + Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdadelta", scope.makeOpName("ApplyAdadelta")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -92,37 +90,53 @@ public static ApplyAdadelta create(Scope scope, Operand } } } - return new ApplyAdadelta(opBuilder.build()); + return new ApplyAdadelta<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var, accum and update_accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdadelta"; - - private Output out; - - private ApplyAdadelta(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdadelta} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var, accum and update_accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagrad.java index e519957a71d..63903e9cebe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagrad.java @@ -29,58 +29,45 @@ /** * Update '*var' according to the adagrad scheme. - *

* accum += grad * grad * var -= lr * grad * (1 / sqrt(accum)) - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyAdagrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ApplyAdagrad"; + + private Output out; + + private ApplyAdagrad(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdagrad} output and operands * @return a new instance of ApplyAdagrad */ - @Endpoint(describeByClass = true) - public static ApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyAdagrad create(Scope scope, Operand var, + Operand accum, Operand lr, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdagrad", scope.makeOpName("ApplyAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -97,45 +84,78 @@ public static ApplyAdagrad create(Scope scope, Operand v } } } - return new ApplyAdagrad(opBuilder.build()); + return new ApplyAdagrad<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdagrad"; - - private Output out; - - private ApplyAdagrad(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = updateSlots; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradDa.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradDa.java index 815c64c23f8..5bf5c640275 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradDa.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradDa.java @@ -30,35 +30,29 @@ /** * Update '*var' according to the proximal adagrad scheme. - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyAdagradDa extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagradDa} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyAdagradDA"; + + private Output out; + + private ApplyAdagradDa(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ApplyAdagradDa operation. - * + * Factory method to create a class wrapping a new ApplyAdagradDA operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -68,11 +62,16 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdagradDA} output and operands * @return a new instance of ApplyAdagradDa */ - @Endpoint(describeByClass = true) - public static ApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyAdagradDa create(Scope scope, Operand var, + Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, + Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdagradDA", scope.makeOpName("ApplyAdagradDa")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(gradientAccumulator.asOutput()); @@ -90,37 +89,53 @@ public static ApplyAdagradDa create(Scope scope, Operand } } } - return new ApplyAdagradDa(opBuilder.build()); + return new ApplyAdagradDa<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdagradDA"; - - private Output out; - - private ApplyAdagradDa(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagradDa} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradV2.java index b74a36ef265..f35c5edd6e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdagradV2.java @@ -24,63 +24,47 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Update '*var' according to the adagrad scheme. - *

* accum += grad * grad * var -= lr * grad * (1 / sqrt(accum)) - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ public final class ApplyAdagradV2 extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagradV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ApplyAdagradV2"; + + private Output out; + + private ApplyAdagradV2(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdagradV2 operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdagradV2} output and operands * @return a new instance of ApplyAdagradV2 */ - @Endpoint(describeByClass = true) - public static ApplyAdagradV2 create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyAdagradV2 create(Scope scope, Operand var, + Operand accum, Operand lr, Operand epsilon, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdagradV2", scope.makeOpName("ApplyAdagradV2")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -98,45 +82,78 @@ public static ApplyAdagradV2 create(Scope scope, Operand } } } - return new ApplyAdagradV2(opBuilder.build()); + return new ApplyAdagradV2<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdagradV2"; - - private Output out; - - private ApplyAdagradV2(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagradV2} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = updateSlots; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdam.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdam.java index ce33080b7a1..5340dda8697 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdam.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAdam.java @@ -29,50 +29,33 @@ /** * Update '*var' according to the Adam algorithm. - *

- * $$lr_t := \text{learning\_rate} * \sqrt{1 - beta_2^t} / (1 - beta_1^t)$$ + * $$lr_t := \text{learning_rate} * \sqrt{1 - beta_2^t} / (1 - beta_1^t)$$ * $$m_t := beta_1 * m_{t-1} + (1 - beta_1) * g$$ * $$v_t := beta_2 * v_{t-1} + (1 - beta_2) * g * g$$ * $$variable := variable - lr_t * m_t / (\sqrt{v_t} + \epsilon)$$ - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyAdam extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAdam} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, uses the nesterov update. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ApplyAdam"; + + private Output out; + + private ApplyAdam(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAdam operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -84,11 +67,16 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAdam} output and operands * @return a new instance of ApplyAdam */ - @Endpoint(describeByClass = true) - public static ApplyAdam create(Scope scope, Operand var, Operand m, Operand v, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyAdam create(Scope scope, Operand var, Operand m, + Operand v, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, + Operand beta2, Operand epsilon, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyAdam", scope.makeOpName("ApplyAdam")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); @@ -111,45 +99,78 @@ public static ApplyAdam create(Scope scope, Operand var, } } } - return new ApplyAdam(opBuilder.build()); + return new ApplyAdam<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, uses the nesterov update. + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, uses the nesterov update. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAdam"; - - private Output out; - - private ApplyAdam(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAdam} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, uses the nesterov update. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = useNesterov; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAddSign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAddSign.java index 9d86187da98..cd78906708e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAddSign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyAddSign.java @@ -29,40 +29,32 @@ /** * Update '*var' according to the AddSign update. - *

- * m_t <- beta1 * m_{t-1} + (1 - beta1) * g - * update <- (alpha + sign_decay * sign(g) *sign(m)) * g - * variable <- variable - lr_t * update - * - * @param data type for {@code out()} output + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * update <- (alpha + sign_decay * sign(g) *sign(m)) * g + * variable <- variable - lr_t * update + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyAddSign extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyAddSign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and m tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyAddSign"; + + private Output out; + + private ApplyAddSign(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyAddSign operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -71,11 +63,16 @@ private Options() { * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyAddSign} output and operands * @return a new instance of ApplyAddSign */ - @Endpoint(describeByClass = true) - public static ApplyAddSign create(Scope scope, Operand var, Operand m, Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyAddSign create(Scope scope, Operand var, Operand m, + Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyAddSign", scope.makeOpName("ApplyAddSign")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); @@ -92,38 +89,55 @@ public static ApplyAddSign create(Scope scope, Operand v } } } - return new ApplyAddSign(opBuilder.build()); + return new ApplyAddSign<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and m tensors is + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and m tensors is * protected by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyAddSign"; - - private Output out; - - private ApplyAddSign(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyAddSign} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and m tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyCenteredRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyCenteredRmsProp.java index a56382a9044..8b5c4862b70 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyCenteredRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyCenteredRmsProp.java @@ -29,55 +29,43 @@ /** * Update '*var' according to the centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient - *

- * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * mg <- rho * mg_{t-1} + (1-rho) * grad - * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) - * var <- var - mom - * - * @param data type for {@code out()} output + *

Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) + *

mg <- rho * mg_{t-1} + (1-rho) * grad + * ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) + * var <- var - mom + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyCenteredRmsProp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyCenteredRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyCenteredRMSProp"; + + private Output out; + + private ApplyCenteredRmsProp(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ApplyCenteredRmsProp operation. - * + * Factory method to create a class wrapping a new ApplyCenteredRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -88,11 +76,16 @@ private Options() { * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyCenteredRMSProp} output and operands * @return a new instance of ApplyCenteredRmsProp */ - @Endpoint(describeByClass = true) - public static ApplyCenteredRmsProp create(Scope scope, Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyCenteredRmsProp create(Scope scope, Operand var, + Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, + Operand momentum, Operand epsilon, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyCenteredRMSProp", scope.makeOpName("ApplyCenteredRmsProp")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(mg.asOutput()); @@ -111,38 +104,55 @@ public static ApplyCenteredRmsProp create(Scope scope, Oper } } } - return new ApplyCenteredRmsProp(opBuilder.build()); + return new ApplyCenteredRmsProp<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, mg, ms, and mom tensors is * protected by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyCenteredRMSProp"; - - private Output out; - - private ApplyCenteredRmsProp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyCenteredRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, mg, ms, and mom tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyFtrl.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyFtrl.java index 71b3488d323..2c8153a2480 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyFtrl.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyFtrl.java @@ -29,53 +29,36 @@ /** * Update '*var' according to the Ftrl-proximal scheme. - *

* grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad * grad * linear += grad_with_shrinkage - - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyFtrl extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyFtrl} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param multiplyLinearByLr - */ - public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { - this.multiplyLinearByLr = multiplyLinearByLr; - return this; - } - - private Boolean useLocking; - private Boolean multiplyLinearByLr; - - private Options() { - } + public static final String OP_NAME = "ApplyFtrlV2"; + + private Output out; + + private ApplyFtrl(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ApplyFtrl operation. - * + * Factory method to create a class wrapping a new ApplyFtrlV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -84,13 +67,18 @@ private Options() { * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage + * @param l2Shrinkage the l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyFtrlV2} output and operands * @return a new instance of ApplyFtrl */ - @Endpoint(describeByClass = true) - public static ApplyFtrl create(Scope scope, Operand var, Operand accum, Operand linear, Operand grad, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyFtrl create(Scope scope, Operand var, Operand accum, + Operand linear, Operand grad, Operand lr, Operand l1, Operand l2, + Operand l2Shrinkage, Operand lrPower, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyFtrlV2", scope.makeOpName("ApplyFtrl")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -112,45 +100,78 @@ public static ApplyFtrl create(Scope scope, Operand var, } } } - return new ApplyFtrl(opBuilder.build()); + return new ApplyFtrl<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param multiplyLinearByLr + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. */ public static Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return new Options().multiplyLinearByLr(multiplyLinearByLr); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyFtrlV2"; - - private Output out; - - private ApplyFtrl(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyFtrl} + */ + public static class Options { + private Boolean useLocking; + + private Boolean multiplyLinearByLr; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. + */ + public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { + this.multiplyLinearByLr = multiplyLinearByLr; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyGradientDescent.java index 049ec73a76d..3f35716e98d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyGradientDescent.java @@ -29,44 +29,42 @@ /** * Update '*var' by subtracting 'alpha' * 'delta' from it. - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyGradientDescent extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyGradientDescent"; + + private Output out; + + private ApplyGradientDescent(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyGradientDescent} output and operands * @return a new instance of ApplyGradientDescent */ - @Endpoint(describeByClass = true) - public static ApplyGradientDescent create(Scope scope, Operand var, Operand alpha, Operand delta, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyGradientDescent create(Scope scope, Operand var, + Operand alpha, Operand delta, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyGradientDescent", scope.makeOpName("ApplyGradientDescent")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); @@ -79,37 +77,53 @@ public static ApplyGradientDescent create(Scope scope, Oper } } } - return new ApplyGradientDescent(opBuilder.build()); + return new ApplyGradientDescent<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, the subtraction will be protected by a lock; + * Sets the useLocking option. + * + * @param useLocking If {@code True}, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyGradientDescent"; - - private Output out; - - private ApplyGradientDescent(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyMomentum.java index 320edadbfb0..baf8e69a794 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyMomentum.java @@ -29,63 +29,47 @@ /** * Update '*var' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * accum = accum * momentum + grad + *

accum = accum * momentum + grad * var -= lr * accum - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyMomentum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, the tensor passed to compute grad will be - * var - lr * momentum * accum, so in the end, the var you get is actually - * var - lr * momentum * accum. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ApplyMomentum"; + + private Output out; + + private ApplyMomentum(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyMomentum} output and operands * @return a new instance of ApplyMomentum */ - @Endpoint(describeByClass = true) - public static ApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyMomentum create(Scope scope, Operand var, + Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyMomentum", scope.makeOpName("ApplyMomentum")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -103,47 +87,82 @@ public static ApplyMomentum create(Scope scope, Operand } } } - return new ApplyMomentum(opBuilder.build()); + return new ApplyMomentum<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be * var - lr * momentum * accum, so in the end, the var you get is actually * var - lr * momentum * accum. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyMomentum"; - - private Output out; - - private ApplyMomentum(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be + * var - lr * momentum * accum, so in the end, the var you get is actually + * var - lr * momentum * accum. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = useNesterov; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyPowerSign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyPowerSign.java index bea7429ed04..93563a4ba4a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyPowerSign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyPowerSign.java @@ -29,40 +29,32 @@ /** * Update '*var' according to the AddSign update. - *

- * m_t <- beta1 * m_{t-1} + (1 - beta1) * g - * update <- exp(logbase * sign_decay * sign(g) * sign(m_t)) * g - * variable <- variable - lr_t * update - * - * @param data type for {@code out()} output + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * update <- exp(logbase * sign_decay * sign(g) * sign(m_t)) * g + * variable <- variable - lr_t * update + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyPowerSign extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyPowerSign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and m tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyPowerSign"; + + private Output out; + + private ApplyPowerSign(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyPowerSign operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -71,11 +63,16 @@ private Options() { * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyPowerSign} output and operands * @return a new instance of ApplyPowerSign */ - @Endpoint(describeByClass = true) - public static ApplyPowerSign create(Scope scope, Operand var, Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyPowerSign create(Scope scope, Operand var, + Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, + Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyPowerSign", scope.makeOpName("ApplyPowerSign")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); @@ -92,38 +89,55 @@ public static ApplyPowerSign create(Scope scope, Operand } } } - return new ApplyPowerSign(opBuilder.build()); + return new ApplyPowerSign<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and m tensors is + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and m tensors is * protected by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyPowerSign"; - - private Output out; - - private ApplyPowerSign(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyPowerSign} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and m tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalAdagrad.java index da570a57223..38ac095bdce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalAdagrad.java @@ -29,39 +29,32 @@ /** * Update '*var' and '*accum' according to FOBOS with Adagrad learning rate. - *

- * accum += grad grad - * prox_v = var - lr grad (1 / sqrt(accum)) - * var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0} - * - * @param data type for {@code out()} output + * accum += grad * grad + * prox_v = var - lr * grad * (1 / sqrt(accum)) + * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyProximalAdagrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyProximalAdagrad"; + + private Output out; + + private ApplyProximalAdagrad(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyProximalAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -69,11 +62,16 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyProximalAdagrad} output and operands * @return a new instance of ApplyProximalAdagrad */ - @Endpoint(describeByClass = true) - public static ApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyProximalAdagrad create(Scope scope, Operand var, + Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyProximalAdagrad", scope.makeOpName("ApplyProximalAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -89,37 +87,53 @@ public static ApplyProximalAdagrad create(Scope scope, Oper } } } - return new ApplyProximalAdagrad(opBuilder.build()); + return new ApplyProximalAdagrad<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyProximalAdagrad"; - - private Output out; - - private ApplyProximalAdagrad(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalGradientDescent.java index 12ea6d3a84a..727f50ef9e3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyProximalGradientDescent.java @@ -29,49 +29,47 @@ /** * Update '*var' as FOBOS algorithm with fixed learning rate. - *

- * prox_v = var - alpha delta - * var = sign(prox_v)/(1+alphal2) max{|prox_v|-alphal1,0} - * - * @param data type for {@code out()} output + * prox_v = var - alpha * delta + * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyProximalGradientDescent extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyProximalGradientDescent"; + + private Output out; + + private ApplyProximalGradientDescent(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ApplyProximalGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyProximalGradientDescent} output and operands * @return a new instance of ApplyProximalGradientDescent */ - @Endpoint(describeByClass = true) - public static ApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyProximalGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyProximalGradientDescent", scope.makeOpName("ApplyProximalGradientDescent")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); @@ -86,37 +84,53 @@ public static ApplyProximalGradientDescent create(Scope sco } } } - return new ApplyProximalGradientDescent(opBuilder.build()); + return new ApplyProximalGradientDescent<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyProximalGradientDescent"; - - private Output out; - - private ApplyProximalGradientDescent(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyRmsProp.java index df9be3f00d5..44bc56ec3a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ApplyRmsProp.java @@ -29,61 +29,56 @@ /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom - * - * @param data type for {@code out()} output + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ApplyRmsProp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ApplyRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ApplyRMSProp"; + + private Output out; + + private ApplyRmsProp(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new ApplyRmsProp operation. - * + * Factory method to create a class wrapping a new ApplyRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param ms Should be from a Variable(). * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum the momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ApplyRMSProp} output and operands * @return a new instance of ApplyRmsProp */ - @Endpoint(describeByClass = true) - public static ApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ApplyRmsProp create(Scope scope, Operand var, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, + Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ApplyRMSProp", scope.makeOpName("ApplyRmsProp")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -101,38 +96,55 @@ public static ApplyRmsProp create(Scope scope, Operand v } } } - return new ApplyRmsProp(opBuilder.build()); + return new ApplyRmsProp<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, ms, and mom tensors is protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ApplyRMSProp"; - - private Output out; - - private ApplyRmsProp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ApplyRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, ms, and mom tensors is protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/BatchMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/BatchMatMul.java index 87a25fa3ff4..6fd46605550 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/BatchMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/BatchMatMul.java @@ -29,75 +29,61 @@ /** * Multiplies slices of two tensors in batches. - *

- * Multiplies all slices of `Tensor` `x` and `y` (each slice can be + * Multiplies all slices of {@code Tensor} {@code x} and {@code y} (each slice can be * viewed as an element of a batch), and arranges the individual results * in a single output tensor of the same batch size. Each of the * individual slices can optionally be adjointed (to adjoint a matrix * means to transpose and conjugate it) before multiplication by setting - * the `adj_x` or `adj_y` flag to `True`, which are by default `False`. - *

- * The input tensors `x` and `y` are 2-D or higher with shape `[..., r_x, c_x]` - * and `[..., r_y, c_y]`. - *

- * The output tensor is 2-D or higher with shape `[..., r_o, c_o]`, where: - *

- * r_o = c_x if adj_x else r_x - * c_o = r_y if adj_y else c_y - *

- * It is computed as: - *

- * output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :]) - *

- * NOTE: `train.BatchMatMul` supports broadcasting in the batch dimensions. More + * the {@code adj_x} or {@code adj_y} flag to {@code True}, which are by default {@code False}. + *

The input tensors {@code x} and {@code y} are 2-D or higher with shape {@code [..., r_x, c_x]} + * and {@code [..., r_y, c_y]}. + *

The output tensor is 2-D or higher with shape {@code [..., r_o, c_o]}, where: + *

+ * r_o = c_x if adj_x else r_x
+ * c_o = r_y if adj_y else c_y
+ * 
+ *

It is computed as: + *

+ * output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])
+ * 
+ *

NOTE: {@code train.BatchMatMul} supports broadcasting in the batch dimensions. More * about broadcasting - * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html). - * - * - * @param data type for {@code output()} output + * here . + * + * @param data type for {@code output} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class BatchMatMul extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.BatchMatMul} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adjX If `True`, adjoint the slices of `x`. Defaults to `False`. - */ - public Options adjX(Boolean adjX) { - this.adjX = adjX; - return this; - } - - /** - * @param adjY If `True`, adjoint the slices of `y`. Defaults to `False`. - */ - public Options adjY(Boolean adjY) { - this.adjY = adjY; - return this; - } - - private Boolean adjX; - private Boolean adjY; - - private Options() { - } + public static final String OP_NAME = "BatchMatMulV2"; + + private Output output; + + private BatchMatMul(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new BatchMatMul operation. - * + * Factory method to create a class wrapping a new BatchMatMulV2 operation. + * * @param scope current scope - * @param x 2-D or higher with shape `[..., r_x, c_x]`. - * @param y 2-D or higher with shape `[..., r_y, c_y]`. - * @param options carries optional attributes values + * @param x 2-D or higher with shape {@code [..., r_x, c_x]}. + * @param y 2-D or higher with shape {@code [..., r_y, c_y]}. + * @param options carries optional attribute values + * @param data type for {@code BatchMatMulV2} output and operands * @return a new instance of BatchMatMul */ - @Endpoint(describeByClass = true) - public static BatchMatMul create(Scope scope, Operand x, Operand y, Options... options) { + @Endpoint( + describeByClass = true + ) + public static BatchMatMul create(Scope scope, Operand x, Operand y, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatMulV2", scope.makeOpName("BatchMatMul")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -112,43 +98,74 @@ public static BatchMatMul create(Scope scope, Operand x, } } } - return new BatchMatMul(opBuilder.build()); + return new BatchMatMul<>(opBuilder.build()); } - + /** - * @param adjX If `True`, adjoint the slices of `x`. Defaults to `False`. + * Sets the adjX option. + * + * @param adjX If {@code True}, adjoint the slices of {@code x}. Defaults to {@code False}. + * @return this Options instance. */ public static Options adjX(Boolean adjX) { return new Options().adjX(adjX); } - + /** - * @param adjY If `True`, adjoint the slices of `y`. Defaults to `False`. + * Sets the adjY option. + * + * @param adjY If {@code True}, adjoint the slices of {@code y}. Defaults to {@code False}. + * @return this Options instance. */ public static Options adjY(Boolean adjY) { return new Options().adjY(adjY); } - + /** - * 3-D or higher with shape `[..., r_o, c_o]` + * Gets output. + * 3-D or higher with shape {@code [..., r_o, c_o]} + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "BatchMatMulV2"; - - private Output output; - - private BatchMatMul(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.BatchMatMul} + */ + public static class Options { + private Boolean adjX; + + private Boolean adjY; + + private Options() { + } + + /** + * Sets the adjX option. + * + * @param adjX If {@code True}, adjoint the slices of {@code x}. Defaults to {@code False}. + * @return this Options instance. + */ + public Options adjX(Boolean adjX) { + this.adjX = adjX; + return this; + } + + /** + * Sets the adjY option. + * + * @param adjY If {@code True}, adjoint the slices of {@code y}. Defaults to {@code False}. + * @return this Options instance. + */ + public Options adjY(Boolean adjY) { + this.adjY = adjY; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ComputeBatchSize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ComputeBatchSize.java index fb02d2b47aa..a0e4e4906f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ComputeBatchSize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ComputeBatchSize.java @@ -24,48 +24,54 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Computes the static batch size of a dataset sans partial batches. */ public final class ComputeBatchSize extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ComputeBatchSize"; + + private Output batchSize; + + private ComputeBatchSize(Operation operation) { + super(operation); + int outputIdx = 0; + batchSize = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ComputeBatchSize operation. - * + * * @param scope current scope - * @param inputDataset + * @param inputDataset the inputDataset value * @return a new instance of ComputeBatchSize */ - @Endpoint(describeByClass = true) - public static ComputeBatchSize create(Scope scope, Operand inputDataset) { + @Endpoint( + describeByClass = true + ) + public static ComputeBatchSize create(Scope scope, Operand inputDataset) { OperationBuilder opBuilder = scope.env().opBuilder("ComputeBatchSize", scope.makeOpName("ComputeBatchSize")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.apply(opBuilder); return new ComputeBatchSize(opBuilder.build()); } - + /** + * Gets batchSize. + * + * @return batchSize. */ public Output batchSize() { return batchSize; } - + @Override public Output asOutput() { return batchSize; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ComputeBatchSize"; - - private Output batchSize; - - private ComputeBatchSize(Operation operation) { - super(operation); - int outputIdx = 0; - batchSize = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ConditionalAccumulator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ConditionalAccumulator.java index 684d9e3485e..a075065c686 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ConditionalAccumulator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ConditionalAccumulator.java @@ -32,7 +32,6 @@ /** * A conditional accumulator for aggregating gradients. - *

* The accumulator accepts gradients marked with local_step greater or * equal to the most recent global_step known to the accumulator. The * average can be extracted from the accumulator, provided sufficient @@ -40,59 +39,38 @@ * resets the aggregate to 0, and increments the global_step recorded by * the accumulator. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ConditionalAccumulator extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ConditionalAccumulator} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this accumulator is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this accumulator will be shared under the - * given name across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param reductionType - */ - public Options reductionType(String reductionType) { - this.reductionType = reductionType; - return this; - } - - private String container; - private String sharedName; - private String reductionType; - - private Options() { - } + public static final String OP_NAME = "ConditionalAccumulator"; + + private Output handle; + + private ConditionalAccumulator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ConditionalAccumulator operation. - * + * * @param scope current scope * @param dtype The type of the value being accumulated. * @param shape The shape of the values, can be [], in which case shape is unknown. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ConditionalAccumulator} output and operands * @return a new instance of ConditionalAccumulator */ - @Endpoint(describeByClass = true) - public static ConditionalAccumulator create(Scope scope, Class dtype, Shape shape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ConditionalAccumulator create(Scope scope, Class dtype, + Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ConditionalAccumulator", scope.makeOpName("ConditionalAccumulator")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); @@ -112,50 +90,99 @@ public static ConditionalAccumulator create(Scope scope, Class } return new ConditionalAccumulator(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this accumulator is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this accumulator will be shared under the * given name across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param reductionType + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. */ public static Options reductionType(String reductionType) { return new Options().reductionType(reductionType); } - + /** + * Gets handle. * The handle to the accumulator. + * @return handle. */ public Output handle() { return handle; } - + @Override public Output asOutput() { return handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ConditionalAccumulator"; - - private Output handle; - - private ConditionalAccumulator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ConditionalAccumulator} + */ + public static class Options { + private String container; + + private String sharedName; + + private String reductionType; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this accumulator is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this accumulator will be shared under the + * given name across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. + */ + public Options reductionType(String reductionType) { + this.reductionType = reductionType; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/GenerateVocabRemapping.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/GenerateVocabRemapping.java index f5e47b453d0..425698f9b52 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/GenerateVocabRemapping.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/GenerateVocabRemapping.java @@ -31,29 +31,24 @@ /** * Given a path to new and old vocabulary files, returns a remapping Tensor of - *

- * length `num_new_vocab`, where `remapping[i]` contains the row number in the old - * vocabulary that corresponds to row `i` in the new vocabulary (starting at line - * `new_vocab_offset` and up to `num_new_vocab` entities), or `-1` if entry `i` + * length {@code num_new_vocab}, where {@code remapping[i]} contains the row number in the old + * vocabulary that corresponds to row {@code i} in the new vocabulary (starting at line + * {@code new_vocab_offset} and up to {@code num_new_vocab} entities), or {@code -1} if entry {@code i} * in the new vocabulary is not in the old vocabulary. The old vocabulary is - * constrained to the first `old_vocab_size` entries if `old_vocab_size` is not the + * constrained to the first {@code old_vocab_size} entries if {@code old_vocab_size} is not the * default value of -1. - *

- * `num_vocab_offset` enables + *

{@code num_vocab_offset} enables * use in the partitioned variable case, and should generally be set through * examining partitioning info. The format of the files should be a text file, * with each line containing a single entity within the vocabulary. - *

- * For example, with `new_vocab_file` a text file containing each of the following - * elements on a single line: `[f0, f1, f2, f3]`, old_vocab_file = [f1, f0, f3], - * `num_new_vocab = 3, new_vocab_offset = 1`, the returned remapping would be - * `[0, -1, 2]`. - *

- * The op also returns a count of how many entries in the new vocabulary + *

For example, with {@code new_vocab_file} a text file containing each of the following + * elements on a single line: {@code [f0, f1, f2, f3]}, old_vocab_file = [f1, f0, f3], + * {@code num_new_vocab = 3, new_vocab_offset = 1}, the returned remapping would be + * {@code [0, -1, 2]}. + *

The op also returns a count of how many entries in the new vocabulary * were present in the old vocabulary, which is used to calculate the number of * values to initialize in a weight matrix remapping - *

- * This functionality can be used to remap both row vocabularies (typically, + *

This functionality can be used to remap both row vocabularies (typically, * features) and column vocabularies (typically, classes) from TensorFlow * checkpoints. Note that the partitioning logic relies on contiguous vocabularies * corresponding to div-partitioned variables. Moreover, the underlying remapping @@ -61,42 +56,42 @@ * use the corresponding index_table_from_file() as the FeatureColumn framework * does (as opposed to tf.feature_to_id(), which uses a CuckooTable). */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class GenerateVocabRemapping extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.GenerateVocabRemapping} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param oldVocabSize Number of entries in the old vocab file to consider. If -1, - * use the entire old vocabulary. - */ - public Options oldVocabSize(Long oldVocabSize) { - this.oldVocabSize = oldVocabSize; - return this; - } - - private Long oldVocabSize; - - private Options() { - } + public static final String OP_NAME = "GenerateVocabRemapping"; + + private Output remapping; + + private Output numPresent; + + private GenerateVocabRemapping(Operation operation) { + super(operation); + int outputIdx = 0; + remapping = operation.output(outputIdx++); + numPresent = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new GenerateVocabRemapping operation. - * + * * @param scope current scope * @param newVocabFile Path to the new vocab file. * @param oldVocabFile Path to the old vocab file. * @param newVocabOffset How many entries into the new vocab file to start reading. * @param numNewVocab Number of entries in the new vocab file to remap. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of GenerateVocabRemapping */ - @Endpoint(describeByClass = true) - public static GenerateVocabRemapping create(Scope scope, Operand newVocabFile, Operand oldVocabFile, Long newVocabOffset, Long numNewVocab, Options... options) { + @Endpoint( + describeByClass = true + ) + public static GenerateVocabRemapping create(Scope scope, Operand newVocabFile, + Operand oldVocabFile, Long newVocabOffset, Long numNewVocab, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("GenerateVocabRemapping", scope.makeOpName("GenerateVocabRemapping")); opBuilder.addInput(newVocabFile.asOutput()); opBuilder.addInput(oldVocabFile.asOutput()); @@ -112,41 +107,57 @@ public static GenerateVocabRemapping create(Scope scope, Operand newVoc } return new GenerateVocabRemapping(opBuilder.build()); } - + /** + * Sets the oldVocabSize option. + * * @param oldVocabSize Number of entries in the old vocab file to consider. If -1, * use the entire old vocabulary. + * @return this Options instance. */ public static Options oldVocabSize(Long oldVocabSize) { return new Options().oldVocabSize(oldVocabSize); } - + /** + * Gets remapping. * A Tensor of length num_new_vocab where the element at index i * is equal to the old ID that maps to the new ID i. This element is -1 for any * new ID that is not found in the old vocabulary. + * @return remapping. */ public Output remapping() { return remapping; } - + /** + * Gets numPresent. * Number of new vocab entries found in old vocab. + * @return numPresent. */ public Output numPresent() { return numPresent; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "GenerateVocabRemapping"; - - private Output remapping; - private Output numPresent; - - private GenerateVocabRemapping(Operation operation) { - super(operation); - int outputIdx = 0; - remapping = operation.output(outputIdx++); - numPresent = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.GenerateVocabRemapping} + */ + public static class Options { + private Long oldVocabSize; + + private Options() { + } + + /** + * Sets the oldVocabSize option. + * + * @param oldVocabSize Number of entries in the old vocab file to consider. If -1, + * use the entire old vocabulary. + * @return this Options instance. + */ + public Options oldVocabSize(Long oldVocabSize) { + this.oldVocabSize = oldVocabSize; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/MergeV2Checkpoints.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/MergeV2Checkpoints.java index 47a71b701ba..8ced390a7d8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/MergeV2Checkpoints.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/MergeV2Checkpoints.java @@ -28,50 +28,41 @@ /** * V2 format specific: merges the metadata files of sharded checkpoints. The - *

* result is one logical checkpoint, with one physical metadata file and renamed * data files. - *

- * Intended for "grouping" multiple checkpoints in a sharded checkpoint setup. - *

- * If delete_old_dirs is true, attempts to delete recursively the dirname of each + *

Intended for "grouping" multiple checkpoints in a sharded checkpoint setup. + *

If delete_old_dirs is true, attempts to delete recursively the dirname of each * path in the input checkpoint_prefixes. This is useful when those paths are non * user-facing temporary locations. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class MergeV2Checkpoints extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.MergeV2Checkpoints} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param deleteOldDirs see above. - */ - public Options deleteOldDirs(Boolean deleteOldDirs) { - this.deleteOldDirs = deleteOldDirs; - return this; - } - - private Boolean deleteOldDirs; - - private Options() { - } + public static final String OP_NAME = "MergeV2Checkpoints"; + + private MergeV2Checkpoints(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new MergeV2Checkpoints operation. - * + * * @param scope current scope * @param checkpointPrefixes prefixes of V2 checkpoints to merge. * @param destinationPrefix scalar. The desired final prefix. Allowed to be the same * as one of the checkpoint_prefixes. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of MergeV2Checkpoints */ - @Endpoint(describeByClass = true) - public static MergeV2Checkpoints create(Scope scope, Operand checkpointPrefixes, Operand destinationPrefix, Options... options) { + @Endpoint( + describeByClass = true + ) + public static MergeV2Checkpoints create(Scope scope, Operand checkpointPrefixes, + Operand destinationPrefix, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MergeV2Checkpoints", scope.makeOpName("MergeV2Checkpoints")); opBuilder.addInput(checkpointPrefixes.asOutput()); opBuilder.addInput(destinationPrefix.asOutput()); @@ -85,18 +76,35 @@ public static MergeV2Checkpoints create(Scope scope, Operand checkpoint } return new MergeV2Checkpoints(opBuilder.build()); } - + /** + * Sets the deleteOldDirs option. + * * @param deleteOldDirs see above. + * @return this Options instance. */ public static Options deleteOldDirs(Boolean deleteOldDirs) { return new Options().deleteOldDirs(deleteOldDirs); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "MergeV2Checkpoints"; - - private MergeV2Checkpoints(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.MergeV2Checkpoints} + */ + public static class Options { + private Boolean deleteOldDirs; + + private Options() { + } + + /** + * Sets the deleteOldDirs option. + * + * @param deleteOldDirs see above. + * @return this Options instance. + */ + public Options deleteOldDirs(Boolean deleteOldDirs) { + this.deleteOldDirs = deleteOldDirs; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/NegTrain.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/NegTrain.java index 03a2d2fd49c..e1c553f72af 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/NegTrain.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/NegTrain.java @@ -31,24 +31,38 @@ /** * Training via negative sampling. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class NegTrain extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "NegTrain"; + + private NegTrain(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new NegTrain operation. - * + * * @param scope current scope * @param wIn input word embedding. * @param wOut output word embedding. * @param examples A vector of word ids. * @param labels A vector of word ids. - * @param lr + * @param lr the lr value * @param vocabCount Count of words in the vocabulary. * @param numNegativeSamples Number of negative samples per example. * @return a new instance of NegTrain */ - @Endpoint(describeByClass = true) - public static NegTrain create(Scope scope, Operand wIn, Operand wOut, Operand examples, Operand labels, Operand lr, List vocabCount, Long numNegativeSamples) { + @Endpoint( + describeByClass = true + ) + public static NegTrain create(Scope scope, Operand wIn, Operand wOut, + Operand examples, Operand labels, Operand lr, List vocabCount, + Long numNegativeSamples) { OperationBuilder opBuilder = scope.env().opBuilder("NegTrain", scope.makeOpName("NegTrain")); opBuilder.addInput(wIn.asOutput()); opBuilder.addInput(wOut.asOutput()); @@ -57,18 +71,11 @@ public static NegTrain create(Scope scope, Operand wIn, Operand * When executed in a graph, this op outputs its input tensor as-is. - *

- * When building ops to compute gradients, the TensorFlow gradient system + *

When building ops to compute gradients, the TensorFlow gradient system * will return an error when trying to lookup the gradient of this op, * because no gradient must ever be registered for this function. This * op exists to prevent subtle bugs from silently returning unimplemented * gradients in some corner cases. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class PreventGradient extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.PreventGradient} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param message Will be printed in the error when anyone tries to differentiate - * this operation. - */ - public Options message(String message) { - this.message = message; - return this; - } - - private String message; - - private Options() { - } + public static final String OP_NAME = "PreventGradient"; + + private Output output; + + private PreventGradient(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new PreventGradient operation. - * + * * @param scope current scope * @param input any tensor. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code PreventGradient} output and operands * @return a new instance of PreventGradient */ - @Endpoint(describeByClass = true) - public static PreventGradient create(Scope scope, Operand input, Options... options) { + @Endpoint( + describeByClass = true + ) + public static PreventGradient create(Scope scope, Operand input, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PreventGradient", scope.makeOpName("PreventGradient")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -83,37 +79,53 @@ public static PreventGradient create(Scope scope, Operand(opBuilder.build()); + return new PreventGradient<>(opBuilder.build()); } - + /** + * Sets the message option. + * * @param message Will be printed in the error when anyone tries to differentiate * this operation. + * @return this Options instance. */ public static Options message(String message) { return new Options().message(message); } - + /** + * Gets output. * the same input tensor. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "PreventGradient"; - - private Output output; - - private PreventGradient(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.PreventGradient} + */ + public static class Options { + private String message; + + private Options() { + } + + /** + * Sets the message option. + * + * @param message Will be printed in the error when anyone tries to differentiate + * this operation. + * @return this Options instance. + */ + public Options message(String message) { + this.message = message; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorApplyGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorApplyGradient.java index 373d5efe501..b9a2fafc101 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorApplyGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorApplyGradient.java @@ -23,28 +23,38 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; import org.tensorflow.types.family.TType; /** * Applies a gradient to a given accumulator. - *

* Does not add if local_step is lesser than the accumulator's global_step. */ public final class ResourceAccumulatorApplyGradient extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceAccumulatorApplyGradient"; + + private ResourceAccumulatorApplyGradient(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ResourceAccumulatorApplyGradient operation. - * + * * @param scope current scope * @param handle The handle to a accumulator. * @param localStep The local_step value at which the gradient was computed. * @param gradient A tensor of the gradient to be accumulated. * @return a new instance of ResourceAccumulatorApplyGradient */ - @Endpoint(describeByClass = true) - public static ResourceAccumulatorApplyGradient create(Scope scope, Operand handle, Operand localStep, Operand gradient) { + @Endpoint( + describeByClass = true + ) + public static ResourceAccumulatorApplyGradient create(Scope scope, + Operand handle, Operand localStep, + Operand gradient) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceAccumulatorApplyGradient", scope.makeOpName("ResourceAccumulatorApplyGradient")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(localStep.asOutput()); @@ -52,11 +62,4 @@ public static ResourceAccumulatorApplyGradient create(Scope scope, Operand ha opBuilder = scope.apply(opBuilder); return new ResourceAccumulatorApplyGradient(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceAccumulatorApplyGradient"; - - private ResourceAccumulatorApplyGradient(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorNumAccumulated.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorNumAccumulated.java index 9c77e31351f..4ab175b74ef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorNumAccumulated.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorNumAccumulated.java @@ -24,49 +24,55 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Returns the number of gradients aggregated in the given accumulators. */ public final class ResourceAccumulatorNumAccumulated extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceAccumulatorNumAccumulated"; + + private Output numAccumulated; + + private ResourceAccumulatorNumAccumulated(Operation operation) { + super(operation); + int outputIdx = 0; + numAccumulated = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ResourceAccumulatorNumAccumulated operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @return a new instance of ResourceAccumulatorNumAccumulated */ - @Endpoint(describeByClass = true) - public static ResourceAccumulatorNumAccumulated create(Scope scope, Operand handle) { + @Endpoint( + describeByClass = true + ) + public static ResourceAccumulatorNumAccumulated create(Scope scope, + Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceAccumulatorNumAccumulated", scope.makeOpName("ResourceAccumulatorNumAccumulated")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.apply(opBuilder); return new ResourceAccumulatorNumAccumulated(opBuilder.build()); } - + /** + * Gets numAccumulated. * The number of gradients aggregated in the given accumulator. + * @return numAccumulated. */ public Output numAccumulated() { return numAccumulated; } - + @Override public Output asOutput() { return numAccumulated; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceAccumulatorNumAccumulated"; - - private Output numAccumulated; - - private ResourceAccumulatorNumAccumulated(Operation operation) { - super(operation); - int outputIdx = 0; - numAccumulated = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorSetGlobalStep.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorSetGlobalStep.java index 7f2f421c6e6..40567653231 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorSetGlobalStep.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorSetGlobalStep.java @@ -23,38 +23,41 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Updates the accumulator with a new value for global_step. - *

* Logs warning if the accumulator's value is already higher than * new_global_step. */ public final class ResourceAccumulatorSetGlobalStep extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceAccumulatorSetGlobalStep"; + + private ResourceAccumulatorSetGlobalStep(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new ResourceAccumulatorSetGlobalStep operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @param newGlobalStep The new global_step value to set. * @return a new instance of ResourceAccumulatorSetGlobalStep */ - @Endpoint(describeByClass = true) - public static ResourceAccumulatorSetGlobalStep create(Scope scope, Operand handle, Operand newGlobalStep) { + @Endpoint( + describeByClass = true + ) + public static ResourceAccumulatorSetGlobalStep create(Scope scope, + Operand handle, Operand newGlobalStep) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceAccumulatorSetGlobalStep", scope.makeOpName("ResourceAccumulatorSetGlobalStep")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(newGlobalStep.asOutput()); opBuilder = scope.apply(opBuilder); return new ResourceAccumulatorSetGlobalStep(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceAccumulatorSetGlobalStep"; - - private ResourceAccumulatorSetGlobalStep(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorTakeGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorTakeGradient.java index 62e33a44749..7186d58b07e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorTakeGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceAccumulatorTakeGradient.java @@ -25,63 +25,68 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TInt32; import org.tensorflow.types.family.TType; /** * Extracts the average gradient in the given ConditionalAccumulator. - *

* The op blocks until sufficient (i.e., more than num_required) * gradients have been accumulated. If the accumulator has already * aggregated more than num_required gradients, it returns the average of * the accumulated gradients. Also automatically increments the recorded * global_step in the accumulator by 1, and resets the aggregate to 0. - * - * @param data type for {@code average()} output + * + * @param data type for {@code average} output */ public final class ResourceAccumulatorTakeGradient extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "ResourceAccumulatorTakeGradient"; + + private Output average; + + private ResourceAccumulatorTakeGradient(Operation operation) { + super(operation); + int outputIdx = 0; + average = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new ResourceAccumulatorTakeGradient operation. - * + * * @param scope current scope * @param handle The handle to an accumulator. * @param numRequired Number of gradients required before we return an aggregate. * @param dtype The data type of accumulated gradients. Needs to correspond to the type * of the accumulator. + * @param data type for {@code ResourceAccumulatorTakeGradient} output and operands * @return a new instance of ResourceAccumulatorTakeGradient */ - @Endpoint(describeByClass = true) - public static ResourceAccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, Class dtype) { + @Endpoint( + describeByClass = true + ) + public static ResourceAccumulatorTakeGradient create(Scope scope, + Operand handle, Operand numRequired, Class dtype) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceAccumulatorTakeGradient", scope.makeOpName("ResourceAccumulatorTakeGradient")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numRequired.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); - return new ResourceAccumulatorTakeGradient(opBuilder.build()); + return new ResourceAccumulatorTakeGradient<>(opBuilder.build()); } - + /** + * Gets average. * The average of the accumulated gradients. + * @return average. */ public Output average() { return average; } - + @Override public Output asOutput() { return average; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceAccumulatorTakeGradient"; - - private Output average; - - private ResourceAccumulatorTakeGradient(Operation operation) { - super(operation); - int outputIdx = 0; - average = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdaMax.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdaMax.java index 868d8664fa2..c473ae1fd1e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdaMax.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdaMax.java @@ -23,42 +23,27 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Update '*var' according to the AdaMax algorithm. - *

- * m_t <- beta1 * m_{t-1} + (1 - beta1) * g - * v_t <- max(beta2 * v_{t-1}, abs(g)) - * variable <- variable - learning_rate / (1 - beta1^t) * m_t / (v_t + epsilon) + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * v_t <- max(beta2 * v_{t-1}, abs(g)) + * variable <- variable - learning_rate / (1 - beta1^t) * m_t / (v_t + epsilon) */ public final class ResourceApplyAdaMax extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdaMax} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdaMax"; + + private ResourceApplyAdaMax(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyAdaMax operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -69,11 +54,17 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdaMax} output and operands * @return a new instance of ResourceApplyAdaMax */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdaMax create(Scope scope, Operand var, Operand m, Operand v, Operand beta1Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdaMax create(Scope scope, + Operand var, Operand m, Operand v, + Operand beta1Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, + Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdaMax", scope.makeOpName("ResourceApplyAdaMax")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); @@ -94,20 +85,39 @@ public static ResourceApplyAdaMax create(Scope scope, Operand< } return new ResourceApplyAdaMax(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdaMax"; - - private ResourceApplyAdaMax(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdaMax} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdadelta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdadelta.java index 0897bb4a2bd..30a3d40b670 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdadelta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdadelta.java @@ -28,38 +28,27 @@ /** * Update '*var' according to the adadelta scheme. - *

* accum = rho() * accum + (1 - rho()) * grad.square(); * update = (update_accum + epsilon).sqrt() * (accum + epsilon()).rsqrt() * grad; * update_accum = rho() * update_accum + (1 - rho()) * update.square(); * var -= update; */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyAdadelta extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdadelta} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var, accum and update_accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdadelta"; + + private ResourceApplyAdadelta(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyAdadelta operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -68,11 +57,17 @@ private Options() { * @param rho Decay factor. Must be a scalar. * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdadelta} output and operands * @return a new instance of ResourceApplyAdadelta */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdadelta create(Scope scope, + Operand var, Operand accum, + Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdadelta", scope.makeOpName("ResourceApplyAdadelta")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -91,19 +86,37 @@ public static ResourceApplyAdadelta create(Scope scope, Operan } return new ResourceApplyAdadelta(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var, accum and update_accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdadelta"; - - private ResourceApplyAdadelta(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdadelta} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var, accum and update_accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagrad.java index 8cf24a3e443..9c579f6b8c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagrad.java @@ -23,61 +23,42 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * Update '*var' according to the adagrad scheme. - *

* accum += grad * grad * var -= lr * grad * (1 / (sqrt(accum) + epsilon)) */ public final class ResourceApplyAdagrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdagradV2"; + + private ResourceApplyAdagrad(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ResourceApplyAdagrad operation. - * + * Factory method to create a class wrapping a new ResourceApplyAdagradV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdagradV2} output and operands * @return a new instance of ResourceApplyAdagrad */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdagrad create(Scope scope, + Operand var, Operand accum, Operand lr, + Operand epsilon, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdagradV2", scope.makeOpName("ResourceApplyAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -97,27 +78,62 @@ public static ResourceApplyAdagrad create(Scope scope, Operand } return new ResourceApplyAdagrad(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdagradV2"; - - private ResourceApplyAdagrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = updateSlots; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagradDa.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagradDa.java index cf572e06da5..1566e1d3219 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagradDa.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdagradDa.java @@ -30,32 +30,22 @@ /** * Update '*var' according to the proximal adagrad scheme. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyAdagradDa extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdagradDa} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdagradDA"; + + private ResourceApplyAdagradDa(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ResourceApplyAdagradDa operation. - * + * Factory method to create a class wrapping a new ResourceApplyAdagradDA operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -65,11 +55,17 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdagradDA} output and operands * @return a new instance of ResourceApplyAdagradDa */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdagradDa create(Scope scope, + Operand var, Operand gradientAccumulator, + Operand gradientSquaredAccumulator, Operand grad, Operand lr, + Operand l1, Operand l2, Operand globalStep, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdagradDA", scope.makeOpName("ResourceApplyAdagradDa")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(gradientAccumulator.asOutput()); @@ -89,19 +85,37 @@ public static ResourceApplyAdagradDa create(Scope scope, Opera } return new ResourceApplyAdagradDa(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdagradDA"; - - private ResourceApplyAdagradDa(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdagradDa} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdam.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdam.java index d2a570aa424..927023ea74c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdam.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdam.java @@ -28,48 +28,27 @@ /** * Update '*var' according to the Adam algorithm. - *

- * $$\text{lr}_t := \mathrm{learning_rate} * \sqrt{1 - \beta_2^t} / (1 - \beta_1^t)$$ - * $$m_t := \beta_1 * m_{t-1} + (1 - \beta_1) * g$$ + * $$\text{lr}t := \mathrm{learning_rate} * \sqrt{1 - \beta_2^t} / (1 - \beta_1^t)$$ + * $$m_t := \beta_1 * m{t-1} + (1 - \beta_1) * g$$ * $$v_t := \beta_2 * v_{t-1} + (1 - \beta_2) * g * g$$ * $$\text{variable} := \text{variable} - \text{lr}_t * m_t / (\sqrt{v_t} + \epsilon)$$ */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyAdam extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdam} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, uses the nesterov update. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdam"; + + private ResourceApplyAdam(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyAdam operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -81,11 +60,17 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdam} output and operands * @return a new instance of ResourceApplyAdam */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdam create(Scope scope, Operand var, Operand m, Operand v, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdam create(Scope scope, + Operand var, Operand m, Operand v, + Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, + Operand beta2, Operand epsilon, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdam", scope.makeOpName("ResourceApplyAdam")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); @@ -110,27 +95,62 @@ public static ResourceApplyAdam create(Scope scope, Operand } return new ResourceApplyAdam(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, uses the nesterov update. + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, uses the nesterov update. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdam"; - - private ResourceApplyAdam(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdam} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, uses the nesterov update. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = useNesterov; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdamWithAmsgrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdamWithAmsgrad.java index 2c9f48fc751..b1a5400470b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdamWithAmsgrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAdamWithAmsgrad.java @@ -28,40 +28,28 @@ /** * Update '*var' according to the Adam algorithm. - *

- * $$\text{lr}_t := \mathrm{learning_rate} * \sqrt{1 - \beta_2^t} / (1 - \beta_1^t)$$ - * $$m_t := \beta_1 * m_{t-1} + (1 - \beta_1) * g$$ + * $$\text{lr}t := \mathrm{learning_rate} * \sqrt{1 - \beta_2^t} / (1 - \beta_1^t)$$ + * $$m_t := \beta_1 * m{t-1} + (1 - \beta_1) * g$$ * $$v_t := \beta_2 * v_{t-1} + (1 - \beta_2) * g * g$$ - * $$\hat{v}_t := max{\hat{v}_{t-1}, v_t}$$ + * $$\hat{v}t := max{\hat{v}{t-1}, v_t}$$ * $$\text{variable} := \text{variable} - \text{lr}_t * m_t / (\sqrt{\hat{v}_t} + \epsilon)$$ */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyAdamWithAmsgrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdamWithAmsgrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAdamWithAmsgrad"; + + private ResourceApplyAdamWithAmsgrad(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyAdamWithAmsgrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -74,11 +62,17 @@ private Options() { * @param beta2 Momentum factor. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAdamWithAmsgrad} output and operands * @return a new instance of ResourceApplyAdamWithAmsgrad */ - @Endpoint(describeByClass = true) - public static ResourceApplyAdamWithAmsgrad create(Scope scope, Operand var, Operand m, Operand v, Operand vhat, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAdamWithAmsgrad create(Scope scope, + Operand var, Operand m, Operand v, + Operand vhat, Operand beta1Power, Operand beta2Power, Operand lr, + Operand beta1, Operand beta2, Operand epsilon, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdamWithAmsgrad", scope.makeOpName("ResourceApplyAdamWithAmsgrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); @@ -101,20 +95,39 @@ public static ResourceApplyAdamWithAmsgrad create(Scope scope, } return new ResourceApplyAdamWithAmsgrad(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, m, and v tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAdamWithAmsgrad"; - - private ResourceApplyAdamWithAmsgrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAdamWithAmsgrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, m, and v tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAddSign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAddSign.java index c8d64fc2894..67742f1c152 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAddSign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyAddSign.java @@ -28,38 +28,26 @@ /** * Update '*var' according to the AddSign update. - *

- * m_t <- beta1 * m_{t-1} + (1 - beta1) * g - * update <- (alpha + sign_decay * sign(g) *sign(m)) * g - * variable <- variable - lr_t * update + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * update <- (alpha + sign_decay * sign(g) *sign(m)) * g + * variable <- variable - lr_t * update */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyAddSign extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAddSign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and m tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyAddSign"; + + private ResourceApplyAddSign(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyAddSign operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -68,11 +56,16 @@ private Options() { * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyAddSign} output and operands * @return a new instance of ResourceApplyAddSign */ - @Endpoint(describeByClass = true) - public static ResourceApplyAddSign create(Scope scope, Operand var, Operand m, Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyAddSign create(Scope scope, + Operand var, Operand m, Operand lr, Operand alpha, + Operand signDecay, Operand beta, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAddSign", scope.makeOpName("ResourceApplyAddSign")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); @@ -91,20 +84,39 @@ public static ResourceApplyAddSign create(Scope scope, Operand } return new ResourceApplyAddSign(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and m tensors is + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and m tensors is * protected by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyAddSign"; - - private ResourceApplyAddSign(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyAddSign} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and m tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyCenteredRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyCenteredRmsProp.java index 722555f4f20..0b6b7f6edc0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyCenteredRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyCenteredRmsProp.java @@ -28,53 +28,37 @@ /** * Update '*var' according to the centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient - *

- * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * mg <- rho * mg_{t-1} + (1-rho) * grad - * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) - * var <- var - mom + *

Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) + *

mg <- rho * mg_{t-1} + (1-rho) * grad + * ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms - mg * mg + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyCenteredRmsProp extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyCenteredRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyCenteredRMSProp"; + + private ResourceApplyCenteredRmsProp(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ResourceApplyCenteredRmsProp operation. - * + * Factory method to create a class wrapping a new ResourceApplyCenteredRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -85,11 +69,17 @@ private Options() { * @param momentum Momentum Scale. Must be a scalar. * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyCenteredRMSProp} output and operands * @return a new instance of ResourceApplyCenteredRmsProp */ - @Endpoint(describeByClass = true) - public static ResourceApplyCenteredRmsProp create(Scope scope, Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyCenteredRmsProp create(Scope scope, + Operand var, Operand mg, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, + Operand epsilon, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyCenteredRMSProp", scope.makeOpName("ResourceApplyCenteredRmsProp")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(mg.asOutput()); @@ -110,20 +100,39 @@ public static ResourceApplyCenteredRmsProp create(Scope scope, } return new ResourceApplyCenteredRmsProp(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, mg, ms, and mom tensors is * protected by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyCenteredRMSProp"; - - private ResourceApplyCenteredRmsProp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyCenteredRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, mg, ms, and mom tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyFtrl.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyFtrl.java index 3c86fc8c313..82f325c9873 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyFtrl.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyFtrl.java @@ -28,51 +28,30 @@ /** * Update '*var' according to the Ftrl-proximal scheme. - *

* grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad_with_shrinkage * grad_with_shrinkage * linear += grad_with_shrinkage + - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyFtrl extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyFtrl} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param multiplyLinearByLr - */ - public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { - this.multiplyLinearByLr = multiplyLinearByLr; - return this; - } - - private Boolean useLocking; - private Boolean multiplyLinearByLr; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyFtrlV2"; + + private ResourceApplyFtrl(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ResourceApplyFtrl operation. - * + * Factory method to create a class wrapping a new ResourceApplyFtrlV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -81,13 +60,19 @@ private Options() { * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage + * @param l2Shrinkage the l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyFtrlV2} output and operands * @return a new instance of ResourceApplyFtrl */ - @Endpoint(describeByClass = true) - public static ResourceApplyFtrl create(Scope scope, Operand var, Operand accum, Operand linear, Operand grad, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyFtrl create(Scope scope, + Operand var, Operand accum, Operand linear, + Operand grad, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, + Operand lrPower, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyFtrlV2", scope.makeOpName("ResourceApplyFtrl")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -111,27 +96,62 @@ public static ResourceApplyFtrl create(Scope scope, Operand } return new ResourceApplyFtrl(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param multiplyLinearByLr + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. */ public static Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return new Options().multiplyLinearByLr(multiplyLinearByLr); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyFtrlV2"; - - private ResourceApplyFtrl(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyFtrl} + */ + public static class Options { + private Boolean useLocking; + + private Boolean multiplyLinearByLr; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. + */ + public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { + this.multiplyLinearByLr = multiplyLinearByLr; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyGradientDescent.java index bf119a731ec..bb055fc76c6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyGradientDescent.java @@ -29,41 +29,35 @@ /** * Update '*var' by subtracting 'alpha' * 'delta' from it. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyGradientDescent extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyGradientDescent"; + + private ResourceApplyGradientDescent(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyGradientDescent} output and operands * @return a new instance of ResourceApplyGradientDescent */ - @Endpoint(describeByClass = true) - public static ResourceApplyGradientDescent create(Scope scope, Operand var, Operand alpha, Operand delta, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand delta, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyGradientDescent", scope.makeOpName("ResourceApplyGradientDescent")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); @@ -78,19 +72,37 @@ public static ResourceApplyGradientDescent create(Scope scope, } return new ResourceApplyGradientDescent(opBuilder.build()); } - + /** - * @param useLocking If `True`, the subtraction will be protected by a lock; + * Sets the useLocking option. + * + * @param useLocking If {@code True}, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyGradientDescent"; - - private ResourceApplyGradientDescent(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyKerasMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyKerasMomentum.java index 6c55590f8ac..0e947d6fe90 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyKerasMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyKerasMomentum.java @@ -28,61 +28,42 @@ /** * Update '*var' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * accum = accum * momentum - lr * grad + *

accum = accum * momentum - lr * grad * var += accum */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyKerasMomentum extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyKerasMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, the tensor passed to compute grad will be - * var + momentum * accum, so in the end, the var you get is actually - * var + momentum * accum. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyKerasMomentum"; + + private ResourceApplyKerasMomentum(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyKerasMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyKerasMomentum} output and operands * @return a new instance of ResourceApplyKerasMomentum */ - @Endpoint(describeByClass = true) - public static ResourceApplyKerasMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyKerasMomentum create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand momentum, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyKerasMomentum", scope.makeOpName("ResourceApplyKerasMomentum")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -102,29 +83,66 @@ public static ResourceApplyKerasMomentum create(Scope scope, O } return new ResourceApplyKerasMomentum(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be * var + momentum * accum, so in the end, the var you get is actually * var + momentum * accum. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyKerasMomentum"; - - private ResourceApplyKerasMomentum(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyKerasMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be + * var + momentum * accum, so in the end, the var you get is actually + * var + momentum * accum. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = useNesterov; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyMomentum.java index 7d8a4b68f77..51f14af776f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyMomentum.java @@ -28,61 +28,42 @@ /** * Update '*var' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * accum = accum * momentum + grad + *

accum = accum * momentum + grad * var -= lr * accum */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyMomentum extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, the tensor passed to compute grad will be - * var - lr * momentum * accum, so in the end, the var you get is actually - * var - lr * momentum * accum. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyMomentum"; + + private ResourceApplyMomentum(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param grad The gradient. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyMomentum} output and operands * @return a new instance of ResourceApplyMomentum */ - @Endpoint(describeByClass = true) - public static ResourceApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyMomentum create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand momentum, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyMomentum", scope.makeOpName("ResourceApplyMomentum")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -102,29 +83,66 @@ public static ResourceApplyMomentum create(Scope scope, Operan } return new ResourceApplyMomentum(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be * var - lr * momentum * accum, so in the end, the var you get is actually * var - lr * momentum * accum. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyMomentum"; - - private ResourceApplyMomentum(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be + * var - lr * momentum * accum, so in the end, the var you get is actually + * var - lr * momentum * accum. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = useNesterov; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyPowerSign.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyPowerSign.java index 3f4cfe11582..fa3567e9580 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyPowerSign.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyPowerSign.java @@ -28,38 +28,26 @@ /** * Update '*var' according to the AddSign update. - *

- * m_t <- beta1 * m_{t-1} + (1 - beta1) * g - * update <- exp(logbase * sign_decay * sign(g) * sign(m_t)) * g - * variable <- variable - lr_t * update + * m_t <- beta1 * m_{t-1} + (1 - beta1) * g + * update <- exp(logbase * sign_decay * sign(g) * sign(m_t)) * g + * variable <- variable - lr_t * update */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyPowerSign extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyPowerSign} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and m tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyPowerSign"; + + private ResourceApplyPowerSign(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyPowerSign operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param m Should be from a Variable(). @@ -68,11 +56,16 @@ private Options() { * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyPowerSign} output and operands * @return a new instance of ResourceApplyPowerSign */ - @Endpoint(describeByClass = true) - public static ResourceApplyPowerSign create(Scope scope, Operand var, Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyPowerSign create(Scope scope, + Operand var, Operand m, Operand lr, Operand logbase, + Operand signDecay, Operand beta, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyPowerSign", scope.makeOpName("ResourceApplyPowerSign")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(m.asOutput()); @@ -91,20 +84,39 @@ public static ResourceApplyPowerSign create(Scope scope, Opera } return new ResourceApplyPowerSign(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and m tensors is + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and m tensors is * protected by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyPowerSign"; - - private ResourceApplyPowerSign(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyPowerSign} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and m tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalAdagrad.java index 8c2aab6b265..95ccd7906fe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalAdagrad.java @@ -28,37 +28,26 @@ /** * Update '*var' and '*accum' according to FOBOS with Adagrad learning rate. - *

- * accum += grad grad - * prox_v = var - lr grad (1 / sqrt(accum)) - * var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0} + * accum += grad * grad + * prox_v = var - lr * grad * (1 / sqrt(accum)) + * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyProximalAdagrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyProximalAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyProximalAdagrad"; + + private ResourceApplyProximalAdagrad(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyProximalAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -66,11 +55,16 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyProximalAdagrad} output and operands * @return a new instance of ResourceApplyProximalAdagrad */ - @Endpoint(describeByClass = true) - public static ResourceApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyProximalAdagrad create(Scope scope, + Operand var, Operand accum, Operand lr, Operand l1, + Operand l2, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyProximalAdagrad", scope.makeOpName("ResourceApplyProximalAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -88,19 +82,37 @@ public static ResourceApplyProximalAdagrad create(Scope scope, } return new ResourceApplyProximalAdagrad(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyProximalAdagrad"; - - private ResourceApplyProximalAdagrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyProximalAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalGradientDescent.java index 56499971a02..c870479aa0a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyProximalGradientDescent.java @@ -28,47 +28,41 @@ /** * Update '*var' as FOBOS algorithm with fixed learning rate. - *

- * prox_v = var - alpha delta - * var = sign(prox_v)/(1+alphal2) max{|prox_v|-alphal1,0} + * prox_v = var - alpha * delta + * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyProximalGradientDescent extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyProximalGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyProximalGradientDescent"; + + private ResourceApplyProximalGradientDescent(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceApplyProximalGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param delta The change. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyProximalGradientDescent} output and operands * @return a new instance of ResourceApplyProximalGradientDescent */ - @Endpoint(describeByClass = true) - public static ResourceApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyProximalGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand l1, Operand l2, + Operand delta, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyProximalGradientDescent", scope.makeOpName("ResourceApplyProximalGradientDescent")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); @@ -85,19 +79,37 @@ public static ResourceApplyProximalGradientDescent create(Scop } return new ResourceApplyProximalGradientDescent(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyProximalGradientDescent"; - - private ResourceApplyProximalGradientDescent(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyProximalGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyRmsProp.java index 703ae96376d..6b59b3896a4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceApplyRmsProp.java @@ -28,59 +28,51 @@ /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceApplyRmsProp extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceApplyRMSProp"; + + private ResourceApplyRmsProp(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ResourceApplyRmsProp operation. - * + * Factory method to create a class wrapping a new ResourceApplyRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param ms Should be from a Variable(). * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum the momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceApplyRMSProp} output and operands * @return a new instance of ResourceApplyRmsProp */ - @Endpoint(describeByClass = true) - public static ResourceApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceApplyRmsProp create(Scope scope, + Operand var, Operand ms, Operand mom, + Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyRMSProp", scope.makeOpName("ResourceApplyRmsProp")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -100,20 +92,39 @@ public static ResourceApplyRmsProp create(Scope scope, Operand } return new ResourceApplyRmsProp(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, ms, and mom tensors is protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceApplyRMSProp"; - - private ResourceApplyRmsProp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceApplyRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, ms, and mom tensors is protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceConditionalAccumulator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceConditionalAccumulator.java index d44b93e6ac1..6596c2c7b59 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceConditionalAccumulator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceConditionalAccumulator.java @@ -26,12 +26,10 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TType; /** * A conditional accumulator for aggregating gradients. - *

* The accumulator accepts gradients marked with local_step greater or * equal to the most recent global_step known to the accumulator. The * average can be extracted from the accumulator, provided sufficient @@ -42,57 +40,35 @@ * with tf.cond version 2. */ public final class ResourceConditionalAccumulator extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceConditionalAccumulator} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param container If non-empty, this accumulator is placed in the given container. - * Otherwise, a default container is used. - */ - public Options container(String container) { - this.container = container; - return this; - } - - /** - * @param sharedName If non-empty, this accumulator will be shared under the - * given name across multiple sessions. - */ - public Options sharedName(String sharedName) { - this.sharedName = sharedName; - return this; - } - - /** - * @param reductionType - */ - public Options reductionType(String reductionType) { - this.reductionType = reductionType; - return this; - } - - private String container; - private String sharedName; - private String reductionType; - - private Options() { - } + public static final String OP_NAME = "ResourceConditionalAccumulator"; + + private Output handle; + + @SuppressWarnings("unchecked") + private ResourceConditionalAccumulator(Operation operation) { + super(operation); + int outputIdx = 0; + handle = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new ResourceConditionalAccumulator operation. - * + * * @param scope current scope * @param dtype The type of the value being accumulated. * @param shape The shape of the values, can be [], in which case shape is unknown. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceConditionalAccumulator} output and operands * @return a new instance of ResourceConditionalAccumulator */ - @Endpoint(describeByClass = true) - public static ResourceConditionalAccumulator create(Scope scope, Class dtype, Shape shape, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceConditionalAccumulator create(Scope scope, Class dtype, + Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceConditionalAccumulator", scope.makeOpName("ResourceConditionalAccumulator")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); @@ -112,51 +88,100 @@ public static ResourceConditionalAccumulator create(Scope scop } return new ResourceConditionalAccumulator(opBuilder.build()); } - + /** + * Sets the container option. + * * @param container If non-empty, this accumulator is placed in the given container. * Otherwise, a default container is used. + * @return this Options instance. */ public static Options container(String container) { return new Options().container(container); } - + /** + * Sets the sharedName option. + * * @param sharedName If non-empty, this accumulator will be shared under the * given name across multiple sessions. + * @return this Options instance. */ public static Options sharedName(String sharedName) { return new Options().sharedName(sharedName); } - + /** - * @param reductionType + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. */ public static Options reductionType(String reductionType) { return new Options().reductionType(reductionType); } - + /** + * Gets handle. * The handle to the accumulator. + * @return handle. */ - public Output handle() { + public Output handle() { return handle; } - + @Override @SuppressWarnings("unchecked") public Output asOutput() { return (Output) handle; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceConditionalAccumulator"; - - private Output handle; - - private ResourceConditionalAccumulator(Operation operation) { - super(operation); - int outputIdx = 0; - handle = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceConditionalAccumulator} + */ + public static class Options { + private String container; + + private String sharedName; + + private String reductionType; + + private Options() { + } + + /** + * Sets the container option. + * + * @param container If non-empty, this accumulator is placed in the given container. + * Otherwise, a default container is used. + * @return this Options instance. + */ + public Options container(String container) { + this.container = container; + return this; + } + + /** + * Sets the sharedName option. + * + * @param sharedName If non-empty, this accumulator will be shared under the + * given name across multiple sessions. + * @return this Options instance. + */ + public Options sharedName(String sharedName) { + this.sharedName = sharedName; + return this; + } + + /** + * Sets the reductionType option. + * + * @param reductionType the reductionType option + * @return this Options instance. + */ + public Options reductionType(String reductionType) { + this.reductionType = reductionType; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdadelta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdadelta.java index 29a2a993245..dd35cff9bc7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdadelta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdadelta.java @@ -30,34 +30,24 @@ /** * var: Should be from a Variable(). */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyAdadelta extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdadelta} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyAdadelta"; + + private ResourceSparseApplyAdadelta(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyAdadelta operation. - * + * * @param scope current scope - * @param var + * @param var the var value * @param accum Should be from a Variable(). * @param accumUpdate : Should be from a Variable(). * @param lr Learning rate. Must be a scalar. @@ -65,11 +55,17 @@ private Options() { * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdadelta} output and operands * @return a new instance of ResourceSparseApplyAdadelta */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyAdadelta create(Scope scope, + Operand var, Operand accum, + Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + Operand grad, Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyAdadelta", scope.makeOpName("ResourceSparseApplyAdadelta")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -89,19 +85,37 @@ public static ResourceSparseApplyAdadelta create(Scope scope, } return new ResourceSparseApplyAdadelta(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyAdadelta"; - - private ResourceSparseApplyAdadelta(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdadelta} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagrad.java index ac0fd69675e..34225335edf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagrad.java @@ -29,58 +29,42 @@ /** * Update relevant entries in '*var' and '*accum' according to the adagrad scheme. - *

* That is for rows we have grad for, we update var and accum as follows: * accum += grad * grad * var -= lr * grad * (1 / sqrt(accum)) */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyAdagrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyAdagrad"; + + private ResourceSparseApplyAdagrad(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). * @param lr Learning rate. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdagrad} output and operands * @return a new instance of ResourceSparseApplyAdagrad */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyAdagrad create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyAdagrad", scope.makeOpName("ResourceSparseApplyAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -100,27 +84,62 @@ public static ResourceSparseApplyAdagrad create(Scope scope, O } return new ResourceSparseApplyAdagrad(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyAdagrad"; - - private ResourceSparseApplyAdagrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = updateSlots; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradDa.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradDa.java index cf3c20f69d6..a704cffcfef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradDa.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradDa.java @@ -31,32 +31,22 @@ /** * Update entries in '*var' and '*accum' according to the proximal adagrad scheme. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyAdagradDa extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagradDa} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyAdagradDA"; + + private ResourceSparseApplyAdagradDa(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ResourceSparseApplyAdagradDa operation. - * + * Factory method to create a class wrapping a new ResourceSparseApplyAdagradDA operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -67,11 +57,18 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdagradDA} output and operands * @return a new instance of ResourceSparseApplyAdagradDa */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyAdagradDa create(Scope scope, + Operand var, Operand gradientAccumulator, + Operand gradientSquaredAccumulator, Operand grad, + Operand indices, Operand lr, Operand l1, Operand l2, + Operand globalStep, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyAdagradDA", scope.makeOpName("ResourceSparseApplyAdagradDa")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(gradientAccumulator.asOutput()); @@ -92,19 +89,37 @@ public static ResourceSparseApplyAdagradDa create(Scope scope, } return new ResourceSparseApplyAdagradDa(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyAdagradDA"; - - private ResourceSparseApplyAdagradDa(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagradDa} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradV2.java index 0cd880c76d8..e5d730c9fe0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyAdagradV2.java @@ -23,52 +23,28 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Update relevant entries in '*var' and '*accum' according to the adagrad scheme. - *

* That is for rows we have grad for, we update var and accum as follows: * accum += grad * grad * var -= lr * grad * (1 / sqrt(accum)) */ public final class ResourceSparseApplyAdagradV2 extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagradV2} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyAdagradV2"; + + private ResourceSparseApplyAdagradV2(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyAdagradV2 operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -76,11 +52,16 @@ private Options() { * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyAdagradV2} output and operands * @return a new instance of ResourceSparseApplyAdagradV2 */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyAdagradV2 create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyAdagradV2 create(Scope scope, + Operand var, Operand accum, Operand lr, + Operand epsilon, Operand grad, Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyAdagradV2", scope.makeOpName("ResourceSparseApplyAdagradV2")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -101,27 +82,62 @@ public static ResourceSparseApplyAdagradV2 create(Scope scope, } return new ResourceSparseApplyAdagradV2(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyAdagradV2"; - - private ResourceSparseApplyAdagradV2(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyAdagradV2} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = updateSlots; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyCenteredRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyCenteredRmsProp.java index aa0cdb54cb5..dc6bb2f8533 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyCenteredRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyCenteredRmsProp.java @@ -29,51 +29,36 @@ /** * Update '*var' according to the centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyCenteredRmsProp extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyCenteredRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyCenteredRMSProp"; + + private ResourceSparseApplyCenteredRmsProp(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ResourceSparseApplyCenteredRmsProp operation. - * + * Factory method to create a class wrapping a new ResourceSparseApplyCenteredRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -81,15 +66,21 @@ private Options() { * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum the momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyCenteredRMSProp} output and operands * @return a new instance of ResourceSparseApplyCenteredRmsProp */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyCenteredRmsProp create(Scope scope, Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyCenteredRmsProp create(Scope scope, + Operand var, Operand mg, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, + Operand epsilon, Operand grad, Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyCenteredRMSProp", scope.makeOpName("ResourceSparseApplyCenteredRmsProp")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(mg.asOutput()); @@ -111,20 +102,39 @@ public static ResourceSparseApplyCenteredRmsProp create(Scope } return new ResourceSparseApplyCenteredRmsProp(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, mg, ms, and mom tensors is * protected by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyCenteredRMSProp"; - - private ResourceSparseApplyCenteredRmsProp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyCenteredRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, mg, ms, and mom tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyFtrl.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyFtrl.java index 802a1d86d5e..b0864f79e68 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyFtrl.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyFtrl.java @@ -29,52 +29,31 @@ /** * Update relevant entries in '*var' according to the Ftrl-proximal scheme. - *

* That is for rows we have grad for, we update var, accum and linear as follows: * grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad_with_shrinkage * grad_with_shrinkage * linear += grad_with_shrinkage + - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyFtrl extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyFtrl} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param multiplyLinearByLr - */ - public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { - this.multiplyLinearByLr = multiplyLinearByLr; - return this; - } - - private Boolean useLocking; - private Boolean multiplyLinearByLr; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyFtrlV2"; + + private ResourceSparseApplyFtrl(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ResourceSparseApplyFtrl operation. - * + * Factory method to create a class wrapping a new ResourceSparseApplyFtrlV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -84,13 +63,19 @@ private Options() { * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage + * @param l2Shrinkage the l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyFtrlV2} output and operands * @return a new instance of ResourceSparseApplyFtrl */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyFtrl create(Scope scope, Operand var, Operand accum, Operand linear, Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyFtrl create(Scope scope, + Operand var, Operand accum, Operand linear, + Operand grad, Operand indices, Operand lr, Operand l1, + Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyFtrlV2", scope.makeOpName("ResourceSparseApplyFtrl")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -115,27 +100,62 @@ public static ResourceSparseApplyFtrl create(Scope scope, Oper } return new ResourceSparseApplyFtrl(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param multiplyLinearByLr + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. */ public static Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return new Options().multiplyLinearByLr(multiplyLinearByLr); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyFtrlV2"; - - private ResourceSparseApplyFtrl(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyFtrl} + */ + public static class Options { + private Boolean useLocking; + + private Boolean multiplyLinearByLr; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. + */ + public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { + this.multiplyLinearByLr = multiplyLinearByLr; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyKerasMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyKerasMomentum.java index e0a6eac37e3..6c4a59a3ee5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyKerasMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyKerasMomentum.java @@ -29,52 +29,27 @@ /** * Update relevant entries in '*var' and '*accum' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * That is for rows we have grad for, we update var and accum as follows: - *

- * accum = accum * momentum - lr * grad + *

That is for rows we have grad for, we update var and accum as follows: + *

accum = accum * momentum - lr * grad * var += accum */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyKerasMomentum extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyKerasMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, the tensor passed to compute grad will be - * var + momentum * accum, so in the end, the var you get is actually - * var + momentum * accum. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyKerasMomentum"; + + private ResourceSparseApplyKerasMomentum(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyKerasMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -82,11 +57,16 @@ private Options() { * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyKerasMomentum} output and operands * @return a new instance of ResourceSparseApplyKerasMomentum */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyKerasMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyKerasMomentum create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand indices, Operand momentum, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyKerasMomentum", scope.makeOpName("ResourceSparseApplyKerasMomentum")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -107,29 +87,66 @@ public static ResourceSparseApplyKerasMomentum create(Scope sc } return new ResourceSparseApplyKerasMomentum(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be * var + momentum * accum, so in the end, the var you get is actually * var + momentum * accum. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyKerasMomentum"; - - private ResourceSparseApplyKerasMomentum(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyKerasMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be + * var + momentum * accum, so in the end, the var you get is actually + * var + momentum * accum. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = useNesterov; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyMomentum.java index 60ca59ace25..7731995c245 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyMomentum.java @@ -29,52 +29,27 @@ /** * Update relevant entries in '*var' and '*accum' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * That is for rows we have grad for, we update var and accum as follows: - *

- * accum = accum * momentum + grad + *

That is for rows we have grad for, we update var and accum as follows: + *

accum = accum * momentum + grad * var -= lr * accum */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyMomentum extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, the tensor passed to compute grad will be - * var - lr * momentum * accum, so in the end, the var you get is actually - * var - lr * momentum * accum. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyMomentum"; + + private ResourceSparseApplyMomentum(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -82,11 +57,16 @@ private Options() { * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyMomentum} output and operands * @return a new instance of ResourceSparseApplyMomentum */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyMomentum create(Scope scope, + Operand var, Operand accum, Operand lr, Operand grad, + Operand indices, Operand momentum, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyMomentum", scope.makeOpName("ResourceSparseApplyMomentum")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -107,29 +87,66 @@ public static ResourceSparseApplyMomentum create(Scope scope, } return new ResourceSparseApplyMomentum(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be * var - lr * momentum * accum, so in the end, the var you get is actually * var - lr * momentum * accum. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyMomentum"; - - private ResourceSparseApplyMomentum(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be + * var - lr * momentum * accum, so in the end, the var you get is actually + * var - lr * momentum * accum. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = useNesterov; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalAdagrad.java index 9fff6b866ff..b1cb878b436 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalAdagrad.java @@ -29,39 +29,28 @@ /** * Sparse update entries in '*var' and '*accum' according to FOBOS algorithm. - *

* That is for rows we have grad for, we update var and accum as follows: - * accum += grad grad + * accum += grad * grad * prox_v = var - * prox_v -= lr grad (1 / sqrt(accum)) - * var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0} + * prox_v -= lr * grad * (1 / sqrt(accum)) + * var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0} */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyProximalAdagrad extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyProximalAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyProximalAdagrad"; + + private ResourceSparseApplyProximalAdagrad(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyProximalAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -70,11 +59,16 @@ private Options() { * @param l2 L2 regularization. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyProximalAdagrad} output and operands * @return a new instance of ResourceSparseApplyProximalAdagrad */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyProximalAdagrad create(Scope scope, + Operand var, Operand accum, Operand lr, Operand l1, + Operand l2, Operand grad, Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyProximalAdagrad", scope.makeOpName("ResourceSparseApplyProximalAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -93,19 +87,37 @@ public static ResourceSparseApplyProximalAdagrad create(Scope } return new ResourceSparseApplyProximalAdagrad(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyProximalAdagrad"; - - private ResourceSparseApplyProximalAdagrad(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyProximalAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalGradientDescent.java index bb6cab1e2d3..eb6df20428d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyProximalGradientDescent.java @@ -29,37 +29,26 @@ /** * Sparse update '*var' as FOBOS algorithm with fixed learning rate. - *

* That is for rows we have grad for, we update var as follows: - * prox_v = var - alpha grad - * var = sign(prox_v)/(1+alphal2) max{|prox_v|-alphal1,0} + * prox_v = var - alpha * grad + * var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0} */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyProximalGradientDescent extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyProximalGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyProximalGradientDescent"; + + private ResourceSparseApplyProximalGradientDescent(Operation operation) { + super(operation); } - + /** * Factory method to create a class wrapping a new ResourceSparseApplyProximalGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. @@ -67,11 +56,16 @@ private Options() { * @param l2 L2 regularization. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyProximalGradientDescent} output and operands * @return a new instance of ResourceSparseApplyProximalGradientDescent */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyProximalGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, + Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyProximalGradientDescent", scope.makeOpName("ResourceSparseApplyProximalGradientDescent")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); @@ -89,19 +83,37 @@ public static ResourceSparseApplyProximalGradientDescent creat } return new ResourceSparseApplyProximalGradientDescent(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyProximalGradientDescent"; - - private ResourceSparseApplyProximalGradientDescent(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyProximalGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyRmsProp.java index 05581cb35c9..434d1c6c042 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/ResourceSparseApplyRmsProp.java @@ -29,60 +29,52 @@ /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * ms <- rho * ms_{t-1} + (1-rho) * grad * grad - * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) - * var <- var - mom + *

ms <- rho * ms_{t-1} + (1-rho) * grad * grad + * mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon) + * var <- var - mom */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class ResourceSparseApplyRmsProp extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "ResourceSparseApplyRMSProp"; + + private ResourceSparseApplyRmsProp(Operation operation) { + super(operation); } - + /** - * Factory method to create a class wrapping a new ResourceSparseApplyRmsProp operation. - * + * Factory method to create a class wrapping a new ResourceSparseApplyRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param ms Should be from a Variable(). * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum the momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code ResourceSparseApplyRMSProp} output and operands * @return a new instance of ResourceSparseApplyRmsProp */ - @Endpoint(describeByClass = true) - public static ResourceSparseApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static ResourceSparseApplyRmsProp create(Scope scope, + Operand var, Operand ms, Operand mom, + Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, + Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceSparseApplyRMSProp", scope.makeOpName("ResourceSparseApplyRmsProp")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -103,20 +95,39 @@ public static ResourceSparseApplyRmsProp create(Scope scope, O } return new ResourceSparseApplyRmsProp(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, ms, and mom tensors is protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "ResourceSparseApplyRMSProp"; - - private ResourceSparseApplyRmsProp(Operation operation) { - super(operation); + + /** + * Optional attributes for {@link org.tensorflow.op.train.ResourceSparseApplyRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, ms, and mom tensors is protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Restore.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Restore.java index bf19384f360..21b540b041b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Restore.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Restore.java @@ -34,27 +34,43 @@ /** * Restores tensors from a V2 checkpoint. - *

* For backward compatibility with the V1 format, this Op currently allows * restoring from a V1 checkpoint as well: - * - This Op first attempts to find the V2 index file pointed to by "prefix", and - * if found proceed to read it as a V2 checkpoint; - * - Otherwise the V1 read path is invoked. + *

    + *
  • This Op first attempts to find the V2 index file pointed to by "prefix", and + * if found proceed to read it as a V2 checkpoint;
  • + *
  • Otherwise the V1 read path is invoked. * Relying on this behavior is not recommended, as the ability to fall back to read - * V1 might be deprecated and eventually removed. - *

    - * By default, restores the named tensors in full. If the caller wishes to restore - * specific slices of stored tensors, "shape_and_slices" should be non-empty + * V1 might be deprecated and eventually removed.

  • + *
+ *

By default, restores the named tensors in full. If the caller wishes to restore + * specific slices of stored tensors, "shape_and_slices" should be non-empty * strings and correspondingly well-formed. - *

- * Callers must ensure all the named tensors are indeed stored in the checkpoint. + *

Callers must ensure all the named tensors are indeed stored in the checkpoint. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class Restore extends RawOp implements Iterable> { - /** - * Factory method to create a class wrapping a new Restore operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "RestoreV2"; + + private List> tensors; + + @SuppressWarnings("unchecked") + private Restore(Operation operation) { + super(operation); + int outputIdx = 0; + int tensorsLength = operation.outputListLength("tensors"); + tensors = Arrays.asList(operation.outputList(outputIdx, tensorsLength)); + outputIdx += tensorsLength; + } + + /** + * Factory method to create a class wrapping a new RestoreV2 operation. + * * @param scope current scope * @param prefix Must have a single element. The prefix of a V2 checkpoint. * @param tensorNames shape {N}. The names of the tensors to be restored. @@ -64,8 +80,11 @@ public final class Restore extends RawOp implements Iterable> { * those stored in the checkpoint. * @return a new instance of Restore */ - @Endpoint(describeByClass = true) - public static Restore create(Scope scope, Operand prefix, Operand tensorNames, Operand shapeAndSlices, List> dtypes) { + @Endpoint( + describeByClass = true + ) + public static Restore create(Scope scope, Operand prefix, Operand tensorNames, + Operand shapeAndSlices, List> dtypes) { OperationBuilder opBuilder = scope.env().opBuilder("RestoreV2", scope.makeOpName("Restore")); opBuilder.addInput(prefix.asOutput()); opBuilder.addInput(tensorNames.asOutput()); @@ -74,31 +93,20 @@ public static Restore create(Scope scope, Operand prefix, Operand> tensors() { return tensors; } - + @Override @SuppressWarnings({"rawtypes", "unchecked"}) public Iterator> iterator() { return (Iterator) tensors.iterator(); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RestoreV2"; - - private List> tensors; - - private Restore(Operation operation) { - super(operation); - int outputIdx = 0; - int tensorsLength = operation.outputListLength("tensors"); - tensors = Arrays.asList(operation.outputList(outputIdx, tensorsLength)); - outputIdx += tensorsLength; - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/RestoreSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/RestoreSlice.java index 579b5b8dbad..4710481547c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/RestoreSlice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/RestoreSlice.java @@ -31,42 +31,34 @@ /** * Restores a tensor from checkpoint files. - *

- * This is like `Restore` except that restored tensor can be listed as filling - * only a slice of a larger tensor. `shape_and_slice` specifies the shape of the + * This is like {@code Restore} except that restored tensor can be listed as filling + * only a slice of a larger tensor. {@code shape_and_slice} specifies the shape of the * larger tensor and the slice that the restored tensor covers. - *

- * The `shape_and_slice` input has the same format as the - * elements of the `shapes_and_slices` input of the `SaveSlices` op. - * - * @param data type for {@code tensor()} output + *

The {@code shape_and_slice} input has the same format as the + * elements of the {@code shapes_and_slices} input of the {@code SaveSlices} op. + * + * @param data type for {@code tensor} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class RestoreSlice extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.RestoreSlice} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param preferredShard Index of file to open first if multiple files match - * `file_pattern`. See the documentation for `Restore`. - */ - public Options preferredShard(Long preferredShard) { - this.preferredShard = preferredShard; - return this; - } - - private Long preferredShard; - - private Options() { - } + public static final String OP_NAME = "RestoreSlice"; + + private Output tensor; + + private RestoreSlice(Operation operation) { + super(operation); + int outputIdx = 0; + tensor = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new RestoreSlice operation. - * + * * @param scope current scope * @param filePattern Must have a single element. The pattern of the files from * which we read the tensor. @@ -75,11 +67,16 @@ private Options() { * @param shapeAndSlice Scalar. The shapes and slice specifications to use when * restoring a tensors. * @param dt The type of the tensor to be restored. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code RestoreSlice} output and operands * @return a new instance of RestoreSlice */ - @Endpoint(describeByClass = true) - public static RestoreSlice create(Scope scope, Operand filePattern, Operand tensorName, Operand shapeAndSlice, Class dt, Options... options) { + @Endpoint( + describeByClass = true + ) + public static RestoreSlice create(Scope scope, Operand filePattern, + Operand tensorName, Operand shapeAndSlice, Class dt, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RestoreSlice", scope.makeOpName("RestoreSlice")); opBuilder.addInput(filePattern.asOutput()); opBuilder.addInput(tensorName.asOutput()); @@ -93,37 +90,53 @@ public static RestoreSlice create(Scope scope, Operand(opBuilder.build()); + return new RestoreSlice<>(opBuilder.build()); } - + /** + * Sets the preferredShard option. + * * @param preferredShard Index of file to open first if multiple files match - * `file_pattern`. See the documentation for `Restore`. + * {@code file_pattern}. See the documentation for {@code Restore}. + * @return this Options instance. */ public static Options preferredShard(Long preferredShard) { return new Options().preferredShard(preferredShard); } - + /** + * Gets tensor. * The restored tensor. + * @return tensor. */ public Output tensor() { return tensor; } - + @Override public Output asOutput() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "RestoreSlice"; - - private Output tensor; - - private RestoreSlice(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.RestoreSlice} + */ + public static class Options { + private Long preferredShard; + + private Options() { + } + + /** + * Sets the preferredShard option. + * + * @param preferredShard Index of file to open first if multiple files match + * {@code file_pattern}. See the documentation for {@code Restore}. + * @return this Options instance. + */ + public Options preferredShard(Long preferredShard) { + this.preferredShard = preferredShard; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Save.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Save.java index fc4b2167194..9bd622da54f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Save.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/Save.java @@ -29,28 +29,40 @@ /** * Saves tensors in V2 checkpoint format. - *

* By default, saves the named tensors in full. If the caller wishes to save - * specific slices of full tensors, "shape_and_slices" should be non-empty strings + * specific slices of full tensors, "shape_and_slices" should be non-empty strings * and correspondingly well-formed. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class Save extends RawOp { - /** - * Factory method to create a class wrapping a new Save operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SaveV2"; + + private Save(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new SaveV2 operation. + * * @param scope current scope * @param prefix Must have a single element. The prefix of the V2 checkpoint to which we * write the tensors. * @param tensorNames shape {N}. The names of the tensors to be saved. * @param shapeAndSlices shape {N}. The slice specs of the tensors to be saved. * Empty strings indicate that they are non-partitioned tensors. - * @param tensors `N` tensors to save. + * @param tensors {@code N} tensors to save. * @return a new instance of Save */ - @Endpoint(describeByClass = true) - public static Save create(Scope scope, Operand prefix, Operand tensorNames, Operand shapeAndSlices, Iterable> tensors) { + @Endpoint( + describeByClass = true + ) + public static Save create(Scope scope, Operand prefix, Operand tensorNames, + Operand shapeAndSlices, Iterable> tensors) { OperationBuilder opBuilder = scope.env().opBuilder("SaveV2", scope.makeOpName("Save")); opBuilder.addInput(prefix.asOutput()); opBuilder.addInput(tensorNames.asOutput()); @@ -59,11 +71,4 @@ public static Save create(Scope scope, Operand prefix, Operand opBuilder = scope.apply(opBuilder); return new Save(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SaveV2"; - - private Save(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SaveSlices.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SaveSlices.java index 002d3a36fd7..e1db978c5d1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SaveSlices.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SaveSlices.java @@ -29,54 +29,57 @@ /** * Saves input tensors slices to disk. - *

- * This is like `Save` except that tensors can be listed in the saved file as being - * a slice of a larger tensor. `shapes_and_slices` specifies the shape of the - * larger tensor and the slice that this tensor covers. `shapes_and_slices` must - * have as many elements as `tensor_names`. - *

- * Elements of the `shapes_and_slices` input must either be: + * This is like {@code Save} except that tensors can be listed in the saved file as being + * a slice of a larger tensor. {@code shapes_and_slices} specifies the shape of the + * larger tensor and the slice that this tensor covers. {@code shapes_and_slices} must + * have as many elements as {@code tensor_names}. + *

Elements of the {@code shapes_and_slices} input must either be: *

    - *
  • - * The empty string, in which case the corresponding tensor is - * saved normally. - *
  • - *
  • - * A string of the form `dim0 dim1 ... dimN-1 slice-spec` where the - * `dimI` are the dimensions of the larger tensor and `slice-spec` - * specifies what part is covered by the tensor to save. - *
  • + *
  • The empty string, in which case the corresponding tensor is + * saved normally.
  • + *
  • A string of the form {@code dim0 dim1 ... dimN-1 slice-spec} where the + * {@code dimI} are the dimensions of the larger tensor and {@code slice-spec} + * specifies what part is covered by the tensor to save.
  • *
- * `slice-spec` itself is a `:`-separated list: `slice0:slice1:...:sliceN-1` - * where each `sliceI` is either: + *

{@code slice-spec} itself is a {@code :}-separated list: {@code slice0:slice1:...:sliceN-1} + * where each {@code sliceI} is either: *

    - *
  • - * The string `-` meaning that the slice covers all indices of this dimension - *
  • - *
  • - * `start,length` where `start` and `length` are integers. In that - * case the slice covers `length` indices starting at `start`. - *
  • + *
  • The string {@code -} meaning that the slice covers all indices of this dimension
  • + *
  • {@code start,length} where {@code start} and {@code length} are integers. In that + * case the slice covers {@code length} indices starting at {@code start}.
  • *
- * See also `Save`. + *

See also {@code Save}. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SaveSlices extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SaveSlices"; + + private SaveSlices(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new SaveSlices operation. - * + * * @param scope current scope * @param filename Must have a single element. The name of the file to which we write the * tensor. - * @param tensorNames Shape `[N]`. The names of the tensors to be saved. - * @param shapesAndSlices Shape `[N]`. The shapes and slice specifications to use when + * @param tensorNames Shape {@code [N]}. The names of the tensors to be saved. + * @param shapesAndSlices Shape {@code [N]}. The shapes and slice specifications to use when * saving the tensors. - * @param data `N` tensors to save. + * @param data {@code N} tensors to save. * @return a new instance of SaveSlices */ - @Endpoint(describeByClass = true) - public static SaveSlices create(Scope scope, Operand filename, Operand tensorNames, Operand shapesAndSlices, Iterable> data) { + @Endpoint( + describeByClass = true + ) + public static SaveSlices create(Scope scope, Operand filename, + Operand tensorNames, Operand shapesAndSlices, Iterable> data) { OperationBuilder opBuilder = scope.env().opBuilder("SaveSlices", scope.makeOpName("SaveSlices")); opBuilder.addInput(filename.asOutput()); opBuilder.addInput(tensorNames.asOutput()); @@ -85,11 +88,4 @@ public static SaveSlices create(Scope scope, Operand filename, Operand< opBuilder = scope.apply(opBuilder); return new SaveSlices(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SaveSlices"; - - private SaveSlices(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaFprint.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaFprint.java index ac5d223ec6b..047615b901f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaFprint.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaFprint.java @@ -31,45 +31,52 @@ /** * Computes fingerprints of the input strings. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SdcaFprint extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SdcaFprint"; + + private Output output; + + private SdcaFprint(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new SdcaFprint operation. - * + * * @param scope current scope * @param input vector of strings to compute fingerprints on. * @return a new instance of SdcaFprint */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static SdcaFprint create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("SdcaFprint", scope.makeOpName("SdcaFprint")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); return new SdcaFprint(opBuilder.build()); } - + /** + * Gets output. * a (N,2) shaped matrix where N is the number of elements in the input * vector. Each row contains the low and high parts of the fingerprint. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SdcaFprint"; - - private Output output; - - private SdcaFprint(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaOptimizer.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaOptimizer.java index 1c2d500faab..e309842a2b0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaOptimizer.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaOptimizer.java @@ -27,55 +27,53 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TFloat32; import org.tensorflow.types.TInt64; /** * Distributed version of Stochastic Dual Coordinate Ascent (SDCA) optimizer for - *

* linear models with L1 + L2 regularization. As global optimization objective is * strongly-convex, the optimizer optimizes the dual objective at each step. The * optimizer applies each update one example at a time. Examples are sampled * uniformly, and the optimizer is learning rate free and enjoys linear convergence * rate. - *

- * [Proximal Stochastic Dual Coordinate Ascent](http://arxiv.org/pdf/1211.2717v1.pdf).
+ *

Proximal Stochastic Dual Coordinate Ascent .
* Shai Shalev-Shwartz, Tong Zhang. 2012 - *

- * $$Loss Objective = \sum f_{i} (wx_{i}) + (l2 / 2) * |w|^2 + l1 * |w|$$ - *

- * [Adding vs. Averaging in Distributed Primal-Dual Optimization](http://arxiv.org/abs/1502.03508).
+ *

$$Loss Objective = \sum f_{i} (wx_{i}) + (l2 / 2) * |w|^2 + l1 * |w|$$ + *

Adding vs. Averaging in Distributed Primal-Dual Optimization .
* Chenxin Ma, Virginia Smith, Martin Jaggi, Michael I. Jordan, * Peter Richtarik, Martin Takac. 2015 - *

- * [Stochastic Dual Coordinate Ascent with Adaptive Probabilities](https://arxiv.org/abs/1502.08053).
+ *

Stochastic Dual Coordinate Ascent with Adaptive Probabilities .
* Dominik Csiba, Zheng Qu, Peter Richtarik. 2015 */ public final class SdcaOptimizer extends RawOp { - /** - * Optional attributes for {@link org.tensorflow.op.train.SdcaOptimizer} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param adaptive Whether to use Adaptive SDCA for the inner loop. - */ - public Options adaptive(Boolean adaptive) { - this.adaptive = adaptive; - return this; - } - - private Boolean adaptive; - - private Options() { - } + public static final String OP_NAME = "SdcaOptimizerV2"; + + private Output outExampleStateData; + + private List> outDeltaSparseWeights; + + private List> outDeltaDenseWeights; + + @SuppressWarnings("unchecked") + private SdcaOptimizer(Operation operation) { + super(operation); + int outputIdx = 0; + outExampleStateData = operation.output(outputIdx++); + int outDeltaSparseWeightsLength = operation.outputListLength("out_delta_sparse_weights"); + outDeltaSparseWeights = Arrays.asList((Output[]) operation.outputList(outputIdx, outDeltaSparseWeightsLength)); + outputIdx += outDeltaSparseWeightsLength; + int outDeltaDenseWeightsLength = operation.outputListLength("out_delta_dense_weights"); + outDeltaDenseWeights = Arrays.asList((Output[]) operation.outputList(outputIdx, outDeltaDenseWeightsLength)); + outputIdx += outDeltaDenseWeightsLength; } - + /** - * Factory method to create a class wrapping a new SdcaOptimizer operation. - * + * Factory method to create a class wrapping a new SdcaOptimizerV2 operation. + * * @param scope current scope * @param sparseExampleIndices a list of vectors which contain example indices. * @param sparseFeatureIndices a list of vectors which contain feature indices. @@ -100,11 +98,19 @@ private Options() { * @param l2 Symmetric l2 regularization strength. * @param numLossPartitions Number of partitions of the global loss function. * @param numInnerIterations Number of iterations per mini-batch. - * @param options carries optional attributes values + * @param options carries optional attribute values * @return a new instance of SdcaOptimizer */ - @Endpoint(describeByClass = true) - public static SdcaOptimizer create(Scope scope, Iterable> sparseExampleIndices, Iterable> sparseFeatureIndices, Iterable> sparseFeatureValues, Iterable> denseFeatures, Operand exampleWeights, Operand exampleLabels, Iterable> sparseIndices, Iterable> sparseWeights, Iterable> denseWeights, Operand exampleStateData, String lossType, Float l1, Float l2, Long numLossPartitions, Long numInnerIterations, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SdcaOptimizer create(Scope scope, Iterable> sparseExampleIndices, + Iterable> sparseFeatureIndices, + Iterable> sparseFeatureValues, Iterable> denseFeatures, + Operand exampleWeights, Operand exampleLabels, + Iterable> sparseIndices, Iterable> sparseWeights, + Iterable> denseWeights, Operand exampleStateData, String lossType, + Float l1, Float l2, Long numLossPartitions, Long numInnerIterations, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SdcaOptimizerV2", scope.makeOpName("SdcaOptimizer")); opBuilder.addInputList(Operands.asOutputs(sparseExampleIndices)); opBuilder.addInputList(Operands.asOutputs(sparseFeatureIndices)); @@ -131,55 +137,65 @@ public static SdcaOptimizer create(Scope scope, Iterable> sparse } return new SdcaOptimizer(opBuilder.build()); } - + /** + * Sets the adaptive option. + * * @param adaptive Whether to use Adaptive SDCA for the inner loop. + * @return this Options instance. */ public static Options adaptive(Boolean adaptive) { return new Options().adaptive(adaptive); } - + /** + * Gets outExampleStateData. * a list of vectors containing the updated example state * data. + * @return outExampleStateData. */ public Output outExampleStateData() { return outExampleStateData; } - + /** + * Gets outDeltaSparseWeights. * a list of vectors where each value is the delta * weights associated with a sparse feature group. + * @return outDeltaSparseWeights. */ public List> outDeltaSparseWeights() { return outDeltaSparseWeights; } - + /** + * Gets outDeltaDenseWeights. * a list of vectors where the values are the delta * weights associated with a dense feature group. + * @return outDeltaDenseWeights. */ public List> outDeltaDenseWeights() { return outDeltaDenseWeights; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SdcaOptimizerV2"; - - private Output outExampleStateData; - private List> outDeltaSparseWeights; - private List> outDeltaDenseWeights; - - @SuppressWarnings("unchecked") - private SdcaOptimizer(Operation operation) { - super(operation); - int outputIdx = 0; - outExampleStateData = operation.output(outputIdx++); - int outDeltaSparseWeightsLength = operation.outputListLength("out_delta_sparse_weights"); - outDeltaSparseWeights = Arrays.asList((Output[])operation.outputList(outputIdx, outDeltaSparseWeightsLength)); - outputIdx += outDeltaSparseWeightsLength; - int outDeltaDenseWeightsLength = operation.outputListLength("out_delta_dense_weights"); - outDeltaDenseWeights = Arrays.asList((Output[])operation.outputList(outputIdx, outDeltaDenseWeightsLength)); - outputIdx += outDeltaDenseWeightsLength; + + /** + * Optional attributes for {@link org.tensorflow.op.train.SdcaOptimizer} + */ + public static class Options { + private Boolean adaptive; + + private Options() { + } + + /** + * Sets the adaptive option. + * + * @param adaptive Whether to use Adaptive SDCA for the inner loop. + * @return this Options instance. + */ + public Options adaptive(Boolean adaptive) { + this.adaptive = adaptive; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaShrinkL1.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaShrinkL1.java index ddd44197c72..ae6713ee6f0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaShrinkL1.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SdcaShrinkL1.java @@ -30,12 +30,22 @@ /** * Applies L1 regularization shrink step on the parameters. */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SdcaShrinkL1 extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "SdcaShrinkL1"; + + private SdcaShrinkL1(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new SdcaShrinkL1 operation. - * + * * @param scope current scope * @param weights a list of vectors where each value is the weight associated with a * feature group. @@ -43,8 +53,11 @@ public final class SdcaShrinkL1 extends RawOp { * @param l2 Symmetric l2 regularization strength. Should be a positive float. * @return a new instance of SdcaShrinkL1 */ - @Endpoint(describeByClass = true) - public static SdcaShrinkL1 create(Scope scope, Iterable> weights, Float l1, Float l2) { + @Endpoint( + describeByClass = true + ) + public static SdcaShrinkL1 create(Scope scope, Iterable> weights, Float l1, + Float l2) { OperationBuilder opBuilder = scope.env().opBuilder("SdcaShrinkL1", scope.makeOpName("SdcaShrinkL1")); opBuilder.addInputList(Operands.asOutputs(weights)); opBuilder = scope.apply(opBuilder); @@ -52,11 +65,4 @@ public static SdcaShrinkL1 create(Scope scope, Iterable> weigh opBuilder.setAttr("l2", l2); return new SdcaShrinkL1(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SdcaShrinkL1"; - - private SdcaShrinkL1(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdadelta.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdadelta.java index 174f3bfecd4..92b8c8d1152 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdadelta.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdadelta.java @@ -30,37 +30,31 @@ /** * var: Should be from a Variable(). - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SparseApplyAdadelta extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdadelta} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyAdadelta"; + + private Output out; + + private SparseApplyAdadelta(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseApplyAdadelta operation. - * + * * @param scope current scope - * @param var + * @param var the var value * @param accum Should be from a Variable(). * @param accumUpdate : Should be from a Variable(). * @param lr Learning rate. Must be a scalar. @@ -68,11 +62,16 @@ private Options() { * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyAdadelta} output and operands * @return a new instance of SparseApplyAdadelta */ - @Endpoint(describeByClass = true) - public static SparseApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseApplyAdadelta create(Scope scope, Operand var, + Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + Operand grad, Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyAdadelta", scope.makeOpName("SparseApplyAdadelta")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -90,37 +89,53 @@ public static SparseApplyAdadelta create(Scope scope, Opera } } } - return new SparseApplyAdadelta(opBuilder.build()); + return new SparseApplyAdadelta<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyAdadelta"; - - private Output out; - - private SparseApplyAdadelta(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdadelta} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagrad.java index 8df06b5e426..da285feddfb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagrad.java @@ -24,54 +24,34 @@ import org.tensorflow.op.RawOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Endpoint; -import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.family.TNumber; import org.tensorflow.types.family.TType; /** * Update relevant entries in '*var' and '*accum' according to the adagrad scheme. - *

* That is for rows we have grad for, we update var and accum as follows: * $$accum += grad * grad$$ * $$var -= lr * grad * (1 / sqrt(accum))$$ - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ public final class SparseApplyAdagrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param updateSlots - */ - public Options updateSlots(Boolean updateSlots) { - this.updateSlots = updateSlots; - return this; - } - - private Boolean useLocking; - private Boolean updateSlots; - - private Options() { - } + public static final String OP_NAME = "SparseApplyAdagradV2"; + + private Output out; + + private SparseApplyAdagrad(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyAdagrad operation. - * + * Factory method to create a class wrapping a new SparseApplyAdagradV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -79,11 +59,16 @@ private Options() { * @param epsilon Constant factor. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyAdagradV2} output and operands * @return a new instance of SparseApplyAdagrad */ - @Endpoint(describeByClass = true) - public static SparseApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseApplyAdagrad create(Scope scope, Operand var, + Operand accum, Operand lr, Operand epsilon, Operand grad, + Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyAdagradV2", scope.makeOpName("SparseApplyAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -102,45 +87,78 @@ public static SparseApplyAdagrad create(Scope scope, Operan } } } - return new SparseApplyAdagrad(opBuilder.build()); + return new SparseApplyAdagrad<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param updateSlots + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. */ public static Options updateSlots(Boolean updateSlots) { return new Options().updateSlots(updateSlots); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyAdagradV2"; - - private Output out; - - private SparseApplyAdagrad(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Boolean updateSlots; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the updateSlots option. + * + * @param updateSlots the updateSlots option + * @return this Options instance. + */ + public Options updateSlots(Boolean updateSlots) { + this.updateSlots = updateSlots; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagradDa.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagradDa.java index 2e8aede1551..2152c4bcabe 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagradDa.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyAdagradDa.java @@ -31,35 +31,29 @@ /** * Update entries in '*var' and '*accum' according to the proximal adagrad scheme. - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SparseApplyAdagradDa extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagradDa} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyAdagradDA"; + + private Output out; + + private SparseApplyAdagradDa(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyAdagradDa operation. - * + * Factory method to create a class wrapping a new SparseApplyAdagradDA operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -70,11 +64,17 @@ private Options() { * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyAdagradDA} output and operands * @return a new instance of SparseApplyAdagradDa */ - @Endpoint(describeByClass = true) - public static SparseApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseApplyAdagradDa create(Scope scope, Operand var, + Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, + Operand indices, Operand lr, Operand l1, Operand l2, + Operand globalStep, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyAdagradDA", scope.makeOpName("SparseApplyAdagradDa")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(gradientAccumulator.asOutput()); @@ -93,37 +93,53 @@ public static SparseApplyAdagradDa create(Scope scope, Oper } } } - return new SparseApplyAdagradDa(opBuilder.build()); + return new SparseApplyAdagradDa<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyAdagradDA"; - - private Output out; - - private SparseApplyAdagradDa(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagradDa} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyCenteredRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyCenteredRmsProp.java index 88ea8cf91f3..0fc5b4dadf4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyCenteredRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyCenteredRmsProp.java @@ -30,53 +30,42 @@ /** * Update '*var' according to the centered RMSProp algorithm. - *

* The centered RMSProp algorithm uses an estimate of the centered second moment * (i.e., the variance) for normalization, as opposed to regular RMSProp, which * uses the (uncentered) second moment. This often helps with training, but is * slightly more expensive in terms of computation and memory. - *

- * Note that in dense implementation of this algorithm, mg, ms, and mom will + *

Note that in dense implementation of this algorithm, mg, ms, and mom will * update even if the grad is zero, but in this sparse implementation, mg, ms, * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * mean_grad = decay * mean_grad + (1-decay) * gradient * Delta = learning_rate * gradient / sqrt(mean_square + epsilon - mean_grad ** 2) - *

- * $$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ - * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ - * $$var <- var - mom$$ - * - * @param data type for {@code out()} output + *

$$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ + * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ + * $$var <- var - mom$$ + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SparseApplyCenteredRmsProp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyCenteredRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is - * protected by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyCenteredRMSProp"; + + private Output out; + + private SparseApplyCenteredRmsProp(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyCenteredRmsProp operation. - * + * Factory method to create a class wrapping a new SparseApplyCenteredRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param mg Should be from a Variable(). @@ -84,15 +73,21 @@ private Options() { * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum the momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyCenteredRMSProp} output and operands * @return a new instance of SparseApplyCenteredRmsProp */ - @Endpoint(describeByClass = true) - public static SparseApplyCenteredRmsProp create(Scope scope, Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseApplyCenteredRmsProp create(Scope scope, Operand var, + Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, + Operand momentum, Operand epsilon, Operand grad, Operand indices, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyCenteredRMSProp", scope.makeOpName("SparseApplyCenteredRmsProp")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(mg.asOutput()); @@ -112,38 +107,55 @@ public static SparseApplyCenteredRmsProp create(Scope scope } } } - return new SparseApplyCenteredRmsProp(opBuilder.build()); + return new SparseApplyCenteredRmsProp<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, mg, ms, and mom tensors is + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, mg, ms, and mom tensors is * protected by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyCenteredRMSProp"; - - private Output out; - - private SparseApplyCenteredRmsProp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyCenteredRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, mg, ms, and mom tensors is + * protected by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyFtrl.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyFtrl.java index f720183d7e7..18d3a370873 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyFtrl.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyFtrl.java @@ -30,54 +30,37 @@ /** * Update relevant entries in '*var' according to the Ftrl-proximal scheme. - *

* That is for rows we have grad for, we update var, accum and linear as follows: * grad_with_shrinkage = grad + 2 * l2_shrinkage * var * accum_new = accum + grad * grad * linear += grad_with_shrinkage - - * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var + * (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var * quadratic = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 - * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 + * var = (sign(linear) * l1 - linear) / quadratic if |linear| > l1 else 0.0 * accum = accum_new - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SparseApplyFtrl extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyFtrl} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param multiplyLinearByLr - */ - public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { - this.multiplyLinearByLr = multiplyLinearByLr; - return this; - } - - private Boolean useLocking; - private Boolean multiplyLinearByLr; - - private Options() { - } + public static final String OP_NAME = "SparseApplyFtrlV2"; + + private Output out; + + private SparseApplyFtrl(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyFtrl operation. - * + * Factory method to create a class wrapping a new SparseApplyFtrlV2 operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -87,13 +70,19 @@ private Options() { * @param lr Scaling factor. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @param l2 L2 shrinkage regularization. Must be a scalar. - * @param l2Shrinkage + * @param l2Shrinkage the l2Shrinkage value * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyFtrlV2} output and operands * @return a new instance of SparseApplyFtrl */ - @Endpoint(describeByClass = true) - public static SparseApplyFtrl create(Scope scope, Operand var, Operand accum, Operand linear, Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseApplyFtrl create(Scope scope, Operand var, + Operand accum, Operand linear, Operand grad, Operand indices, + Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, + Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyFtrlV2", scope.makeOpName("SparseApplyFtrl")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -116,45 +105,78 @@ public static SparseApplyFtrl create(Scope scope, Operand(opBuilder.build()); + return new SparseApplyFtrl<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param multiplyLinearByLr + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. */ public static Options multiplyLinearByLr(Boolean multiplyLinearByLr) { return new Options().multiplyLinearByLr(multiplyLinearByLr); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyFtrlV2"; - - private Output out; - - private SparseApplyFtrl(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyFtrl} + */ + public static class Options { + private Boolean useLocking; + + private Boolean multiplyLinearByLr; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the multiplyLinearByLr option. + * + * @param multiplyLinearByLr the multiplyLinearByLr option + * @return this Options instance. + */ + public Options multiplyLinearByLr(Boolean multiplyLinearByLr) { + this.multiplyLinearByLr = multiplyLinearByLr; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyMomentum.java index 577ea1ac28b..79263d46e0f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyMomentum.java @@ -30,54 +30,33 @@ /** * Update relevant entries in '*var' and '*accum' according to the momentum scheme. - *

* Set use_nesterov = True if you want to use Nesterov momentum. - *

- * That is for rows we have grad for, we update var and accum as follows: - *

- * $$accum = accum * momentum + grad$$ + *

That is for rows we have grad for, we update var and accum as follows: + *

$$accum = accum * momentum + grad$$ * $$var -= lr * accum$$ - * - * @param data type for {@code out()} output + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SparseApplyMomentum extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyMomentum} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - /** - * @param useNesterov If `True`, the tensor passed to compute grad will be - * var - lr * momentum * accum, so in the end, the var you get is actually - * var - lr * momentum * accum. - */ - public Options useNesterov(Boolean useNesterov) { - this.useNesterov = useNesterov; - return this; - } - - private Boolean useLocking; - private Boolean useNesterov; - - private Options() { - } + public static final String OP_NAME = "SparseApplyMomentum"; + + private Output out; + + private SparseApplyMomentum(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseApplyMomentum operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -85,11 +64,16 @@ private Options() { * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyMomentum} output and operands * @return a new instance of SparseApplyMomentum */ - @Endpoint(describeByClass = true) - public static SparseApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseApplyMomentum create(Scope scope, Operand var, + Operand accum, Operand lr, Operand grad, Operand indices, + Operand momentum, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyMomentum", scope.makeOpName("SparseApplyMomentum")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -108,47 +92,82 @@ public static SparseApplyMomentum create(Scope scope, Opera } } } - return new SparseApplyMomentum(opBuilder.build()); + return new SparseApplyMomentum<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var and accum tensors will be protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * @param useNesterov If `True`, the tensor passed to compute grad will be + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be * var - lr * momentum * accum, so in the end, the var you get is actually * var - lr * momentum * accum. + * @return this Options instance. */ public static Options useNesterov(Boolean useNesterov) { return new Options().useNesterov(useNesterov); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyMomentum"; - - private Output out; - - private SparseApplyMomentum(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyMomentum} + */ + public static class Options { + private Boolean useLocking; + + private Boolean useNesterov; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var and accum tensors will be protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } + + /** + * Sets the useNesterov option. + * + * @param useNesterov If {@code True}, the tensor passed to compute grad will be + * var - lr * momentum * accum, so in the end, the var you get is actually + * var - lr * momentum * accum. + * @return this Options instance. + */ + public Options useNesterov(Boolean useNesterov) { + this.useNesterov = useNesterov; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalAdagrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalAdagrad.java index f38f42737ef..85631664327 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalAdagrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalAdagrad.java @@ -30,41 +30,34 @@ /** * Sparse update entries in '*var' and '*accum' according to FOBOS algorithm. - *

* That is for rows we have grad for, we update var and accum as follows: - * $$accum += grad grad$$ + * $$accum += grad * grad$$ * $$prox_v = var$$ - * $$prox_v -= lr grad (1 / sqrt(accum))$$ - * $$var = sign(prox_v)/(1+lrl2) max{|prox_v|-lrl1,0}$$ - * - * @param data type for {@code out()} output + * $$prox_v -= lr * grad * (1 / sqrt(accum))$$ + * $$var = sign(prox_v)/(1+lrl2) * max{|prox_v|-lrl1,0}$$ + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SparseApplyProximalAdagrad extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalAdagrad} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, updating of the var and accum tensors will be protected by - * a lock; otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyProximalAdagrad"; + + private Output out; + + private SparseApplyProximalAdagrad(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseApplyProximalAdagrad operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param accum Should be from a Variable(). @@ -73,11 +66,16 @@ private Options() { * @param l2 L2 regularization. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyProximalAdagrad} output and operands * @return a new instance of SparseApplyProximalAdagrad */ - @Endpoint(describeByClass = true) - public static SparseApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseApplyProximalAdagrad create(Scope scope, Operand var, + Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, + Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyProximalAdagrad", scope.makeOpName("SparseApplyProximalAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); @@ -94,37 +92,53 @@ public static SparseApplyProximalAdagrad create(Scope scope } } } - return new SparseApplyProximalAdagrad(opBuilder.build()); + return new SparseApplyProximalAdagrad<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, updating of the var and accum tensors will be protected by * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyProximalAdagrad"; - - private Output out; - - private SparseApplyProximalAdagrad(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalAdagrad} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, updating of the var and accum tensors will be protected by + * a lock; otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalGradientDescent.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalGradientDescent.java index 169b8d4f0c2..712dbebad5e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalGradientDescent.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyProximalGradientDescent.java @@ -30,39 +30,32 @@ /** * Sparse update '*var' as FOBOS algorithm with fixed learning rate. - *

* That is for rows we have grad for, we update var as follows: - * $$prox_v = var - alpha grad$$ - * $$var = sign(prox_v)/(1+alphal2) max{|prox_v|-alphal1,0}$$ - * - * @param data type for {@code out()} output + * $$prox_v = var - alpha * grad$$ + * $$var = sign(prox_v)/(1+alphal2) * max{|prox_v|-alphal1,0}$$ + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SparseApplyProximalGradientDescent extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalGradientDescent} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If True, the subtraction will be protected by a lock; - * otherwise the behavior is undefined, but may exhibit less contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyProximalGradientDescent"; + + private Output out; + + private SparseApplyProximalGradientDescent(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** * Factory method to create a class wrapping a new SparseApplyProximalGradientDescent operation. - * + * * @param scope current scope * @param var Should be from a Variable(). * @param alpha Scaling factor. Must be a scalar. @@ -70,11 +63,16 @@ private Options() { * @param l2 L2 regularization. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyProximalGradientDescent} output and operands * @return a new instance of SparseApplyProximalGradientDescent */ - @Endpoint(describeByClass = true) - public static SparseApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseApplyProximalGradientDescent create(Scope scope, + Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, + Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyProximalGradientDescent", scope.makeOpName("SparseApplyProximalGradientDescent")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(alpha.asOutput()); @@ -90,37 +88,53 @@ public static SparseApplyProximalGradientDescent create(Sco } } } - return new SparseApplyProximalGradientDescent(opBuilder.build()); + return new SparseApplyProximalGradientDescent<>(opBuilder.build()); } - + /** + * Sets the useLocking option. + * * @param useLocking If True, the subtraction will be protected by a lock; * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyProximalGradientDescent"; - - private Output out; - - private SparseApplyProximalGradientDescent(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalGradientDescent} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If True, the subtraction will be protected by a lock; + * otherwise the behavior is undefined, but may exhibit less contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyRmsProp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyRmsProp.java index 6de8f3be05d..f175008ef44 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyRmsProp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/SparseApplyRmsProp.java @@ -30,62 +30,57 @@ /** * Update '*var' according to the RMSProp algorithm. - *

* Note that in dense implementation of this algorithm, ms and mom will * update even if the grad is zero, but in this sparse implementation, ms * and mom will not update in iterations during which the grad is zero. - *

- * mean_square = decay * mean_square + (1-decay) * gradient ** 2 + *

mean_square = decay * mean_square + (1-decay) * gradient ** 2 * Delta = learning_rate * gradient / sqrt(mean_square + epsilon) - *

- * $$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ - * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ - * $$var <- var - mom$$ - * - * @param data type for {@code out()} output + *

$$ms <- rho * ms_{t-1} + (1-rho) * grad * grad$$ + * $$mom <- momentum * mom_{t-1} + lr * grad / sqrt(ms + epsilon)$$ + * $$var <- var - mom$$ + * + * @param data type for {@code out} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class SparseApplyRmsProp extends RawOp implements Operand { - /** - * Optional attributes for {@link org.tensorflow.op.train.SparseApplyRmsProp} + * The name of this op, as known by TensorFlow core engine */ - public static class Options { - - /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected - * by a lock; otherwise the behavior is undefined, but may exhibit less - * contention. - */ - public Options useLocking(Boolean useLocking) { - this.useLocking = useLocking; - return this; - } - - private Boolean useLocking; - - private Options() { - } + public static final String OP_NAME = "SparseApplyRMSProp"; + + private Output out; + + private SparseApplyRmsProp(Operation operation) { + super(operation); + int outputIdx = 0; + out = operation.output(outputIdx++); } - + /** - * Factory method to create a class wrapping a new SparseApplyRmsProp operation. - * + * Factory method to create a class wrapping a new SparseApplyRMSProp operation. + * * @param scope current scope * @param var Should be from a Variable(). * @param ms Should be from a Variable(). * @param mom Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param momentum the momentum value * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param indices A vector of indices into the first dimension of var, ms and mom. - * @param options carries optional attributes values + * @param options carries optional attribute values + * @param data type for {@code SparseApplyRMSProp} output and operands * @return a new instance of SparseApplyRmsProp */ - @Endpoint(describeByClass = true) - public static SparseApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, Options... options) { + @Endpoint( + describeByClass = true + ) + public static SparseApplyRmsProp create(Scope scope, Operand var, + Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, + Operand epsilon, Operand grad, Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyRMSProp", scope.makeOpName("SparseApplyRmsProp")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(ms.asOutput()); @@ -104,38 +99,55 @@ public static SparseApplyRmsProp create(Scope scope, Operan } } } - return new SparseApplyRmsProp(opBuilder.build()); + return new SparseApplyRmsProp<>(opBuilder.build()); } - + /** - * @param useLocking If `True`, updating of the var, ms, and mom tensors is protected + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, ms, and mom tensors is protected * by a lock; otherwise the behavior is undefined, but may exhibit less * contention. + * @return this Options instance. */ public static Options useLocking(Boolean useLocking) { return new Options().useLocking(useLocking); } - + /** - * Same as "var". + * Gets out. + * Same as "var". + * @return out. */ public Output out() { return out; } - + @Override public Output asOutput() { return out; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "SparseApplyRMSProp"; - - private Output out; - - private SparseApplyRmsProp(Operation operation) { - super(operation); - int outputIdx = 0; - out = operation.output(outputIdx++); + + /** + * Optional attributes for {@link org.tensorflow.op.train.SparseApplyRmsProp} + */ + public static class Options { + private Boolean useLocking; + + private Options() { + } + + /** + * Sets the useLocking option. + * + * @param useLocking If {@code True}, updating of the var, ms, and mom tensors is protected + * by a lock; otherwise the behavior is undefined, but may exhibit less + * contention. + * @return this Options instance. + */ + public Options useLocking(Boolean useLocking) { + this.useLocking = useLocking; + return this; + } } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/TileGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/TileGrad.java index f1b8b1ee444..6bb4ef8dea5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/TileGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/TileGrad.java @@ -29,53 +29,62 @@ import org.tensorflow.types.family.TType; /** - * Returns the gradient of `Tile`. - *

- * Since `Tile` takes an input and repeats the input `multiples` times - * along each dimension, `train.TileGrad` takes in `multiples` and aggregates - * each repeated tile of `input` into `output`. - * - * @param data type for {@code output()} output + * Returns the gradient of {@code Tile}. + * Since {@code Tile} takes an input and repeats the input {@code multiples} times + * along each dimension, {@code train.TileGrad} takes in {@code multiples} and aggregates + * each repeated tile of {@code input} into {@code output}. + * + * @param data type for {@code output} output */ -@Operator(group = "train") +@Operator( + group = "train" +) public final class TileGrad extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "TileGrad"; + + private Output output; + + private TileGrad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new TileGrad operation. - * + * * @param scope current scope - * @param input - * @param multiples + * @param input the input value + * @param multiples the multiples value + * @param data type for {@code TileGrad} output and operands * @return a new instance of TileGrad */ - @Endpoint(describeByClass = true) - public static TileGrad create(Scope scope, Operand input, Operand multiples) { + @Endpoint( + describeByClass = true + ) + public static TileGrad create(Scope scope, Operand input, + Operand multiples) { OperationBuilder opBuilder = scope.env().opBuilder("TileGrad", scope.makeOpName("TileGrad")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(multiples.asOutput()); opBuilder = scope.apply(opBuilder); - return new TileGrad(opBuilder.build()); + return new TileGrad<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "TileGrad"; - - private Output output; - - private TileGrad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/BroadcastHelper.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/BroadcastHelper.java index 0813440fa03..4e474a0360b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/BroadcastHelper.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/BroadcastHelper.java @@ -30,59 +30,70 @@ /** * Helper operator for performing XLA-style broadcasts - *

- * Broadcasts `lhs` and `rhs` to the same rank, by adding size 1 dimensions to - * whichever of `lhs` and `rhs` has the lower rank, using XLA's broadcasting rules + * Broadcasts {@code lhs} and {@code rhs} to the same rank, by adding size 1 dimensions to + * whichever of {@code lhs} and {@code rhs} has the lower rank, using XLA's broadcasting rules * for binary operators. - * - * @param data type for {@code lhsOutput()} output + * + * @param data type for {@code lhs_output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class BroadcastHelper extends RawOp { - /** - * Factory method to create a class wrapping a new BroadcastHelper operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaBroadcastHelper"; + + private Output lhsOutput; + + private Output rhsOutput; + + private BroadcastHelper(Operation operation) { + super(operation); + int outputIdx = 0; + lhsOutput = operation.output(outputIdx++); + rhsOutput = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaBroadcastHelper operation. + * * @param scope current scope * @param lhs the LHS input tensor * @param rhs the RHS input tensor * @param broadcastDims an XLA-style broadcast dimension specification + * @param data type for {@code XlaBroadcastHelper} output and operands * @return a new instance of BroadcastHelper */ - @Endpoint(describeByClass = true) - public static BroadcastHelper create(Scope scope, Operand lhs, Operand rhs, Operand broadcastDims) { + @Endpoint( + describeByClass = true + ) + public static BroadcastHelper create(Scope scope, Operand lhs, + Operand rhs, Operand broadcastDims) { OperationBuilder opBuilder = scope.env().opBuilder("XlaBroadcastHelper", scope.makeOpName("BroadcastHelper")); opBuilder.addInput(lhs.asOutput()); opBuilder.addInput(rhs.asOutput()); opBuilder.addInput(broadcastDims.asOutput()); opBuilder = scope.apply(opBuilder); - return new BroadcastHelper(opBuilder.build()); + return new BroadcastHelper<>(opBuilder.build()); } - + /** + * Gets lhsOutput. * the broadcasted LHS tensor + * @return lhsOutput. */ public Output lhsOutput() { return lhsOutput; } - + /** + * Gets rhsOutput. * the broadcasted RHS tensor + * @return rhsOutput. */ public Output rhsOutput() { return rhsOutput; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaBroadcastHelper"; - - private Output lhsOutput; - private Output rhsOutput; - - private BroadcastHelper(Operation operation) { - super(operation); - int outputIdx = 0; - lhsOutput = operation.output(outputIdx++); - rhsOutput = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ClusterOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ClusterOutput.java index ffd282478a5..17a5adef536 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ClusterOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ClusterOutput.java @@ -29,46 +29,55 @@ /** * Operator that connects the output of an XLA computation to other consumer graph nodes. - * - * @param data type for {@code outputs()} output + * + * @param data type for {@code outputs} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class ClusterOutput extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ClusterOutput operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaClusterOutput"; + + private Output outputs; + + private ClusterOutput(Operation operation) { + super(operation); + int outputIdx = 0; + outputs = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaClusterOutput operation. + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code XlaClusterOutput} output and operands * @return a new instance of ClusterOutput */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ClusterOutput create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("XlaClusterOutput", scope.makeOpName("ClusterOutput")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new ClusterOutput(opBuilder.build()); + return new ClusterOutput<>(opBuilder.build()); } - + /** + * Gets outputs. + * + * @return outputs. */ public Output outputs() { return outputs; } - + @Override public Output asOutput() { return outputs; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaClusterOutput"; - - private Output outputs; - - private ClusterOutput(Operation operation) { - super(operation); - int outputIdx = 0; - outputs = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Conv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Conv.java index d8daba47f27..b352153faee 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Conv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Conv.java @@ -30,18 +30,31 @@ /** * Wraps the XLA ConvGeneralDilated operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution + * https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution * . - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Conv extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Conv operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaConv"; + + private Output output; + + private Conv(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaConv operation. + * * @param scope current scope * @param lhs the input tensor * @param rhs the kernel tensor @@ -52,10 +65,17 @@ public final class Conv extends RawOp implements Operand { * @param featureGroupCount number of feature groups for grouped convolution. * @param dimensionNumbers a serialized xla::ConvolutionDimensionNumbers proto. * @param precisionConfig a serialized xla::PrecisionConfig proto. + * @param data type for {@code XlaConv} output and operands + * @param data type for {@code XlaConv} output and operands * @return a new instance of Conv */ - @Endpoint(describeByClass = true) - public static Conv create(Scope scope, Operand lhs, Operand rhs, Operand windowStrides, Operand padding, Operand lhsDilation, Operand rhsDilation, Operand featureGroupCount, String dimensionNumbers, String precisionConfig) { + @Endpoint( + describeByClass = true + ) + public static Conv create(Scope scope, Operand lhs, + Operand rhs, Operand windowStrides, Operand padding, Operand lhsDilation, + Operand rhsDilation, Operand featureGroupCount, String dimensionNumbers, + String precisionConfig) { OperationBuilder opBuilder = scope.env().opBuilder("XlaConv", scope.makeOpName("Conv")); opBuilder.addInput(lhs.asOutput()); opBuilder.addInput(rhs.asOutput()); @@ -67,28 +87,20 @@ public static Conv create(Scope scope, O opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dimension_numbers", dimensionNumbers); opBuilder.setAttr("precision_config", precisionConfig); - return new Conv(opBuilder.build()); + return new Conv<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaConv"; - - private Output output; - - private Conv(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java index 9e62c69996a..5f3f1b625c9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dequantize.java @@ -26,29 +26,46 @@ import org.tensorflow.op.annotation.Endpoint; import org.tensorflow.op.annotation.Operator; import org.tensorflow.types.TBfloat16; +import org.tensorflow.types.family.TType; /** * Takes the packed uint32 input and unpacks the input to uint8 to do - *

* Dequantization on device. */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Dequantize extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Dequantize operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaDequantize"; + + private Output output; + + private Dequantize(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaDequantize operation. + * * @param scope current scope * @param input Input tensors whose types is uint32, shape is [d0, ..., dn]. * @param minRange The minimum scalar value possibly produced for the input. * @param maxRange The maximum scalar value possibly produced for the input. - * @param mode String to determine the dequantize mode in {"MIN_COMBINED", "MIN_FIRST", "SCALED"}. + * @param mode String to determine the dequantize mode in {"MIN_COMBINED", "MIN_FIRST", "SCALED"}. * @param transposeOutput Boolean to determine if output is transposed. transpose_output * is faster when input is large and rank of input is higher than 1. * @return a new instance of Dequantize */ - @Endpoint(describeByClass = true) - public static Dequantize create(Scope scope, Operand input, Float minRange, Float maxRange, String mode, Boolean transposeOutput) { + @Endpoint( + describeByClass = true + ) + public static Dequantize create(Scope scope, Operand input, Float minRange, + Float maxRange, String mode, Boolean transposeOutput) { OperationBuilder opBuilder = scope.env().opBuilder("XlaDequantize", scope.makeOpName("Dequantize")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); @@ -58,29 +75,20 @@ public static Dequantize create(Scope scope, Operand input, Float minRange, F opBuilder.setAttr("transpose_output", transposeOutput); return new Dequantize(opBuilder.build()); } - + /** + * Gets output. * Output tensors whose types is bloat16. If transpose_output is true, * output shape is [dn * 4, dn-1, ..., d1, d0]. If transpose_output * is false, output shape is [d0,..., dn * 4]. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaDequantize"; - - private Output output; - - private Dequantize(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.java index ea4c485db6d..db734e6ef69 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Dot.java @@ -29,55 +29,64 @@ /** * Wraps the XLA DotGeneral operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral + * https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral * . - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Dot extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Dot operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaDot"; + + private Output output; + + private Dot(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaDot operation. + * * @param scope current scope * @param lhs the LHS tensor * @param rhs the RHS tensor * @param dimensionNumbers a serialized xla::DotDimensionNumbers proto. * @param precisionConfig a serialized xla::PrecisionConfig proto. + * @param data type for {@code XlaDot} output and operands * @return a new instance of Dot */ - @Endpoint(describeByClass = true) - public static Dot create(Scope scope, Operand lhs, Operand rhs, String dimensionNumbers, String precisionConfig) { + @Endpoint( + describeByClass = true + ) + public static Dot create(Scope scope, Operand lhs, Operand rhs, + String dimensionNumbers, String precisionConfig) { OperationBuilder opBuilder = scope.env().opBuilder("XlaDot", scope.makeOpName("Dot")); opBuilder.addInput(lhs.asOutput()); opBuilder.addInput(rhs.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dimension_numbers", dimensionNumbers); opBuilder.setAttr("precision_config", precisionConfig); - return new Dot(opBuilder.build()); + return new Dot<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaDot"; - - private Output output; - - private Dot(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.java index 631e22513cf..c7f7407d6e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicSlice.java @@ -30,62 +30,71 @@ /** * Wraps the XLA DynamicSlice operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#dynamicslice + * https://www.tensorflow.org/performance/xla/operation_semantics#dynamicslice * . - *

- * DynamicSlice extracts a sub-array from the input array at dynamic + *

DynamicSlice extracts a sub-array from the input array at dynamic * start_indices. The size of the slice in each dimension is passed in * size_indices, which specify the end point of exclusive slice intervals in each * dimension -- [start, start + size). The shape of start_indices must have rank 1, * with dimension size equal to the rank of operand. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class DynamicSlice extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new DynamicSlice operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaDynamicSlice"; + + private Output output; + + private DynamicSlice(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaDynamicSlice operation. + * * @param scope current scope - * @param input A `Tensor` of type T. + * @param input A {@code Tensor} of type T. * @param startIndices List of N integers containing the slice size for each * dimension. Each value must be strictly greater than zero, and start + size * must be less than or equal to the size of the dimension to avoid * implementation defined behavior. - * @param sizeIndices + * @param sizeIndices the sizeIndices value + * @param data type for {@code XlaDynamicSlice} output and operands + * @param data type for {@code XlaDynamicSlice} output and operands * @return a new instance of DynamicSlice */ - @Endpoint(describeByClass = true) - public static DynamicSlice create(Scope scope, Operand input, Operand startIndices, Operand sizeIndices) { + @Endpoint( + describeByClass = true + ) + public static DynamicSlice create(Scope scope, + Operand input, Operand startIndices, Operand sizeIndices) { OperationBuilder opBuilder = scope.env().opBuilder("XlaDynamicSlice", scope.makeOpName("DynamicSlice")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(startIndices.asOutput()); opBuilder.addInput(sizeIndices.asOutput()); opBuilder = scope.apply(opBuilder); - return new DynamicSlice(opBuilder.build()); + return new DynamicSlice<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaDynamicSlice"; - - private Output output; - - private DynamicSlice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.java index 32653d46869..8dee468d397 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/DynamicUpdateSlice.java @@ -30,62 +30,68 @@ /** * Wraps the XLA DynamicUpdateSlice operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#dynamicupdateslice + * https://www.tensorflow.org/performance/xla/operation_semantics#dynamicupdateslice * . - *

- * XlaDynamicUpdateSlice generates a result which is the value of the `input` - * operand, with a slice update overwritten at `indices`. The shape of `update` + *

XlaDynamicUpdateSlice generates a result which is the value of the {@code input} + * operand, with a slice update overwritten at {@code indices}. The shape of {@code update} * determines the shape of the sub-array of the result which is updated. The shape - * of indices must be rank == 1, with dimension size equal to the rank of `input`. - *

- * Handling of out-of-bounds slice indices is implementation-defined. - * - * @param data type for {@code output()} output + * of indices must be rank == 1, with dimension size equal to the rank of {@code input}. + *

Handling of out-of-bounds slice indices is implementation-defined. + * + * @param data type for {@code output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class DynamicUpdateSlice extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new DynamicUpdateSlice operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaDynamicUpdateSlice"; + + private Output output; + + private DynamicUpdateSlice(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaDynamicUpdateSlice operation. + * * @param scope current scope - * @param input A `Tensor` of type T. - * @param update A `Tensor` of type T. Same rank as `input`. - * @param indices A vector of indices into `input`. Must have length equal to the rank of - * `input`. + * @param input A {@code Tensor} of type T. + * @param update A {@code Tensor} of type T. Same rank as {@code input}. + * @param indices A vector of indices into {@code input}. Must have length equal to the rank of + * {@code input}. + * @param data type for {@code XlaDynamicUpdateSlice} output and operands * @return a new instance of DynamicUpdateSlice */ - @Endpoint(describeByClass = true) - public static DynamicUpdateSlice create(Scope scope, Operand input, Operand update, Operand indices) { + @Endpoint( + describeByClass = true + ) + public static DynamicUpdateSlice create(Scope scope, Operand input, + Operand update, Operand indices) { OperationBuilder opBuilder = scope.env().opBuilder("XlaDynamicUpdateSlice", scope.makeOpName("DynamicUpdateSlice")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(update.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder = scope.apply(opBuilder); - return new DynamicUpdateSlice(opBuilder.build()); + return new DynamicUpdateSlice<>(opBuilder.build()); } - + /** - * A `Tensor` of type T. + * Gets output. + * A {@code Tensor} of type T. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaDynamicUpdateSlice"; - - private Output output; - - private DynamicUpdateSlice(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.java index 3ddffcd2e94..eed296226c9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Einsum.java @@ -29,53 +29,62 @@ /** * An op which supports basic einsum op with 2 inputs and 1 output. - *

* This op has better TPU performance since it doesn't have explicitly reshape and * transpose operations as tf.einsum does. - * - * @param data type for {@code product()} output + * + * @param data type for {@code product} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Einsum extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Einsum operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaEinsum"; + + private Output product; + + private Einsum(Operation operation) { + super(operation); + int outputIdx = 0; + product = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaEinsum operation. + * * @param scope current scope - * @param a - * @param b - * @param equation + * @param a the a value + * @param b the b value + * @param equation the value of the equation property + * @param data type for {@code XlaEinsum} output and operands * @return a new instance of Einsum */ - @Endpoint(describeByClass = true) - public static Einsum create(Scope scope, Operand a, Operand b, String equation) { + @Endpoint( + describeByClass = true + ) + public static Einsum create(Scope scope, Operand a, Operand b, + String equation) { OperationBuilder opBuilder = scope.env().opBuilder("XlaEinsum", scope.makeOpName("Einsum")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("equation", equation); - return new Einsum(opBuilder.build()); + return new Einsum<>(opBuilder.build()); } - + /** + * Gets product. + * + * @return product. */ public Output product() { return product; } - + @Override public Output asOutput() { return product; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaEinsum"; - - private Output product; - - private Einsum(Operation operation) { - super(operation); - int outputIdx = 0; - product = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Gather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Gather.java index c01483049dd..626cebdf108 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Gather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Gather.java @@ -30,27 +30,46 @@ /** * Wraps the XLA Gather operator documented at - *

- * https://www.tensorflow.org/xla/operation_semantics#gather - * - * @param data type for {@code output()} output + * https://www.tensorflow.org/xla/operation_semantics#gather + * + * @param data type for {@code output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Gather extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Gather operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaGather"; + + private Output output; + + private Gather(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaGather operation. + * * @param scope current scope * @param operand The array we're gathering from. * @param startIndices Array containing the starting indices of the slices we gather. * @param sliceSizes slice_sizes[i] is the bounds for the slice on dimension i. * @param dimensionNumbers A serialized xla::GatherDimensionNumbers proto. * @param indicesAreSorted Boolean indicating if the indices are sorted. + * @param data type for {@code XlaGather} output and operands + * @param data type for {@code XlaGather} output and operands * @return a new instance of Gather */ - @Endpoint(describeByClass = true) - public static Gather create(Scope scope, Operand operand, Operand startIndices, Operand sliceSizes, String dimensionNumbers, Boolean indicesAreSorted) { + @Endpoint( + describeByClass = true + ) + public static Gather create(Scope scope, + Operand operand, Operand startIndices, Operand sliceSizes, String dimensionNumbers, + Boolean indicesAreSorted) { OperationBuilder opBuilder = scope.env().opBuilder("XlaGather", scope.makeOpName("Gather")); opBuilder.addInput(operand.asOutput()); opBuilder.addInput(startIndices.asOutput()); @@ -58,28 +77,20 @@ public static Gather create(Scope scope, opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dimension_numbers", dimensionNumbers); opBuilder.setAttr("indices_are_sorted", indicesAreSorted); - return new Gather(opBuilder.build()); + return new Gather<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaGather"; - - private Output output; - - private Gather(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.java index eb657bb4220..41ed8f23428 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/KeyValueSort.java @@ -30,59 +30,71 @@ /** * Wraps the XLA Sort operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#sort + * https://www.tensorflow.org/performance/xla/operation_semantics#sort * . - *

- * Sorts a tensor. Currently only sorts in ascending order are supported. - * - * @param data type for {@code sortedKeys()} output - * @param data type for {@code sortedValues()} output + *

Sorts a tensor. Currently only sorts in ascending order are supported. + * + * @param data type for {@code sorted_keys} output + * + * @param data type for {@code sorted_values} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class KeyValueSort extends RawOp { - /** - * Factory method to create a class wrapping a new KeyValueSort operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaKeyValueSort"; + + private Output sortedKeys; + + private Output sortedValues; + + private KeyValueSort(Operation operation) { + super(operation); + int outputIdx = 0; + sortedKeys = operation.output(outputIdx++); + sortedValues = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaKeyValueSort operation. + * * @param scope current scope - * @param keys A `Tensor` of type K. - * @param values A `Tensor` of type V. + * @param keys A {@code Tensor} of type K. + * @param values A {@code Tensor} of type V. + * @param data type for {@code XlaKeyValueSort} output and operands + * @param data type for {@code XlaKeyValueSort} output and operands * @return a new instance of KeyValueSort */ - @Endpoint(describeByClass = true) - public static KeyValueSort create(Scope scope, Operand keys, Operand values) { + @Endpoint( + describeByClass = true + ) + public static KeyValueSort create(Scope scope, + Operand keys, Operand values) { OperationBuilder opBuilder = scope.env().opBuilder("XlaKeyValueSort", scope.makeOpName("KeyValueSort")); opBuilder.addInput(keys.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder = scope.apply(opBuilder); - return new KeyValueSort(opBuilder.build()); + return new KeyValueSort<>(opBuilder.build()); } - + /** - * A `Tensor` of type K. + * Gets sortedKeys. + * A {@code Tensor} of type K. + * @return sortedKeys. */ public Output sortedKeys() { return sortedKeys; } - + /** - * A `Tensor` of type V. + * Gets sortedValues. + * A {@code Tensor} of type V. + * @return sortedValues. */ public Output sortedValues() { return sortedValues; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaKeyValueSort"; - - private Output sortedKeys; - private Output sortedValues; - - private KeyValueSort(Operation operation) { - super(operation); - int outputIdx = 0; - sortedKeys = operation.output(outputIdx++); - sortedValues = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Pad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Pad.java index aa4df05f3e0..c801e1fc9c1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Pad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Pad.java @@ -30,28 +30,47 @@ /** * Wraps the XLA Pad operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#pad + * https://www.tensorflow.org/performance/xla/operation_semantics#pad * . - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Pad extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Pad operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaPad"; + + private Output output; + + private Pad(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaPad operation. + * * @param scope current scope - * @param input A `Tensor` of type T. - * @param paddingValue A scalar `Tensor` of type T. + * @param input A {@code Tensor} of type T. + * @param paddingValue A scalar {@code Tensor} of type T. * @param paddingLow the padding to apply at the start of each input dimensions * @param paddingHigh the padding to apply at the end of each input dimension. * @param paddingInterior the padding to apply between each input element. + * @param data type for {@code XlaPad} output and operands + * @param data type for {@code XlaPad} output and operands * @return a new instance of Pad */ - @Endpoint(describeByClass = true) - public static Pad create(Scope scope, Operand input, Operand paddingValue, Operand paddingLow, Operand paddingHigh, Operand paddingInterior) { + @Endpoint( + describeByClass = true + ) + public static Pad create(Scope scope, Operand input, + Operand paddingValue, Operand paddingLow, Operand paddingHigh, + Operand paddingInterior) { OperationBuilder opBuilder = scope.env().opBuilder("XlaPad", scope.makeOpName("Pad")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(paddingValue.asOutput()); @@ -59,29 +78,20 @@ public static Pad create(Scope scope, Op opBuilder.addInput(paddingHigh.asOutput()); opBuilder.addInput(paddingInterior.asOutput()); opBuilder = scope.apply(opBuilder); - return new Pad(opBuilder.build()); + return new Pad<>(opBuilder.build()); } - + /** - * A `Tensor` of type T. + * Gets output. + * A {@code Tensor} of type T. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaPad"; - - private Output output; - - private Pad(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Recv.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Recv.java index 05781f61017..bfd24e0a20d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Recv.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Recv.java @@ -31,54 +31,62 @@ /** * Receives the named tensor from another XLA computation. Wraps the XLA Recv - *

* operator documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#recv . - * - * @param data type for {@code tensor()} output + * https://www.tensorflow.org/performance/xla/operation_semantics#recv . + * + * @param data type for {@code tensor} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Recv extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Recv operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaRecv"; + + private Output tensor; + + private Recv(Operation operation) { + super(operation); + int outputIdx = 0; + tensor = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaRecv operation. + * * @param scope current scope * @param dtype The type of the tensor. * @param tensorName A string key that identifies the channel. * @param shape The shape of the tensor. + * @param data type for {@code XlaRecv} output and operands * @return a new instance of Recv */ - @Endpoint(describeByClass = true) - public static Recv create(Scope scope, Class dtype, String tensorName, Shape shape) { + @Endpoint( + describeByClass = true + ) + public static Recv create(Scope scope, Class dtype, String tensorName, + Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("XlaRecv", scope.makeOpName("Recv")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("dtype", Operands.toDataType(dtype)); opBuilder.setAttr("tensor_name", tensorName); opBuilder.setAttr("shape", shape); - return new Recv(opBuilder.build()); + return new Recv<>(opBuilder.build()); } - + /** + * Gets tensor. * The tensor to receive. + * @return tensor. */ public Output tensor() { return tensor; } - + @Override public Output asOutput() { return tensor; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaRecv"; - - private Output tensor; - - private Recv(Operation operation) { - super(operation); - int outputIdx = 0; - tensor = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReplicaId.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReplicaId.java index 74386cc395d..22cf5cdb5c8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReplicaId.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/ReplicaId.java @@ -30,41 +30,49 @@ /** * Replica ID. */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class ReplicaId extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new ReplicaId operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaReplicaId"; + + private Output id; + + private ReplicaId(Operation operation) { + super(operation); + int outputIdx = 0; + id = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaReplicaId operation. + * * @param scope current scope * @return a new instance of ReplicaId */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static ReplicaId create(Scope scope) { OperationBuilder opBuilder = scope.env().opBuilder("XlaReplicaId", scope.makeOpName("ReplicaId")); opBuilder = scope.apply(opBuilder); return new ReplicaId(opBuilder.build()); } - + /** + * Gets id. + * + * @return id. */ public Output id() { return id; } - + @Override public Output asOutput() { return id; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaReplicaId"; - - private Output id; - - private ReplicaId(Operation operation) { - super(operation); - int outputIdx = 0; - id = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelfAdjointEig.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelfAdjointEig.java index 5f3f8e69c89..7e552eb5bc4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelfAdjointEig.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/SelfAdjointEig.java @@ -29,69 +29,79 @@ /** * Computes the eigen decomposition of a batch of self-adjoint matrices - *

* (Note: Only real inputs are supported). - *

- * Computes the eigenvalues and eigenvectors of the innermost N-by-N matrices in + *

Computes the eigenvalues and eigenvectors of the innermost N-by-N matrices in * tensor such that tensor[...,:,:] * v[..., :,i] = e[..., i] * v[...,:,i], for * i=0...N-1. - * - * @param data type for {@code w()} output + * + * @param data type for {@code w} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class SelfAdjointEig extends RawOp { - /** - * Factory method to create a class wrapping a new SelfAdjointEig operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSelfAdjointEig"; + + private Output w; + + private Output v; + + private SelfAdjointEig(Operation operation) { + super(operation); + int outputIdx = 0; + w = operation.output(outputIdx++); + v = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSelfAdjointEig operation. + * * @param scope current scope * @param a the input tensor. * @param lower a boolean specifies whether the calculation is done with the lower * triangular part or the upper triangular part. * @param maxIter maximum number of sweep update, i.e., the whole lower triangular * part or upper triangular part based on parameter lower. Heuristically, it has - * been argued that approximately logN sweeps are needed in practice (Ref: Golub & - * van Loan "Matrix Computation"). + * been argued that approximately logN sweeps are needed in practice (Ref: Golub & + * van Loan "Matrix Computation"). * @param epsilon the tolerance ratio. + * @param data type for {@code XlaSelfAdjointEig} output and operands * @return a new instance of SelfAdjointEig */ - @Endpoint(describeByClass = true) - public static SelfAdjointEig create(Scope scope, Operand a, Boolean lower, Long maxIter, Float epsilon) { + @Endpoint( + describeByClass = true + ) + public static SelfAdjointEig create(Scope scope, Operand a, Boolean lower, + Long maxIter, Float epsilon) { OperationBuilder opBuilder = scope.env().opBuilder("XlaSelfAdjointEig", scope.makeOpName("SelfAdjointEig")); opBuilder.addInput(a.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("lower", lower); opBuilder.setAttr("max_iter", maxIter); opBuilder.setAttr("epsilon", epsilon); - return new SelfAdjointEig(opBuilder.build()); + return new SelfAdjointEig<>(opBuilder.build()); } - + /** + * Gets w. * The eigenvalues in ascending order, each repeated according to its * multiplicity. + * @return w. */ public Output w() { return w; } - + /** + * Gets v. * The column v[..., :, i] is the normalized eigenvector corresponding to the * eigenvalue w[..., i]. + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSelfAdjointEig"; - - private Output w; - private Output v; - - private SelfAdjointEig(Operation operation) { - super(operation); - int outputIdx = 0; - w = operation.output(outputIdx++); - v = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Send.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Send.java index 948cdee567f..55e766b9cd8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Send.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Send.java @@ -28,22 +28,33 @@ /** * Sends the named tensor to another XLA computation. Wraps the XLA Send operator - *

* documented at - * https://www.tensorflow.org/performance/xla/operation_semantics#send . + * https://www.tensorflow.org/performance/xla/operation_semantics#send . */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Send extends RawOp { - /** - * Factory method to create a class wrapping a new Send operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSend"; + + private Send(Operation operation) { + super(operation); + } + + /** + * Factory method to create a class wrapping a new XlaSend operation. + * * @param scope current scope * @param tensor The tensor to send. * @param tensorName A string key that identifies the channel. * @return a new instance of Send */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Send create(Scope scope, Operand tensor, String tensorName) { OperationBuilder opBuilder = scope.env().opBuilder("XlaSend", scope.makeOpName("Send")); opBuilder.addInput(tensor.asOutput()); @@ -51,11 +62,4 @@ public static Send create(Scope scope, Operand tensor, String t opBuilder.setAttr("tensor_name", tensorName); return new Send(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSend"; - - private Send(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sharding.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sharding.java index 4404d297105..d62e4741a94 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sharding.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sharding.java @@ -29,46 +29,55 @@ /** * An op which shards the input based on the given sharding attribute. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Sharding extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Sharding operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSharding"; + + private Output output; + + private Sharding(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSharding operation. + * * @param scope current scope - * @param input + * @param input the input value + * @param data type for {@code XlaSharding} output and operands * @return a new instance of Sharding */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sharding create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("XlaSharding", scope.makeOpName("Sharding")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Sharding(opBuilder.build()); + return new Sharding<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSharding"; - - private Output output; - - private Sharding(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.java index b8bb34526ba..e04b43bdbfa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Sort.java @@ -29,52 +29,58 @@ /** * Wraps the XLA Sort operator, documented at - *

- * https://www.tensorflow.org/performance/xla/operation_semantics#sort + * https://www.tensorflow.org/performance/xla/operation_semantics#sort * . - *

- * Sorts a tensor. Currently only sorts in ascending order are supported. - * - * @param data type for {@code output()} output + *

Sorts a tensor. Currently only sorts in ascending order are supported. + * + * @param data type for {@code output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Sort extends RawOp implements Operand { - /** - * Factory method to create a class wrapping a new Sort operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSort"; + + private Output output; + + private Sort(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSort operation. + * * @param scope current scope - * @param input A `Tensor` of type T. + * @param input A {@code Tensor} of type T. + * @param data type for {@code XlaSort} output and operands * @return a new instance of Sort */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static Sort create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("XlaSort", scope.makeOpName("Sort")); opBuilder.addInput(input.asOutput()); opBuilder = scope.apply(opBuilder); - return new Sort(opBuilder.build()); + return new Sort<>(opBuilder.build()); } - + /** - * A `Tensor` of type T. + * Gets output. + * A {@code Tensor} of type T. + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSort"; - - private Output output; - - private Sort(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Svd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Svd.java index 9e7f75bee8c..ddcb4f9c2d7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Svd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/Svd.java @@ -29,75 +29,88 @@ /** * Computes the eigen decomposition of a batch of self-adjoint matrices - *

* (Note: Only real inputs are supported). - *

- * Computes the eigenvalues and eigenvectors of the innermost M-by-N matrices in + *

Computes the eigenvalues and eigenvectors of the innermost M-by-N matrices in * tensor such that tensor[...,:,:] = u[..., :, :] * Diag(s[..., :]) * Transpose(v[...,:,:]). - * - * @param data type for {@code s()} output + * + * @param data type for {@code s} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class Svd extends RawOp { - /** - * Factory method to create a class wrapping a new Svd operation. - * + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSvd"; + + private Output s; + + private Output u; + + private Output v; + + private Svd(Operation operation) { + super(operation); + int outputIdx = 0; + s = operation.output(outputIdx++); + u = operation.output(outputIdx++); + v = operation.output(outputIdx++); + } + + /** + * Factory method to create a class wrapping a new XlaSvd operation. + * * @param scope current scope * @param a the input tensor. * @param maxIter maximum number of sweep update, i.e., the whole lower triangular * part or upper triangular part based on parameter lower. Heuristically, it has * been argued that approximately log(min (M, N)) sweeps are needed in practice - * (Ref: Golub & van Loan "Matrix Computation"). + * (Ref: Golub & van Loan "Matrix Computation"). * @param epsilon the tolerance ratio. * @param precisionConfig a serialized xla::PrecisionConfig proto. + * @param data type for {@code XlaSvd} output and operands * @return a new instance of Svd */ - @Endpoint(describeByClass = true) - public static Svd create(Scope scope, Operand a, Long maxIter, Float epsilon, String precisionConfig) { + @Endpoint( + describeByClass = true + ) + public static Svd create(Scope scope, Operand a, Long maxIter, + Float epsilon, String precisionConfig) { OperationBuilder opBuilder = scope.env().opBuilder("XlaSvd", scope.makeOpName("Svd")); opBuilder.addInput(a.asOutput()); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("max_iter", maxIter); opBuilder.setAttr("epsilon", epsilon); opBuilder.setAttr("precision_config", precisionConfig); - return new Svd(opBuilder.build()); + return new Svd<>(opBuilder.build()); } - + /** + * Gets s. * Singular values. The values are sorted in reverse order of magnitude, so * s[..., 0] is the largest value, s[..., 1] is the second largest, etc. + * @return s. */ public Output s() { return s; } - + /** + * Gets u. * Left singular vectors. + * @return u. */ public Output u() { return u; } - + /** + * Gets v. * Right singular vectors. + * @return v. */ public Output v() { return v; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSvd"; - - private Output s; - private Output u; - private Output v; - - private Svd(Operation operation) { - super(operation); - int outputIdx = 0; - s = operation.output(outputIdx++); - u = operation.output(outputIdx++); - v = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvFromHost.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvFromHost.java index 64790e8a5bc..17064728c67 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvFromHost.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaRecvFromHost.java @@ -31,55 +31,64 @@ /** * An op to receive a tensor from the host. - *

* output: the tensor that will be received from the host. * Toutput: element type for output. * shape: shape for output. * key: A unique identifier for this region used to match up host transfers. - * - * @param data type for {@code output()} output + * + * @param data type for {@code output} output */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class XlaRecvFromHost extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaRecvFromHost"; + + private Output output; + + private XlaRecvFromHost(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new XlaRecvFromHost operation. - * + * * @param scope current scope - * @param Toutput - * @param shape - * @param key + * @param Toutput the value of the Toutput property + * @param shape the value of the shape property + * @param key the value of the key property + * @param data type for {@code XlaRecvFromHost} output and operands * @return a new instance of XlaRecvFromHost */ - @Endpoint(describeByClass = true) - public static XlaRecvFromHost create(Scope scope, Class Toutput, Shape shape, String key) { + @Endpoint( + describeByClass = true + ) + public static XlaRecvFromHost create(Scope scope, Class Toutput, + Shape shape, String key) { OperationBuilder opBuilder = scope.env().opBuilder("XlaRecvFromHost", scope.makeOpName("XlaRecvFromHost")); opBuilder = scope.apply(opBuilder); opBuilder.setAttr("Toutput", Operands.toDataType(Toutput)); opBuilder.setAttr("shape", shape); opBuilder.setAttr("key", key); - return new XlaRecvFromHost(opBuilder.build()); + return new XlaRecvFromHost<>(opBuilder.build()); } - + /** + * Gets output. + * + * @return output. */ public Output output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaRecvFromHost"; - - private Output output; - - private XlaRecvFromHost(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendToHost.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendToHost.java index 61c296710a4..d996d1e9e95 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendToHost.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSendToHost.java @@ -28,23 +28,34 @@ /** * An op to send a tensor to the host. - *

* input: the tensor that will be sent to the host. * Tinput: element type for input. * key: A unique identifier for this region used to match up host transfers. */ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class XlaSendToHost extends RawOp { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSendToHost"; + + private XlaSendToHost(Operation operation) { + super(operation); + } + /** * Factory method to create a class wrapping a new XlaSendToHost operation. - * + * * @param scope current scope - * @param input - * @param key + * @param input the input value + * @param key the value of the key property * @return a new instance of XlaSendToHost */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static XlaSendToHost create(Scope scope, Operand input, String key) { OperationBuilder opBuilder = scope.env().opBuilder("XlaSendToHost", scope.makeOpName("XlaSendToHost")); opBuilder.addInput(input.asOutput()); @@ -52,11 +63,4 @@ public static XlaSendToHost create(Scope scope, Operand input, opBuilder.setAttr("key", key); return new XlaSendToHost(opBuilder.build()); } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSendToHost"; - - private XlaSendToHost(Operation operation) { - super(operation); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSetBound.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSetBound.java index 2ae6581abc0..35262eb9f3a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSetBound.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/xla/XlaSetBound.java @@ -29,21 +29,38 @@ /** * Set a bound for the given input value as a hint to Xla compiler, - *

- * returns the same value. + *

+ *     returns the same value.
+ * 
*/ -@Operator(group = "xla") +@Operator( + group = "xla" +) public final class XlaSetBound extends RawOp implements Operand { - + /** + * The name of this op, as known by TensorFlow core engine + */ + public static final String OP_NAME = "XlaSetBound"; + + private Output output; + + private XlaSetBound(Operation operation) { + super(operation); + int outputIdx = 0; + output = operation.output(outputIdx++); + } + /** * Factory method to create a class wrapping a new XlaSetBound operation. - * + * * @param scope current scope - * @param input - * @param bound + * @param input the input value + * @param bound the bound value * @return a new instance of XlaSetBound */ - @Endpoint(describeByClass = true) + @Endpoint( + describeByClass = true + ) public static XlaSetBound create(Scope scope, Operand input, Operand bound) { OperationBuilder opBuilder = scope.env().opBuilder("XlaSetBound", scope.makeOpName("XlaSetBound")); opBuilder.addInput(input.asOutput()); @@ -51,26 +68,18 @@ public static XlaSetBound create(Scope scope, Operand input, Operand output() { return output; } - + @Override public Output asOutput() { return output; } - - /** The name of this op, as known by TensorFlow core engine */ - public static final String OP_NAME = "XlaSetBound"; - - private Output output; - - private XlaSetBound(Operation operation) { - super(operation); - int outputIdx = 0; - output = operation.output(outputIdx++); - } }