diff --git a/pom.xml b/pom.xml index 9cae184350a..e26bb73311a 100644 --- a/pom.xml +++ b/pom.xml @@ -29,12 +29,41 @@ + tensorflow-tools tensorflow-core - + + 1.8 + 1.8 + 4.12 + 1.21 + + + + + + junit + junit + ${junit.version} + + + org.openjdk.jmh + jmh-core + ${jmh.version} + test + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh.version} + test + + + + @@ -64,6 +93,7 @@ + @@ -72,6 +102,7 @@ http://www.tensorflow.org + diff --git a/tensorflow-core/tensorflow-core-api/pom.xml b/tensorflow-core/tensorflow-core-api/pom.xml index 4e26ca21853..d5c82ff9179 100644 --- a/tensorflow-core/tensorflow-core-api/pom.xml +++ b/tensorflow-core/tensorflow-core-api/pom.xml @@ -26,6 +26,11 @@ ${project.version} true + + org.tensorflow + tensorflow-tools + ${project.version} + junit junit @@ -71,10 +76,6 @@ maven-compiler-plugin 3.8.0 - - 1.7 - 1.7 - default-compile @@ -94,7 +95,7 @@ - org/tensorflow/c_api/presets/*.java + org/tensorflow/internal/c_api/presets/*.java @@ -199,7 +200,7 @@ ${javacpp.parser.skip} ${project.basedir}/src/gen/java - org.tensorflow.c_api.presets.* + org.tensorflow.internal.c_api.presets.* @@ -209,9 +210,9 @@ build - ${project.build.directory}/native/org/tensorflow/c_api/${javacpp.platform}${javacpp.platform.extension}/ + ${project.build.directory}/native/org/tensorflow/internal/c_api/${javacpp.platform}${javacpp.platform.extension}/ ${javacpp.compiler.skip} - org.tensorflow.c_api.** + org.tensorflow.internal.c_api.** true true @@ -222,6 +223,9 @@ maven-surefire-plugin 2.22.0 + + -Djava.library.path=${project.build.directory}/native/org/tensorflow/internal/c_api/${javacpp.platform}${javacpp.platform.extension} + ${project.build.directory}/native/ @@ -254,16 +258,16 @@ - org/tensorflow/c_api/${javacpp.platform}${javacpp.platform.extension}/ + org/tensorflow/internal/c_api/${javacpp.platform}${javacpp.platform.extension}/ ${project.build.directory}/native - org/tensorflow/c_api/${javacpp.platform}${javacpp.platform.extension}/*.exp - org/tensorflow/c_api/${javacpp.platform}${javacpp.platform.extension}/*.lib - org/tensorflow/c_api/${javacpp.platform}${javacpp.platform.extension}/*.obj - org/tensorflow/c_api/${javacpp.platform}${javacpp.platform.extension}/*mklml* - org/tensorflow/c_api/${javacpp.platform}${javacpp.platform.extension}/*iomp5* - org/tensorflow/c_api/${javacpp.platform}${javacpp.platform.extension}/*msvcr120* + org/tensorflow/internal/c_api/${javacpp.platform}${javacpp.platform.extension}/*.exp + org/tensorflow/internal/c_api/${javacpp.platform}${javacpp.platform.extension}/*.lib + org/tensorflow/internal/c_api/${javacpp.platform}${javacpp.platform.extension}/*.obj + org/tensorflow/internal/c_api/${javacpp.platform}${javacpp.platform.extension}/*mklml* + org/tensorflow/internal/c_api/${javacpp.platform}${javacpp.platform.extension}/*iomp5* + org/tensorflow/internal/c_api/${javacpp.platform}${javacpp.platform.extension}/*msvcr120* diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastRecv.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastRecv.pbtxt index 8ada333e446..a5c7a7ffaba 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastRecv.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastRecv.pbtxt @@ -3,4 +3,8 @@ op { endpoint { name: "collective.BroadcastRecv" } + out_arg: { + name: "data" + rename_to: "output" + } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastSend.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastSend.pbtxt index 18b4bef345e..628ad951a5b 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastSend.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveBcastSend.pbtxt @@ -3,4 +3,8 @@ op { endpoint { name: "collective.BroadcastSend" } + out_arg: { + name: "data" + rename_to: "output" + } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGather.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGather.pbtxt new file mode 100644 index 00000000000..5be0737f80a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveGather.pbtxt @@ -0,0 +1,7 @@ +op { + graph_op_name: "CollectiveGather" + out_arg: { + name: "data" + rename_to: "output" + } +} \ No newline at end of file diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduce.pbtxt index 6226cc05ec3..84251a19aa5 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduce.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_CollectiveReduce.pbtxt @@ -3,4 +3,8 @@ op { endpoint { name: "collective.AllReduce" } + out_arg: { + name: "data" + rename_to: "output" + } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_KafkaDataset.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_KafkaDataset.pbtxt new file mode 100644 index 00000000000..5f0da216cbb --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_KafkaDataset.pbtxt @@ -0,0 +1,6 @@ +op { + graph_op_name: "KafkaDataset" + endpoint { + name: "data.KafkaDataset" + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclAllReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclAllReduce.pbtxt index c7133d4a4a8..26ee24f6cde 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclAllReduce.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclAllReduce.pbtxt @@ -1,3 +1,7 @@ op { graph_op_name: "NcclAllReduce" + out_arg: { + name: "data" + rename_to: "output" + } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclReduce.pbtxt b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclReduce.pbtxt index 18dc8901778..42c6e131c14 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclReduce.pbtxt +++ b/tensorflow-core/tensorflow-core-api/src/bazel/api_def/api_def_NcclReduce.pbtxt @@ -1,3 +1,7 @@ op { graph_op_name: "NcclReduce" + out_arg: { + name: "data" + rename_to: "output" + } } diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/java_defs.h b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/java_defs.h index 0f1002b5953..8a3e16dbf3a 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/java_defs.h +++ b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/java_defs.h @@ -97,22 +97,25 @@ class Type { static Type IterableOf(const Type& type) { return Interface("Iterable").add_parameter(type); } + static Type DataTypeOf(const Type& type) { + return Class("DataType", "org.tensorflow").add_parameter(type); + } static Type ForDataType(DataType data_type) { switch (data_type) { case DataType::DT_BOOL: - return Class("Boolean"); + return Class("TBool", "org.tensorflow.types"); case DataType::DT_STRING: - return Class("String"); + return Class("TString", "org.tensorflow.types"); case DataType::DT_FLOAT: - return Class("Float"); + return Class("TFloat", "org.tensorflow.types"); case DataType::DT_DOUBLE: - return Class("Double"); + return Class("TDouble", "org.tensorflow.types"); case DataType::DT_UINT8: - return Class("UInt8", "org.tensorflow.types"); + return Class("TUInt8", "org.tensorflow.types"); case DataType::DT_INT32: - return Class("Integer"); + return Class("TInt32", "org.tensorflow.types"); case DataType::DT_INT64: - return Class("Long"); + return Class("TInt64", "org.tensorflow.types"); case DataType::DT_RESOURCE: // TODO(karllessard) create a Resource utility class that could be // used to store a resource and its type (passed in a second argument). diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_generator.cc b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_generator.cc index 92cb406e868..997ad561113 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_generator.cc +++ b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_generator.cc @@ -124,24 +124,16 @@ void WriteSetAttrDirective(const AttributeSpec& attr, bool optional, .EndLine() .BeginBlock("for (int i = 0; i < " + array_name + ".length; ++i)") .Append(array_name + "[i] = "); - if (attr.type().kind() == Type::GENERIC) { - writer->Append("DataType.fromClass(" + var_name + ".get(i));"); - } else { - writer->Append(var_name + ".get(i);"); - } + writer->Append(var_name + ".get(i);"); writer->EndLine() .EndBlock() .Append("opBuilder.setAttr(\"" + attr.op_def_name() + "\", ") .Append(array_name + ");") .EndLine(); } else { - writer->Append("opBuilder.setAttr(\"" + attr.op_def_name() + "\", "); - if (attr.var().type().name() == "Class") { - writer->Append("DataType.fromClass(" + var_name + "));"); - } else { - writer->Append(var_name + ");"); - } - writer->EndLine(); + writer->Append("opBuilder.setAttr(\"" + attr.op_def_name() + "\", ") + .Append(var_name + ");") + .EndLine(); } } @@ -179,7 +171,7 @@ void RenderSecondaryFactoryMethod(const OpSpec& op, const Type& op_class, if (attr.type().kind() == Type::GENERIC && default_types.find(attr.type().name()) != default_types.end()) { factory_statement << default_types.at(attr.type().name()).name() - << ".class"; + << ".DTYPE"; } else { AddArgument(attr.var(), attr.description(), &factory, &factory_doc); factory_statement << attr.var().name(); @@ -345,11 +337,10 @@ void RenderInterfaceImpl(const OpSpec& op, RenderMode mode, if (mode == OPERAND) { bool cast2obj = output.type().wildcard(); - Type return_type = - Type::Class("Output", "org.tensorflow") - .add_parameter(cast2obj ? Type::Class("Object") : output.type()); + Type return_type = Type::Class("Output", "org.tensorflow") + .add_parameter(cast2obj ? Type::Class("TType", "org.tensorflow.types.family") : output.type()); Method as_output = Method::Create("asOutput", return_type) - .add_annotation(Annotation::Create("Override")); + .add_annotation(Annotation::Create("Override")); if (cast2obj) { as_output.add_annotation( Annotation::Create("SuppressWarnings").attributes("\"unchecked\"")); @@ -365,7 +356,7 @@ void RenderInterfaceImpl(const OpSpec& op, RenderMode mode, } else if (mode == LIST_OPERAND) { Type operand = Type::Interface("Operand", "org.tensorflow"); if (output.type().wildcard()) { - operand.add_parameter(Type::Class("Object")); + operand.add_parameter(Type::Class("TType", "org.tensorflow.types.family")); } else { operand.add_parameter(output.type()); } @@ -429,7 +420,7 @@ void GenerateOp(const OpSpec& op, const EndpointSpec& endpoint, RenderMode mode = DEFAULT; if (op.outputs().size() == 1) { const ArgumentSpec& output = op.outputs().front(); - Type operand_type(output.type().wildcard() ? Type::Class("Object") + Type operand_type(output.type().wildcard() ? Type::Class("TType", "org.tensorflow.types.family") : output.type()); Type operand_inf(Type::Interface("Operand", "org.tensorflow") .add_parameter(operand_type)); diff --git a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_specs.cc b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_specs.cc index 004c6b1bfa6..5bb63109df5 100644 --- a/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_specs.cc +++ b/tensorflow-core/tensorflow-core-api/src/bazel/op_generator/op_specs.cc @@ -86,7 +86,8 @@ class TypeResolver { if (next_generic_letter_ > 'Z') { next_generic_letter_ = 'A'; } - return Type::Generic(string(1, generic_letter)); + return Type::Generic(string(1, generic_letter)) + .add_supertype(Type::Class("TType", "org.tensorflow.types.family")); } }; @@ -148,7 +149,7 @@ std::pair TypeResolver::TypesOf(const OpDef_AttrDef& attr_def, types = MakeTypePair(Type::Class("Boolean"), Type::Boolean()); } else if (attr_type == "shape") { - types = MakeTypePair(Type::Class("Shape", "org.tensorflow")); + types = MakeTypePair(Type::Class("Shape", "org.tensorflow.tools")); } else if (attr_type == "tensor") { types = MakeTypePair(Type::Class("Tensor", "org.tensorflow") @@ -157,7 +158,7 @@ std::pair TypeResolver::TypesOf(const OpDef_AttrDef& attr_def, } else if (attr_type == "type") { Type type = *iterable_out ? Type::Wildcard() : NextGeneric(); if (IsRealNumbers(attr_def.allowed_values())) { - type.add_supertype(Type::Class("Number")); + type.add_supertype(Type::Class("TNumber", "org.tensorflow.types.family")); } types = MakeTypePair(type, Type::Enum("DataType", "org.tensorflow")); @@ -305,7 +306,7 @@ AttributeSpec CreateAttribute(const OpDef_AttrDef& attr_def, bool iterable = false; std::pair types = type_resolver->TypesOf(attr_def, &iterable); Type var_type = types.first.kind() == Type::GENERIC - ? Type::ClassOf(types.first) + ? Type::DataTypeOf(types.first) : types.first; if (iterable) { var_type = Type::ListOf(var_type); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/AudioOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/AudioOps.java index e284ca9edb6..6d4c1fdd75b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/AudioOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/AudioOps.java @@ -5,6 +5,9 @@ import org.tensorflow.op.audio.DecodeWav; import org.tensorflow.op.audio.EncodeWav; import org.tensorflow.op.audio.Mfcc; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * An API for building {@code audio} operations as {@link Op Op}s @@ -18,33 +21,6 @@ public final class AudioOps { this.scope = scope; } - /** - * Builds an {@link AudioSpectrogram} operation - * - * @param input Float representation of audio data. - * @param windowSize How wide the input window is in samples. For the highest efficiency - * @param stride How widely apart the center of adjacent sample windows should be. - * @param options carries optional attributes values - * @return a new instance of AudioSpectrogram - * @see org.tensorflow.op.audio.AudioSpectrogram - */ - public AudioSpectrogram audioSpectrogram(Operand input, Long windowSize, Long stride, - AudioSpectrogram.Options... options) { - return AudioSpectrogram.create(scope, input, windowSize, stride, options); - } - - /** - * Builds an {@link EncodeWav} operation - * - * @param audio 2-D with shape `[length, channels]`. - * @param sampleRate Scalar containing the sample frequency. - * @return a new instance of EncodeWav - * @see org.tensorflow.op.audio.EncodeWav - */ - public EncodeWav encodeWav(Operand audio, Operand sampleRate) { - return EncodeWav.create(scope, audio, sampleRate); - } - /** * Builds an {@link DecodeWav} operation * @@ -53,7 +29,7 @@ public EncodeWav encodeWav(Operand audio, Operand sampleRate) { * @return a new instance of DecodeWav * @see org.tensorflow.op.audio.DecodeWav */ - public DecodeWav decodeWav(Operand contents, DecodeWav.Options... options) { + public DecodeWav decodeWav(Operand contents, DecodeWav.Options... options) { return DecodeWav.create(scope, contents, options); } @@ -66,8 +42,35 @@ public DecodeWav decodeWav(Operand contents, DecodeWav.Options... option * @return a new instance of Mfcc * @see org.tensorflow.op.audio.Mfcc */ - public Mfcc mfcc(Operand spectrogram, Operand sampleRate, + public Mfcc mfcc(Operand spectrogram, Operand sampleRate, Mfcc.Options... options) { return Mfcc.create(scope, spectrogram, sampleRate, options); } + + /** + * Builds an {@link EncodeWav} operation + * + * @param audio 2-D with shape `[length, channels]`. + * @param sampleRate Scalar containing the sample frequency. + * @return a new instance of EncodeWav + * @see org.tensorflow.op.audio.EncodeWav + */ + public EncodeWav encodeWav(Operand audio, Operand sampleRate) { + return EncodeWav.create(scope, audio, sampleRate); + } + + /** + * Builds an {@link AudioSpectrogram} operation + * + * @param input Float representation of audio data. + * @param windowSize How wide the input window is in samples. For the highest efficiency + * @param stride How widely apart the center of adjacent sample windows should be. + * @param options carries optional attributes values + * @return a new instance of AudioSpectrogram + * @see org.tensorflow.op.audio.AudioSpectrogram + */ + public AudioSpectrogram audioSpectrogram(Operand input, Long windowSize, Long stride, + AudioSpectrogram.Options... options) { + return AudioSpectrogram.create(scope, input, windowSize, stride, options); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/BitwiseOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/BitwiseOps.java index 51798c83e24..37b1105fb83 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/BitwiseOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/BitwiseOps.java @@ -7,6 +7,7 @@ import org.tensorflow.op.bitwise.Invert; import org.tensorflow.op.bitwise.LeftShift; import org.tensorflow.op.bitwise.RightShift; +import org.tensorflow.types.family.TNumber; /** * An API for building {@code bitwise} operations as {@link Op Op}s @@ -21,50 +22,50 @@ public final class BitwiseOps { } /** - * Builds an {@link Invert} operation + * Builds an {@link BitwiseOr} operation * * @param x - * @return a new instance of Invert - * @see org.tensorflow.op.bitwise.Invert + * @param y + * @return a new instance of BitwiseOr + * @see org.tensorflow.op.bitwise.BitwiseOr */ - public Invert invert(Operand x) { - return Invert.create(scope, x); + public BitwiseOr bitwiseOr(Operand x, Operand y) { + return BitwiseOr.create(scope, x, y); } /** - * Builds an {@link BitwiseAnd} operation + * Builds an {@link BitwiseXor} operation * * @param x * @param y - * @return a new instance of BitwiseAnd - * @see org.tensorflow.op.bitwise.BitwiseAnd + * @return a new instance of BitwiseXor + * @see org.tensorflow.op.bitwise.BitwiseXor */ - public BitwiseAnd bitwiseAnd(Operand x, Operand y) { - return BitwiseAnd.create(scope, x, y); + public BitwiseXor bitwiseXor(Operand x, Operand y) { + return BitwiseXor.create(scope, x, y); } /** - * Builds an {@link BitwiseOr} operation + * Builds an {@link BitwiseAnd} operation * * @param x * @param y - * @return a new instance of BitwiseOr - * @see org.tensorflow.op.bitwise.BitwiseOr + * @return a new instance of BitwiseAnd + * @see org.tensorflow.op.bitwise.BitwiseAnd */ - public BitwiseOr bitwiseOr(Operand x, Operand y) { - return BitwiseOr.create(scope, x, y); + public BitwiseAnd bitwiseAnd(Operand x, Operand y) { + return BitwiseAnd.create(scope, x, y); } /** - * Builds an {@link LeftShift} operation + * Builds an {@link Invert} operation * * @param x - * @param y - * @return a new instance of LeftShift - * @see org.tensorflow.op.bitwise.LeftShift + * @return a new instance of Invert + * @see org.tensorflow.op.bitwise.Invert */ - public LeftShift leftShift(Operand x, Operand y) { - return LeftShift.create(scope, x, y); + public Invert invert(Operand x) { + return Invert.create(scope, x); } /** @@ -75,19 +76,19 @@ public LeftShift leftShift(Operand x, Operand y) { * @return a new instance of RightShift * @see org.tensorflow.op.bitwise.RightShift */ - public RightShift rightShift(Operand x, Operand y) { + public RightShift rightShift(Operand x, Operand y) { return RightShift.create(scope, x, y); } /** - * Builds an {@link BitwiseXor} operation + * Builds an {@link LeftShift} operation * * @param x * @param y - * @return a new instance of BitwiseXor - * @see org.tensorflow.op.bitwise.BitwiseXor + * @return a new instance of LeftShift + * @see org.tensorflow.op.bitwise.LeftShift */ - public BitwiseXor bitwiseXor(Operand x, Operand y) { - return BitwiseXor.create(scope, x, y); + public LeftShift leftShift(Operand x, Operand y) { + return LeftShift.create(scope, x, y); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java index 6bb3e67e93f..79893582201 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DataOps.java @@ -1,20 +1,25 @@ package org.tensorflow.op; import java.util.List; +import org.tensorflow.DataType; import org.tensorflow.Operand; -import org.tensorflow.Shape; import org.tensorflow.op.data.AnonymousIterator; import org.tensorflow.op.data.DeserializeIterator; import org.tensorflow.op.data.IteratorGetNext; import org.tensorflow.op.data.IteratorGetNextAsOptional; import org.tensorflow.op.data.IteratorGetNextSync; import org.tensorflow.op.data.IteratorToStringHandle; +import org.tensorflow.op.data.KafkaDataset; import org.tensorflow.op.data.MakeIterator; import org.tensorflow.op.data.OptionalFromValue; import org.tensorflow.op.data.OptionalGetValue; import org.tensorflow.op.data.OptionalHasValue; import org.tensorflow.op.data.OptionalNone; import org.tensorflow.op.data.SerializeIterator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * An API for building {@code data} operations as {@link Op Op}s @@ -29,53 +34,44 @@ public final class DataOps { } /** - * Builds an {@link OptionalNone} operation - * - * @return a new instance of OptionalNone - * @see org.tensorflow.op.data.OptionalNone - */ - public OptionalNone optionalNone() { - return OptionalNone.create(scope); - } - - /** - * Builds an {@link AnonymousIterator} operation + * Builds an {@link KafkaDataset} operation * - * @param outputTypes - * @param outputShapes - * @return a new instance of AnonymousIterator - * @see org.tensorflow.op.data.AnonymousIterator + * @param topics A `tf.string` tensor containing one or more subscriptions, + * @param servers A list of bootstrap servers. + * @param group The consumer group id. + * @param eof If True, the kafka reader will stop on EOF. + * @param timeout The timeout value for the Kafka Consumer to wait + * @param configGlobal A `tf.string` tensor containing global configuration + * @param configTopic A `tf.string` tensor containing topic configuration + * @return a new instance of KafkaDataset + * @see org.tensorflow.op.data.KafkaDataset */ - public AnonymousIterator anonymousIterator(List> outputTypes, List outputShapes) { - return AnonymousIterator.create(scope, outputTypes, outputShapes); + public KafkaDataset kafkaDataset(Operand topics, Operand servers, + Operand group, Operand eof, Operand timeout, + Operand configGlobal, Operand configTopic) { + return KafkaDataset.create(scope, topics, servers, group, eof, timeout, configGlobal, configTopic); } /** - * Builds an {@link OptionalGetValue} operation + * Builds an {@link DeserializeIterator} operation * - * @param optional - * @param outputTypes - * @param outputShapes - * @return a new instance of OptionalGetValue - * @see org.tensorflow.op.data.OptionalGetValue + * @param resourceHandle A handle to an iterator resource. + * @param serialized A variant tensor storing the state of the iterator contained in the + * @return a new instance of DeserializeIterator + * @see org.tensorflow.op.data.DeserializeIterator */ - public OptionalGetValue optionalGetValue(Operand optional, List> outputTypes, - List outputShapes) { - return OptionalGetValue.create(scope, optional, outputTypes, outputShapes); + public DeserializeIterator deserializeIterator(Operand resourceHandle, Operand serialized) { + return DeserializeIterator.create(scope, resourceHandle, serialized); } /** - * Builds an {@link IteratorGetNext} operation + * Builds an {@link OptionalNone} operation * - * @param iterator - * @param outputTypes - * @param outputShapes - * @return a new instance of IteratorGetNext - * @see org.tensorflow.op.data.IteratorGetNext + * @return a new instance of OptionalNone + * @see org.tensorflow.op.data.OptionalNone */ - public IteratorGetNext iteratorGetNext(Operand iterator, List> outputTypes, - List outputShapes) { - return IteratorGetNext.create(scope, iterator, outputTypes, outputShapes); + public OptionalNone optionalNone() { + return OptionalNone.create(scope); } /** @@ -99,7 +95,7 @@ public OptionalFromValue optionalFromValue(Iterable> components) { * @see org.tensorflow.op.data.IteratorGetNextAsOptional */ public IteratorGetNextAsOptional iteratorGetNextAsOptional(Operand iterator, - List> outputTypes, List outputShapes) { + List> outputTypes, List outputShapes) { return IteratorGetNextAsOptional.create(scope, iterator, outputTypes, outputShapes); } @@ -114,20 +110,6 @@ public IteratorToStringHandle iteratorToStringHandle(Operand resourceHandle) return IteratorToStringHandle.create(scope, resourceHandle); } - /** - * Builds an {@link IteratorGetNextSync} operation - * - * @param iterator - * @param outputTypes - * @param outputShapes - * @return a new instance of IteratorGetNextSync - * @see org.tensorflow.op.data.IteratorGetNextSync - */ - public IteratorGetNextSync iteratorGetNextSync(Operand iterator, List> outputTypes, - List outputShapes) { - return IteratorGetNextSync.create(scope, iterator, outputTypes, outputShapes); - } - /** * Builds an {@link OptionalHasValue} operation * @@ -139,6 +121,17 @@ public OptionalHasValue optionalHasValue(Operand optional) { return OptionalHasValue.create(scope, optional); } + /** + * Builds an {@link SerializeIterator} operation + * + * @param resourceHandle A handle to an iterator resource. + * @return a new instance of SerializeIterator + * @see org.tensorflow.op.data.SerializeIterator + */ + public SerializeIterator serializeIterator(Operand resourceHandle) { + return SerializeIterator.create(scope, resourceHandle); + } + /** * Builds an {@link MakeIterator} operation * @@ -152,25 +145,57 @@ public MakeIterator makeIterator(Operand dataset, Operand iterator) { } /** - * Builds an {@link DeserializeIterator} operation + * Builds an {@link OptionalGetValue} operation * - * @param resourceHandle A handle to an iterator resource. - * @param serialized A variant tensor storing the state of the iterator contained in the - * @return a new instance of DeserializeIterator - * @see org.tensorflow.op.data.DeserializeIterator + * @param optional + * @param outputTypes + * @param outputShapes + * @return a new instance of OptionalGetValue + * @see org.tensorflow.op.data.OptionalGetValue */ - public DeserializeIterator deserializeIterator(Operand resourceHandle, Operand serialized) { - return DeserializeIterator.create(scope, resourceHandle, serialized); + public OptionalGetValue optionalGetValue(Operand optional, List> outputTypes, + List outputShapes) { + return OptionalGetValue.create(scope, optional, outputTypes, outputShapes); } /** - * Builds an {@link SerializeIterator} operation + * Builds an {@link IteratorGetNext} operation * - * @param resourceHandle A handle to an iterator resource. - * @return a new instance of SerializeIterator - * @see org.tensorflow.op.data.SerializeIterator + * @param iterator + * @param outputTypes + * @param outputShapes + * @return a new instance of IteratorGetNext + * @see org.tensorflow.op.data.IteratorGetNext */ - public SerializeIterator serializeIterator(Operand resourceHandle) { - return SerializeIterator.create(scope, resourceHandle); + public IteratorGetNext iteratorGetNext(Operand iterator, List> outputTypes, + List outputShapes) { + return IteratorGetNext.create(scope, iterator, outputTypes, outputShapes); + } + + /** + * Builds an {@link AnonymousIterator} operation + * + * @param outputTypes + * @param outputShapes + * @return a new instance of AnonymousIterator + * @see org.tensorflow.op.data.AnonymousIterator + */ + public AnonymousIterator anonymousIterator(List> outputTypes, + List outputShapes) { + return AnonymousIterator.create(scope, outputTypes, outputShapes); + } + + /** + * Builds an {@link IteratorGetNextSync} operation + * + * @param iterator + * @param outputTypes + * @param outputShapes + * @return a new instance of IteratorGetNextSync + * @see org.tensorflow.op.data.IteratorGetNextSync + */ + public IteratorGetNextSync iteratorGetNextSync(Operand iterator, List> outputTypes, + List outputShapes) { + return IteratorGetNextSync.create(scope, iterator, outputTypes, outputShapes); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DtypesOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DtypesOps.java index 7766fefed69..083b065f112 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DtypesOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/DtypesOps.java @@ -1,9 +1,12 @@ package org.tensorflow.op; +import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.op.dtypes.AsString; import org.tensorflow.op.dtypes.Cast; import org.tensorflow.op.dtypes.Complex; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code dtypes} operations as {@link Op Op}s @@ -26,7 +29,8 @@ public final class DtypesOps { * @return a new instance of Cast * @see org.tensorflow.op.dtypes.Cast */ - public Cast cast(Operand x, Class DstT, Cast.Options... options) { + public Cast cast(Operand x, DataType DstT, + Cast.Options... options) { return Cast.create(scope, x, DstT, options); } @@ -38,7 +42,7 @@ public Cast cast(Operand x, Class DstT, Cast.Options... options) * @return a new instance of AsString * @see org.tensorflow.op.dtypes.AsString */ - public AsString asString(Operand input, AsString.Options... options) { + public AsString asString(Operand input, AsString.Options... options) { return AsString.create(scope, input, options); } @@ -51,7 +55,8 @@ public AsString asString(Operand input, AsString.Options... options) { * @return a new instance of Complex * @see org.tensorflow.op.dtypes.Complex */ - public Complex complex(Operand real, Operand imag, Class Tout) { + public Complex complex(Operand real, Operand imag, + DataType Tout) { return Complex.create(scope, real, imag, Tout); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java index 98e4a46455c..18f0229a9c7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/ImageOps.java @@ -1,6 +1,7 @@ package org.tensorflow.op; import java.util.List; +import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.op.image.AdjustContrast; import org.tensorflow.op.image.AdjustHue; @@ -31,7 +32,13 @@ import org.tensorflow.op.image.ResizeNearestNeighbor; import org.tensorflow.op.image.RgbToHsv; import org.tensorflow.op.image.SampleDistortedBoundingBox; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +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; /** * An API for building {@code image} operations as {@link Op Op}s @@ -46,43 +53,30 @@ public final class ImageOps { } /** - * Builds an {@link AdjustHue} operation - * - * @param images Images to adjust. At least 3-D. - * @param delta A float delta to add to the hue. - * @return a new instance of AdjustHue - * @see org.tensorflow.op.image.AdjustHue - */ - public AdjustHue adjustHue(Operand images, Operand delta) { - return AdjustHue.create(scope, images, delta); - } - - /** - * Builds an {@link EncodePng} operation + * Builds an {@link DrawBoundingBoxes} operation * - * @param image 3-D with shape `[height, width, channels]`. - * @param options carries optional attributes values - * @return a new instance of EncodePng - * @see org.tensorflow.op.image.EncodePng + * @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 + * @return a new instance of DrawBoundingBoxes + * @see org.tensorflow.op.image.DrawBoundingBoxes */ - public EncodePng encodePng(Operand image, EncodePng.Options... options) { - return EncodePng.create(scope, image, options); + public DrawBoundingBoxes drawBoundingBoxes(Operand images, + Operand boxes) { + return DrawBoundingBoxes.create(scope, images, boxes); } /** - * Builds an {@link SampleDistortedBoundingBox} operation + * Builds an {@link ResizeBilinear} operation * - * @param imageSize 1-D, containing `[height, width, channels]`. - * @param boundingBoxes 3-D with shape `[batch, N, 4]` describing the N bounding boxes - * @param minObjectCovered The cropped area of the image must contain at least this + * @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 options carries optional attributes values - * @return a new instance of SampleDistortedBoundingBox - * @see org.tensorflow.op.image.SampleDistortedBoundingBox + * @return a new instance of ResizeBilinear + * @see org.tensorflow.op.image.ResizeBilinear */ - public SampleDistortedBoundingBox sampleDistortedBoundingBox( - Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, - SampleDistortedBoundingBox.Options... options) { - return SampleDistortedBoundingBox.create(scope, imageSize, boundingBoxes, minObjectCovered, options); + public ResizeBilinear resizeBilinear(Operand images, Operand size, + ResizeBilinear.Options... options) { + return ResizeBilinear.create(scope, images, size, options); } /** @@ -92,138 +86,156 @@ public SampleDistortedBoundingBox sampleDistortedBoundingB * @return a new instance of DecodeGif * @see org.tensorflow.op.image.DecodeGif */ - public DecodeGif decodeGif(Operand contents) { + public DecodeGif decodeGif(Operand contents) { return DecodeGif.create(scope, contents); } /** - * Builds an {@link RandomCrop} operation + * Builds an {@link RgbToHsv} operation * - * @param image 3-D of shape `[height, width, channels]`. - * @param size 1-D of length 2 containing: `crop_height`, `crop_width`.. + * @param images 1-D or higher rank. RGB data to convert. Last dimension must be size 3. + * @return a new instance of RgbToHsv + * @see org.tensorflow.op.image.RgbToHsv + */ + public RgbToHsv rgbToHsv(Operand images) { + return RgbToHsv.create(scope, images); + } + + /** + * Builds an {@link HsvToRgb} operation + * + * @param images 1-D or higher rank. HSV data to convert. Last dimension must be size 3. + * @return a new instance of HsvToRgb + * @see org.tensorflow.op.image.HsvToRgb + */ + public HsvToRgb hsvToRgb(Operand images) { + return HsvToRgb.create(scope, images); + } + + /** + * Builds an {@link CropAndResizeGradBoxes} operation + * + * @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]`. + * @param boxes A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor + * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. * @param options carries optional attributes values - * @return a new instance of RandomCrop - * @see org.tensorflow.op.image.RandomCrop + * @return a new instance of CropAndResizeGradBoxes + * @see org.tensorflow.op.image.CropAndResizeGradBoxes */ - public RandomCrop randomCrop(Operand image, Operand size, - RandomCrop.Options... options) { - return RandomCrop.create(scope, image, size, options); + public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand grads, + Operand image, Operand boxes, Operand boxInd, + CropAndResizeGradBoxes.Options... options) { + return CropAndResizeGradBoxes.create(scope, grads, image, boxes, boxInd, options); } /** - * Builds an {@link DecodePng} operation + * Builds an {@link DecodeBmp} operation * - * @param contents 0-D. The PNG-encoded image. - * @param dtype + * @param contents 0-D. The BMP-encoded image. * @param options carries optional attributes values - * @return a new instance of DecodePng - * @see org.tensorflow.op.image.DecodePng + * @return a new instance of DecodeBmp + * @see org.tensorflow.op.image.DecodeBmp */ - public DecodePng decodePng(Operand contents, Class dtype, - DecodePng.Options... options) { - return DecodePng.create(scope, contents, dtype, options); + public DecodeBmp decodeBmp(Operand contents, DecodeBmp.Options... options) { + return DecodeBmp.create(scope, contents, options); } /** - * Builds an {@link NonMaxSuppression} operation + * Builds an {@link ExtractGlimpse} operation * - * @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 maxOutputSize A scalar integer tensor representing the maximum number of - * @param iouThreshold A 0-D float tensor representing the threshold for deciding whether - * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove + * @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 offsets A 2-D integer tensor of shape `[batch_size, 2]` containing * @param options carries optional attributes values - * @return a new instance of NonMaxSuppression - * @see org.tensorflow.op.image.NonMaxSuppression + * @return a new instance of ExtractGlimpse + * @see org.tensorflow.op.image.ExtractGlimpse */ - public NonMaxSuppression nonMaxSuppression(Operand boxes, - Operand scores, Operand maxOutputSize, Operand iouThreshold, - Operand scoreThreshold, NonMaxSuppression.Options... options) { - return NonMaxSuppression.create(scope, boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, options); + public ExtractGlimpse extractGlimpse(Operand input, Operand size, + Operand offsets, ExtractGlimpse.Options... options) { + return ExtractGlimpse.create(scope, input, size, offsets, options); } /** - * Builds an {@link ResizeBilinear} operation + * Builds an {@link ResizeBicubic} operation * * @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 options carries optional attributes values - * @return a new instance of ResizeBilinear - * @see org.tensorflow.op.image.ResizeBilinear + * @return a new instance of ResizeBicubic + * @see org.tensorflow.op.image.ResizeBicubic */ - public ResizeBilinear resizeBilinear(Operand images, Operand size, - ResizeBilinear.Options... options) { - return ResizeBilinear.create(scope, images, size, options); + public ResizeBicubic resizeBicubic(Operand images, Operand size, + ResizeBicubic.Options... options) { + return ResizeBicubic.create(scope, images, size, options); } /** * Builds an {@link DecodePng} operation * * @param contents 0-D. The PNG-encoded image. + * @param dtype * @param options carries optional attributes values * @return a new instance of DecodePng * @see org.tensorflow.op.image.DecodePng */ - public DecodePng decodePng(Operand contents, DecodePng.Options... options) { - return DecodePng.create(scope, contents, options); + public DecodePng decodePng(Operand contents, DataType dtype, + DecodePng.Options... options) { + return DecodePng.create(scope, contents, dtype, options); } /** - * Builds an {@link ExtractJpegShape} operation + * Builds an {@link RandomCrop} operation * - * @param contents 0-D. The JPEG-encoded image. - * @return a new instance of ExtractJpegShape - * @see org.tensorflow.op.image.ExtractJpegShape + * @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 + * @return a new instance of RandomCrop + * @see org.tensorflow.op.image.RandomCrop */ - public ExtractJpegShape extractJpegShape(Operand contents) { - return ExtractJpegShape.create(scope, contents); + public RandomCrop randomCrop(Operand image, Operand size, + RandomCrop.Options... options) { + return RandomCrop.create(scope, image, size, options); } /** - * Builds an {@link AdjustContrast} operation + * Builds an {@link DecodeAndCropJpeg} operation * - * @param images Images to adjust. At least 3-D. - * @param contrastFactor A float multiplier for adjusting contrast. - * @return a new instance of AdjustContrast - * @see org.tensorflow.op.image.AdjustContrast + * @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 + * @return a new instance of DecodeAndCropJpeg + * @see org.tensorflow.op.image.DecodeAndCropJpeg */ - public AdjustContrast adjustContrast(Operand images, - Operand contrastFactor) { - return AdjustContrast.create(scope, images, contrastFactor); + public DecodeAndCropJpeg decodeAndCropJpeg(Operand contents, Operand cropWindow, + DecodeAndCropJpeg.Options... options) { + return DecodeAndCropJpeg.create(scope, contents, cropWindow, options); } /** - * Builds an {@link CropAndResizeGradImage} operation + * Builds an {@link ExtractJpegShape} operation * - * @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 - * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. - * @param imageSize A 1-D tensor with value `[batch, image_height, image_width, depth]` - * @param T - * @param options carries optional attributes values - * @return a new instance of CropAndResizeGradImage - * @see org.tensorflow.op.image.CropAndResizeGradImage + * @param contents 0-D. The JPEG-encoded image. + * @param outputType (Optional) The output type of the operation (int32 or int64). + * @return a new instance of ExtractJpegShape + * @see org.tensorflow.op.image.ExtractJpegShape */ - public CropAndResizeGradImage cropAndResizeGradImage(Operand grads, - Operand boxes, Operand boxInd, Operand imageSize, Class T, - CropAndResizeGradImage.Options... options) { - return CropAndResizeGradImage.create(scope, grads, boxes, boxInd, imageSize, T, options); + public ExtractJpegShape extractJpegShape(Operand contents, + DataType outputType) { + return ExtractJpegShape.create(scope, contents, outputType); } /** - * Builds an {@link CropAndResize} operation + * Builds an {@link EncodeJpegVariableQuality} operation * - * @param image A 4-D tensor of shape `[batch, image_height, image_width, depth]`. - * @param boxes A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor - * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. - * @param cropSize A 1-D tensor of 2 elements, `size = [crop_height, crop_width]`. All - * @param options carries optional attributes values - * @return a new instance of CropAndResize - * @see org.tensorflow.op.image.CropAndResize + * @param images Images to adjust. At least 3-D. + * @param quality An int quality to encode to. + * @return a new instance of EncodeJpegVariableQuality + * @see org.tensorflow.op.image.EncodeJpegVariableQuality */ - public CropAndResize cropAndResize(Operand image, Operand boxes, - Operand boxInd, Operand cropSize, CropAndResize.Options... options) { - return CropAndResize.create(scope, image, boxes, boxInd, cropSize, options); + public EncodeJpegVariableQuality encodeJpegVariableQuality(Operand images, + Operand quality) { + return EncodeJpegVariableQuality.create(scope, images, quality); } /** @@ -234,130 +246,142 @@ public CropAndResize cropAndResize(Operand image, Operand< * @return a new instance of AdjustSaturation * @see org.tensorflow.op.image.AdjustSaturation */ - public AdjustSaturation adjustSaturation(Operand images, - Operand scale) { + public AdjustSaturation adjustSaturation(Operand images, + Operand scale) { return AdjustSaturation.create(scope, images, scale); } /** - * Builds an {@link DecodeAndCropJpeg} operation + * Builds an {@link ResizeArea} operation * - * @param contents 0-D. The JPEG-encoded image. - * @param cropWindow 1-D. The crop window: [crop_y, crop_x, crop_height, crop_width]. + * @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 options carries optional attributes values - * @return a new instance of DecodeAndCropJpeg - * @see org.tensorflow.op.image.DecodeAndCropJpeg + * @return a new instance of ResizeArea + * @see org.tensorflow.op.image.ResizeArea */ - public DecodeAndCropJpeg decodeAndCropJpeg(Operand contents, Operand cropWindow, - DecodeAndCropJpeg.Options... options) { - return DecodeAndCropJpeg.create(scope, contents, cropWindow, options); + public ResizeArea resizeArea(Operand images, Operand size, + ResizeArea.Options... options) { + return ResizeArea.create(scope, images, size, options); } /** - * Builds an {@link DecodeJpeg} operation + * Builds an {@link EncodePng} operation * - * @param contents 0-D. The JPEG-encoded image. + * @param image 3-D with shape `[height, width, channels]`. * @param options carries optional attributes values - * @return a new instance of DecodeJpeg - * @see org.tensorflow.op.image.DecodeJpeg + * @return a new instance of EncodePng + * @see org.tensorflow.op.image.EncodePng */ - public DecodeJpeg decodeJpeg(Operand contents, DecodeJpeg.Options... options) { - return DecodeJpeg.create(scope, contents, options); + public EncodePng encodePng(Operand image, EncodePng.Options... options) { + return EncodePng.create(scope, image, options); } /** - * Builds an {@link ExtractGlimpse} operation + * Builds an {@link NonMaxSuppression} operation * - * @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 offsets A 2-D integer tensor of shape `[batch_size, 2]` containing + * @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 maxOutputSize A scalar integer tensor representing the maximum number of + * @param iouThreshold A 0-D float tensor representing the threshold for deciding whether + * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove * @param options carries optional attributes values - * @return a new instance of ExtractGlimpse - * @see org.tensorflow.op.image.ExtractGlimpse + * @return a new instance of NonMaxSuppression + * @see org.tensorflow.op.image.NonMaxSuppression */ - public ExtractGlimpse extractGlimpse(Operand input, Operand size, - Operand offsets, ExtractGlimpse.Options... options) { - return ExtractGlimpse.create(scope, input, size, offsets, options); + public NonMaxSuppression nonMaxSuppression( + Operand boxes, Operand scores, Operand maxOutputSize, Operand iouThreshold, + Operand scoreThreshold, NonMaxSuppression.Options... options) { + return NonMaxSuppression.create(scope, boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, options); } /** - * Builds an {@link DecodeBmp} operation + * Builds an {@link QuantizedResizeBilinear} operation * - * @param contents 0-D. The BMP-encoded image. + * @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 min + * @param max * @param options carries optional attributes values - * @return a new instance of DecodeBmp - * @see org.tensorflow.op.image.DecodeBmp + * @return a new instance of QuantizedResizeBilinear + * @see org.tensorflow.op.image.QuantizedResizeBilinear */ - public DecodeBmp decodeBmp(Operand contents, DecodeBmp.Options... options) { - return DecodeBmp.create(scope, contents, options); + public QuantizedResizeBilinear quantizedResizeBilinear(Operand images, + Operand size, Operand min, Operand max, + QuantizedResizeBilinear.Options... options) { + return QuantizedResizeBilinear.create(scope, images, size, min, max, options); } /** - * Builds an {@link ExtractJpegShape} operation + * Builds an {@link CropAndResize} operation * - * @param contents 0-D. The JPEG-encoded image. - * @param outputType (Optional) The output type of the operation (int32 or int64). - * @return a new instance of ExtractJpegShape - * @see org.tensorflow.op.image.ExtractJpegShape + * @param image A 4-D tensor of shape `[batch, image_height, image_width, depth]`. + * @param boxes A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor + * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. + * @param cropSize A 1-D tensor of 2 elements, `size = [crop_height, crop_width]`. All + * @param options carries optional attributes values + * @return a new instance of CropAndResize + * @see org.tensorflow.op.image.CropAndResize */ - public ExtractJpegShape extractJpegShape(Operand contents, - Class outputType) { - return ExtractJpegShape.create(scope, contents, outputType); + public CropAndResize cropAndResize(Operand image, Operand boxes, + Operand boxInd, Operand cropSize, CropAndResize.Options... options) { + return CropAndResize.create(scope, image, boxes, boxInd, cropSize, options); } /** - * Builds an {@link ResizeArea} operation + * Builds an {@link CropAndResizeGradImage} operation * - * @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 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 + * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. + * @param imageSize A 1-D tensor with value `[batch, image_height, image_width, depth]` + * @param T * @param options carries optional attributes values - * @return a new instance of ResizeArea - * @see org.tensorflow.op.image.ResizeArea + * @return a new instance of CropAndResizeGradImage + * @see org.tensorflow.op.image.CropAndResizeGradImage */ - public ResizeArea resizeArea(Operand images, Operand size, - ResizeArea.Options... options) { - return ResizeArea.create(scope, images, size, options); + public CropAndResizeGradImage cropAndResizeGradImage(Operand grads, + Operand boxes, Operand boxInd, Operand imageSize, DataType T, + CropAndResizeGradImage.Options... options) { + return CropAndResizeGradImage.create(scope, grads, boxes, boxInd, imageSize, T, options); } /** - * Builds an {@link RgbToHsv} operation + * Builds an {@link DecodePng} operation * - * @param images 1-D or higher rank. RGB data to convert. Last dimension must be size 3. - * @return a new instance of RgbToHsv - * @see org.tensorflow.op.image.RgbToHsv + * @param contents 0-D. The PNG-encoded image. + * @param options carries optional attributes values + * @return a new instance of DecodePng + * @see org.tensorflow.op.image.DecodePng */ - public RgbToHsv rgbToHsv(Operand images) { - return RgbToHsv.create(scope, images); + public DecodePng decodePng(Operand contents, DecodePng.Options... options) { + return DecodePng.create(scope, contents, options); } /** - * Builds an {@link EncodeJpegVariableQuality} operation + * Builds an {@link ResizeNearestNeighbor} operation * - * @param images Images to adjust. At least 3-D. - * @param quality An int quality to encode to. - * @return a new instance of EncodeJpegVariableQuality - * @see org.tensorflow.op.image.EncodeJpegVariableQuality + * @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 options carries optional attributes values + * @return a new instance of ResizeNearestNeighbor + * @see org.tensorflow.op.image.ResizeNearestNeighbor */ - public EncodeJpegVariableQuality encodeJpegVariableQuality(Operand images, - Operand quality) { - return EncodeJpegVariableQuality.create(scope, images, quality); + public ResizeNearestNeighbor resizeNearestNeighbor(Operand images, + Operand size, ResizeNearestNeighbor.Options... options) { + return ResizeNearestNeighbor.create(scope, images, size, options); } /** - * Builds an {@link CropAndResizeGradBoxes} operation + * Builds an {@link AdjustHue} operation * - * @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]`. - * @param boxes A 2-D tensor of shape `[num_boxes, 4]`. The `i`-th row of the tensor - * @param boxInd A 1-D tensor of shape `[num_boxes]` with int32 values in `[0, batch)`. - * @param options carries optional attributes values - * @return a new instance of CropAndResizeGradBoxes - * @see org.tensorflow.op.image.CropAndResizeGradBoxes + * @param images Images to adjust. At least 3-D. + * @param delta A float delta to add to the hue. + * @return a new instance of AdjustHue + * @see org.tensorflow.op.image.AdjustHue */ - public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand grads, - Operand image, Operand boxes, Operand boxInd, - CropAndResizeGradBoxes.Options... options) { - return CropAndResizeGradBoxes.create(scope, grads, image, boxes, boxInd, options); + public AdjustHue adjustHue(Operand images, Operand delta) { + return AdjustHue.create(scope, images, delta); } /** @@ -371,106 +395,89 @@ public CropAndResizeGradBoxes cropAndResizeGradBoxes(Operand< * @return a new instance of ExtractImagePatches * @see org.tensorflow.op.image.ExtractImagePatches */ - public ExtractImagePatches extractImagePatches(Operand images, + public ExtractImagePatches extractImagePatches(Operand images, List ksizes, List strides, List rates, String padding) { return ExtractImagePatches.create(scope, images, ksizes, strides, rates, padding); } /** - * Builds an {@link DrawBoundingBoxes} operation + * Builds an {@link AdjustContrast} operation * - * @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 - * @return a new instance of DrawBoundingBoxes - * @see org.tensorflow.op.image.DrawBoundingBoxes + * @param images Images to adjust. At least 3-D. + * @param contrastFactor A float multiplier for adjusting contrast. + * @return a new instance of AdjustContrast + * @see org.tensorflow.op.image.AdjustContrast */ - public DrawBoundingBoxes drawBoundingBoxes(Operand images, - Operand boxes) { - return DrawBoundingBoxes.create(scope, images, boxes); + public AdjustContrast adjustContrast(Operand images, + Operand contrastFactor) { + return AdjustContrast.create(scope, images, contrastFactor); } /** - * Builds an {@link NonMaxSuppressionWithOverlaps} operation + * Builds an {@link ExtractJpegShape} operation * - * @param overlaps A 2-D float tensor of shape `[num_boxes, num_boxes]` representing - * @param scores A 1-D float tensor of shape `[num_boxes]` representing a single - * @param maxOutputSize A scalar integer tensor representing the maximum number of - * @param overlapThreshold A 0-D float tensor representing the threshold for deciding whether - * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove - * @return a new instance of NonMaxSuppressionWithOverlaps - * @see org.tensorflow.op.image.NonMaxSuppressionWithOverlaps + * @param contents 0-D. The JPEG-encoded image. + * @return a new instance of ExtractJpegShape + * @see org.tensorflow.op.image.ExtractJpegShape */ - public NonMaxSuppressionWithOverlaps nonMaxSuppressionWithOverlaps(Operand overlaps, - Operand scores, Operand maxOutputSize, Operand overlapThreshold, - Operand scoreThreshold) { - return NonMaxSuppressionWithOverlaps.create(scope, overlaps, scores, maxOutputSize, overlapThreshold, scoreThreshold); + public ExtractJpegShape extractJpegShape(Operand contents) { + return ExtractJpegShape.create(scope, contents); } /** - * Builds an {@link ResizeBicubic} operation + * Builds an {@link EncodeJpeg} operation * - * @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 image 3-D with shape `[height, width, channels]`. * @param options carries optional attributes values - * @return a new instance of ResizeBicubic - * @see org.tensorflow.op.image.ResizeBicubic + * @return a new instance of EncodeJpeg + * @see org.tensorflow.op.image.EncodeJpeg */ - public ResizeBicubic resizeBicubic(Operand images, Operand size, - ResizeBicubic.Options... options) { - return ResizeBicubic.create(scope, images, size, options); + public EncodeJpeg encodeJpeg(Operand image, EncodeJpeg.Options... options) { + return EncodeJpeg.create(scope, image, options); } /** - * Builds an {@link QuantizedResizeBilinear} operation + * Builds an {@link NonMaxSuppressionWithOverlaps} operation * - * @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 min - * @param max - * @param options carries optional attributes values - * @return a new instance of QuantizedResizeBilinear - * @see org.tensorflow.op.image.QuantizedResizeBilinear + * @param overlaps A 2-D float tensor of shape `[num_boxes, num_boxes]` representing + * @param scores A 1-D float tensor of shape `[num_boxes]` representing a single + * @param maxOutputSize A scalar integer tensor representing the maximum number of + * @param overlapThreshold A 0-D float tensor representing the threshold for deciding whether + * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove + * @return a new instance of NonMaxSuppressionWithOverlaps + * @see org.tensorflow.op.image.NonMaxSuppressionWithOverlaps */ - public QuantizedResizeBilinear quantizedResizeBilinear(Operand images, - Operand size, Operand min, Operand max, - QuantizedResizeBilinear.Options... options) { - return QuantizedResizeBilinear.create(scope, images, size, min, max, options); + public NonMaxSuppressionWithOverlaps nonMaxSuppressionWithOverlaps(Operand overlaps, + Operand scores, Operand maxOutputSize, Operand overlapThreshold, + Operand scoreThreshold) { + return NonMaxSuppressionWithOverlaps.create(scope, overlaps, scores, maxOutputSize, overlapThreshold, scoreThreshold); } /** - * Builds an {@link ResizeNearestNeighbor} operation + * Builds an {@link DecodeJpeg} operation * - * @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 contents 0-D. The JPEG-encoded image. * @param options carries optional attributes values - * @return a new instance of ResizeNearestNeighbor - * @see org.tensorflow.op.image.ResizeNearestNeighbor - */ - public ResizeNearestNeighbor resizeNearestNeighbor(Operand images, - Operand size, ResizeNearestNeighbor.Options... options) { - return ResizeNearestNeighbor.create(scope, images, size, options); - } - - /** - * Builds an {@link HsvToRgb} operation - * - * @param images 1-D or higher rank. HSV data to convert. Last dimension must be size 3. - * @return a new instance of HsvToRgb - * @see org.tensorflow.op.image.HsvToRgb + * @return a new instance of DecodeJpeg + * @see org.tensorflow.op.image.DecodeJpeg */ - public HsvToRgb hsvToRgb(Operand images) { - return HsvToRgb.create(scope, images); + public DecodeJpeg decodeJpeg(Operand contents, DecodeJpeg.Options... options) { + return DecodeJpeg.create(scope, contents, options); } /** - * Builds an {@link EncodeJpeg} operation + * Builds an {@link SampleDistortedBoundingBox} operation * - * @param image 3-D with shape `[height, width, channels]`. + * @param imageSize 1-D, containing `[height, width, channels]`. + * @param boundingBoxes 3-D with shape `[batch, N, 4]` describing the N bounding boxes + * @param minObjectCovered The cropped area of the image must contain at least this * @param options carries optional attributes values - * @return a new instance of EncodeJpeg - * @see org.tensorflow.op.image.EncodeJpeg + * @return a new instance of SampleDistortedBoundingBox + * @see org.tensorflow.op.image.SampleDistortedBoundingBox */ - public EncodeJpeg encodeJpeg(Operand image, EncodeJpeg.Options... options) { - return EncodeJpeg.create(scope, image, options); + public SampleDistortedBoundingBox sampleDistortedBoundingBox( + Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, + SampleDistortedBoundingBox.Options... options) { + return SampleDistortedBoundingBox.create(scope, imageSize, boundingBoxes, minObjectCovered, options); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/IoOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/IoOps.java index 04978cbdab3..21755c346fa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/IoOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/IoOps.java @@ -1,8 +1,8 @@ package org.tensorflow.op; import java.util.List; +import org.tensorflow.DataType; import org.tensorflow.Operand; -import org.tensorflow.Shape; import org.tensorflow.op.io.DecodeBase64; import org.tensorflow.op.io.DecodeCompressed; import org.tensorflow.op.io.DecodeCsv; @@ -48,6 +48,11 @@ import org.tensorflow.op.io.TfRecordReader; import org.tensorflow.op.io.WholeFileReader; import org.tensorflow.op.io.WriteFile; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * An API for building {@code io} operations as {@link Op Op}s @@ -76,98 +81,97 @@ public QueueEnqueueMany queueEnqueueMany(Operand handle, Iterable> } /** - * Builds an {@link ReaderReset} operation + * Builds an {@link SerializeManySparse} operation * - * @param readerHandle Handle to a Reader. - * @return a new instance of ReaderReset - * @see org.tensorflow.op.io.ReaderReset + * @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 + * @see org.tensorflow.op.io.SerializeManySparse */ - public ReaderReset readerReset(Operand readerHandle) { - return ReaderReset.create(scope, readerHandle); + public SerializeManySparse serializeManySparse( + Operand sparseIndices, Operand sparseValues, Operand sparseShape) { + return SerializeManySparse.create(scope, sparseIndices, sparseValues, sparseShape); } /** - * Builds an {@link QueueDequeue} operation + * Builds an {@link ShardedFilename} operation * - * @param handle The handle to a queue. - * @param componentTypes The type of each component in a tuple. + * @param basename + * @param shard + * @param numShards + * @return a new instance of ShardedFilename + * @see org.tensorflow.op.io.ShardedFilename + */ + public ShardedFilename shardedFilename(Operand basename, Operand shard, + Operand numShards) { + return ShardedFilename.create(scope, basename, shard, numShards); + } + + /** + * Builds an {@link FifoQueue} operation + * + * @param componentTypes The type of each component in a value. * @param options carries optional attributes values - * @return a new instance of QueueDequeue - * @see org.tensorflow.op.io.QueueDequeue + * @return a new instance of FifoQueue + * @see org.tensorflow.op.io.FifoQueue */ - public QueueDequeue queueDequeue(Operand handle, List> componentTypes, - QueueDequeue.Options... options) { - return QueueDequeue.create(scope, handle, componentTypes, options); + public FifoQueue fifoQueue(List> componentTypes, FifoQueue.Options... options) { + return FifoQueue.create(scope, componentTypes, options); } /** - * Builds an {@link ReaderRestoreState} operation + * Builds an {@link ReaderReset} operation * * @param readerHandle Handle to a Reader. - * @param state Result of a ReaderSerializeState of a Reader with type - * @return a new instance of ReaderRestoreState - * @see org.tensorflow.op.io.ReaderRestoreState + * @return a new instance of ReaderReset + * @see org.tensorflow.op.io.ReaderReset */ - public ReaderRestoreState readerRestoreState(Operand readerHandle, Operand state) { - return ReaderRestoreState.create(scope, readerHandle, state); + public ReaderReset readerReset(Operand readerHandle) { + return ReaderReset.create(scope, readerHandle); } /** - * Builds an {@link ParseSingleExample} operation + * Builds an {@link ParseTensor} operation * - * @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 - * @param numSparse The number of sparse features to be parsed from the example. This - * @param sparseKeys A list of `num_sparse` strings. - * @param denseKeys The keys expected in the Examples' features associated with dense - * @param sparseTypes A list of `num_sparse` types; the data types of data in each - * @param denseShapes The shapes of data in each Feature given in dense_keys. - * @return a new instance of ParseSingleExample - * @see org.tensorflow.op.io.ParseSingleExample + * @param serialized A scalar string containing a serialized TensorProto proto. + * @param outType The type of the serialized tensor. The provided type must match the + * @return a new instance of ParseTensor + * @see org.tensorflow.op.io.ParseTensor */ - public ParseSingleExample parseSingleExample(Operand serialized, - Iterable> denseDefaults, Long numSparse, List sparseKeys, - List denseKeys, List> sparseTypes, List denseShapes) { - return ParseSingleExample.create(scope, serialized, denseDefaults, numSparse, sparseKeys, denseKeys, sparseTypes, denseShapes); + public ParseTensor parseTensor(Operand serialized, + DataType outType) { + return ParseTensor.create(scope, serialized, outType); } /** - * Builds an {@link DecodeJsonExample} operation + * Builds an {@link SerializeSparse} operation * - * @param jsonExamples Each string is a JSON object serialized according to the JSON - * @return a new instance of DecodeJsonExample - * @see org.tensorflow.op.io.DecodeJsonExample + * @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` + * @return a new instance of SerializeSparse + * @see org.tensorflow.op.io.SerializeSparse */ - public DecodeJsonExample decodeJsonExample(Operand jsonExamples) { - return DecodeJsonExample.create(scope, jsonExamples); + public SerializeSparse serializeSparse( + Operand sparseIndices, Operand sparseValues, Operand sparseShape, + DataType outType) { + return SerializeSparse.create(scope, sparseIndices, sparseValues, sparseShape, outType); } /** - * Builds an {@link ParseSequenceExample} operation + * Builds an {@link ReaderReadUpTo} operation * - * @param serialized A vector containing binary serialized SequenceExample protos. - * @param debugName A vector containing the names of the serialized protos. - * @param contextDenseDefaults A list of Ncontext_dense Tensors (some may be empty). - * @param featureListDenseMissingAssumedEmpty A vector listing the - * @param contextSparseKeys A list of Ncontext_sparse string Tensors (scalars). - * @param contextDenseKeys A list of Ncontext_dense string Tensors (scalars). - * @param featureListSparseKeys A list of Nfeature_list_sparse string Tensors - * @param featureListDenseKeys A list of Nfeature_list_dense string Tensors (scalars). - * @param contextSparseTypes A list of Ncontext_sparse types; the data types of data in - * @param featureListDenseTypes - * @param featureListSparseTypes A list of Nfeature_list_sparse types; the data types - * @param options carries optional attributes values - * @return a new instance of ParseSequenceExample - * @see org.tensorflow.op.io.ParseSequenceExample + * @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`. + * @return a new instance of ReaderReadUpTo + * @see org.tensorflow.op.io.ReaderReadUpTo */ - public ParseSequenceExample parseSequenceExample(Operand serialized, - Operand debugName, Iterable> contextDenseDefaults, - List featureListDenseMissingAssumedEmpty, List contextSparseKeys, - List contextDenseKeys, List featureListSparseKeys, - List featureListDenseKeys, List> contextSparseTypes, - List> featureListDenseTypes, List> featureListSparseTypes, - ParseSequenceExample.Options... options) { - return ParseSequenceExample.create(scope, serialized, debugName, contextDenseDefaults, featureListDenseMissingAssumedEmpty, contextSparseKeys, contextDenseKeys, featureListSparseKeys, featureListDenseKeys, contextSparseTypes, featureListDenseTypes, featureListSparseTypes, options); + public ReaderReadUpTo readerReadUpTo(Operand readerHandle, Operand queueHandle, + Operand numRecords) { + return ReaderReadUpTo.create(scope, readerHandle, queueHandle, numRecords); } /** @@ -182,85 +186,106 @@ public IdentityReader identityReader(IdentityReader.Options... options) { } /** - * Builds an {@link SerializeManySparse} operation + * Builds an {@link SerializeTensor} operation * - * @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 - * @see org.tensorflow.op.io.SerializeManySparse + * @param tensor A Tensor of type `T`. + * @return a new instance of SerializeTensor + * @see org.tensorflow.op.io.SerializeTensor */ - public SerializeManySparse serializeManySparse(Operand sparseIndices, - Operand sparseValues, Operand sparseShape) { - return SerializeManySparse.create(scope, sparseIndices, sparseValues, sparseShape); + public SerializeTensor serializeTensor(Operand tensor) { + return SerializeTensor.create(scope, tensor); } /** - * Builds an {@link ShardedFilename} operation + * Builds an {@link SerializeSparse} operation * - * @param basename - * @param shard - * @param numShards - * @return a new instance of ShardedFilename - * @see org.tensorflow.op.io.ShardedFilename + * @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 + * @see org.tensorflow.op.io.SerializeSparse */ - public ShardedFilename shardedFilename(Operand basename, Operand shard, - Operand numShards) { - return ShardedFilename.create(scope, basename, shard, numShards); + public SerializeSparse serializeSparse(Operand sparseIndices, + Operand sparseValues, Operand sparseShape) { + return SerializeSparse.create(scope, sparseIndices, sparseValues, sparseShape); } /** - * Builds an {@link WholeFileReader} operation + * Builds an {@link DecodeBase64} operation * - * @param options carries optional attributes values - * @return a new instance of WholeFileReader - * @see org.tensorflow.op.io.WholeFileReader + * @param input Base64 strings to decode. + * @return a new instance of DecodeBase64 + * @see org.tensorflow.op.io.DecodeBase64 */ - public WholeFileReader wholeFileReader(WholeFileReader.Options... options) { - return WholeFileReader.create(scope, options); + public DecodeBase64 decodeBase64(Operand input) { + return DecodeBase64.create(scope, input); } /** - * Builds an {@link SerializeSparse} operation + * Builds an {@link MatchingFiles} operation * - * @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` - * @return a new instance of SerializeSparse - * @see org.tensorflow.op.io.SerializeSparse + * @param pattern Shell wildcard pattern(s). Scalar or vector of type string. + * @return a new instance of MatchingFiles + * @see org.tensorflow.op.io.MatchingFiles */ - public SerializeSparse serializeSparse(Operand sparseIndices, - Operand sparseValues, Operand sparseShape, Class outType) { - return SerializeSparse.create(scope, sparseIndices, sparseValues, sparseShape, outType); + public MatchingFiles matchingFiles(Operand pattern) { + return MatchingFiles.create(scope, pattern); } /** - * Builds an {@link PriorityQueue} operation + * Builds an {@link ParseExample} operation * - * @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 + * @param serialized A vector containing a batch of binary serialized Example protos. + * @param names A vector containing the names of the serialized protos. + * @param sparseKeys A list of Nsparse string Tensors (scalars). + * @param denseKeys A list of Ndense string Tensors (scalars). + * @param denseDefaults A list of Ndense Tensors (some may be empty). + * @param sparseTypes A list of Nsparse types; the data types of data in each Feature + * @param denseShapes A list of Ndense shapes; the shapes of data in each Feature + * @return a new instance of ParseExample + * @see org.tensorflow.op.io.ParseExample + */ + public ParseExample parseExample(Operand serialized, Operand names, + Iterable> sparseKeys, Iterable> denseKeys, + Iterable> denseDefaults, List> sparseTypes, List denseShapes) { + return ParseExample.create(scope, serialized, names, sparseKeys, denseKeys, denseDefaults, sparseTypes, denseShapes); + } + + /** + * Builds an {@link DecodeRaw} operation + * + * @param bytes All the elements must have the same length. + * @param outType * @param options carries optional attributes values - * @return a new instance of PriorityQueue - * @see org.tensorflow.op.io.PriorityQueue + * @return a new instance of DecodeRaw + * @see org.tensorflow.op.io.DecodeRaw */ - public PriorityQueue priorityQueue(List> componentTypes, List shapes, - PriorityQueue.Options... options) { - return PriorityQueue.create(scope, componentTypes, shapes, options); + public DecodeRaw decodeRaw(Operand bytes, DataType outType, + DecodeRaw.Options... options) { + return DecodeRaw.create(scope, bytes, outType, options); } /** - * Builds an {@link ReaderReadUpTo} operation + * Builds an {@link WholeFileReader} operation * - * @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`. - * @return a new instance of ReaderReadUpTo - * @see org.tensorflow.op.io.ReaderReadUpTo + * @param options carries optional attributes values + * @return a new instance of WholeFileReader + * @see org.tensorflow.op.io.WholeFileReader */ - public ReaderReadUpTo readerReadUpTo(Operand readerHandle, Operand queueHandle, - Operand numRecords) { - return ReaderReadUpTo.create(scope, readerHandle, queueHandle, numRecords); + public WholeFileReader wholeFileReader(WholeFileReader.Options... options) { + return WholeFileReader.create(scope, options); + } + + /** + * Builds an {@link WriteFile} operation + * + * @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 + * @see org.tensorflow.op.io.WriteFile + */ + public WriteFile writeFile(Operand filename, Operand contents) { + return WriteFile.create(scope, filename, contents); } /** @@ -288,34 +313,6 @@ public QueueEnqueue queueEnqueue(Operand handle, Iterable> compone return QueueEnqueue.create(scope, handle, components, options); } - /** - * Builds an {@link QueueDequeueUpTo} operation - * - * @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 - * @return a new instance of QueueDequeueUpTo - * @see org.tensorflow.op.io.QueueDequeueUpTo - */ - public QueueDequeueUpTo queueDequeueUpTo(Operand handle, Operand n, - List> componentTypes, QueueDequeueUpTo.Options... options) { - return QueueDequeueUpTo.create(scope, handle, n, componentTypes, options); - } - - /** - * Builds an {@link DecodeCompressed} operation - * - * @param bytes A Tensor of string which is compressed. - * @param options carries optional attributes values - * @return a new instance of DecodeCompressed - * @see org.tensorflow.op.io.DecodeCompressed - */ - public DecodeCompressed decodeCompressed(Operand bytes, - DecodeCompressed.Options... options) { - return DecodeCompressed.create(scope, bytes, options); - } - /** * Builds an {@link ReaderSerializeState} operation * @@ -327,6 +324,20 @@ public ReaderSerializeState readerSerializeState(Operand readerHandle) { return ReaderSerializeState.create(scope, readerHandle); } + /** + * Builds an {@link PriorityQueue} operation + * + * @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 + * @param options carries optional attributes values + * @return a new instance of PriorityQueue + * @see org.tensorflow.op.io.PriorityQueue + */ + public PriorityQueue priorityQueue(List> componentTypes, List shapes, + PriorityQueue.Options... options) { + return PriorityQueue.create(scope, componentTypes, shapes, options); + } + /** * Builds an {@link QueueClose} operation * @@ -340,94 +351,127 @@ public QueueClose queueClose(Operand handle, QueueClose.Options... options) { } /** - * Builds an {@link ParseExample} operation + * Builds an {@link ReadFile} operation * - * @param serialized A vector containing a batch of binary serialized Example protos. - * @param names A vector containing the names of the serialized protos. - * @param sparseKeys A list of Nsparse string Tensors (scalars). - * @param denseKeys A list of Ndense string Tensors (scalars). - * @param denseDefaults A list of Ndense Tensors (some may be empty). - * @param sparseTypes A list of Nsparse types; the data types of data in each Feature - * @param denseShapes A list of Ndense shapes; the shapes of data in each Feature - * @return a new instance of ParseExample - * @see org.tensorflow.op.io.ParseExample + * @param filename + * @return a new instance of ReadFile + * @see org.tensorflow.op.io.ReadFile */ - public ParseExample parseExample(Operand serialized, Operand names, - Iterable> sparseKeys, Iterable> denseKeys, - Iterable> denseDefaults, List> sparseTypes, List denseShapes) { - return ParseExample.create(scope, serialized, names, sparseKeys, denseKeys, denseDefaults, sparseTypes, denseShapes); + public ReadFile readFile(Operand filename) { + return ReadFile.create(scope, filename); } /** - * Builds an {@link WriteFile} operation + * Builds an {@link QueueDequeueUpTo} operation * - * @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 - * @see org.tensorflow.op.io.WriteFile + * @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 + * @return a new instance of QueueDequeueUpTo + * @see org.tensorflow.op.io.QueueDequeueUpTo + */ + public QueueDequeueUpTo queueDequeueUpTo(Operand handle, Operand n, + List> componentTypes, QueueDequeueUpTo.Options... options) { + return QueueDequeueUpTo.create(scope, handle, n, componentTypes, options); + } + + /** + * Builds an {@link ParseSingleSequenceExample} operation + * + * @param serialized A scalar containing a binary serialized SequenceExample proto. + * @param featureListDenseMissingAssumedEmpty A vector listing the + * @param contextSparseKeys A list of Ncontext_sparse string Tensors (scalars). + * @param contextDenseKeys A list of Ncontext_dense string Tensors (scalars). + * @param featureListSparseKeys A list of Nfeature_list_sparse string Tensors + * @param featureListDenseKeys A list of Nfeature_list_dense string Tensors (scalars). + * @param contextDenseDefaults A list of Ncontext_dense Tensors (some may be empty). + * @param debugName A scalar containing the name of the serialized proto. + * @param contextSparseTypes A list of Ncontext_sparse types; the data types of data in + * @param featureListDenseTypes + * @param featureListSparseTypes A list of Nfeature_list_sparse types; the data types + * @param options carries optional attributes values + * @return a new instance of ParseSingleSequenceExample + * @see org.tensorflow.op.io.ParseSingleSequenceExample */ - public WriteFile writeFile(Operand filename, Operand contents) { - return WriteFile.create(scope, filename, contents); + public ParseSingleSequenceExample parseSingleSequenceExample(Operand serialized, + Operand featureListDenseMissingAssumedEmpty, + Iterable> contextSparseKeys, Iterable> contextDenseKeys, + Iterable> featureListSparseKeys, + Iterable> featureListDenseKeys, Iterable> contextDenseDefaults, + Operand debugName, List> contextSparseTypes, + List> featureListDenseTypes, List> featureListSparseTypes, + ParseSingleSequenceExample.Options... options) { + return ParseSingleSequenceExample.create(scope, serialized, featureListDenseMissingAssumedEmpty, contextSparseKeys, contextDenseKeys, featureListSparseKeys, featureListDenseKeys, contextDenseDefaults, debugName, contextSparseTypes, featureListDenseTypes, featureListSparseTypes, options); } /** - * Builds an {@link RandomShuffleQueue} operation + * Builds an {@link ShardedFilespec} operation * - * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values - * @return a new instance of RandomShuffleQueue - * @see org.tensorflow.op.io.RandomShuffleQueue + * @param basename + * @param numShards + * @return a new instance of ShardedFilespec + * @see org.tensorflow.op.io.ShardedFilespec */ - public RandomShuffleQueue randomShuffleQueue(List> componentTypes, - RandomShuffleQueue.Options... options) { - return RandomShuffleQueue.create(scope, componentTypes, options); + public ShardedFilespec shardedFilespec(Operand basename, Operand numShards) { + return ShardedFilespec.create(scope, basename, numShards); } /** - * Builds an {@link ReadFile} operation + * Builds an {@link TfRecordReader} operation * - * @param filename - * @return a new instance of ReadFile - * @see org.tensorflow.op.io.ReadFile + * @param options carries optional attributes values + * @return a new instance of TfRecordReader + * @see org.tensorflow.op.io.TfRecordReader */ - public ReadFile readFile(Operand filename) { - return ReadFile.create(scope, filename); + public TfRecordReader tfRecordReader(TfRecordReader.Options... options) { + return TfRecordReader.create(scope, options); } /** - * Builds an {@link FifoQueue} operation + * Builds an {@link SerializeManySparse} operation * - * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values - * @return a new instance of FifoQueue - * @see org.tensorflow.op.io.FifoQueue + * @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` + * @return a new instance of SerializeManySparse + * @see org.tensorflow.op.io.SerializeManySparse */ - public FifoQueue fifoQueue(List> componentTypes, FifoQueue.Options... options) { - return FifoQueue.create(scope, componentTypes, options); + public SerializeManySparse serializeManySparse( + Operand sparseIndices, Operand sparseValues, Operand sparseShape, + DataType outType) { + return SerializeManySparse.create(scope, sparseIndices, sparseValues, sparseShape, outType); } /** - * Builds an {@link DeserializeManySparse} operation + * Builds an {@link DecodeJsonExample} operation * - * @param serializedSparse 2-D, The `N` serialized `SparseTensor` objects. - * @param dtype The `dtype` of the serialized `SparseTensor` objects. - * @return a new instance of DeserializeManySparse - * @see org.tensorflow.op.io.DeserializeManySparse + * @param jsonExamples Each string is a JSON object serialized according to the JSON + * @return a new instance of DecodeJsonExample + * @see org.tensorflow.op.io.DecodeJsonExample */ - public DeserializeManySparse deserializeManySparse(Operand serializedSparse, - Class dtype) { - return DeserializeManySparse.create(scope, serializedSparse, dtype); + public DecodeJsonExample decodeJsonExample(Operand jsonExamples) { + return DecodeJsonExample.create(scope, jsonExamples); } /** - * Builds an {@link TfRecordReader} operation + * Builds an {@link ParseSingleExample} operation * - * @param options carries optional attributes values - * @return a new instance of TfRecordReader - * @see org.tensorflow.op.io.TfRecordReader + * @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 + * @param numSparse The number of sparse features to be parsed from the example. This + * @param sparseKeys A list of `num_sparse` strings. + * @param denseKeys The keys expected in the Examples' features associated with dense + * @param sparseTypes A list of `num_sparse` types; the data types of data in each + * @param denseShapes The shapes of data in each Feature given in dense_keys. + * @return a new instance of ParseSingleExample + * @see org.tensorflow.op.io.ParseSingleExample */ - public TfRecordReader tfRecordReader(TfRecordReader.Options... options) { - return TfRecordReader.create(scope, options); + public ParseSingleExample parseSingleExample(Operand serialized, + Iterable> denseDefaults, Long numSparse, List sparseKeys, + List denseKeys, List> sparseTypes, List denseShapes) { + return ParseSingleExample.create(scope, serialized, denseDefaults, numSparse, sparseKeys, denseKeys, sparseTypes, denseShapes); } /** @@ -438,10 +482,24 @@ public TfRecordReader tfRecordReader(TfRecordReader.Options... options) { * @return a new instance of EncodeBase64 * @see org.tensorflow.op.io.EncodeBase64 */ - public EncodeBase64 encodeBase64(Operand input, EncodeBase64.Options... options) { + public EncodeBase64 encodeBase64(Operand input, EncodeBase64.Options... options) { return EncodeBase64.create(scope, input, options); } + /** + * Builds an {@link DecodeCsv} operation + * + * @param records Each string is a record/row in the csv and all records should have + * @param recordDefaults One tensor per column of the input record, with either a + * @param options carries optional attributes values + * @return a new instance of DecodeCsv + * @see org.tensorflow.op.io.DecodeCsv + */ + public DecodeCsv decodeCsv(Operand records, Iterable> recordDefaults, + DecodeCsv.Options... options) { + return DecodeCsv.create(scope, records, recordDefaults, options); + } + /** * Builds an {@link QueueDequeueMany} operation * @@ -452,11 +510,24 @@ public EncodeBase64 encodeBase64(Operand input, EncodeBase64.Options... * @return a new instance of QueueDequeueMany * @see org.tensorflow.op.io.QueueDequeueMany */ - public QueueDequeueMany queueDequeueMany(Operand handle, Operand n, - List> componentTypes, QueueDequeueMany.Options... options) { + public QueueDequeueMany queueDequeueMany(Operand handle, Operand n, + List> componentTypes, QueueDequeueMany.Options... options) { return QueueDequeueMany.create(scope, handle, n, componentTypes, options); } + /** + * Builds an {@link DeserializeManySparse} operation + * + * @param serializedSparse 2-D, The `N` serialized `SparseTensor` objects. + * @param dtype The `dtype` of the serialized `SparseTensor` objects. + * @return a new instance of DeserializeManySparse + * @see org.tensorflow.op.io.DeserializeManySparse + */ + public DeserializeManySparse deserializeManySparse( + Operand serializedSparse, DataType dtype) { + return DeserializeManySparse.create(scope, serializedSparse, dtype); + } + /** * Builds an {@link LmdbReader} operation * @@ -479,18 +550,6 @@ public ReaderNumWorkUnitsCompleted readerNumWorkUnitsCompleted(Operand reader return ReaderNumWorkUnitsCompleted.create(scope, readerHandle); } - /** - * Builds an {@link ParseTensor} operation - * - * @param serialized A scalar string containing a serialized TensorProto proto. - * @param outType The type of the serialized tensor. The provided type must match the - * @return a new instance of ParseTensor - * @see org.tensorflow.op.io.ParseTensor - */ - public ParseTensor parseTensor(Operand serialized, Class outType) { - return ParseTensor.create(scope, serialized, outType); - } - /** * Builds an {@link ReaderRead} operation * @@ -504,93 +563,31 @@ public ReaderRead readerRead(Operand readerHandle, Operand queueHandle) { } /** - * Builds an {@link DecodeBase64} operation - * - * @param input Base64 strings to decode. - * @return a new instance of DecodeBase64 - * @see org.tensorflow.op.io.DecodeBase64 - */ - public DecodeBase64 decodeBase64(Operand input) { - return DecodeBase64.create(scope, input); - } - - /** - * Builds an {@link PaddingFifoQueue} operation - * - * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values - * @return a new instance of PaddingFifoQueue - * @see org.tensorflow.op.io.PaddingFifoQueue - */ - public PaddingFifoQueue paddingFifoQueue(List> componentTypes, - PaddingFifoQueue.Options... options) { - return PaddingFifoQueue.create(scope, componentTypes, options); - } - - /** - * Builds an {@link ParseSingleSequenceExample} operation + * Builds an {@link ParseSequenceExample} operation * - * @param serialized A scalar containing a binary serialized SequenceExample proto. + * @param serialized A vector containing binary serialized SequenceExample protos. + * @param debugName A vector containing the names of the serialized protos. + * @param contextDenseDefaults A list of Ncontext_dense Tensors (some may be empty). * @param featureListDenseMissingAssumedEmpty A vector listing the * @param contextSparseKeys A list of Ncontext_sparse string Tensors (scalars). * @param contextDenseKeys A list of Ncontext_dense string Tensors (scalars). * @param featureListSparseKeys A list of Nfeature_list_sparse string Tensors * @param featureListDenseKeys A list of Nfeature_list_dense string Tensors (scalars). - * @param contextDenseDefaults A list of Ncontext_dense Tensors (some may be empty). - * @param debugName A scalar containing the name of the serialized proto. * @param contextSparseTypes A list of Ncontext_sparse types; the data types of data in * @param featureListDenseTypes * @param featureListSparseTypes A list of Nfeature_list_sparse types; the data types * @param options carries optional attributes values - * @return a new instance of ParseSingleSequenceExample - * @see org.tensorflow.op.io.ParseSingleSequenceExample - */ - public ParseSingleSequenceExample parseSingleSequenceExample(Operand serialized, - Operand featureListDenseMissingAssumedEmpty, - Iterable> contextSparseKeys, Iterable> contextDenseKeys, - Iterable> featureListSparseKeys, - Iterable> featureListDenseKeys, Iterable> contextDenseDefaults, - Operand debugName, List> contextSparseTypes, - List> featureListDenseTypes, List> featureListSparseTypes, - ParseSingleSequenceExample.Options... options) { - return ParseSingleSequenceExample.create(scope, serialized, featureListDenseMissingAssumedEmpty, contextSparseKeys, contextDenseKeys, featureListSparseKeys, featureListDenseKeys, contextDenseDefaults, debugName, contextSparseTypes, featureListDenseTypes, featureListSparseTypes, options); - } - - /** - * Builds an {@link SerializeTensor} operation - * - * @param tensor A Tensor of type `T`. - * @return a new instance of SerializeTensor - * @see org.tensorflow.op.io.SerializeTensor - */ - public SerializeTensor serializeTensor(Operand tensor) { - return SerializeTensor.create(scope, tensor); - } - - /** - * Builds an {@link ShardedFilespec} operation - * - * @param basename - * @param numShards - * @return a new instance of ShardedFilespec - * @see org.tensorflow.op.io.ShardedFilespec - */ - public ShardedFilespec shardedFilespec(Operand basename, Operand numShards) { - return ShardedFilespec.create(scope, basename, numShards); - } - - /** - * Builds an {@link SerializeSparse} operation - * - * @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 - * @see org.tensorflow.op.io.SerializeSparse + * @return a new instance of ParseSequenceExample + * @see org.tensorflow.op.io.ParseSequenceExample */ - public SerializeSparse serializeSparse(Operand sparseIndices, - Operand sparseValues, Operand sparseShape) { - return SerializeSparse.create(scope, sparseIndices, sparseValues, sparseShape); + public ParseSequenceExample parseSequenceExample(Operand serialized, + Operand debugName, Iterable> contextDenseDefaults, + List featureListDenseMissingAssumedEmpty, List contextSparseKeys, + List contextDenseKeys, List featureListSparseKeys, + List featureListDenseKeys, List> contextSparseTypes, + List> featureListDenseTypes, List> featureListSparseTypes, + ParseSequenceExample.Options... options) { + return ParseSequenceExample.create(scope, serialized, debugName, contextDenseDefaults, featureListDenseMissingAssumedEmpty, contextSparseKeys, contextDenseKeys, featureListSparseKeys, featureListDenseKeys, contextSparseTypes, featureListDenseTypes, featureListSparseTypes, options); } /** @@ -605,54 +602,54 @@ public QueueIsClosed queueIsClosed(Operand handle) { } /** - * Builds an {@link MatchingFiles} operation + * Builds an {@link DecodeCompressed} operation * - * @param pattern Shell wildcard pattern(s). Scalar or vector of type string. - * @return a new instance of MatchingFiles - * @see org.tensorflow.op.io.MatchingFiles + * @param bytes A Tensor of string which is compressed. + * @param options carries optional attributes values + * @return a new instance of DecodeCompressed + * @see org.tensorflow.op.io.DecodeCompressed */ - public MatchingFiles matchingFiles(Operand pattern) { - return MatchingFiles.create(scope, pattern); + public DecodeCompressed decodeCompressed(Operand bytes, + DecodeCompressed.Options... options) { + return DecodeCompressed.create(scope, bytes, options); } /** - * Builds an {@link SerializeManySparse} operation + * Builds an {@link QueueSize} operation * - * @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` - * @return a new instance of SerializeManySparse - * @see org.tensorflow.op.io.SerializeManySparse + * @param handle The handle to a queue. + * @return a new instance of QueueSize + * @see org.tensorflow.op.io.QueueSize */ - public SerializeManySparse serializeManySparse(Operand sparseIndices, - Operand sparseValues, Operand sparseShape, Class outType) { - return SerializeManySparse.create(scope, sparseIndices, sparseValues, sparseShape, outType); + public QueueSize queueSize(Operand handle) { + return QueueSize.create(scope, handle); } /** - * Builds an {@link DecodeRaw} operation + * Builds an {@link RandomShuffleQueue} operation * - * @param bytes All the elements must have the same length. - * @param outType + * @param componentTypes The type of each component in a value. * @param options carries optional attributes values - * @return a new instance of DecodeRaw - * @see org.tensorflow.op.io.DecodeRaw + * @return a new instance of RandomShuffleQueue + * @see org.tensorflow.op.io.RandomShuffleQueue */ - public DecodeRaw decodeRaw(Operand bytes, Class outType, - DecodeRaw.Options... options) { - return DecodeRaw.create(scope, bytes, outType, options); + public RandomShuffleQueue randomShuffleQueue(List> componentTypes, + RandomShuffleQueue.Options... options) { + return RandomShuffleQueue.create(scope, componentTypes, options); } /** - * Builds an {@link QueueSize} operation + * Builds an {@link QueueDequeue} operation * * @param handle The handle to a queue. - * @return a new instance of QueueSize - * @see org.tensorflow.op.io.QueueSize + * @param componentTypes The type of each component in a tuple. + * @param options carries optional attributes values + * @return a new instance of QueueDequeue + * @see org.tensorflow.op.io.QueueDequeue */ - public QueueSize queueSize(Operand handle) { - return QueueSize.create(scope, handle); + public QueueDequeue queueDequeue(Operand handle, List> componentTypes, + QueueDequeue.Options... options) { + return QueueDequeue.create(scope, handle, componentTypes, options); } /** @@ -680,16 +677,27 @@ public FixedLengthRecordReader fixedLengthRecordReader(Long recordBytes, } /** - * Builds an {@link DecodeCsv} operation + * Builds an {@link ReaderRestoreState} operation * - * @param records Each string is a record/row in the csv and all records should have - * @param recordDefaults One tensor per column of the input record, with either a + * @param readerHandle Handle to a Reader. + * @param state Result of a ReaderSerializeState of a Reader with type + * @return a new instance of ReaderRestoreState + * @see org.tensorflow.op.io.ReaderRestoreState + */ + public ReaderRestoreState readerRestoreState(Operand readerHandle, Operand state) { + return ReaderRestoreState.create(scope, readerHandle, state); + } + + /** + * Builds an {@link PaddingFifoQueue} operation + * + * @param componentTypes The type of each component in a value. * @param options carries optional attributes values - * @return a new instance of DecodeCsv - * @see org.tensorflow.op.io.DecodeCsv + * @return a new instance of PaddingFifoQueue + * @see org.tensorflow.op.io.PaddingFifoQueue */ - public DecodeCsv decodeCsv(Operand records, Iterable> recordDefaults, - DecodeCsv.Options... options) { - return DecodeCsv.create(scope, records, recordDefaults, options); + public PaddingFifoQueue paddingFifoQueue(List> componentTypes, + PaddingFifoQueue.Options... options) { + return PaddingFifoQueue.create(scope, componentTypes, options); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgOps.java index f6b4876cf12..0af2b84b9c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/LinalgOps.java @@ -1,5 +1,6 @@ package org.tensorflow.op; +import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.op.linalg.BandPart; import org.tensorflow.op.linalg.BatchCholesky; @@ -39,6 +40,12 @@ import org.tensorflow.op.linalg.TensorDiagPart; import org.tensorflow.op.linalg.Transpose; import org.tensorflow.op.linalg.TriangularSolve; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code linalg} operations as {@link Op Op}s @@ -53,215 +60,219 @@ public final class LinalgOps { } /** - * Builds an {@link BatchMatrixSolve} operation + * Builds an {@link Transpose} operation * - * @param matrix - * @param rhs - * @param options carries optional attributes values - * @return a new instance of BatchMatrixSolve - * @see org.tensorflow.op.linalg.BatchMatrixSolve + * @param x + * @param perm + * @return a new instance of Transpose + * @see org.tensorflow.op.linalg.Transpose */ - public BatchMatrixSolve batchMatrixSolve(Operand matrix, Operand rhs, - BatchMatrixSolve.Options... options) { - return BatchMatrixSolve.create(scope, matrix, rhs, options); + public Transpose transpose(Operand x, + Operand perm) { + return Transpose.create(scope, x, perm); } /** - * Builds an {@link Qr} operation + * Builds an {@link BatchMatrixSolveLs} operation * - * @param input A tensor of shape `[..., M, N]` whose inner-most 2 dimensions + * @param matrix + * @param rhs + * @param l2Regularizer * @param options carries optional attributes values - * @return a new instance of Qr - * @see org.tensorflow.op.linalg.Qr + * @return a new instance of BatchMatrixSolveLs + * @see org.tensorflow.op.linalg.BatchMatrixSolveLs */ - public Qr qr(Operand input, Qr.Options... options) { - return Qr.create(scope, input, options); + public BatchMatrixSolveLs batchMatrixSolveLs(Operand matrix, + Operand rhs, Operand l2Regularizer, BatchMatrixSolveLs.Options... options) { + return BatchMatrixSolveLs.create(scope, matrix, rhs, l2Regularizer, options); } /** - * Builds an {@link ConjugateTranspose} operation + * Builds an {@link LogMatrixDeterminant} operation * - * @param x - * @param perm - * @return a new instance of ConjugateTranspose - * @see org.tensorflow.op.linalg.ConjugateTranspose + * @param input Shape is `[N, M, M]`. + * @return a new instance of LogMatrixDeterminant + * @see org.tensorflow.op.linalg.LogMatrixDeterminant */ - public ConjugateTranspose conjugateTranspose(Operand x, - Operand perm) { - return ConjugateTranspose.create(scope, x, perm); + public LogMatrixDeterminant logMatrixDeterminant(Operand input) { + return LogMatrixDeterminant.create(scope, input); } /** - * Builds an {@link BatchMatrixDiagPart} operation + * Builds an {@link TriangularSolve} operation * - * @param input - * @return a new instance of BatchMatrixDiagPart - * @see org.tensorflow.op.linalg.BatchMatrixDiagPart + * @param matrix Shape is `[..., M, M]`. + * @param rhs Shape is `[..., M, K]`. + * @param options carries optional attributes values + * @return a new instance of TriangularSolve + * @see org.tensorflow.op.linalg.TriangularSolve */ - public BatchMatrixDiagPart batchMatrixDiagPart(Operand input) { - return BatchMatrixDiagPart.create(scope, input); + public TriangularSolve triangularSolve(Operand matrix, Operand rhs, + TriangularSolve.Options... options) { + return TriangularSolve.create(scope, matrix, rhs, options); } /** - * Builds an {@link BatchMatrixBandPart} operation + * Builds an {@link Svd} operation * - * @param input - * @param numLower - * @param numUpper - * @return a new instance of BatchMatrixBandPart - * @see org.tensorflow.op.linalg.BatchMatrixBandPart + * @param input A tensor of shape `[..., M, N]` whose inner-most 2 dimensions + * @param options carries optional attributes values + * @return a new instance of Svd + * @see org.tensorflow.op.linalg.Svd */ - public BatchMatrixBandPart batchMatrixBandPart(Operand input, Operand numLower, - Operand numUpper) { - return BatchMatrixBandPart.create(scope, input, numLower, numUpper); + public Svd svd(Operand input, Svd.Options... options) { + return Svd.create(scope, input, options); } /** - * Builds an {@link BatchMatrixDeterminant} operation + * Builds an {@link BatchMatrixInverse} operation * * @param input - * @return a new instance of BatchMatrixDeterminant - * @see org.tensorflow.op.linalg.BatchMatrixDeterminant + * @param options carries optional attributes values + * @return a new instance of BatchMatrixInverse + * @see org.tensorflow.op.linalg.BatchMatrixInverse */ - public BatchMatrixDeterminant batchMatrixDeterminant(Operand input) { - return BatchMatrixDeterminant.create(scope, input); + public BatchMatrixInverse batchMatrixInverse(Operand input, + BatchMatrixInverse.Options... options) { + return BatchMatrixInverse.create(scope, input, options); } /** - * Builds an {@link LoadAndRemapMatrix} operation + * Builds an {@link Solve} operation * - * @param ckptPath Path to the TensorFlow checkpoint (version 2, `TensorBundle`) from - * @param oldTensorName Name of the 2-D `Tensor` to load from checkpoint. - * @param rowRemapping An int `Tensor` of row remappings (generally created by - * @param colRemapping An int `Tensor` of column remappings (generally created by - * @param initializingValues A float `Tensor` containing values to fill in for 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 matrix Shape is `[..., M, M]`. + * @param rhs Shape is `[..., M, K]`. * @param options carries optional attributes values - * @return a new instance of LoadAndRemapMatrix - * @see org.tensorflow.op.linalg.LoadAndRemapMatrix + * @return a new instance of Solve + * @see org.tensorflow.op.linalg.Solve */ - public LoadAndRemapMatrix loadAndRemapMatrix(Operand ckptPath, - Operand oldTensorName, Operand rowRemapping, Operand colRemapping, - Operand initializingValues, Long numRows, Long numCols, - LoadAndRemapMatrix.Options... options) { - return LoadAndRemapMatrix.create(scope, ckptPath, oldTensorName, rowRemapping, colRemapping, initializingValues, numRows, numCols, options); + public Solve solve(Operand matrix, Operand rhs, + Solve.Options... options) { + return Solve.create(scope, matrix, rhs, options); } /** - * Builds an {@link TensorDiag} operation + * Builds an {@link BatchMatrixDiagPart} operation * - * @param diagonal Rank k tensor where k is at most 1. - * @return a new instance of TensorDiag - * @see org.tensorflow.op.linalg.TensorDiag + * @param input + * @return a new instance of BatchMatrixDiagPart + * @see org.tensorflow.op.linalg.BatchMatrixDiagPart */ - public TensorDiag tensorDiag(Operand diagonal) { - return TensorDiag.create(scope, diagonal); + public BatchMatrixDiagPart batchMatrixDiagPart(Operand input) { + return BatchMatrixDiagPart.create(scope, input); } /** - * Builds an {@link TriangularSolve} operation + * Builds an {@link Cross} operation * - * @param matrix Shape is `[..., M, M]`. - * @param rhs Shape is `[..., M, K]`. - * @param options carries optional attributes values - * @return a new instance of TriangularSolve - * @see org.tensorflow.op.linalg.TriangularSolve + * @param a A tensor containing 3-element vectors. + * @param b Another tensor, of same type and shape as `a`. + * @return a new instance of Cross + * @see org.tensorflow.op.linalg.Cross */ - public TriangularSolve triangularSolve(Operand matrix, Operand rhs, - TriangularSolve.Options... options) { - return TriangularSolve.create(scope, matrix, rhs, options); + public Cross cross(Operand a, Operand b) { + return Cross.create(scope, a, b); } /** - * Builds an {@link SelfAdjointEig} operation + * Builds an {@link MatrixSolveLs} operation * - * @param input `Tensor` input of shape `[N, N]`. + * @param matrix Shape is `[..., M, N]`. + * @param rhs Shape is `[..., M, K]`. + * @param l2Regularizer Scalar tensor. * @param options carries optional attributes values - * @return a new instance of SelfAdjointEig - * @see org.tensorflow.op.linalg.SelfAdjointEig + * @return a new instance of MatrixSolveLs + * @see org.tensorflow.op.linalg.MatrixSolveLs */ - public SelfAdjointEig selfAdjointEig(Operand input, SelfAdjointEig.Options... options) { - return SelfAdjointEig.create(scope, input, options); + public MatrixSolveLs matrixSolveLs(Operand matrix, Operand rhs, + Operand l2Regularizer, MatrixSolveLs.Options... options) { + return MatrixSolveLs.create(scope, matrix, rhs, l2Regularizer, options); } /** - * Builds an {@link Sqrtm} operation + * Builds an {@link BatchMatrixSetDiag} operation * - * @param input Shape is `[..., M, M]`. - * @return a new instance of Sqrtm - * @see org.tensorflow.op.linalg.Sqrtm + * @param input + * @param diagonal + * @return a new instance of BatchMatrixSetDiag + * @see org.tensorflow.op.linalg.BatchMatrixSetDiag */ - public Sqrtm sqrtm(Operand input) { - return Sqrtm.create(scope, input); + public BatchMatrixSetDiag batchMatrixSetDiag(Operand input, + Operand diagonal) { + return BatchMatrixSetDiag.create(scope, input, diagonal); } /** - * Builds an {@link BatchCholeskyGrad} operation + * Builds an {@link DiagPart} operation * - * @param l - * @param grad - * @return a new instance of BatchCholeskyGrad - * @see org.tensorflow.op.linalg.BatchCholeskyGrad + * @param input Rank `k` tensor where `k >= 2`. + * @return a new instance of DiagPart + * @see org.tensorflow.op.linalg.DiagPart */ - public BatchCholeskyGrad batchCholeskyGrad(Operand l, Operand grad) { - return BatchCholeskyGrad.create(scope, l, grad); + public DiagPart diagPart(Operand input) { + return DiagPart.create(scope, input); } /** - * Builds an {@link Cholesky} operation + * Builds an {@link BatchMatMul} operation * - * @param input Shape is `[..., M, M]`. - * @return a new instance of Cholesky - * @see org.tensorflow.op.linalg.Cholesky + * @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 + * @return a new instance of BatchMatMul + * @see org.tensorflow.op.linalg.BatchMatMul */ - public Cholesky cholesky(Operand input) { - return Cholesky.create(scope, input); + public BatchMatMul batchMatMul(Operand x, Operand y, + BatchMatMul.Options... options) { + return BatchMatMul.create(scope, x, y, options); } /** - * Builds an {@link BatchCholesky} operation + * Builds an {@link CholeskyGrad} operation * - * @param input - * @return a new instance of BatchCholesky - * @see org.tensorflow.op.linalg.BatchCholesky + * @param l Output of batch Cholesky algorithm l = cholesky(A). Shape is `[..., M, M]`. + * @param grad df/dl where f is some scalar function. Shape is `[..., M, M]`. + * @return a new instance of CholeskyGrad + * @see org.tensorflow.op.linalg.CholeskyGrad */ - public BatchCholesky batchCholesky(Operand input) { - return BatchCholesky.create(scope, input); + public CholeskyGrad choleskyGrad(Operand l, Operand grad) { + return CholeskyGrad.create(scope, l, grad); } /** - * Builds an {@link Svd} operation + * Builds an {@link Qr} operation * * @param input A tensor of shape `[..., M, N]` whose inner-most 2 dimensions * @param options carries optional attributes values - * @return a new instance of Svd - * @see org.tensorflow.op.linalg.Svd + * @return a new instance of Qr + * @see org.tensorflow.op.linalg.Qr */ - public Svd svd(Operand input, Svd.Options... options) { - return Svd.create(scope, input, options); + public Qr qr(Operand input, Qr.Options... options) { + return Qr.create(scope, input, options); } /** - * Builds an {@link Det} operation + * Builds an {@link BatchSelfAdjointEig} operation * - * @param input Shape is `[..., M, M]`. - * @return a new instance of Det - * @see org.tensorflow.op.linalg.Det + * @param input + * @param options carries optional attributes values + * @return a new instance of BatchSelfAdjointEig + * @see org.tensorflow.op.linalg.BatchSelfAdjointEig */ - public Det det(Operand input) { - return Det.create(scope, input); + public BatchSelfAdjointEig batchSelfAdjointEig(Operand input, + BatchSelfAdjointEig.Options... options) { + return BatchSelfAdjointEig.create(scope, input, options); } /** - * Builds an {@link DiagPart} operation + * Builds an {@link Cholesky} operation * - * @param input Rank `k` tensor where `k >= 2`. - * @return a new instance of DiagPart - * @see org.tensorflow.op.linalg.DiagPart + * @param input Shape is `[..., M, M]`. + * @return a new instance of Cholesky + * @see org.tensorflow.op.linalg.Cholesky */ - public DiagPart diagPart(Operand input) { - return DiagPart.create(scope, input); + public Cholesky cholesky(Operand input) { + return Cholesky.create(scope, input); } /** @@ -272,112 +283,109 @@ public DiagPart diagPart(Operand input) { * @return a new instance of SetDiag * @see org.tensorflow.op.linalg.SetDiag */ - public SetDiag setDiag(Operand input, Operand diagonal) { + public SetDiag setDiag(Operand input, Operand diagonal) { return SetDiag.create(scope, input, diagonal); } /** - * Builds an {@link Solve} operation + * Builds an {@link Diag} operation * - * @param matrix Shape is `[..., M, M]`. - * @param rhs Shape is `[..., M, K]`. - * @param options carries optional attributes values - * @return a new instance of Solve - * @see org.tensorflow.op.linalg.Solve + * @param diagonal Rank `k`, where `k >= 1`. + * @return a new instance of Diag + * @see org.tensorflow.op.linalg.Diag */ - public Solve solve(Operand matrix, Operand rhs, Solve.Options... options) { - return Solve.create(scope, matrix, rhs, options); + public Diag diag(Operand diagonal) { + return Diag.create(scope, diagonal); } /** - * Builds an {@link MatrixSolveLs} operation + * Builds an {@link BatchMatrixDiag} operation * - * @param matrix Shape is `[..., M, N]`. - * @param rhs Shape is `[..., M, K]`. - * @param l2Regularizer Scalar tensor. - * @param options carries optional attributes values - * @return a new instance of MatrixSolveLs - * @see org.tensorflow.op.linalg.MatrixSolveLs + * @param diagonal + * @return a new instance of BatchMatrixDiag + * @see org.tensorflow.op.linalg.BatchMatrixDiag */ - public MatrixSolveLs matrixSolveLs(Operand matrix, Operand rhs, - Operand l2Regularizer, MatrixSolveLs.Options... options) { - return MatrixSolveLs.create(scope, matrix, rhs, l2Regularizer, options); + public BatchMatrixDiag batchMatrixDiag(Operand diagonal) { + return BatchMatrixDiag.create(scope, diagonal); } /** - * Builds an {@link BatchSvd} operation + * Builds an {@link LoadAndRemapMatrix} operation * - * @param input + * @param ckptPath Path to the TensorFlow checkpoint (version 2, `TensorBundle`) from + * @param oldTensorName Name of the 2-D `Tensor` to load from checkpoint. + * @param rowRemapping An int `Tensor` of row remappings (generally created by + * @param colRemapping An int `Tensor` of column remappings (generally created by + * @param initializingValues A float `Tensor` containing values to fill in for 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 - * @return a new instance of BatchSvd - * @see org.tensorflow.op.linalg.BatchSvd + * @return a new instance of LoadAndRemapMatrix + * @see org.tensorflow.op.linalg.LoadAndRemapMatrix */ - public BatchSvd batchSvd(Operand input, BatchSvd.Options... options) { - return BatchSvd.create(scope, input, options); + public LoadAndRemapMatrix loadAndRemapMatrix(Operand ckptPath, + Operand oldTensorName, Operand rowRemapping, Operand colRemapping, + Operand initializingValues, Long numRows, Long numCols, + LoadAndRemapMatrix.Options... options) { + return LoadAndRemapMatrix.create(scope, ckptPath, oldTensorName, rowRemapping, colRemapping, initializingValues, numRows, numCols, options); } /** - * Builds an {@link BatchMatrixInverse} operation + * Builds an {@link Sqrtm} operation * - * @param input - * @param options carries optional attributes values - * @return a new instance of BatchMatrixInverse - * @see org.tensorflow.op.linalg.BatchMatrixInverse + * @param input Shape is `[..., M, M]`. + * @return a new instance of Sqrtm + * @see org.tensorflow.op.linalg.Sqrtm */ - public BatchMatrixInverse batchMatrixInverse(Operand input, - BatchMatrixInverse.Options... options) { - return BatchMatrixInverse.create(scope, input, options); + public Sqrtm sqrtm(Operand input) { + return Sqrtm.create(scope, input); } /** - * Builds an {@link CholeskyGrad} operation + * Builds an {@link TensorDiag} operation * - * @param l Output of batch Cholesky algorithm l = cholesky(A). Shape is `[..., M, M]`. - * @param grad df/dl where f is some scalar function. Shape is `[..., M, M]`. - * @return a new instance of CholeskyGrad - * @see org.tensorflow.op.linalg.CholeskyGrad + * @param diagonal Rank k tensor where k is at most 1. + * @return a new instance of TensorDiag + * @see org.tensorflow.op.linalg.TensorDiag */ - public CholeskyGrad choleskyGrad(Operand l, Operand grad) { - return CholeskyGrad.create(scope, l, grad); + public TensorDiag tensorDiag(Operand diagonal) { + return TensorDiag.create(scope, diagonal); } /** - * Builds an {@link Inv} operation + * Builds an {@link BatchCholesky} operation * - * @param input Shape is `[..., M, M]`. - * @param options carries optional attributes values - * @return a new instance of Inv - * @see org.tensorflow.op.linalg.Inv + * @param input + * @return a new instance of BatchCholesky + * @see org.tensorflow.op.linalg.BatchCholesky */ - public Inv inv(Operand input, Inv.Options... options) { - return Inv.create(scope, input, options); + public BatchCholesky batchCholesky(Operand input) { + return BatchCholesky.create(scope, input); } /** - * Builds an {@link BatchMatrixTriangularSolve} operation + * Builds an {@link BatchMatrixSolve} operation * * @param matrix * @param rhs * @param options carries optional attributes values - * @return a new instance of BatchMatrixTriangularSolve - * @see org.tensorflow.op.linalg.BatchMatrixTriangularSolve + * @return a new instance of BatchMatrixSolve + * @see org.tensorflow.op.linalg.BatchMatrixSolve */ - public BatchMatrixTriangularSolve batchMatrixTriangularSolve( - Operand matrix, Operand rhs, BatchMatrixTriangularSolve.Options... options) { - return BatchMatrixTriangularSolve.create(scope, matrix, rhs, options); + public BatchMatrixSolve batchMatrixSolve(Operand matrix, Operand rhs, + BatchMatrixSolve.Options... options) { + return BatchMatrixSolve.create(scope, matrix, rhs, options); } /** - * Builds an {@link MatMul} operation + * Builds an {@link BatchMatrixDeterminant} operation * - * @param a - * @param b - * @param options carries optional attributes values - * @return a new instance of MatMul - * @see org.tensorflow.op.linalg.MatMul + * @param input + * @return a new instance of BatchMatrixDeterminant + * @see org.tensorflow.op.linalg.BatchMatrixDeterminant */ - public MatMul matMul(Operand a, Operand b, MatMul.Options... options) { - return MatMul.create(scope, a, b, options); + public BatchMatrixDeterminant batchMatrixDeterminant(Operand input) { + return BatchMatrixDeterminant.create(scope, input); } /** @@ -395,145 +403,149 @@ public MatMul matMul(Operand a, Operand b, MatMul.Options... option * @return a new instance of QuantizedMatMul * @see org.tensorflow.op.linalg.QuantizedMatMul */ - public QuantizedMatMul quantizedMatMul(Operand a, Operand b, - Operand minA, Operand maxA, Operand minB, Operand maxB, - Class Toutput, Class Tactivation, QuantizedMatMul.Options... options) { + public QuantizedMatMul quantizedMatMul( + Operand a, Operand b, Operand minA, Operand maxA, Operand minB, + Operand maxB, DataType Toutput, DataType Tactivation, + QuantizedMatMul.Options... options) { return QuantizedMatMul.create(scope, a, b, minA, maxA, minB, maxB, Toutput, Tactivation, options); } /** - * Builds an {@link Cross} operation + * Builds an {@link SelfAdjointEig} operation * - * @param a A tensor containing 3-element vectors. - * @param b Another tensor, of same type and shape as `a`. - * @return a new instance of Cross - * @see org.tensorflow.op.linalg.Cross + * @param input `Tensor` input of shape `[N, N]`. + * @param options carries optional attributes values + * @return a new instance of SelfAdjointEig + * @see org.tensorflow.op.linalg.SelfAdjointEig */ - public Cross cross(Operand a, Operand b) { - return Cross.create(scope, a, b); + public SelfAdjointEig selfAdjointEig(Operand input, + SelfAdjointEig.Options... options) { + return SelfAdjointEig.create(scope, input, options); } /** - * Builds an {@link BatchMatrixDiag} operation + * Builds an {@link BandPart} operation * - * @param diagonal - * @return a new instance of BatchMatrixDiag - * @see org.tensorflow.op.linalg.BatchMatrixDiag + * @param input Rank `k` tensor. + * @param numLower 0-D tensor. Number of subdiagonals to keep. If negative, keep entire + * @param numUpper 0-D tensor. Number of superdiagonals to keep. If negative, keep + * @return a new instance of BandPart + * @see org.tensorflow.op.linalg.BandPart */ - public BatchMatrixDiag batchMatrixDiag(Operand diagonal) { - return BatchMatrixDiag.create(scope, diagonal); + public BandPart bandPart(Operand input, + Operand numLower, Operand numUpper) { + return BandPart.create(scope, input, numLower, numUpper); } /** - * Builds an {@link Transpose} operation + * Builds an {@link ConjugateTranspose} operation * * @param x * @param perm - * @return a new instance of Transpose - * @see org.tensorflow.op.linalg.Transpose + * @return a new instance of ConjugateTranspose + * @see org.tensorflow.op.linalg.ConjugateTranspose */ - public Transpose transpose(Operand x, Operand perm) { - return Transpose.create(scope, x, perm); + public ConjugateTranspose conjugateTranspose(Operand x, + Operand perm) { + return ConjugateTranspose.create(scope, x, perm); } /** - * Builds an {@link LogMatrixDeterminant} operation + * Builds an {@link Inv} operation * - * @param input Shape is `[N, M, M]`. - * @return a new instance of LogMatrixDeterminant - * @see org.tensorflow.op.linalg.LogMatrixDeterminant + * @param input Shape is `[..., M, M]`. + * @param options carries optional attributes values + * @return a new instance of Inv + * @see org.tensorflow.op.linalg.Inv */ - public LogMatrixDeterminant logMatrixDeterminant(Operand input) { - return LogMatrixDeterminant.create(scope, input); + public Inv inv(Operand input, Inv.Options... options) { + return Inv.create(scope, input, options); } /** - * Builds an {@link BatchMatrixSolveLs} operation + * Builds an {@link BatchMatrixBandPart} operation * - * @param matrix - * @param rhs - * @param l2Regularizer - * @param options carries optional attributes values - * @return a new instance of BatchMatrixSolveLs - * @see org.tensorflow.op.linalg.BatchMatrixSolveLs + * @param input + * @param numLower + * @param numUpper + * @return a new instance of BatchMatrixBandPart + * @see org.tensorflow.op.linalg.BatchMatrixBandPart */ - public BatchMatrixSolveLs batchMatrixSolveLs(Operand matrix, - Operand rhs, Operand l2Regularizer, BatchMatrixSolveLs.Options... options) { - return BatchMatrixSolveLs.create(scope, matrix, rhs, l2Regularizer, options); + public BatchMatrixBandPart batchMatrixBandPart(Operand input, + Operand numLower, Operand numUpper) { + return BatchMatrixBandPart.create(scope, input, numLower, numUpper); } /** - * Builds an {@link Diag} operation + * Builds an {@link TensorDiagPart} operation * - * @param diagonal Rank `k`, where `k >= 1`. - * @return a new instance of Diag - * @see org.tensorflow.op.linalg.Diag + * @param input Rank k tensor where k is even and not zero. + * @return a new instance of TensorDiagPart + * @see org.tensorflow.op.linalg.TensorDiagPart */ - public Diag diag(Operand diagonal) { - return Diag.create(scope, diagonal); + public TensorDiagPart tensorDiagPart(Operand input) { + return TensorDiagPart.create(scope, input); } /** - * Builds an {@link BatchMatrixSetDiag} operation + * Builds an {@link BatchCholeskyGrad} operation * - * @param input - * @param diagonal - * @return a new instance of BatchMatrixSetDiag - * @see org.tensorflow.op.linalg.BatchMatrixSetDiag + * @param l + * @param grad + * @return a new instance of BatchCholeskyGrad + * @see org.tensorflow.op.linalg.BatchCholeskyGrad */ - public BatchMatrixSetDiag batchMatrixSetDiag(Operand input, Operand diagonal) { - return BatchMatrixSetDiag.create(scope, input, diagonal); + public BatchCholeskyGrad batchCholeskyGrad(Operand l, Operand grad) { + return BatchCholeskyGrad.create(scope, l, grad); } /** - * Builds an {@link TensorDiagPart} operation + * Builds an {@link BatchSvd} operation * - * @param input Rank k tensor where k is even and not zero. - * @return a new instance of TensorDiagPart - * @see org.tensorflow.op.linalg.TensorDiagPart + * @param input + * @param options carries optional attributes values + * @return a new instance of BatchSvd + * @see org.tensorflow.op.linalg.BatchSvd */ - public TensorDiagPart tensorDiagPart(Operand input) { - return TensorDiagPart.create(scope, input); + public BatchSvd batchSvd(Operand input, BatchSvd.Options... options) { + return BatchSvd.create(scope, input, options); } /** - * Builds an {@link BandPart} operation + * Builds an {@link MatMul} operation * - * @param input Rank `k` tensor. - * @param numLower 0-D tensor. Number of subdiagonals to keep. If negative, keep entire - * @param numUpper 0-D tensor. Number of superdiagonals to keep. If negative, keep - * @return a new instance of BandPart - * @see org.tensorflow.op.linalg.BandPart + * @param a + * @param b + * @param options carries optional attributes values + * @return a new instance of MatMul + * @see org.tensorflow.op.linalg.MatMul */ - public BandPart bandPart(Operand input, Operand numLower, - Operand numUpper) { - return BandPart.create(scope, input, numLower, numUpper); + public MatMul matMul(Operand a, Operand b, MatMul.Options... options) { + return MatMul.create(scope, a, b, options); } /** - * Builds an {@link BatchSelfAdjointEig} operation + * Builds an {@link Det} operation * - * @param input - * @param options carries optional attributes values - * @return a new instance of BatchSelfAdjointEig - * @see org.tensorflow.op.linalg.BatchSelfAdjointEig + * @param input Shape is `[..., M, M]`. + * @return a new instance of Det + * @see org.tensorflow.op.linalg.Det */ - public BatchSelfAdjointEig batchSelfAdjointEig(Operand input, - BatchSelfAdjointEig.Options... options) { - return BatchSelfAdjointEig.create(scope, input, options); + public Det det(Operand input) { + return Det.create(scope, input); } /** - * Builds an {@link BatchMatMul} operation + * Builds an {@link BatchMatrixTriangularSolve} operation * - * @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 matrix + * @param rhs * @param options carries optional attributes values - * @return a new instance of BatchMatMul - * @see org.tensorflow.op.linalg.BatchMatMul + * @return a new instance of BatchMatrixTriangularSolve + * @see org.tensorflow.op.linalg.BatchMatrixTriangularSolve */ - public BatchMatMul batchMatMul(Operand x, Operand y, - BatchMatMul.Options... options) { - return BatchMatMul.create(scope, x, y, options); + public BatchMatrixTriangularSolve batchMatrixTriangularSolve( + Operand matrix, Operand rhs, BatchMatrixTriangularSolve.Options... options) { + return BatchMatrixTriangularSolve.create(scope, matrix, rhs, options); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathOps.java index 7f14ae6abe5..4ebe3662054 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/MathOps.java @@ -1,7 +1,7 @@ package org.tensorflow.op; +import org.tensorflow.DataType; import org.tensorflow.Operand; -import org.tensorflow.Shape; import org.tensorflow.op.math.Abs; import org.tensorflow.op.math.AccumulateN; import org.tensorflow.op.math.Acos; @@ -102,6 +102,13 @@ import org.tensorflow.op.math.Xdivy; import org.tensorflow.op.math.Xlogy; import org.tensorflow.op.math.Zeta; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code math} operations as {@link Op Op}s @@ -116,301 +123,236 @@ public final class MathOps { } /** - * Builds an {@link LogicalOr} operation + * Builds an {@link Bincount} operation * - * @param x - * @param y - * @return a new instance of LogicalOr - * @see org.tensorflow.op.math.LogicalOr + * @param arr int32 `Tensor`. + * @param size non-negative int32 scalar `Tensor`. + * @param weights is an int32, int64, float32, or float64 `Tensor` with the same + * @return a new instance of Bincount + * @see org.tensorflow.op.math.Bincount */ - public LogicalOr logicalOr(Operand x, Operand y) { - return LogicalOr.create(scope, x, y); + public Bincount bincount(Operand arr, Operand size, + Operand weights) { + return Bincount.create(scope, arr, size, weights); } /** - * Builds an {@link Digamma} operation + * Builds an {@link Polygamma} operation * + * @param a * @param x - * @return a new instance of Digamma - * @see org.tensorflow.op.math.Digamma + * @return a new instance of Polygamma + * @see org.tensorflow.op.math.Polygamma */ - public Digamma digamma(Operand x) { - return Digamma.create(scope, x); + public Polygamma polygamma(Operand a, Operand x) { + return Polygamma.create(scope, a, x); } /** - * Builds an {@link TruncateDiv} operation + * Builds an {@link BesselI0e} operation * * @param x - * @param y - * @return a new instance of TruncateDiv - * @see org.tensorflow.op.math.TruncateDiv + * @return a new instance of BesselI0e + * @see org.tensorflow.op.math.BesselI0e */ - public TruncateDiv truncateDiv(Operand x, Operand y) { - return TruncateDiv.create(scope, x, y); + public BesselI0e besselI0e(Operand x) { + return BesselI0e.create(scope, x); } /** - * Builds an {@link Square} operation + * Builds an {@link Reciprocal} operation * * @param x - * @return a new instance of Square - * @see org.tensorflow.op.math.Square + * @return a new instance of Reciprocal + * @see org.tensorflow.op.math.Reciprocal */ - public Square square(Operand x) { - return Square.create(scope, x); + public Reciprocal reciprocal(Operand x) { + return Reciprocal.create(scope, x); } /** - * Builds an {@link LogicalNot} operation + * Builds an {@link Rint} operation * * @param x - * @return a new instance of LogicalNot - * @see org.tensorflow.op.math.LogicalNot - */ - public LogicalNot logicalNot(Operand x) { - return LogicalNot.create(scope, x); - } - - /** - * Builds an {@link CheckNumerics} operation - * - * @param tensor - * @param message Prefix of the error message. - * @return a new instance of CheckNumerics - * @see org.tensorflow.op.math.CheckNumerics + * @return a new instance of Rint + * @see org.tensorflow.op.math.Rint */ - public CheckNumerics checkNumerics(Operand tensor, String message) { - return CheckNumerics.create(scope, tensor, message); + public Rint rint(Operand x) { + return Rint.create(scope, x); } /** - * Builds an {@link Equal} operation + * Builds an {@link Igamma} operation * + * @param a * @param x - * @param y - * @param options carries optional attributes values - * @return a new instance of Equal - * @see org.tensorflow.op.math.Equal - */ - public Equal equal(Operand x, Operand y, Equal.Options... options) { - return Equal.create(scope, x, y, options); - } - - /** - * Builds an {@link Bincount} operation - * - * @param arr int32 `Tensor`. - * @param size non-negative int32 scalar `Tensor`. - * @param weights is an int32, int64, float32, or float64 `Tensor` with the same - * @return a new instance of Bincount - * @see org.tensorflow.op.math.Bincount + * @return a new instance of Igamma + * @see org.tensorflow.op.math.Igamma */ - public Bincount bincount(Operand arr, Operand size, - Operand weights) { - return Bincount.create(scope, arr, size, weights); + public Igamma igamma(Operand a, Operand x) { + return Igamma.create(scope, a, x); } /** - * Builds an {@link Mul} operation + * Builds an {@link Pow} operation * * @param x * @param y - * @return a new instance of Mul - * @see org.tensorflow.op.math.Mul + * @return a new instance of Pow + * @see org.tensorflow.op.math.Pow */ - public Mul mul(Operand x, Operand y) { - return Mul.create(scope, x, y); + public Pow pow(Operand x, Operand y) { + return Pow.create(scope, x, y); } /** - * Builds an {@link Neg} operation + * Builds an {@link Cosh} operation * * @param x - * @return a new instance of Neg - * @see org.tensorflow.op.math.Neg + * @return a new instance of Cosh + * @see org.tensorflow.op.math.Cosh */ - public Neg neg(Operand x) { - return Neg.create(scope, x); + public Cosh cosh(Operand x) { + return Cosh.create(scope, x); } /** - * Builds an {@link Asinh} operation + * Builds an {@link Round} operation * * @param x - * @return a new instance of Asinh - * @see org.tensorflow.op.math.Asinh - */ - public Asinh asinh(Operand x) { - return Asinh.create(scope, x); - } - - /** - * Builds an {@link SegmentMean} operation - * - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s - * @return a new instance of SegmentMean - * @see org.tensorflow.op.math.SegmentMean + * @return a new instance of Round + * @see org.tensorflow.op.math.Round */ - public SegmentMean segmentMean(Operand data, Operand segmentIds) { - return SegmentMean.create(scope, data, segmentIds); + public Round round(Operand x) { + return Round.create(scope, x); } /** - * Builds an {@link Atan} operation + * Builds an {@link IsInf} operation * * @param x - * @return a new instance of Atan - * @see org.tensorflow.op.math.Atan + * @return a new instance of IsInf + * @see org.tensorflow.op.math.IsInf */ - public Atan atan(Operand x) { - return Atan.create(scope, x); + public IsInf isInf(Operand x) { + return IsInf.create(scope, x); } /** - * Builds an {@link TruncateMod} operation + * Builds an {@link LessEqual} operation * * @param x * @param y - * @return a new instance of TruncateMod - * @see org.tensorflow.op.math.TruncateMod + * @return a new instance of LessEqual + * @see org.tensorflow.op.math.LessEqual */ - public TruncateMod truncateMod(Operand x, Operand y) { - return TruncateMod.create(scope, x, y); + public LessEqual lessEqual(Operand x, Operand y) { + return LessEqual.create(scope, x, y); } /** - * Builds an {@link Acos} operation + * Builds an {@link BesselI1e} operation * * @param x - * @return a new instance of Acos - * @see org.tensorflow.op.math.Acos + * @return a new instance of BesselI1e + * @see org.tensorflow.op.math.BesselI1e */ - public Acos acos(Operand x) { - return Acos.create(scope, x); + public BesselI1e besselI1e(Operand x) { + return BesselI1e.create(scope, x); } /** - * Builds an {@link Xlogy} operation + * Builds an {@link Atanh} operation * * @param x - * @param y - * @return a new instance of Xlogy - * @see org.tensorflow.op.math.Xlogy - */ - public Xlogy xlogy(Operand x, Operand y) { - return Xlogy.create(scope, x, y); - } - - /** - * Builds an {@link UnsortedSegmentSum} operation - * - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments - * @return a new instance of UnsortedSegmentSum - * @see org.tensorflow.op.math.UnsortedSegmentSum + * @return a new instance of Atanh + * @see org.tensorflow.op.math.Atanh */ - public UnsortedSegmentSum unsortedSegmentSum( - Operand data, Operand segmentIds, Operand numSegments) { - return UnsortedSegmentSum.create(scope, data, segmentIds, numSegments); + public Atanh atanh(Operand x) { + return Atanh.create(scope, x); } /** - * Builds an {@link Tan} operation + * Builds an {@link Ceil} operation * * @param x - * @return a new instance of Tan - * @see org.tensorflow.op.math.Tan + * @return a new instance of Ceil + * @see org.tensorflow.op.math.Ceil */ - public Tan tan(Operand x) { - return Tan.create(scope, x); + public Ceil ceil(Operand x) { + return Ceil.create(scope, x); } /** - * Builds an {@link Betainc} operation + * Builds an {@link Atan2} operation * - * @param a - * @param b + * @param y * @param x - * @return a new instance of Betainc - * @see org.tensorflow.op.math.Betainc - */ - public Betainc betainc(Operand a, Operand b, Operand x) { - return Betainc.create(scope, a, b, x); - } - - /** - * Builds an {@link UnsortedSegmentProd} operation - * - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments - * @return a new instance of UnsortedSegmentProd - * @see org.tensorflow.op.math.UnsortedSegmentProd + * @return a new instance of Atan2 + * @see org.tensorflow.op.math.Atan2 */ - public UnsortedSegmentProd unsortedSegmentProd( - Operand data, Operand segmentIds, Operand numSegments) { - return UnsortedSegmentProd.create(scope, data, segmentIds, numSegments); + public Atan2 atan2(Operand y, Operand x) { + return Atan2.create(scope, y, x); } /** - * Builds an {@link Igamma} operation + * Builds an {@link ArgMin} operation * - * @param a - * @param x - * @return a new instance of Igamma - * @see org.tensorflow.op.math.Igamma + * @param input + * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @param outputType + * @return a new instance of ArgMin + * @see org.tensorflow.op.math.ArgMin */ - public Igamma igamma(Operand a, Operand x) { - return Igamma.create(scope, a, x); + public ArgMin argMin(Operand input, + Operand dimension, DataType outputType) { + return ArgMin.create(scope, input, dimension, outputType); } /** - * Builds an {@link Xdivy} operation + * Builds an {@link Sign} operation * * @param x - * @param y - * @return a new instance of Xdivy - * @see org.tensorflow.op.math.Xdivy + * @return a new instance of Sign + * @see org.tensorflow.op.math.Sign */ - public Xdivy xdivy(Operand x, Operand y) { - return Xdivy.create(scope, x, y); + public Sign sign(Operand x) { + return Sign.create(scope, x); } /** - * Builds an {@link Ceil} operation + * Builds an {@link Exp} operation * * @param x - * @return a new instance of Ceil - * @see org.tensorflow.op.math.Ceil + * @return a new instance of Exp + * @see org.tensorflow.op.math.Exp */ - public Ceil ceil(Operand x) { - return Ceil.create(scope, x); + public Exp exp(Operand x) { + return Exp.create(scope, x); } /** - * Builds an {@link ComplexAbs} operation + * Builds an {@link Angle} operation * - * @param x + * @param input * @param Tout - * @return a new instance of ComplexAbs - * @see org.tensorflow.op.math.ComplexAbs + * @return a new instance of Angle + * @see org.tensorflow.op.math.Angle */ - public ComplexAbs complexAbs(Operand x, Class Tout) { - return ComplexAbs.create(scope, x, Tout); + public Angle angle(Operand input, DataType Tout) { + return Angle.create(scope, input, Tout); } /** - * Builds an {@link BesselI0e} operation + * Builds an {@link Add} operation * * @param x - * @return a new instance of BesselI0e - * @see org.tensorflow.op.math.BesselI0e + * @param y + * @return a new instance of Add + * @see org.tensorflow.op.math.Add */ - public BesselI0e besselI0e(Operand x) { - return BesselI0e.create(scope, x); + public Add add(Operand x, Operand y) { + return Add.create(scope, x, y); } /** @@ -420,286 +362,314 @@ public BesselI0e besselI0e(Operand x) { * @return a new instance of Log * @see org.tensorflow.op.math.Log */ - public Log log(Operand x) { + public Log log(Operand x) { return Log.create(scope, x); } /** - * Builds an {@link Sqrt} operation + * Builds an {@link UnsortedSegmentMin} operation * - * @param x - * @return a new instance of Sqrt - * @see org.tensorflow.op.math.Sqrt + * @param data + * @param segmentIds A tensor whose shape is a prefix of `data.shape`. + * @param numSegments + * @return a new instance of UnsortedSegmentMin + * @see org.tensorflow.op.math.UnsortedSegmentMin */ - public Sqrt sqrt(Operand x) { - return Sqrt.create(scope, x); + public UnsortedSegmentMin unsortedSegmentMin( + Operand data, Operand segmentIds, Operand numSegments) { + return UnsortedSegmentMin.create(scope, data, segmentIds, numSegments); } /** - * Builds an {@link InvertPermutation} operation + * Builds an {@link SquaredDifference} operation * - * @param x 1-D. - * @return a new instance of InvertPermutation - * @see org.tensorflow.op.math.InvertPermutation + * @param x + * @param y + * @return a new instance of SquaredDifference + * @see org.tensorflow.op.math.SquaredDifference */ - public InvertPermutation invertPermutation(Operand x) { - return InvertPermutation.create(scope, x); + public SquaredDifference squaredDifference(Operand x, Operand y) { + return SquaredDifference.create(scope, x, y); } /** - * Builds an {@link GreaterEqual} operation + * Builds an {@link NotEqual} operation * * @param x * @param y - * @return a new instance of GreaterEqual - * @see org.tensorflow.op.math.GreaterEqual + * @param options carries optional attributes values + * @return a new instance of NotEqual + * @see org.tensorflow.op.math.NotEqual */ - public GreaterEqual greaterEqual(Operand x, Operand y) { - return GreaterEqual.create(scope, x, y); + public NotEqual notEqual(Operand x, Operand y, + NotEqual.Options... options) { + return NotEqual.create(scope, x, y, options); } /** - * Builds an {@link BesselI1e} operation + * Builds an {@link Cumprod} operation * - * @param x - * @return a new instance of BesselI1e - * @see org.tensorflow.op.math.BesselI1e + * @param x A `Tensor`. Must be one of the following types: `float32`, `float64`, + * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range + * @param options carries optional attributes values + * @return a new instance of Cumprod + * @see org.tensorflow.op.math.Cumprod */ - public BesselI1e besselI1e(Operand x) { - return BesselI1e.create(scope, x); + public Cumprod cumprod(Operand x, Operand axis, + Cumprod.Options... options) { + return Cumprod.create(scope, x, axis, options); } /** - * Builds an {@link FloorDiv} operation + * Builds an {@link DivNoNan} operation * * @param x * @param y - * @return a new instance of FloorDiv - * @see org.tensorflow.op.math.FloorDiv + * @return a new instance of DivNoNan + * @see org.tensorflow.op.math.DivNoNan */ - public FloorDiv floorDiv(Operand x, Operand y) { - return FloorDiv.create(scope, x, y); + public DivNoNan divNoNan(Operand x, Operand y) { + return DivNoNan.create(scope, x, y); } /** - * Builds an {@link Angle} operation + * Builds an {@link Atan} operation + * + * @param x + * @return a new instance of Atan + * @see org.tensorflow.op.math.Atan + */ + public Atan atan(Operand x) { + return Atan.create(scope, x); + } + + /** + * Builds an {@link ArgMax} operation * * @param input - * @return a new instance of Angle - * @see org.tensorflow.op.math.Angle + * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @return a new instance of ArgMax + * @see org.tensorflow.op.math.ArgMax */ - public Angle angle(Operand input) { - return Angle.create(scope, input); + public ArgMax argMax(Operand input, + Operand dimension) { + return ArgMax.create(scope, input, dimension); } /** - * Builds an {@link RealDiv} operation + * Builds an {@link Maximum} operation * * @param x * @param y - * @return a new instance of RealDiv - * @see org.tensorflow.op.math.RealDiv + * @return a new instance of Maximum + * @see org.tensorflow.op.math.Maximum */ - public RealDiv realDiv(Operand x, Operand y) { - return RealDiv.create(scope, x, y); + public Maximum maximum(Operand x, Operand y) { + return Maximum.create(scope, x, y); } /** - * Builds an {@link QuantizedMul} operation + * Builds an {@link ArgMax} operation * - * @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 - * @return a new instance of QuantizedMul - * @see org.tensorflow.op.math.QuantizedMul + * @param input + * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @param outputType + * @return a new instance of ArgMax + * @see org.tensorflow.op.math.ArgMax */ - public QuantizedMul quantizedMul(Operand x, Operand y, Operand minX, - Operand maxX, Operand minY, Operand maxY, Class Toutput) { - return QuantizedMul.create(scope, x, y, minX, maxX, minY, maxY, Toutput); + public ArgMax argMax(Operand input, + Operand dimension, DataType outputType) { + return ArgMax.create(scope, input, dimension, outputType); } /** - * Builds an {@link IsInf} operation + * Builds an {@link UnsortedSegmentProd} operation * - * @param x - * @return a new instance of IsInf - * @see org.tensorflow.op.math.IsInf + * @param data + * @param segmentIds A tensor whose shape is a prefix of `data.shape`. + * @param numSegments + * @return a new instance of UnsortedSegmentProd + * @see org.tensorflow.op.math.UnsortedSegmentProd */ - public IsInf isInf(Operand x) { - return IsInf.create(scope, x); + public UnsortedSegmentProd unsortedSegmentProd( + Operand data, Operand segmentIds, Operand numSegments) { + return UnsortedSegmentProd.create(scope, data, segmentIds, numSegments); } /** - * Builds an {@link Angle} operation + * Builds an {@link LogicalNot} operation * - * @param input - * @param Tout - * @return a new instance of Angle - * @see org.tensorflow.op.math.Angle + * @param x + * @return a new instance of LogicalNot + * @see org.tensorflow.op.math.LogicalNot */ - public Angle angle(Operand input, Class Tout) { - return Angle.create(scope, input, Tout); + public LogicalNot logicalNot(Operand x) { + return LogicalNot.create(scope, x); } /** * Builds an {@link Real} operation * * @param input - * @param Tout * @return a new instance of Real * @see org.tensorflow.op.math.Real */ - public Real real(Operand input, Class Tout) { - return Real.create(scope, input, Tout); + public Real real(Operand input) { + return Real.create(scope, input); } /** - * Builds an {@link Acosh} operation + * Builds an {@link Cos} operation * * @param x - * @return a new instance of Acosh - * @see org.tensorflow.op.math.Acosh + * @return a new instance of Cos + * @see org.tensorflow.op.math.Cos */ - public Acosh acosh(Operand x) { - return Acosh.create(scope, x); + public Cos cos(Operand x) { + return Cos.create(scope, x); } /** - * Builds an {@link Mod} operation + * Builds an {@link Greater} operation * * @param x * @param y - * @return a new instance of Mod - * @see org.tensorflow.op.math.Mod + * @return a new instance of Greater + * @see org.tensorflow.op.math.Greater */ - public Mod mod(Operand x, Operand y) { - return Mod.create(scope, x, y); + public Greater greater(Operand x, Operand y) { + return Greater.create(scope, x, y); } /** - * Builds an {@link LessEqual} operation + * Builds an {@link TruncateDiv} operation * * @param x * @param y - * @return a new instance of LessEqual - * @see org.tensorflow.op.math.LessEqual + * @return a new instance of TruncateDiv + * @see org.tensorflow.op.math.TruncateDiv */ - public LessEqual lessEqual(Operand x, Operand y) { - return LessEqual.create(scope, x, y); + public TruncateDiv truncateDiv(Operand x, Operand y) { + return TruncateDiv.create(scope, x, y); } /** - * Builds an {@link Sigmoid} operation + * Builds an {@link CheckNumerics} operation + * + * @param tensor + * @param message Prefix of the error message. + * @return a new instance of CheckNumerics + * @see org.tensorflow.op.math.CheckNumerics + */ + public CheckNumerics checkNumerics(Operand tensor, String message) { + return CheckNumerics.create(scope, tensor, message); + } + + /** + * Builds an {@link Minimum} operation * * @param x - * @return a new instance of Sigmoid - * @see org.tensorflow.op.math.Sigmoid + * @param y + * @return a new instance of Minimum + * @see org.tensorflow.op.math.Minimum */ - public Sigmoid sigmoid(Operand x) { - return Sigmoid.create(scope, x); + public Minimum minimum(Operand x, Operand y) { + return Minimum.create(scope, x, y); } /** - * Builds an {@link ArgMax} operation + * Builds an {@link Div} operation * - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. - * @param outputType - * @return a new instance of ArgMax - * @see org.tensorflow.op.math.ArgMax + * @param x + * @param y + * @return a new instance of Div + * @see org.tensorflow.op.math.Div */ - public ArgMax argMax(Operand input, - Operand dimension, Class outputType) { - return ArgMax.create(scope, input, dimension, outputType); + public Div div(Operand x, Operand y) { + return Div.create(scope, x, y); } /** - * Builds an {@link Rint} operation + * Builds an {@link Digamma} operation * * @param x - * @return a new instance of Rint - * @see org.tensorflow.op.math.Rint + * @return a new instance of Digamma + * @see org.tensorflow.op.math.Digamma */ - public Rint rint(Operand x) { - return Rint.create(scope, x); + public Digamma digamma(Operand x) { + return Digamma.create(scope, x); } /** - * Builds an {@link Cumprod} operation + * Builds an {@link Mean} operation * - * @param x A `Tensor`. Must be one of the following types: `float32`, `float64`, - * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range * @param options carries optional attributes values - * @return a new instance of Cumprod - * @see org.tensorflow.op.math.Cumprod + * @return a new instance of Mean + * @see org.tensorflow.op.math.Mean */ - public Cumprod cumprod(Operand x, Operand axis, - Cumprod.Options... options) { - return Cumprod.create(scope, x, axis, options); + public Mean mean(Operand input, Operand axis, + Mean.Options... options) { + return Mean.create(scope, input, axis, options); } /** - * Builds an {@link LogicalAnd} operation + * Builds an {@link Betainc} operation * + * @param a + * @param b * @param x - * @param y - * @return a new instance of LogicalAnd - * @see org.tensorflow.op.math.LogicalAnd + * @return a new instance of Betainc + * @see org.tensorflow.op.math.Betainc */ - public LogicalAnd logicalAnd(Operand x, Operand y) { - return LogicalAnd.create(scope, x, y); + public Betainc betainc(Operand a, Operand b, Operand x) { + return Betainc.create(scope, a, b, x); } /** - * Builds an {@link Sin} operation + * Builds an {@link Real} operation * - * @param x - * @return a new instance of Sin - * @see org.tensorflow.op.math.Sin + * @param input + * @param Tout + * @return a new instance of Real + * @see org.tensorflow.op.math.Real */ - public Sin sin(Operand x) { - return Sin.create(scope, x); + public Real real(Operand input, DataType Tout) { + return Real.create(scope, input, Tout); } /** - * Builds an {@link Erf} operation + * Builds an {@link Asin} operation * * @param x - * @return a new instance of Erf - * @see org.tensorflow.op.math.Erf + * @return a new instance of Asin + * @see org.tensorflow.op.math.Asin */ - public Erf erf(Operand x) { - return Erf.create(scope, x); + public Asin asin(Operand x) { + return Asin.create(scope, x); } /** - * Builds an {@link Igammac} operation + * Builds an {@link Log1p} operation * - * @param a * @param x - * @return a new instance of Igammac - * @see org.tensorflow.op.math.Igammac + * @return a new instance of Log1p + * @see org.tensorflow.op.math.Log1p */ - public Igammac igammac(Operand a, Operand x) { - return Igammac.create(scope, a, x); + public Log1p log1p(Operand x) { + return Log1p.create(scope, x); } /** - * Builds an {@link ApproximateEqual} operation + * Builds an {@link Conj} operation * - * @param x - * @param y - * @param options carries optional attributes values - * @return a new instance of ApproximateEqual - * @see org.tensorflow.op.math.ApproximateEqual + * @param input + * @return a new instance of Conj + * @see org.tensorflow.op.math.Conj */ - public ApproximateEqual approximateEqual(Operand x, Operand y, - ApproximateEqual.Options... options) { - return ApproximateEqual.create(scope, x, y, options); + public Conj conj(Operand input) { + return Conj.create(scope, input); } /** @@ -709,316 +679,349 @@ public ApproximateEqual approximateEqual(Operand x, Operand y, * @return a new instance of Imag * @see org.tensorflow.op.math.Imag */ - public Imag imag(Operand input) { + public Imag imag(Operand input) { return Imag.create(scope, input); } /** - * Builds an {@link FloorMod} operation + * Builds an {@link Mul} operation * * @param x * @param y - * @return a new instance of FloorMod - * @see org.tensorflow.op.math.FloorMod + * @return a new instance of Mul + * @see org.tensorflow.op.math.Mul */ - public FloorMod floorMod(Operand x, Operand y) { - return FloorMod.create(scope, x, y); + public Mul mul(Operand x, Operand y) { + return Mul.create(scope, x, y); } /** - * Builds an {@link Maximum} operation + * Builds an {@link Rsqrt} operation * * @param x - * @param y - * @return a new instance of Maximum - * @see org.tensorflow.op.math.Maximum + * @return a new instance of Rsqrt + * @see org.tensorflow.op.math.Rsqrt */ - public Maximum maximum(Operand x, Operand y) { - return Maximum.create(scope, x, y); + public Rsqrt rsqrt(Operand x) { + return Rsqrt.create(scope, x); } /** - * Builds an {@link NotEqual} operation + * Builds an {@link Tanh} operation * * @param x - * @param y + * @return a new instance of Tanh + * @see org.tensorflow.op.math.Tanh + */ + public Tanh tanh(Operand x) { + return Tanh.create(scope, x); + } + + /** + * Builds an {@link Cumsum} operation + * + * @param x A `Tensor`. Must be one of the following types: `float32`, `float64`, + * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range * @param options carries optional attributes values - * @return a new instance of NotEqual - * @see org.tensorflow.op.math.NotEqual + * @return a new instance of Cumsum + * @see org.tensorflow.op.math.Cumsum */ - public NotEqual notEqual(Operand x, Operand y, NotEqual.Options... options) { - return NotEqual.create(scope, x, y, options); + public Cumsum cumsum(Operand x, Operand axis, + Cumsum.Options... options) { + return Cumsum.create(scope, x, axis, options); } /** - * Builds an {@link Expm1} operation + * Builds an {@link Xlogy} operation * * @param x - * @return a new instance of Expm1 - * @see org.tensorflow.op.math.Expm1 + * @param y + * @return a new instance of Xlogy + * @see org.tensorflow.op.math.Xlogy */ - public Expm1 expm1(Operand x) { - return Expm1.create(scope, x); + public Xlogy xlogy(Operand x, Operand y) { + return Xlogy.create(scope, x, y); } /** - * Builds an {@link IsFinite} operation + * Builds an {@link Mod} operation * * @param x - * @return a new instance of IsFinite - * @see org.tensorflow.op.math.IsFinite + * @param y + * @return a new instance of Mod + * @see org.tensorflow.op.math.Mod */ - public IsFinite isFinite(Operand x) { - return IsFinite.create(scope, x); + public Mod mod(Operand x, Operand y) { + return Mod.create(scope, x, y); } /** - * Builds an {@link QuantizedAdd} operation + * Builds an {@link Expm1} operation * * @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 - * @return a new instance of QuantizedAdd - * @see org.tensorflow.op.math.QuantizedAdd + * @return a new instance of Expm1 + * @see org.tensorflow.op.math.Expm1 + */ + public Expm1 expm1(Operand x) { + return Expm1.create(scope, x); + } + + /** + * Builds an {@link UnsortedSegmentSum} operation + * + * @param data + * @param segmentIds A tensor whose shape is a prefix of `data.shape`. + * @param numSegments + * @return a new instance of UnsortedSegmentSum + * @see org.tensorflow.op.math.UnsortedSegmentSum */ - public QuantizedAdd quantizedAdd(Operand x, Operand y, Operand minX, - Operand maxX, Operand minY, Operand maxY, Class Toutput) { - return QuantizedAdd.create(scope, x, y, minX, maxX, minY, maxY, Toutput); + public UnsortedSegmentSum unsortedSegmentSum( + Operand data, Operand segmentIds, Operand numSegments) { + return UnsortedSegmentSum.create(scope, data, segmentIds, numSegments); } /** - * Builds an {@link Log1p} operation + * Builds an {@link SegmentMax} operation * - * @param x - * @return a new instance of Log1p - * @see org.tensorflow.op.math.Log1p + * @param data + * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @return a new instance of SegmentMax + * @see org.tensorflow.op.math.SegmentMax */ - public Log1p log1p(Operand x) { - return Log1p.create(scope, x); + public SegmentMax segmentMax(Operand data, + Operand segmentIds) { + return SegmentMax.create(scope, data, segmentIds); } /** - * Builds an {@link Exp} operation + * Builds an {@link Less} operation * * @param x - * @return a new instance of Exp - * @see org.tensorflow.op.math.Exp + * @param y + * @return a new instance of Less + * @see org.tensorflow.op.math.Less */ - public Exp exp(Operand x) { - return Exp.create(scope, x); + public Less less(Operand x, Operand y) { + return Less.create(scope, x, y); } /** - * Builds an {@link Erfc} operation + * Builds an {@link FloorDiv} operation * * @param x - * @return a new instance of Erfc - * @see org.tensorflow.op.math.Erfc + * @param y + * @return a new instance of FloorDiv + * @see org.tensorflow.op.math.FloorDiv */ - public Erfc erfc(Operand x) { - return Erfc.create(scope, x); + public FloorDiv floorDiv(Operand x, Operand y) { + return FloorDiv.create(scope, x, y); } /** - * Builds an {@link SquaredDifference} operation + * Builds an {@link LogicalOr} operation * * @param x * @param y - * @return a new instance of SquaredDifference - * @see org.tensorflow.op.math.SquaredDifference + * @return a new instance of LogicalOr + * @see org.tensorflow.op.math.LogicalOr */ - public SquaredDifference squaredDifference(Operand x, Operand y) { - return SquaredDifference.create(scope, x, y); + public LogicalOr logicalOr(Operand x, Operand y) { + return LogicalOr.create(scope, x, y); } /** - * Builds an {@link Softplus} operation + * Builds an {@link Neg} operation * - * @param features - * @return a new instance of Softplus - * @see org.tensorflow.op.math.Softplus + * @param x + * @return a new instance of Neg + * @see org.tensorflow.op.math.Neg */ - public Softplus softplus(Operand features) { - return Softplus.create(scope, features); + public Neg neg(Operand x) { + return Neg.create(scope, x); } /** - * Builds an {@link CompareAndBitpack} operation + * Builds an {@link FloorMod} operation * - * @param input Values to compare against `threshold` and bitpack. - * @param threshold Threshold to compare against. - * @return a new instance of CompareAndBitpack - * @see org.tensorflow.op.math.CompareAndBitpack + * @param x + * @param y + * @return a new instance of FloorMod + * @see org.tensorflow.op.math.FloorMod */ - public CompareAndBitpack compareAndBitpack(Operand input, Operand threshold) { - return CompareAndBitpack.create(scope, input, threshold); + public FloorMod floorMod(Operand x, Operand y) { + return FloorMod.create(scope, x, y); } /** - * Builds an {@link IsNan} operation + * Builds an {@link QuantizedMul} operation * * @param x - * @return a new instance of IsNan - * @see org.tensorflow.op.math.IsNan + * @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 + * @return a new instance of QuantizedMul + * @see org.tensorflow.op.math.QuantizedMul */ - public IsNan isNan(Operand x) { - return IsNan.create(scope, x); + public QuantizedMul quantizedMul( + Operand x, Operand y, Operand minX, Operand maxX, Operand minY, + Operand maxY, DataType Toutput) { + return QuantizedMul.create(scope, x, y, minX, maxX, minY, maxY, Toutput); } /** - * Builds an {@link Floor} operation + * Builds an {@link Acos} operation * * @param x - * @return a new instance of Floor - * @see org.tensorflow.op.math.Floor + * @return a new instance of Acos + * @see org.tensorflow.op.math.Acos */ - public Floor floor(Operand x) { - return Floor.create(scope, x); + public Acos acos(Operand x) { + return Acos.create(scope, x); } /** - * Builds an {@link Sub} operation + * Builds an {@link Igammac} operation * + * @param a * @param x - * @param y - * @return a new instance of Sub - * @see org.tensorflow.op.math.Sub + * @return a new instance of Igammac + * @see org.tensorflow.op.math.Igammac */ - public Sub sub(Operand x, Operand y) { - return Sub.create(scope, x, y); + public Igammac igammac(Operand a, Operand x) { + return Igammac.create(scope, a, x); } /** - * Builds an {@link Asin} operation + * Builds an {@link Angle} operation * - * @param x - * @return a new instance of Asin - * @see org.tensorflow.op.math.Asin + * @param input + * @return a new instance of Angle + * @see org.tensorflow.op.math.Angle */ - public Asin asin(Operand x) { - return Asin.create(scope, x); + public Angle angle(Operand input) { + return Angle.create(scope, input); } /** - * Builds an {@link Round} operation + * Builds an {@link ApproximateEqual} operation * * @param x - * @return a new instance of Round - * @see org.tensorflow.op.math.Round + * @param y + * @param options carries optional attributes values + * @return a new instance of ApproximateEqual + * @see org.tensorflow.op.math.ApproximateEqual */ - public Round round(Operand x) { - return Round.create(scope, x); + public ApproximateEqual approximateEqual(Operand x, Operand y, + ApproximateEqual.Options... options) { + return ApproximateEqual.create(scope, x, y, options); } /** - * Builds an {@link SegmentMin} operation + * Builds an {@link SegmentMean} operation * * @param data * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s - * @return a new instance of SegmentMin - * @see org.tensorflow.op.math.SegmentMin + * @return a new instance of SegmentMean + * @see org.tensorflow.op.math.SegmentMean */ - public SegmentMin segmentMin(Operand data, + public SegmentMean segmentMean(Operand data, Operand segmentIds) { - return SegmentMin.create(scope, data, segmentIds); + return SegmentMean.create(scope, data, segmentIds); } /** - * Builds an {@link Atan2} operation + * Builds an {@link Lgamma} operation * - * @param y * @param x - * @return a new instance of Atan2 - * @see org.tensorflow.op.math.Atan2 + * @return a new instance of Lgamma + * @see org.tensorflow.op.math.Lgamma */ - public Atan2 atan2(Operand y, Operand x) { - return Atan2.create(scope, y, x); + public Lgamma lgamma(Operand x) { + return Lgamma.create(scope, x); } /** - * Builds an {@link SegmentProd} operation + * Builds an {@link Sqrt} operation * - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s - * @return a new instance of SegmentProd - * @see org.tensorflow.op.math.SegmentProd + * @param x + * @return a new instance of Sqrt + * @see org.tensorflow.op.math.Sqrt */ - public SegmentProd segmentProd(Operand data, Operand segmentIds) { - return SegmentProd.create(scope, data, segmentIds); + public Sqrt sqrt(Operand x) { + return Sqrt.create(scope, x); } /** - * Builds an {@link Sign} operation + * Builds an {@link IsNan} operation * * @param x - * @return a new instance of Sign - * @see org.tensorflow.op.math.Sign + * @return a new instance of IsNan + * @see org.tensorflow.op.math.IsNan */ - public Sign sign(Operand x) { - return Sign.create(scope, x); + public IsNan isNan(Operand x) { + return IsNan.create(scope, x); } /** - * Builds an {@link ComplexAbs} operation + * Builds an {@link Equal} operation * * @param x - * @return a new instance of ComplexAbs - * @see org.tensorflow.op.math.ComplexAbs + * @param y + * @param options carries optional attributes values + * @return a new instance of Equal + * @see org.tensorflow.op.math.Equal */ - public ComplexAbs complexAbs(Operand x) { - return ComplexAbs.create(scope, x); + public Equal equal(Operand x, Operand y, Equal.Options... options) { + return Equal.create(scope, x, y, options); } /** - * Builds an {@link SegmentSum} operation + * Builds an {@link Erf} operation * - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s - * @return a new instance of SegmentSum - * @see org.tensorflow.op.math.SegmentSum + * @param x + * @return a new instance of Erf + * @see org.tensorflow.op.math.Erf */ - public SegmentSum segmentSum(Operand data, Operand segmentIds) { - return SegmentSum.create(scope, data, segmentIds); + public Erf erf(Operand x) { + return Erf.create(scope, x); } /** - * Builds an {@link Div} operation + * Builds an {@link LogicalAnd} operation * * @param x * @param y - * @return a new instance of Div - * @see org.tensorflow.op.math.Div + * @return a new instance of LogicalAnd + * @see org.tensorflow.op.math.LogicalAnd */ - public Div div(Operand x, Operand y) { - return Div.create(scope, x, y); + public LogicalAnd logicalAnd(Operand x, Operand y) { + return LogicalAnd.create(scope, x, y); } /** - * Builds an {@link Pow} operation + * Builds an {@link Square} operation * * @param x - * @param y - * @return a new instance of Pow - * @see org.tensorflow.op.math.Pow + * @return a new instance of Square + * @see org.tensorflow.op.math.Square */ - public Pow pow(Operand x, Operand y) { - return Pow.create(scope, x, y); + public Square square(Operand x) { + return Square.create(scope, x); } /** - * Builds an {@link Less} operation + * Builds an {@link Sub} operation * * @param x * @param y - * @return a new instance of Less - * @see org.tensorflow.op.math.Less + * @return a new instance of Sub + * @see org.tensorflow.op.math.Sub */ - public Less less(Operand x, Operand y) { - return Less.create(scope, x, y); + public Sub sub(Operand x, Operand y) { + return Sub.create(scope, x, y); } /** @@ -1029,32 +1032,44 @@ public Less less(Operand x, Operand y) { * @return a new instance of AccumulateN * @see org.tensorflow.op.math.AccumulateN */ - public AccumulateN accumulateN(Iterable> inputs, Shape shape) { + public AccumulateN accumulateN(Iterable> inputs, Shape shape) { return AccumulateN.create(scope, inputs, shape); } /** - * Builds an {@link Zeta} operation + * Builds an {@link UnsortedSegmentMax} operation * - * @param x - * @param q - * @return a new instance of Zeta - * @see org.tensorflow.op.math.Zeta + * @param data + * @param segmentIds A tensor whose shape is a prefix of `data.shape`. + * @param numSegments + * @return a new instance of UnsortedSegmentMax + * @see org.tensorflow.op.math.UnsortedSegmentMax */ - public Zeta zeta(Operand x, Operand q) { - return Zeta.create(scope, x, q); + public UnsortedSegmentMax unsortedSegmentMax( + Operand data, Operand segmentIds, Operand numSegments) { + return UnsortedSegmentMax.create(scope, data, segmentIds, numSegments); } /** - * Builds an {@link ArgMin} operation + * Builds an {@link InvertPermutation} operation * - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. - * @return a new instance of ArgMin - * @see org.tensorflow.op.math.ArgMin + * @param x 1-D. + * @return a new instance of InvertPermutation + * @see org.tensorflow.op.math.InvertPermutation */ - public ArgMin argMin(Operand input, Operand dimension) { - return ArgMin.create(scope, input, dimension); + public InvertPermutation invertPermutation(Operand x) { + return InvertPermutation.create(scope, x); + } + + /** + * Builds an {@link IsFinite} operation + * + * @param x + * @return a new instance of IsFinite + * @see org.tensorflow.op.math.IsFinite + */ + public IsFinite isFinite(Operand x) { + return IsFinite.create(scope, x); } /** @@ -1064,32 +1079,56 @@ public ArgMin argMin(Operand input, Operand di * @return a new instance of Abs * @see org.tensorflow.op.math.Abs */ - public Abs abs(Operand x) { + public Abs abs(Operand x) { return Abs.create(scope, x); } /** - * Builds an {@link Polygamma} operation + * Builds an {@link TruncateMod} operation + * + * @param x + * @param y + * @return a new instance of TruncateMod + * @see org.tensorflow.op.math.TruncateMod + */ + public TruncateMod truncateMod(Operand x, Operand y) { + return TruncateMod.create(scope, x, y); + } + + /** + * Builds an {@link SegmentProd} operation + * + * @param data + * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @return a new instance of SegmentProd + * @see org.tensorflow.op.math.SegmentProd + */ + public SegmentProd segmentProd(Operand data, + Operand segmentIds) { + return SegmentProd.create(scope, data, segmentIds); + } + + /** + * Builds an {@link AddN} operation * - * @param a - * @param x - * @return a new instance of Polygamma - * @see org.tensorflow.op.math.Polygamma + * @param inputs + * @return a new instance of AddN + * @see org.tensorflow.op.math.AddN */ - public Polygamma polygamma(Operand a, Operand x) { - return Polygamma.create(scope, a, x); + public AddN addN(Iterable> inputs) { + return AddN.create(scope, inputs); } /** - * Builds an {@link DivNoNan} operation + * Builds an {@link RealDiv} operation * * @param x * @param y - * @return a new instance of DivNoNan - * @see org.tensorflow.op.math.DivNoNan + * @return a new instance of RealDiv + * @see org.tensorflow.op.math.RealDiv */ - public DivNoNan divNoNan(Operand x, Operand y) { - return DivNoNan.create(scope, x, y); + public RealDiv realDiv(Operand x, Operand y) { + return RealDiv.create(scope, x, y); } /** @@ -1099,84 +1138,73 @@ public DivNoNan divNoNan(Operand x, Operand y) { * @return a new instance of Sinh * @see org.tensorflow.op.math.Sinh */ - public Sinh sinh(Operand x) { + public Sinh sinh(Operand x) { return Sinh.create(scope, x); } /** - * Builds an {@link Rsqrt} operation + * Builds an {@link ComplexAbs} operation * * @param x - * @return a new instance of Rsqrt - * @see org.tensorflow.op.math.Rsqrt + * @return a new instance of ComplexAbs + * @see org.tensorflow.op.math.ComplexAbs */ - public Rsqrt rsqrt(Operand x) { - return Rsqrt.create(scope, x); + public ComplexAbs complexAbs(Operand x) { + return ComplexAbs.create(scope, x); } /** - * Builds an {@link Minimum} operation + * Builds an {@link QuantizedAdd} operation * * @param x * @param y - * @return a new instance of Minimum - * @see org.tensorflow.op.math.Minimum + * @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 + * @return a new instance of QuantizedAdd + * @see org.tensorflow.op.math.QuantizedAdd */ - public Minimum minimum(Operand x, Operand y) { - return Minimum.create(scope, x, y); + public QuantizedAdd quantizedAdd( + Operand x, Operand y, Operand minX, Operand maxX, Operand minY, + Operand maxY, DataType Toutput) { + return QuantizedAdd.create(scope, x, y, minX, maxX, minY, maxY, Toutput); } /** - * Builds an {@link Lgamma} operation + * Builds an {@link Acosh} operation * * @param x - * @return a new instance of Lgamma - * @see org.tensorflow.op.math.Lgamma - */ - public Lgamma lgamma(Operand x) { - return Lgamma.create(scope, x); - } - - /** - * Builds an {@link ArgMin} operation - * - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. - * @param outputType - * @return a new instance of ArgMin - * @see org.tensorflow.op.math.ArgMin + * @return a new instance of Acosh + * @see org.tensorflow.op.math.Acosh */ - public ArgMin argMin(Operand input, - Operand dimension, Class outputType) { - return ArgMin.create(scope, input, dimension, outputType); + public Acosh acosh(Operand x) { + return Acosh.create(scope, x); } /** - * Builds an {@link UnsortedSegmentMax} operation + * Builds an {@link Floor} operation * - * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments - * @return a new instance of UnsortedSegmentMax - * @see org.tensorflow.op.math.UnsortedSegmentMax + * @param x + * @return a new instance of Floor + * @see org.tensorflow.op.math.Floor */ - public UnsortedSegmentMax unsortedSegmentMax( - Operand data, Operand segmentIds, Operand numSegments) { - return UnsortedSegmentMax.create(scope, data, segmentIds, numSegments); + public Floor floor(Operand x) { + return Floor.create(scope, x); } /** - * Builds an {@link UnsortedSegmentMin} operation + * Builds an {@link SegmentMin} operation * * @param data - * @param segmentIds A tensor whose shape is a prefix of `data.shape`. - * @param numSegments - * @return a new instance of UnsortedSegmentMin - * @see org.tensorflow.op.math.UnsortedSegmentMin + * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @return a new instance of SegmentMin + * @see org.tensorflow.op.math.SegmentMin */ - public UnsortedSegmentMin unsortedSegmentMin( - Operand data, Operand segmentIds, Operand numSegments) { - return UnsortedSegmentMin.create(scope, data, segmentIds, numSegments); + public SegmentMin segmentMin(Operand data, + Operand segmentIds) { + return SegmentMin.create(scope, data, segmentIds); } /** @@ -1186,194 +1214,183 @@ public UnsortedSegmentMin * @return a new instance of PopulationCount * @see org.tensorflow.op.math.PopulationCount */ - public PopulationCount populationCount(Operand x) { + public PopulationCount populationCount(Operand x) { return PopulationCount.create(scope, x); } /** - * Builds an {@link Cumsum} operation + * Builds an {@link Softplus} operation * - * @param x A `Tensor`. Must be one of the following types: `float32`, `float64`, - * @param axis A `Tensor` of type `int32` (default: 0). Must be in the range - * @param options carries optional attributes values - * @return a new instance of Cumsum - * @see org.tensorflow.op.math.Cumsum + * @param features + * @return a new instance of Softplus + * @see org.tensorflow.op.math.Softplus */ - public Cumsum cumsum(Operand x, Operand axis, - Cumsum.Options... options) { - return Cumsum.create(scope, x, axis, options); + public Softplus softplus(Operand features) { + return Softplus.create(scope, features); } /** - * Builds an {@link Imag} operation + * Builds an {@link Asinh} operation * - * @param input - * @param Tout - * @return a new instance of Imag - * @see org.tensorflow.op.math.Imag + * @param x + * @return a new instance of Asinh + * @see org.tensorflow.op.math.Asinh */ - public Imag imag(Operand input, Class Tout) { - return Imag.create(scope, input, Tout); + public Asinh asinh(Operand x) { + return Asinh.create(scope, x); } /** - * Builds an {@link Tanh} operation + * Builds an {@link Sin} operation * * @param x - * @return a new instance of Tanh - * @see org.tensorflow.op.math.Tanh + * @return a new instance of Sin + * @see org.tensorflow.op.math.Sin */ - public Tanh tanh(Operand x) { - return Tanh.create(scope, x); + public Sin sin(Operand x) { + return Sin.create(scope, x); } /** - * Builds an {@link AddN} operation + * Builds an {@link Erfc} operation * - * @param inputs - * @return a new instance of AddN - * @see org.tensorflow.op.math.AddN + * @param x + * @return a new instance of Erfc + * @see org.tensorflow.op.math.Erfc */ - public AddN addN(Iterable> inputs) { - return AddN.create(scope, inputs); + public Erfc erfc(Operand x) { + return Erfc.create(scope, x); } /** - * Builds an {@link SegmentMax} operation + * Builds an {@link Fact} operation * - * @param data - * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s - * @return a new instance of SegmentMax - * @see org.tensorflow.op.math.SegmentMax + * @return a new instance of Fact + * @see org.tensorflow.op.math.Fact */ - public SegmentMax segmentMax(Operand data, - Operand segmentIds) { - return SegmentMax.create(scope, data, segmentIds); + public Fact fact() { + return Fact.create(scope); } /** - * Builds an {@link Cosh} operation + * Builds an {@link SegmentSum} operation * - * @param x - * @return a new instance of Cosh - * @see org.tensorflow.op.math.Cosh + * @param data + * @param segmentIds A 1-D tensor whose size is equal to the size of `data`'s + * @return a new instance of SegmentSum + * @see org.tensorflow.op.math.SegmentSum */ - public Cosh cosh(Operand x) { - return Cosh.create(scope, x); + public SegmentSum segmentSum(Operand data, + Operand segmentIds) { + return SegmentSum.create(scope, data, segmentIds); } /** - * Builds an {@link Conj} operation + * Builds an {@link Sigmoid} operation * - * @param input - * @return a new instance of Conj - * @see org.tensorflow.op.math.Conj + * @param x + * @return a new instance of Sigmoid + * @see org.tensorflow.op.math.Sigmoid */ - public Conj conj(Operand input) { - return Conj.create(scope, input); + public Sigmoid sigmoid(Operand x) { + return Sigmoid.create(scope, x); } /** - * Builds an {@link Add} operation + * Builds an {@link Xdivy} operation * * @param x * @param y - * @return a new instance of Add - * @see org.tensorflow.op.math.Add - */ - public Add add(Operand x, Operand y) { - return Add.create(scope, x, y); - } - - /** - * Builds an {@link Fact} operation - * - * @return a new instance of Fact - * @see org.tensorflow.op.math.Fact + * @return a new instance of Xdivy + * @see org.tensorflow.op.math.Xdivy */ - public Fact fact() { - return Fact.create(scope); + public Xdivy xdivy(Operand x, Operand y) { + return Xdivy.create(scope, x, y); } /** - * Builds an {@link Cos} operation + * Builds an {@link Tan} operation * * @param x - * @return a new instance of Cos - * @see org.tensorflow.op.math.Cos + * @return a new instance of Tan + * @see org.tensorflow.op.math.Tan */ - public Cos cos(Operand x) { - return Cos.create(scope, x); + public Tan tan(Operand x) { + return Tan.create(scope, x); } /** - * Builds an {@link Mean} operation + * Builds an {@link ArgMin} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range - * @param options carries optional attributes values - * @return a new instance of Mean - * @see org.tensorflow.op.math.Mean + * @param input + * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. + * @return a new instance of ArgMin + * @see org.tensorflow.op.math.ArgMin */ - public Mean mean(Operand input, Operand axis, - Mean.Options... options) { - return Mean.create(scope, input, axis, options); + public ArgMin argMin(Operand input, + Operand dimension) { + return ArgMin.create(scope, input, dimension); } /** - * Builds an {@link ArgMax} operation + * Builds an {@link CompareAndBitpack} operation * - * @param input - * @param dimension int32 or int64, must be in the range `[-rank(input), rank(input))`. - * @return a new instance of ArgMax - * @see org.tensorflow.op.math.ArgMax + * @param input Values to compare against `threshold` and bitpack. + * @param threshold Threshold to compare against. + * @return a new instance of CompareAndBitpack + * @see org.tensorflow.op.math.CompareAndBitpack */ - public ArgMax argMax(Operand input, Operand dimension) { - return ArgMax.create(scope, input, dimension); + public CompareAndBitpack compareAndBitpack(Operand input, + Operand threshold) { + return CompareAndBitpack.create(scope, input, threshold); } /** - * Builds an {@link Real} operation + * Builds an {@link GreaterEqual} operation * - * @param input - * @return a new instance of Real - * @see org.tensorflow.op.math.Real + * @param x + * @param y + * @return a new instance of GreaterEqual + * @see org.tensorflow.op.math.GreaterEqual */ - public Real real(Operand input) { - return Real.create(scope, input); + public GreaterEqual greaterEqual(Operand x, Operand y) { + return GreaterEqual.create(scope, x, y); } /** - * Builds an {@link Greater} operation + * Builds an {@link Zeta} operation * * @param x - * @param y - * @return a new instance of Greater - * @see org.tensorflow.op.math.Greater + * @param q + * @return a new instance of Zeta + * @see org.tensorflow.op.math.Zeta */ - public Greater greater(Operand x, Operand y) { - return Greater.create(scope, x, y); + public Zeta zeta(Operand x, Operand q) { + return Zeta.create(scope, x, q); } /** - * Builds an {@link Atanh} operation + * Builds an {@link ComplexAbs} operation * * @param x - * @return a new instance of Atanh - * @see org.tensorflow.op.math.Atanh + * @param Tout + * @return a new instance of ComplexAbs + * @see org.tensorflow.op.math.ComplexAbs */ - public Atanh atanh(Operand x) { - return Atanh.create(scope, x); + public ComplexAbs complexAbs(Operand x, + DataType Tout) { + return ComplexAbs.create(scope, x, Tout); } /** - * Builds an {@link Reciprocal} operation + * Builds an {@link Imag} operation * - * @param x - * @return a new instance of Reciprocal - * @see org.tensorflow.op.math.Reciprocal + * @param input + * @param Tout + * @return a new instance of Imag + * @see org.tensorflow.op.math.Imag */ - public Reciprocal reciprocal(Operand x) { - return Reciprocal.create(scope, x); + public Imag imag(Operand input, DataType Tout) { + return Imag.create(scope, input, Tout); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java index da716e4639e..b1cdb58c78d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/NnOps.java @@ -1,6 +1,7 @@ package org.tensorflow.op; import java.util.List; +import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.op.nn.AvgPool; import org.tensorflow.op.nn.AvgPool3d; @@ -72,6 +73,11 @@ import org.tensorflow.op.nn.SpaceToDepth; import org.tensorflow.op.nn.SparseSoftmaxCrossEntropyWithLogits; import org.tensorflow.op.nn.TopK; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code nn} operations as {@link Op Op}s @@ -86,86 +92,63 @@ public final class NnOps { } /** - * Builds an {@link QuantizedReluX} operation - * - * @param features - * @param maxValue - * @param minFeatures The float value that the lowest quantized value represents. - * @param maxFeatures The float value that the highest quantized value represents. - * @param outType - * @return a new instance of QuantizedReluX - * @see org.tensorflow.op.nn.QuantizedReluX - */ - public QuantizedReluX quantizedReluX(Operand features, Operand maxValue, - Operand minFeatures, Operand maxFeatures, Class outType) { - return QuantizedReluX.create(scope, features, maxValue, minFeatures, maxFeatures, outType); - } - - /** - * Builds an {@link Conv2d} operation + * Builds an {@link MaxPool} operation * - * @param input A 4-D tensor. The dimension order is interpreted according to the value - * @param filter A 4-D tensor of shape - * @param strides 1-D tensor of length 4. The stride of the sliding window for each + * @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 * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of Conv2d - * @see org.tensorflow.op.nn.Conv2d + * @return a new instance of MaxPool + * @see org.tensorflow.op.nn.MaxPool */ - public Conv2d conv2d(Operand input, Operand filter, - List strides, String padding, Conv2d.Options... options) { - return Conv2d.create(scope, input, filter, strides, padding, options); + public MaxPool maxPool(Operand input, Operand ksize, + Operand strides, String padding, MaxPool.Options... options) { + return MaxPool.create(scope, input, ksize, strides, padding, options); } /** - * Builds an {@link QuantizedAvgPool} operation + * Builds an {@link DataFormatVecPermute} operation * - * @param input 4-D with shape `[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. - * @param strides The stride of the sliding window for each dimension of the input - * @param padding The type of padding algorithm to use. - * @return a new instance of QuantizedAvgPool - * @see org.tensorflow.op.nn.QuantizedAvgPool + * @param x Vector of size 4 or Tensor of shape (4, 2) in source data format. + * @param options carries optional attributes values + * @return a new instance of DataFormatVecPermute + * @see org.tensorflow.op.nn.DataFormatVecPermute */ - public QuantizedAvgPool quantizedAvgPool(Operand input, Operand minInput, - Operand maxInput, List ksize, List strides, String padding) { - return QuantizedAvgPool.create(scope, input, minInput, maxInput, ksize, strides, padding); + public DataFormatVecPermute dataFormatVecPermute(Operand x, + DataFormatVecPermute.Options... options) { + return DataFormatVecPermute.create(scope, x, options); } /** - * Builds an {@link AvgPool3d} operation + * Builds an {@link DepthwiseConv2dNative} operation * - * @param input Shape `[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 - * @param strides 1-D tensor of length 5. The stride of the sliding window for each + * @param input + * @param filter + * @param strides 1-D of length 4. The stride of the sliding window for each dimension * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of AvgPool3d - * @see org.tensorflow.op.nn.AvgPool3d + * @return a new instance of DepthwiseConv2dNative + * @see org.tensorflow.op.nn.DepthwiseConv2dNative */ - public AvgPool3d avgPool3d(Operand input, List ksize, - List strides, String padding, AvgPool3d.Options... options) { - return AvgPool3d.create(scope, input, ksize, strides, padding, options); + public DepthwiseConv2dNative depthwiseConv2dNative(Operand input, + Operand filter, List strides, String padding, + DepthwiseConv2dNative.Options... options) { + return DepthwiseConv2dNative.create(scope, input, filter, strides, padding, options); } /** - * Builds an {@link LearnedUnigramCandidateSampler} operation + * Builds an {@link SpaceToBatch} operation * - * @param trueClasses A batch_size * num_true matrix, in which each row contains the - * @param numTrue Number of true labels per context. - * @param numSampled Number of candidates to randomly sample. - * @param unique If unique is true, we sample with rejection, so that all sampled - * @param rangeMax The sampler will sample integers from the interval [0, range_max). - * @param options carries optional attributes values - * @return a new instance of LearnedUnigramCandidateSampler - * @see org.tensorflow.op.nn.LearnedUnigramCandidateSampler + * @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 + * @param blockSize + * @return a new instance of SpaceToBatch + * @see org.tensorflow.op.nn.SpaceToBatch */ - public LearnedUnigramCandidateSampler learnedUnigramCandidateSampler(Operand trueClasses, - Long numTrue, Long numSampled, Boolean unique, Long rangeMax, - LearnedUnigramCandidateSampler.Options... options) { - return LearnedUnigramCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, rangeMax, options); + public SpaceToBatch spaceToBatch(Operand input, + Operand paddings, Long blockSize) { + return SpaceToBatch.create(scope, input, paddings, blockSize); } /** @@ -177,185 +160,120 @@ public LearnedUnigramCandidateSampler learnedUnigramCandidateSampler(Operand DepthToSpace depthToSpace(Operand input, Long blockSize, + public DepthToSpace depthToSpace(Operand input, Long blockSize, DepthToSpace.Options... options) { return DepthToSpace.create(scope, input, blockSize, options); } /** - * Builds an {@link CudnnRnnParamsSize} operation - * - * @param numLayers - * @param numUnits - * @param inputSize - * @param T - * @param S - * @param options carries optional attributes values - * @return a new instance of CudnnRnnParamsSize - * @see org.tensorflow.op.nn.CudnnRnnParamsSize - */ - public CudnnRnnParamsSize cudnnRnnParamsSize( - Operand numLayers, Operand numUnits, Operand inputSize, Class T, - Class S, CudnnRnnParamsSize.Options... options) { - return CudnnRnnParamsSize.create(scope, numLayers, numUnits, inputSize, T, S, options); - } - - /** - * Builds an {@link Dilation2d} operation - * - * @param input 4-D with shape `[batch, in_height, in_width, depth]`. - * @param filter 3-D with shape `[filter_height, filter_width, depth]`. - * @param strides The stride of the sliding window for each dimension of the input - * @param rates The input stride for atrous morphological dilation. Must be: - * @param padding The type of padding algorithm to use. - * @return a new instance of Dilation2d - * @see org.tensorflow.op.nn.Dilation2d - */ - public Dilation2d dilation2d(Operand input, Operand filter, - List strides, List rates, String padding) { - return Dilation2d.create(scope, input, filter, strides, rates, padding); - } - - /** - * Builds an {@link Conv3dBackpropFilter} operation + * Builds an {@link AvgPool} operation * - * @param input Shape `[batch, depth, rows, cols, in_channels]`. - * @param filterSizes An integer vector representing the tensor shape of `filter`, - * @param outBackprop Backprop signal of shape `[batch, out_depth, out_rows, out_cols, - * @param strides 1-D tensor of length 5. The stride of the sliding window for each + * @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 padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of Conv3dBackpropFilter - * @see org.tensorflow.op.nn.Conv3dBackpropFilter + * @return a new instance of AvgPool + * @see org.tensorflow.op.nn.AvgPool */ - public Conv3dBackpropFilter conv3dBackpropFilter(Operand input, - Operand filterSizes, Operand outBackprop, List strides, String padding, - Conv3dBackpropFilter.Options... options) { - return Conv3dBackpropFilter.create(scope, input, filterSizes, outBackprop, strides, padding, options); + public AvgPool avgPool(Operand value, List ksize, + List strides, String padding, AvgPool.Options... options) { + return AvgPool.create(scope, value, ksize, strides, padding, options); } /** - * Builds an {@link MaxPool3dGradGrad} operation + * Builds an {@link MaxPoolWithArgmax} operation * - * @param origInput The original input tensor. - * @param origOutput The original output tensor. - * @param grad Output backprop of shape `[batch, depth, rows, cols, channels]`. - * @param ksize 1-D tensor of length 5. The size of the window for each dimension of - * @param strides 1-D tensor of length 5. The stride of the sliding window for each + * @param input 4-D with shape `[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 * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of MaxPool3dGradGrad - * @see org.tensorflow.op.nn.MaxPool3dGradGrad + * @return a new instance of MaxPoolWithArgmax + * @see org.tensorflow.op.nn.MaxPoolWithArgmax */ - public MaxPool3dGradGrad maxPool3dGradGrad(Operand origInput, - Operand origOutput, Operand grad, List ksize, List strides, String padding, - MaxPool3dGradGrad.Options... options) { - return MaxPool3dGradGrad.create(scope, origInput, origOutput, grad, ksize, strides, padding, options); + public MaxPoolWithArgmax maxPoolWithArgmax(Operand input, + List ksize, List strides, String padding, MaxPoolWithArgmax.Options... options) { + return MaxPoolWithArgmax.create(scope, input, ksize, strides, padding, options); } /** - * Builds an {@link CtcLoss} operation + * Builds an {@link SpaceToDepth} operation * - * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. - * @param labelsIndices The indices of a `SparseTensor`. - * @param labelsValues The values (labels) associated with the given batch and time. - * @param sequenceLength A vector containing sequence lengths (batch). + * @param input + * @param blockSize The size of the spatial block. * @param options carries optional attributes values - * @return a new instance of CtcLoss - * @see org.tensorflow.op.nn.CtcLoss - */ - public CtcLoss ctcLoss(Operand inputs, Operand labelsIndices, - Operand labelsValues, Operand sequenceLength, CtcLoss.Options... options) { - return CtcLoss.create(scope, inputs, labelsIndices, labelsValues, sequenceLength, options); - } - - /** - * Builds an {@link SoftmaxCrossEntropyWithLogits} operation - * - * @param features batch_size x num_classes matrix - * @param labels batch_size x num_classes matrix - * @return a new instance of SoftmaxCrossEntropyWithLogits - * @see org.tensorflow.op.nn.SoftmaxCrossEntropyWithLogits - */ - public SoftmaxCrossEntropyWithLogits softmaxCrossEntropyWithLogits( - Operand features, Operand labels) { - return SoftmaxCrossEntropyWithLogits.create(scope, features, labels); - } - - /** - * Builds an {@link QuantizedMaxPool} operation - * - * @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. - * @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. - * @param strides The stride of the sliding window for each dimension of the input - * @param padding The type of padding algorithm to use. - * @return a new instance of QuantizedMaxPool - * @see org.tensorflow.op.nn.QuantizedMaxPool + * @return a new instance of SpaceToDepth + * @see org.tensorflow.op.nn.SpaceToDepth */ - public QuantizedMaxPool quantizedMaxPool(Operand input, Operand minInput, - Operand maxInput, List ksize, List strides, String padding) { - return QuantizedMaxPool.create(scope, input, minInput, maxInput, ksize, strides, padding); + public SpaceToDepth spaceToDepth(Operand input, Long blockSize, + SpaceToDepth.Options... options) { + return SpaceToDepth.create(scope, input, blockSize, options); } /** - * Builds an {@link Softmax} operation + * Builds an {@link ComputeAccidentalHits} operation * - * @param logits 2-D with shape `[batch_size, num_classes]`. - * @return a new instance of Softmax - * @see org.tensorflow.op.nn.Softmax + * @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 + * @return a new instance of ComputeAccidentalHits + * @see org.tensorflow.op.nn.ComputeAccidentalHits */ - public Softmax softmax(Operand logits) { - return Softmax.create(scope, logits); + public ComputeAccidentalHits computeAccidentalHits(Operand trueClasses, + Operand sampledCandidates, Long numTrue, ComputeAccidentalHits.Options... options) { + return ComputeAccidentalHits.create(scope, trueClasses, sampledCandidates, numTrue, options); } /** - * Builds an {@link Conv2dBackpropFilter} operation + * Builds an {@link Conv2dBackpropInput} operation * - * @param input 4-D with shape `[batch, in_height, in_width, in_channels]`. - * @param filterSizes An integer vector representing the tensor shape of `filter`, + * @param inputSizes An integer vector representing the shape of `input`, + * @param filter 4-D with shape * @param outBackprop 4-D with shape `[batch, out_height, out_width, out_channels]`. * @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 - * @return a new instance of Conv2dBackpropFilter - * @see org.tensorflow.op.nn.Conv2dBackpropFilter + * @return a new instance of Conv2dBackpropInput + * @see org.tensorflow.op.nn.Conv2dBackpropInput */ - public Conv2dBackpropFilter conv2dBackpropFilter(Operand input, - Operand filterSizes, Operand outBackprop, List strides, String padding, - Conv2dBackpropFilter.Options... options) { - return Conv2dBackpropFilter.create(scope, input, filterSizes, outBackprop, strides, padding, options); + public Conv2dBackpropInput conv2dBackpropInput(Operand inputSizes, + Operand filter, Operand outBackprop, List strides, String padding, + Conv2dBackpropInput.Options... options) { + return Conv2dBackpropInput.create(scope, inputSizes, filter, outBackprop, strides, padding, options); } /** - * Builds an {@link L2Loss} operation + * Builds an {@link CudnnRnnParamsToCanonical} operation * - * @param t Typically 2-D, but may have any dimensions. - * @return a new instance of L2Loss - * @see org.tensorflow.op.nn.L2Loss + * @param numLayers + * @param numUnits + * @param inputSize + * @param params + * @param numParams + * @param options carries optional attributes values + * @return a new instance of CudnnRnnParamsToCanonical + * @see org.tensorflow.op.nn.CudnnRnnParamsToCanonical */ - public L2Loss l2Loss(Operand t) { - return L2Loss.create(scope, t); + public CudnnRnnParamsToCanonical cudnnRnnParamsToCanonical( + Operand numLayers, Operand numUnits, Operand inputSize, + Operand params, Long numParams, CudnnRnnParamsToCanonical.Options... options) { + return CudnnRnnParamsToCanonical.create(scope, numLayers, numUnits, inputSize, params, numParams, options); } /** - * Builds an {@link MaxPool3dGrad} operation + * Builds an {@link FractionalAvgPool} operation * - * @param origInput The original input tensor. - * @param origOutput The original output tensor. - * @param grad Output backprop of shape `[batch, depth, rows, cols, channels]`. - * @param ksize 1-D tensor of length 5. The size of the window for each dimension of - * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * @param padding The type of padding algorithm to use. + * @param value 4-D with shape `[batch, height, width, channels]`. + * @param poolingRatio Pooling ratio for each dimension of `value`, currently only * @param options carries optional attributes values - * @return a new instance of MaxPool3dGrad - * @see org.tensorflow.op.nn.MaxPool3dGrad + * @return a new instance of FractionalAvgPool + * @see org.tensorflow.op.nn.FractionalAvgPool */ - public MaxPool3dGrad maxPool3dGrad(Operand origInput, - Operand origOutput, Operand grad, List ksize, List strides, String padding, - MaxPool3dGrad.Options... options) { - return MaxPool3dGrad.create(scope, origInput, origOutput, grad, ksize, strides, padding, options); + public FractionalAvgPool fractionalAvgPool(Operand value, + List poolingRatio, FractionalAvgPool.Options... options) { + return FractionalAvgPool.create(scope, value, poolingRatio, options); } /** @@ -366,316 +284,309 @@ public MaxPool3dGrad maxPool3dGrad(Opera * @return a new instance of SparseSoftmaxCrossEntropyWithLogits * @see org.tensorflow.op.nn.SparseSoftmaxCrossEntropyWithLogits */ - public SparseSoftmaxCrossEntropyWithLogits sparseSoftmaxCrossEntropyWithLogits( + public SparseSoftmaxCrossEntropyWithLogits sparseSoftmaxCrossEntropyWithLogits( Operand features, Operand labels) { return SparseSoftmaxCrossEntropyWithLogits.create(scope, features, labels); } /** - * Builds an {@link QuantizedConv2d} operation + * Builds an {@link NthElement} operation * - * @param input - * @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 strides The stride of the sliding window for each dimension of the input - * @param padding The type of padding algorithm to use. + * @param input 1-D or higher with last dimension at least `n+1`. + * @param n 0-D. Position of sorted vector to select along the last dimension (along * @param options carries optional attributes values - * @return a new instance of QuantizedConv2d - * @see org.tensorflow.op.nn.QuantizedConv2d + * @return a new instance of NthElement + * @see org.tensorflow.op.nn.NthElement */ - public QuantizedConv2d quantizedConv2d(Operand input, Operand filter, - Operand minInput, Operand maxInput, Operand minFilter, - Operand maxFilter, Class outType, List strides, String padding, - QuantizedConv2d.Options... options) { - return QuantizedConv2d.create(scope, input, filter, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); + public NthElement nthElement(Operand input, Operand n, + NthElement.Options... options) { + return NthElement.create(scope, input, n, options); } /** - * Builds an {@link AvgPool} operation + * Builds an {@link BatchNormWithGlobalNormalizationGrad} operation * - * @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 padding The type of padding algorithm to use. - * @param options carries optional attributes values - * @return a new instance of AvgPool - * @see org.tensorflow.op.nn.AvgPool + * @param t A 4D input Tensor. + * @param m A 1D mean Tensor with size matching the last dimension of t. + * @param v A 1D variance Tensor with size matching the last dimension of t. + * @param gamma A 1D gamma Tensor with size matching the last dimension of t. + * @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 + * @return a new instance of BatchNormWithGlobalNormalizationGrad + * @see org.tensorflow.op.nn.BatchNormWithGlobalNormalizationGrad */ - public AvgPool avgPool(Operand value, List ksize, - List strides, String padding, AvgPool.Options... options) { - return AvgPool.create(scope, value, ksize, strides, padding, options); + public BatchNormWithGlobalNormalizationGrad batchNormWithGlobalNormalizationGrad( + Operand t, Operand m, Operand v, Operand gamma, Operand backprop, + Float varianceEpsilon, Boolean scaleAfterNormalization) { + return BatchNormWithGlobalNormalizationGrad.create(scope, t, m, v, gamma, backprop, varianceEpsilon, scaleAfterNormalization); } /** - * Builds an {@link QuantizedRelu} operation + * Builds an {@link MaxPoolWithArgmax} operation * - * @param features - * @param minFeatures The float value that the lowest quantized value represents. - * @param maxFeatures The float value that the highest quantized value represents. - * @param outType - * @return a new instance of QuantizedRelu - * @see org.tensorflow.op.nn.QuantizedRelu + * @param input 4-D with shape `[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 + * @param Targmax + * @param padding The type of padding algorithm to use. + * @param options carries optional attributes values + * @return a new instance of MaxPoolWithArgmax + * @see org.tensorflow.op.nn.MaxPoolWithArgmax */ - public QuantizedRelu quantizedRelu(Operand features, Operand minFeatures, - Operand maxFeatures, Class outType) { - return QuantizedRelu.create(scope, features, minFeatures, maxFeatures, outType); + public MaxPoolWithArgmax maxPoolWithArgmax( + Operand input, List ksize, List strides, DataType Targmax, String padding, + MaxPoolWithArgmax.Options... options) { + return MaxPoolWithArgmax.create(scope, input, ksize, strides, Targmax, padding, options); } /** - * Builds an {@link Conv3d} operation + * Builds an {@link QuantizedBatchNormWithGlobalNormalization} operation * - * @param input Shape `[batch, in_depth, in_height, in_width, in_channels]`. - * @param filter Shape `[filter_depth, filter_height, filter_width, in_channels, - * @param strides 1-D tensor of length 5. The stride of the sliding window for each - * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values - * @return a new instance of Conv3d - * @see org.tensorflow.op.nn.Conv3d + * @param t A 4D input Tensor. + * @param tMin The value represented by the lowest quantized input. + * @param tMax The value represented by the highest quantized input. + * @param m A 1D mean Tensor with size matching the last dimension of t. + * @param mMin The value represented by the lowest quantized mean. + * @param mMax The value represented by the highest quantized mean. + * @param v A 1D variance Tensor with size matching the last dimension of t. + * @param vMin The value represented by the lowest quantized variance. + * @param vMax The value represented by the highest quantized variance. + * @param beta A 1D beta Tensor with size matching the last dimension of t. + * @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. + * @param gammaMin The value represented by the lowest quantized gamma. + * @param gammaMax The value represented by the highest quantized gamma. + * @param outType + * @param varianceEpsilon A small float number to avoid dividing by 0. + * @param scaleAfterNormalization A bool indicating whether the resulted tensor + * @return a new instance of QuantizedBatchNormWithGlobalNormalization + * @see org.tensorflow.op.nn.QuantizedBatchNormWithGlobalNormalization */ - public Conv3d conv3d(Operand input, Operand filter, - List strides, String padding, Conv3d.Options... options) { - return Conv3d.create(scope, input, filter, strides, padding, options); + public QuantizedBatchNormWithGlobalNormalization quantizedBatchNormWithGlobalNormalization( + 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, DataType outType, + Float varianceEpsilon, Boolean scaleAfterNormalization) { + return QuantizedBatchNormWithGlobalNormalization.create(scope, t, tMin, tMax, m, mMin, mMax, v, vMin, vMax, beta, betaMin, betaMax, gamma, gammaMin, gammaMax, outType, varianceEpsilon, scaleAfterNormalization); } /** - * Builds an {@link FractionalMaxPool} operation + * Builds an {@link InTopK} operation * - * @param value 4-D with shape `[batch, height, width, channels]`. - * @param poolingRatio Pooling ratio for each dimension of `value`, currently only - * @param options carries optional attributes values - * @return a new instance of FractionalMaxPool - * @see org.tensorflow.op.nn.FractionalMaxPool + * @param predictions A `batch_size` x `classes` tensor. + * @param targets A `batch_size` vector of class ids. + * @param k Number of top elements to look at for computing precision. + * @return a new instance of InTopK + * @see org.tensorflow.op.nn.InTopK */ - public FractionalMaxPool fractionalMaxPool(Operand value, - List poolingRatio, FractionalMaxPool.Options... options) { - return FractionalMaxPool.create(scope, value, poolingRatio, options); + public InTopK inTopK(Operand predictions, Operand targets, + Operand k) { + return InTopK.create(scope, predictions, targets, k); } /** - * Builds an {@link QuantizedInstanceNorm} operation + * Builds an {@link L2Loss} operation * - * @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 - * @return a new instance of QuantizedInstanceNorm - * @see org.tensorflow.op.nn.QuantizedInstanceNorm + * @param t Typically 2-D, but may have any dimensions. + * @return a new instance of L2Loss + * @see org.tensorflow.op.nn.L2Loss */ - public QuantizedInstanceNorm quantizedInstanceNorm(Operand x, Operand xMin, - Operand xMax, QuantizedInstanceNorm.Options... options) { - return QuantizedInstanceNorm.create(scope, x, xMin, xMax, options); + public L2Loss l2Loss(Operand t) { + return L2Loss.create(scope, t); } /** - * Builds an {@link AvgPool3dGrad} operation + * Builds an {@link Conv3d} operation * - * @param origInputShape The original input dimensions. - * @param grad Output backprop of shape `[batch, depth, rows, cols, channels]`. - * @param ksize 1-D tensor of length 5. The size of the window for each dimension of + * @param input Shape `[batch, in_depth, in_height, in_width, in_channels]`. + * @param filter Shape `[filter_depth, filter_height, filter_width, in_channels, * @param strides 1-D tensor of length 5. The stride of the sliding window for each * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of AvgPool3dGrad - * @see org.tensorflow.op.nn.AvgPool3dGrad + * @return a new instance of Conv3d + * @see org.tensorflow.op.nn.Conv3d */ - public AvgPool3dGrad avgPool3dGrad(Operand origInputShape, - Operand grad, List ksize, List strides, String padding, - AvgPool3dGrad.Options... options) { - return AvgPool3dGrad.create(scope, origInputShape, grad, ksize, strides, padding, options); + public Conv3d conv3d(Operand input, Operand filter, + List strides, String padding, Conv3d.Options... options) { + return Conv3d.create(scope, input, filter, strides, padding, options); } /** - * Builds an {@link DepthwiseConv2dNativeBackpropInput} operation + * Builds an {@link DepthwiseConv2dNativeBackpropFilter} operation * - * @param inputSizes An integer vector representing the shape of `input`, based - * @param filter 4-D with shape + * @param input 4-D with shape based on `data_format`. For example, if + * @param filterSizes An integer vector representing the tensor shape of `filter`, * @param outBackprop 4-D with shape based on `data_format`. * @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 - * @return a new instance of DepthwiseConv2dNativeBackpropInput - * @see org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropInput - */ - public DepthwiseConv2dNativeBackpropInput depthwiseConv2dNativeBackpropInput( - Operand inputSizes, Operand filter, Operand outBackprop, List strides, - String padding, DepthwiseConv2dNativeBackpropInput.Options... options) { - return DepthwiseConv2dNativeBackpropInput.create(scope, inputSizes, filter, outBackprop, strides, padding, options); - } - - /** - * Builds an {@link Relu6} operation - * - * @param features - * @return a new instance of Relu6 - * @see org.tensorflow.op.nn.Relu6 - */ - public Relu6 relu6(Operand features) { - return Relu6.create(scope, features); - } - - /** - * Builds an {@link DataFormatDimMap} operation - * - * @param x A Tensor with each element as a dimension index in source data format. - * @param options carries optional attributes values - * @return a new instance of DataFormatDimMap - * @see org.tensorflow.op.nn.DataFormatDimMap + * @return a new instance of DepthwiseConv2dNativeBackpropFilter + * @see org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropFilter */ - public DataFormatDimMap dataFormatDimMap(Operand x, - DataFormatDimMap.Options... options) { - return DataFormatDimMap.create(scope, x, options); + public DepthwiseConv2dNativeBackpropFilter depthwiseConv2dNativeBackpropFilter( + Operand input, Operand filterSizes, Operand outBackprop, List strides, + String padding, DepthwiseConv2dNativeBackpropFilter.Options... options) { + return DepthwiseConv2dNativeBackpropFilter.create(scope, input, filterSizes, outBackprop, strides, padding, options); } /** - * Builds an {@link Relu} operation + * Builds an {@link FusedBatchNorm} operation * - * @param features - * @return a new instance of Relu - * @see org.tensorflow.op.nn.Relu + * @param x A 4D Tensor for input data. + * @param scale A 1D Tensor for scaling factor, to scale the normalized x. + * @param offset A 1D Tensor for offset, to shift to the normalized x. + * @param mean A 1D Tensor for population mean. Used for inference only; + * @param variance A 1D Tensor for population variance. Used for inference only; + * @param options carries optional attributes values + * @return a new instance of FusedBatchNorm + * @see org.tensorflow.op.nn.FusedBatchNorm */ - public Relu relu(Operand features) { - return Relu.create(scope, features); + public FusedBatchNorm fusedBatchNorm(Operand x, + Operand scale, Operand offset, Operand mean, Operand variance, + FusedBatchNorm.Options... options) { + return FusedBatchNorm.create(scope, x, scale, offset, mean, variance, options); } /** - * Builds an {@link FusedBatchNormGrad} operation + * Builds an {@link MaxPoolGrad} operation * - * @param yBackprop A 4D Tensor for the gradient with respect to y. - * @param x A 4D Tensor for input data. - * @param scale A 1D Tensor for scaling factor, to scale the normalized x. - * @param reserveSpace1 When is_training is True, a 1D Tensor for the computed batch - * @param reserveSpace2 When is_training is True, a 1D Tensor for the computed batch + * @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 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 + * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of FusedBatchNormGrad - * @see org.tensorflow.op.nn.FusedBatchNormGrad + * @return a new instance of MaxPoolGrad + * @see org.tensorflow.op.nn.MaxPoolGrad */ - public FusedBatchNormGrad fusedBatchNormGrad( - Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, - Operand reserveSpace2, FusedBatchNormGrad.Options... options) { - return FusedBatchNormGrad.create(scope, yBackprop, x, scale, reserveSpace1, reserveSpace2, options); + public MaxPoolGrad maxPoolGrad(Operand origInput, Operand origOutput, + Operand grad, Operand ksize, Operand strides, String padding, + MaxPoolGrad.Options... options) { + return MaxPoolGrad.create(scope, origInput, origOutput, grad, ksize, strides, padding, options); } /** - * Builds an {@link SpaceToDepth} operation + * Builds an {@link MaxPool3dGradGrad} operation * - * @param input - * @param blockSize The size of the spatial block. + * @param origInput The original input tensor. + * @param origOutput The original output tensor. + * @param grad Output backprop of shape `[batch, depth, rows, cols, channels]`. + * @param ksize 1-D tensor of length 5. The size of the window for each dimension of + * @param strides 1-D tensor of length 5. The stride of the sliding window for each + * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of SpaceToDepth - * @see org.tensorflow.op.nn.SpaceToDepth + * @return a new instance of MaxPool3dGradGrad + * @see org.tensorflow.op.nn.MaxPool3dGradGrad */ - public SpaceToDepth spaceToDepth(Operand input, Long blockSize, - SpaceToDepth.Options... options) { - return SpaceToDepth.create(scope, input, blockSize, options); + public MaxPool3dGradGrad maxPool3dGradGrad(Operand origInput, + Operand origOutput, Operand grad, List ksize, List strides, String padding, + MaxPool3dGradGrad.Options... options) { + return MaxPool3dGradGrad.create(scope, origInput, origOutput, grad, ksize, strides, padding, options); } /** - * Builds an {@link MaxPool} operation + * Builds an {@link MaxPoolGradGradWithArgmax} operation * - * @param input 4-D input to pool over. + * @param input The original input. + * @param grad 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. the + * @param argmax The indices of the maximum values chosen for each output of `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 * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of MaxPool - * @see org.tensorflow.op.nn.MaxPool + * @return a new instance of MaxPoolGradGradWithArgmax + * @see org.tensorflow.op.nn.MaxPoolGradGradWithArgmax */ - public MaxPool maxPool(Operand input, Operand ksize, Operand strides, - String padding, MaxPool.Options... options) { - return MaxPool.create(scope, input, ksize, strides, padding, options); + public MaxPoolGradGradWithArgmax maxPoolGradGradWithArgmax( + Operand input, Operand grad, Operand argmax, List ksize, List strides, + String padding, MaxPoolGradGradWithArgmax.Options... options) { + return MaxPoolGradGradWithArgmax.create(scope, input, grad, argmax, ksize, strides, padding, options); } /** - * Builds an {@link BatchNormWithGlobalNormalizationGrad} operation + * Builds an {@link BiasAdd} operation * - * @param t A 4D input Tensor. - * @param m A 1D mean Tensor with size matching the last dimension of t. - * @param v A 1D variance Tensor with size matching the last dimension of t. - * @param gamma A 1D gamma Tensor with size matching the last dimension of t. - * @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 - * @return a new instance of BatchNormWithGlobalNormalizationGrad - * @see org.tensorflow.op.nn.BatchNormWithGlobalNormalizationGrad + * @param value Any number of dimensions. + * @param bias 1-D with size the last dimension of `value`. + * @param options carries optional attributes values + * @return a new instance of BiasAdd + * @see org.tensorflow.op.nn.BiasAdd */ - public BatchNormWithGlobalNormalizationGrad batchNormWithGlobalNormalizationGrad( - Operand t, Operand m, Operand v, Operand gamma, Operand backprop, - Float varianceEpsilon, Boolean scaleAfterNormalization) { - return BatchNormWithGlobalNormalizationGrad.create(scope, t, m, v, gamma, backprop, varianceEpsilon, scaleAfterNormalization); + public BiasAdd biasAdd(Operand value, Operand bias, + BiasAdd.Options... options) { + return BiasAdd.create(scope, value, bias, options); } /** - * Builds an {@link BatchNormWithGlobalNormalization} operation + * Builds an {@link QuantizedMaxPool} operation * - * @param t A 4D input Tensor. - * @param m A 1D mean Tensor with size matching the last dimension of t. - * @param v A 1D variance Tensor with size matching the last dimension of t. - * @param beta A 1D beta Tensor with size matching the last dimension of t. - * @param gamma A 1D gamma Tensor with size matching the last dimension of t. - * @param varianceEpsilon A small float number to avoid dividing by 0. - * @param scaleAfterNormalization A bool indicating whether the resulted tensor - * @return a new instance of BatchNormWithGlobalNormalization - * @see org.tensorflow.op.nn.BatchNormWithGlobalNormalization + * @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. + * @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. + * @param strides The stride of the sliding window for each dimension of the input + * @param padding The type of padding algorithm to use. + * @return a new instance of QuantizedMaxPool + * @see org.tensorflow.op.nn.QuantizedMaxPool */ - public BatchNormWithGlobalNormalization batchNormWithGlobalNormalization(Operand t, - Operand m, Operand v, Operand beta, Operand gamma, Float varianceEpsilon, - Boolean scaleAfterNormalization) { - return BatchNormWithGlobalNormalization.create(scope, t, m, v, beta, gamma, varianceEpsilon, scaleAfterNormalization); + public QuantizedMaxPool quantizedMaxPool(Operand input, + Operand minInput, Operand maxInput, List ksize, List strides, + String padding) { + return QuantizedMaxPool.create(scope, input, minInput, maxInput, ksize, strides, padding); } /** - * Builds an {@link CudnnRnnCanonicalToParams} operation + * Builds an {@link MaxPool3dGrad} operation * - * @param numLayers - * @param numUnits - * @param inputSize - * @param weights - * @param biases + * @param origInput The original input tensor. + * @param origOutput The original output tensor. + * @param grad Output backprop of shape `[batch, depth, rows, cols, channels]`. + * @param ksize 1-D tensor of length 5. The size of the window for each dimension of + * @param strides 1-D tensor of length 5. The stride of the sliding window for each + * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of CudnnRnnCanonicalToParams - * @see org.tensorflow.op.nn.CudnnRnnCanonicalToParams + * @return a new instance of MaxPool3dGrad + * @see org.tensorflow.op.nn.MaxPool3dGrad */ - public CudnnRnnCanonicalToParams cudnnRnnCanonicalToParams( - Operand numLayers, Operand numUnits, Operand inputSize, - Iterable> weights, Iterable> biases, - CudnnRnnCanonicalToParams.Options... options) { - return CudnnRnnCanonicalToParams.create(scope, numLayers, numUnits, inputSize, weights, biases, options); + public MaxPool3dGrad maxPool3dGrad(Operand origInput, + Operand origOutput, Operand grad, List ksize, List strides, String padding, + MaxPool3dGrad.Options... options) { + return MaxPool3dGrad.create(scope, origInput, origOutput, grad, ksize, strides, padding, options); } /** - * Builds an {@link InTopK} operation + * Builds an {@link CudnnRnnParamsSize} operation * - * @param predictions A `batch_size` x `classes` tensor. - * @param targets A `batch_size` vector of class ids. - * @param k Number of top elements to look at for computing precision. - * @return a new instance of InTopK - * @see org.tensorflow.op.nn.InTopK + * @param numLayers + * @param numUnits + * @param inputSize + * @param T + * @param S + * @param options carries optional attributes values + * @return a new instance of CudnnRnnParamsSize + * @see org.tensorflow.op.nn.CudnnRnnParamsSize */ - public InTopK inTopK(Operand predictions, Operand targets, - Operand k) { - return InTopK.create(scope, predictions, targets, k); + public CudnnRnnParamsSize cudnnRnnParamsSize( + Operand numLayers, Operand numUnits, Operand inputSize, DataType T, + DataType S, CudnnRnnParamsSize.Options... options) { + return CudnnRnnParamsSize.create(scope, numLayers, numUnits, inputSize, T, S, options); } /** - * Builds an {@link MaxPoolWithArgmax} operation + * Builds an {@link BiasAddGrad} operation * - * @param input 4-D with shape `[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 - * @param Targmax - * @param padding The type of padding algorithm to use. + * @param outBackprop Any number of dimensions. * @param options carries optional attributes values - * @return a new instance of MaxPoolWithArgmax - * @see org.tensorflow.op.nn.MaxPoolWithArgmax + * @return a new instance of BiasAddGrad + * @see org.tensorflow.op.nn.BiasAddGrad */ - public MaxPoolWithArgmax maxPoolWithArgmax( - Operand input, List ksize, List strides, Class Targmax, String padding, - MaxPoolWithArgmax.Options... options) { - return MaxPoolWithArgmax.create(scope, input, ksize, strides, Targmax, padding, options); + public BiasAddGrad biasAddGrad(Operand outBackprop, + BiasAddGrad.Options... options) { + return BiasAddGrad.create(scope, outBackprop, options); } /** @@ -691,119 +602,108 @@ public MaxPoolWithArgmax maxPoolWithA * @return a new instance of MaxPoolGradGrad * @see org.tensorflow.op.nn.MaxPoolGradGrad */ - public MaxPoolGradGrad maxPoolGradGrad(Operand origInput, - Operand origOutput, Operand grad, Operand ksize, Operand strides, + public MaxPoolGradGrad maxPoolGradGrad(Operand origInput, + Operand origOutput, Operand grad, Operand ksize, Operand strides, String padding, MaxPoolGradGrad.Options... options) { return MaxPoolGradGrad.create(scope, origInput, origOutput, grad, ksize, strides, padding, options); } /** - * Builds an {@link Dilation2dBackpropFilter} operation + * Builds an {@link SoftmaxCrossEntropyWithLogits} operation * - * @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 strides 1-D of length 4. The stride of the sliding window for each dimension of - * @param rates 1-D of length 4. The input stride for atrous morphological dilation. - * @param padding The type of padding algorithm to use. - * @return a new instance of Dilation2dBackpropFilter - * @see org.tensorflow.op.nn.Dilation2dBackpropFilter + * @param features batch_size x num_classes matrix + * @param labels batch_size x num_classes matrix + * @return a new instance of SoftmaxCrossEntropyWithLogits + * @see org.tensorflow.op.nn.SoftmaxCrossEntropyWithLogits */ - public Dilation2dBackpropFilter dilation2dBackpropFilter(Operand input, - Operand filter, Operand outBackprop, List strides, List rates, - String padding) { - return Dilation2dBackpropFilter.create(scope, input, filter, outBackprop, strides, rates, padding); + public SoftmaxCrossEntropyWithLogits softmaxCrossEntropyWithLogits( + Operand features, Operand labels) { + return SoftmaxCrossEntropyWithLogits.create(scope, features, labels); } /** - * Builds an {@link FusedBatchNorm} operation + * Builds an {@link DepthwiseConv2dNativeBackpropInput} operation * - * @param x A 4D Tensor for input data. - * @param scale A 1D Tensor for scaling factor, to scale the normalized x. - * @param offset A 1D Tensor for offset, to shift to the normalized x. - * @param mean A 1D Tensor for population mean. Used for inference only; - * @param variance A 1D Tensor for population variance. Used for inference only; + * @param inputSizes An integer vector representing the shape of `input`, based + * @param filter 4-D with shape + * @param outBackprop 4-D with shape based on `data_format`. + * @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 - * @return a new instance of FusedBatchNorm - * @see org.tensorflow.op.nn.FusedBatchNorm + * @return a new instance of DepthwiseConv2dNativeBackpropInput + * @see org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropInput */ - public FusedBatchNorm fusedBatchNorm(Operand x, - Operand scale, Operand offset, Operand mean, Operand variance, - FusedBatchNorm.Options... options) { - return FusedBatchNorm.create(scope, x, scale, offset, mean, variance, options); + public DepthwiseConv2dNativeBackpropInput depthwiseConv2dNativeBackpropInput( + Operand inputSizes, Operand filter, Operand outBackprop, List strides, + String padding, DepthwiseConv2dNativeBackpropInput.Options... options) { + return DepthwiseConv2dNativeBackpropInput.create(scope, inputSizes, filter, outBackprop, strides, padding, options); } /** - * Builds an {@link FractionalAvgPool} operation + * Builds an {@link CtcLoss} operation * - * @param value 4-D with shape `[batch, height, width, channels]`. - * @param poolingRatio Pooling ratio for each dimension of `value`, currently only + * @param inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits. + * @param labelsIndices The indices of a `SparseTensor`. + * @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 - * @return a new instance of FractionalAvgPool - * @see org.tensorflow.op.nn.FractionalAvgPool + * @return a new instance of CtcLoss + * @see org.tensorflow.op.nn.CtcLoss */ - public FractionalAvgPool fractionalAvgPool(Operand value, - List poolingRatio, FractionalAvgPool.Options... options) { - return FractionalAvgPool.create(scope, value, poolingRatio, options); + public CtcLoss ctcLoss(Operand inputs, Operand labelsIndices, + Operand labelsValues, Operand sequenceLength, CtcLoss.Options... options) { + return CtcLoss.create(scope, inputs, labelsIndices, labelsValues, sequenceLength, options); } /** - * Builds an {@link BiasAddGrad} operation + * Builds an {@link LocalResponseNormalization} operation * - * @param outBackprop Any number of dimensions. + * @param input 4-D. * @param options carries optional attributes values - * @return a new instance of BiasAddGrad - * @see org.tensorflow.op.nn.BiasAddGrad - */ - public BiasAddGrad biasAddGrad(Operand outBackprop, BiasAddGrad.Options... options) { - return BiasAddGrad.create(scope, outBackprop, options); - } - - /** - * Builds an {@link LogSoftmax} operation - * - * @param logits 2-D with shape `[batch_size, num_classes]`. - * @return a new instance of LogSoftmax - * @see org.tensorflow.op.nn.LogSoftmax + * @return a new instance of LocalResponseNormalization + * @see org.tensorflow.op.nn.LocalResponseNormalization */ - public LogSoftmax logSoftmax(Operand logits) { - return LogSoftmax.create(scope, logits); + public LocalResponseNormalization localResponseNormalization( + Operand input, LocalResponseNormalization.Options... options) { + return LocalResponseNormalization.create(scope, input, options); } /** - * Builds an {@link TopK} operation + * Builds an {@link QuantizedBiasAdd} operation * - * @param input 1-D or higher with last dimension at least `k`. - * @param k 0-D. Number of top elements to look for along the last dimension (along each - * @param options carries optional attributes values - * @return a new instance of TopK - * @see org.tensorflow.op.nn.TopK + * @param input + * @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 + * @return a new instance of QuantizedBiasAdd + * @see org.tensorflow.op.nn.QuantizedBiasAdd */ - public TopK topK(Operand input, Operand k, - TopK.Options... options) { - return TopK.create(scope, input, k, options); + public QuantizedBiasAdd quantizedBiasAdd( + Operand input, Operand bias, Operand minInput, Operand maxInput, + Operand minBias, Operand maxBias, DataType outType) { + return QuantizedBiasAdd.create(scope, input, bias, minInput, maxInput, minBias, maxBias, outType); } /** - * Builds an {@link CudnnRnnParamsToCanonical} operation + * Builds an {@link QuantizedRelu} operation * - * @param numLayers - * @param numUnits - * @param inputSize - * @param params - * @param numParams - * @param options carries optional attributes values - * @return a new instance of CudnnRnnParamsToCanonical - * @see org.tensorflow.op.nn.CudnnRnnParamsToCanonical + * @param features + * @param minFeatures The float value that the lowest quantized value represents. + * @param maxFeatures The float value that the highest quantized value represents. + * @param outType + * @return a new instance of QuantizedRelu + * @see org.tensorflow.op.nn.QuantizedRelu */ - public CudnnRnnParamsToCanonical cudnnRnnParamsToCanonical( - Operand numLayers, Operand numUnits, Operand inputSize, - Operand params, Long numParams, CudnnRnnParamsToCanonical.Options... options) { - return CudnnRnnParamsToCanonical.create(scope, numLayers, numUnits, inputSize, params, numParams, options); + public QuantizedRelu quantizedRelu(Operand features, + Operand minFeatures, Operand maxFeatures, DataType outType) { + return QuantizedRelu.create(scope, features, minFeatures, maxFeatures, outType); } /** - * Builds an {@link FixedUnigramCandidateSampler} operation + * Builds an {@link LearnedUnigramCandidateSampler} operation * * @param trueClasses A batch_size * num_true matrix, in which each row contains the * @param numTrue Number of true labels per context. @@ -811,158 +711,181 @@ public CudnnRnnParamsToCanonical cudnnRnnParamsToCanonical * @param unique If unique is true, we sample with rejection, so that all sampled * @param rangeMax The sampler will sample integers from the interval [0, range_max). * @param options carries optional attributes values - * @return a new instance of FixedUnigramCandidateSampler - * @see org.tensorflow.op.nn.FixedUnigramCandidateSampler + * @return a new instance of LearnedUnigramCandidateSampler + * @see org.tensorflow.op.nn.LearnedUnigramCandidateSampler */ - public FixedUnigramCandidateSampler fixedUnigramCandidateSampler(Operand trueClasses, + public LearnedUnigramCandidateSampler learnedUnigramCandidateSampler(Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, - FixedUnigramCandidateSampler.Options... options) { - return FixedUnigramCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, rangeMax, options); + LearnedUnigramCandidateSampler.Options... options) { + return LearnedUnigramCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, rangeMax, options); } /** - * Builds an {@link MaxPoolGradGradWithArgmax} operation + * Builds an {@link AvgPool3dGrad} operation * - * @param input The original input. - * @param grad 4-D with shape `[batch, height, width, channels]`. Gradients w.r.t. the - * @param argmax The indices of the maximum values chosen for each output of `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 + * @param origInputShape The original input dimensions. + * @param grad Output backprop of shape `[batch, depth, rows, cols, channels]`. + * @param ksize 1-D tensor of length 5. The size of the window for each dimension of + * @param strides 1-D tensor of length 5. The stride of the sliding window for each * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of MaxPoolGradGradWithArgmax - * @see org.tensorflow.op.nn.MaxPoolGradGradWithArgmax + * @return a new instance of AvgPool3dGrad + * @see org.tensorflow.op.nn.AvgPool3dGrad */ - public MaxPoolGradGradWithArgmax maxPoolGradGradWithArgmax( - Operand input, Operand grad, Operand argmax, List ksize, List strides, - String padding, MaxPoolGradGradWithArgmax.Options... options) { - return MaxPoolGradGradWithArgmax.create(scope, input, grad, argmax, ksize, strides, padding, options); + public AvgPool3dGrad avgPool3dGrad(Operand origInputShape, + Operand grad, List ksize, List strides, String padding, + AvgPool3dGrad.Options... options) { + return AvgPool3dGrad.create(scope, origInputShape, grad, ksize, strides, padding, options); } /** - * Builds an {@link Conv3dBackpropInput} operation + * Builds an {@link QuantizedAvgPool} operation * - * @param inputSizes An integer vector representing the tensor shape of `input`, - * @param filter Shape `[depth, rows, cols, in_channels, out_channels]`. - * @param outBackprop Backprop signal of shape `[batch, out_depth, out_rows, out_cols, - * @param strides 1-D tensor of length 5. The stride of the sliding window for each + * @param input 4-D with shape `[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. + * @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 - * @return a new instance of Conv3dBackpropInput - * @see org.tensorflow.op.nn.Conv3dBackpropInput + * @return a new instance of QuantizedAvgPool + * @see org.tensorflow.op.nn.QuantizedAvgPool */ - public Conv3dBackpropInput conv3dBackpropInput( - Operand inputSizes, Operand filter, Operand outBackprop, List strides, - String padding, Conv3dBackpropInput.Options... options) { - return Conv3dBackpropInput.create(scope, inputSizes, filter, outBackprop, strides, padding, options); + public QuantizedAvgPool quantizedAvgPool(Operand input, + Operand minInput, Operand maxInput, List ksize, List strides, + String padding) { + return QuantizedAvgPool.create(scope, input, minInput, maxInput, ksize, strides, padding); } /** - * Builds an {@link Softsign} operation + * Builds an {@link Selu} operation * * @param features - * @return a new instance of Softsign - * @see org.tensorflow.op.nn.Softsign + * @return a new instance of Selu + * @see org.tensorflow.op.nn.Selu */ - public Softsign softsign(Operand features) { - return Softsign.create(scope, features); + public Selu selu(Operand features) { + return Selu.create(scope, features); } /** - * Builds an {@link ComputeAccidentalHits} operation + * Builds an {@link Conv3dBackpropFilter} operation * - * @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 input Shape `[batch, depth, rows, cols, in_channels]`. + * @param filterSizes An integer vector representing the tensor shape of `filter`, + * @param outBackprop Backprop signal of shape `[batch, out_depth, out_rows, out_cols, + * @param strides 1-D tensor of length 5. The stride of the sliding window for each + * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of ComputeAccidentalHits - * @see org.tensorflow.op.nn.ComputeAccidentalHits + * @return a new instance of Conv3dBackpropFilter + * @see org.tensorflow.op.nn.Conv3dBackpropFilter */ - public ComputeAccidentalHits computeAccidentalHits(Operand trueClasses, - Operand sampledCandidates, Long numTrue, ComputeAccidentalHits.Options... options) { - return ComputeAccidentalHits.create(scope, trueClasses, sampledCandidates, numTrue, options); + public Conv3dBackpropFilter conv3dBackpropFilter(Operand input, + Operand filterSizes, Operand outBackprop, List strides, String padding, + Conv3dBackpropFilter.Options... options) { + return Conv3dBackpropFilter.create(scope, input, filterSizes, outBackprop, strides, padding, options); } /** - * Builds an {@link DataFormatVecPermute} operation + * Builds an {@link AvgPool3d} operation * - * @param x Vector of size 4 or Tensor of shape (4, 2) in source data format. + * @param input Shape `[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 + * @param strides 1-D tensor of length 5. The stride of the sliding window for each + * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of DataFormatVecPermute - * @see org.tensorflow.op.nn.DataFormatVecPermute + * @return a new instance of AvgPool3d + * @see org.tensorflow.op.nn.AvgPool3d */ - public DataFormatVecPermute dataFormatVecPermute(Operand x, - DataFormatVecPermute.Options... options) { - return DataFormatVecPermute.create(scope, x, options); + public AvgPool3d avgPool3d(Operand input, List ksize, + List strides, String padding, AvgPool3d.Options... options) { + return AvgPool3d.create(scope, input, ksize, strides, padding, options); } /** - * Builds an {@link CtcBeamSearchDecoder} operation + * Builds an {@link QuantizedConv2d} operation * - * @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 input + * @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 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 - * @return a new instance of CtcBeamSearchDecoder - * @see org.tensorflow.op.nn.CtcBeamSearchDecoder + * @return a new instance of QuantizedConv2d + * @see org.tensorflow.op.nn.QuantizedConv2d */ - public CtcBeamSearchDecoder ctcBeamSearchDecoder(Operand inputs, - Operand sequenceLength, Long beamWidth, Long topPaths, - CtcBeamSearchDecoder.Options... options) { - return CtcBeamSearchDecoder.create(scope, inputs, sequenceLength, beamWidth, topPaths, options); + public QuantizedConv2d quantizedConv2d( + Operand input, Operand filter, Operand minInput, Operand maxInput, + Operand minFilter, Operand maxFilter, DataType outType, List strides, + String padding, QuantizedConv2d.Options... options) { + return QuantizedConv2d.create(scope, input, filter, minInput, maxInput, minFilter, maxFilter, outType, strides, padding, options); } /** - * Builds an {@link MaxPoolWithArgmax} operation + * Builds an {@link DataFormatDimMap} operation * - * @param input 4-D with shape `[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 - * @param padding The type of padding algorithm to use. + * @param x A Tensor with each element as a dimension index in source data format. * @param options carries optional attributes values - * @return a new instance of MaxPoolWithArgmax - * @see org.tensorflow.op.nn.MaxPoolWithArgmax + * @return a new instance of DataFormatDimMap + * @see org.tensorflow.op.nn.DataFormatDimMap */ - public MaxPoolWithArgmax maxPoolWithArgmax(Operand input, - List ksize, List strides, String padding, MaxPoolWithArgmax.Options... options) { - return MaxPoolWithArgmax.create(scope, input, ksize, strides, padding, options); + public DataFormatDimMap dataFormatDimMap(Operand x, + DataFormatDimMap.Options... options) { + return DataFormatDimMap.create(scope, x, options); } /** - * Builds an {@link DepthwiseConv2dNative} operation + * Builds an {@link Relu} operation * - * @param input - * @param filter - * @param strides 1-D of length 4. The stride of the sliding window for each dimension - * @param padding The type of padding algorithm to use. + * @param features + * @return a new instance of Relu + * @see org.tensorflow.op.nn.Relu + */ + public Relu relu(Operand features) { + return Relu.create(scope, features); + } + + /** + * Builds an {@link TopK} operation + * + * @param input 1-D or higher with last dimension at least `k`. + * @param k 0-D. Number of top elements to look for along the last dimension (along each * @param options carries optional attributes values - * @return a new instance of DepthwiseConv2dNative - * @see org.tensorflow.op.nn.DepthwiseConv2dNative + * @return a new instance of TopK + * @see org.tensorflow.op.nn.TopK */ - public DepthwiseConv2dNative depthwiseConv2dNative(Operand input, - Operand filter, List strides, String padding, - DepthwiseConv2dNative.Options... options) { - return DepthwiseConv2dNative.create(scope, input, filter, strides, padding, options); + public TopK topK(Operand input, Operand k, + TopK.Options... options) { + return TopK.create(scope, input, k, options); } /** - * Builds an {@link QuantizedBiasAdd} operation + * Builds an {@link LogSoftmax} operation * - * @param input - * @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 - * @return a new instance of QuantizedBiasAdd - * @see org.tensorflow.op.nn.QuantizedBiasAdd + * @param logits 2-D with shape `[batch_size, num_classes]`. + * @return a new instance of LogSoftmax + * @see org.tensorflow.op.nn.LogSoftmax */ - public QuantizedBiasAdd quantizedBiasAdd(Operand input, Operand bias, - Operand minInput, Operand maxInput, Operand minBias, - Operand maxBias, Class outType) { - return QuantizedBiasAdd.create(scope, input, bias, minInput, maxInput, minBias, maxBias, outType); + public LogSoftmax logSoftmax(Operand logits) { + return LogSoftmax.create(scope, logits); + } + + /** + * Builds an {@link QuantizedInstanceNorm} operation + * + * @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 + * @return a new instance of QuantizedInstanceNorm + * @see org.tensorflow.op.nn.QuantizedInstanceNorm + */ + public QuantizedInstanceNorm quantizedInstanceNorm(Operand x, + Operand xMin, Operand xMax, QuantizedInstanceNorm.Options... options) { + return QuantizedInstanceNorm.create(scope, x, xMin, xMax, options); } /** @@ -977,98 +900,115 @@ public QuantizedBiasAdd quantizedBiasAdd(Operand input, Operand< * @return a new instance of Dilation2dBackpropInput * @see org.tensorflow.op.nn.Dilation2dBackpropInput */ - public Dilation2dBackpropInput dilation2dBackpropInput(Operand input, + public Dilation2dBackpropInput dilation2dBackpropInput(Operand input, Operand filter, Operand outBackprop, List strides, List rates, String padding) { return Dilation2dBackpropInput.create(scope, input, filter, outBackprop, strides, rates, padding); } /** - * Builds an {@link NthElement} operation + * Builds an {@link Relu6} operation * - * @param input 1-D or higher with last dimension at least `n+1`. - * @param n 0-D. Position of sorted vector to select along the last dimension (along - * @param options carries optional attributes values - * @return a new instance of NthElement - * @see org.tensorflow.op.nn.NthElement + * @param features + * @return a new instance of Relu6 + * @see org.tensorflow.op.nn.Relu6 */ - public NthElement nthElement(Operand input, Operand n, - NthElement.Options... options) { - return NthElement.create(scope, input, n, options); + public Relu6 relu6(Operand features) { + return Relu6.create(scope, features); } /** - * Builds an {@link Conv2dBackpropInput} operation + * Builds an {@link CtcBeamSearchDecoder} operation * - * @param inputSizes An integer vector representing the shape of `input`, - * @param filter 4-D with shape - * @param outBackprop 4-D with shape `[batch, out_height, out_width, out_channels]`. - * @param strides The stride of the sliding window for each dimension of the input - * @param padding The type of padding algorithm to use. + * @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 - * @return a new instance of Conv2dBackpropInput - * @see org.tensorflow.op.nn.Conv2dBackpropInput + * @return a new instance of CtcBeamSearchDecoder + * @see org.tensorflow.op.nn.CtcBeamSearchDecoder */ - public Conv2dBackpropInput conv2dBackpropInput(Operand inputSizes, - Operand filter, Operand outBackprop, List strides, String padding, - Conv2dBackpropInput.Options... options) { - return Conv2dBackpropInput.create(scope, inputSizes, filter, outBackprop, strides, padding, options); + public CtcBeamSearchDecoder ctcBeamSearchDecoder(Operand inputs, + Operand sequenceLength, Long beamWidth, Long topPaths, + CtcBeamSearchDecoder.Options... options) { + return CtcBeamSearchDecoder.create(scope, inputs, sequenceLength, beamWidth, topPaths, options); + } + + /** + * Builds an {@link Softmax} operation + * + * @param logits 2-D with shape `[batch_size, num_classes]`. + * @return a new instance of Softmax + * @see org.tensorflow.op.nn.Softmax + */ + public Softmax softmax(Operand logits) { + return Softmax.create(scope, logits); } /** - * Builds an {@link Elu} operation + * Builds an {@link QuantizedRelu6} operation * * @param features - * @return a new instance of Elu - * @see org.tensorflow.op.nn.Elu + * @param minFeatures The float value that the lowest quantized value represents. + * @param maxFeatures The float value that the highest quantized value represents. + * @param outType + * @return a new instance of QuantizedRelu6 + * @see org.tensorflow.op.nn.QuantizedRelu6 */ - public Elu elu(Operand features) { - return Elu.create(scope, features); + public QuantizedRelu6 quantizedRelu6(Operand features, + Operand minFeatures, Operand maxFeatures, DataType outType) { + return QuantizedRelu6.create(scope, features, minFeatures, maxFeatures, outType); } /** - * Builds an {@link LocalResponseNormalization} operation + * Builds an {@link Conv2d} operation * - * @param input 4-D. + * @param input A 4-D tensor. The dimension order is interpreted according to the value + * @param filter A 4-D tensor of shape + * @param strides 1-D tensor of length 4. The stride of the sliding window for each + * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of LocalResponseNormalization - * @see org.tensorflow.op.nn.LocalResponseNormalization + * @return a new instance of Conv2d + * @see org.tensorflow.op.nn.Conv2d */ - public LocalResponseNormalization localResponseNormalization( - Operand input, LocalResponseNormalization.Options... options) { - return LocalResponseNormalization.create(scope, input, options); + public Conv2d conv2d(Operand input, Operand filter, + List strides, String padding, Conv2d.Options... options) { + return Conv2d.create(scope, input, filter, strides, padding, options); } /** - * Builds an {@link DepthwiseConv2dNativeBackpropFilter} operation + * Builds an {@link Conv3dBackpropInput} operation * - * @param input 4-D with shape based on `data_format`. For example, if - * @param filterSizes An integer vector representing the tensor shape of `filter`, - * @param outBackprop 4-D with shape based on `data_format`. - * @param strides The stride of the sliding window for each dimension of the input + * @param inputSizes An integer vector representing the tensor shape of `input`, + * @param filter Shape `[depth, rows, cols, in_channels, out_channels]`. + * @param outBackprop Backprop signal of shape `[batch, out_depth, out_rows, out_cols, + * @param strides 1-D tensor of length 5. The stride of the sliding window for each * @param padding The type of padding algorithm to use. * @param options carries optional attributes values - * @return a new instance of DepthwiseConv2dNativeBackpropFilter - * @see org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropFilter + * @return a new instance of Conv3dBackpropInput + * @see org.tensorflow.op.nn.Conv3dBackpropInput */ - public DepthwiseConv2dNativeBackpropFilter depthwiseConv2dNativeBackpropFilter( - Operand input, Operand filterSizes, Operand outBackprop, List strides, - String padding, DepthwiseConv2dNativeBackpropFilter.Options... options) { - return DepthwiseConv2dNativeBackpropFilter.create(scope, input, filterSizes, outBackprop, strides, padding, options); + public Conv3dBackpropInput conv3dBackpropInput( + Operand inputSizes, Operand filter, Operand outBackprop, List strides, + String padding, Conv3dBackpropInput.Options... options) { + return Conv3dBackpropInput.create(scope, inputSizes, filter, outBackprop, strides, padding, options); } /** - * Builds an {@link SpaceToBatch} operation + * Builds an {@link QuantizedReluX} operation * - * @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 - * @param blockSize - * @return a new instance of SpaceToBatch - * @see org.tensorflow.op.nn.SpaceToBatch + * @param features + * @param maxValue + * @param minFeatures The float value that the lowest quantized value represents. + * @param maxFeatures The float value that the highest quantized value represents. + * @param outType + * @return a new instance of QuantizedReluX + * @see org.tensorflow.op.nn.QuantizedReluX */ - public SpaceToBatch spaceToBatch(Operand input, Operand paddings, - Long blockSize) { - return SpaceToBatch.create(scope, input, paddings, blockSize); + public QuantizedReluX quantizedReluX(Operand features, + Operand maxValue, Operand minFeatures, Operand maxFeatures, + DataType outType) { + return QuantizedReluX.create(scope, features, maxValue, minFeatures, maxFeatures, outType); } /** @@ -1083,93 +1023,73 @@ public SpaceToBatch spaceToBatch(Operand input, Oper * @return a new instance of FusedPadConv2d * @see org.tensorflow.op.nn.FusedPadConv2d */ - public FusedPadConv2d fusedPadConv2d(Operand input, - Operand paddings, Operand filter, String mode, List strides, + public FusedPadConv2d fusedPadConv2d(Operand input, + Operand paddings, Operand filter, String mode, List strides, String padding) { return FusedPadConv2d.create(scope, input, paddings, filter, mode, strides, padding); } /** - * Builds an {@link MaxPoolGrad} operation + * Builds an {@link FixedUnigramCandidateSampler} operation * - * @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 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 - * @param padding The type of padding algorithm to use. + * @param trueClasses A batch_size * num_true matrix, in which each row contains the + * @param numTrue Number of true labels per context. + * @param numSampled Number of candidates to randomly sample. + * @param unique If unique is true, we sample with rejection, so that all sampled + * @param rangeMax The sampler will sample integers from the interval [0, range_max). * @param options carries optional attributes values - * @return a new instance of MaxPoolGrad - * @see org.tensorflow.op.nn.MaxPoolGrad + * @return a new instance of FixedUnigramCandidateSampler + * @see org.tensorflow.op.nn.FixedUnigramCandidateSampler */ - public MaxPoolGrad maxPoolGrad(Operand origInput, Operand origOutput, - Operand grad, Operand ksize, Operand strides, String padding, - MaxPoolGrad.Options... options) { - return MaxPoolGrad.create(scope, origInput, origOutput, grad, ksize, strides, padding, options); + public FixedUnigramCandidateSampler fixedUnigramCandidateSampler(Operand trueClasses, + Long numTrue, Long numSampled, Boolean unique, Long rangeMax, + FixedUnigramCandidateSampler.Options... options) { + return FixedUnigramCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, rangeMax, options); } /** - * Builds an {@link QuantizedBatchNormWithGlobalNormalization} operation + * Builds an {@link Dilation2dBackpropFilter} operation * - * @param t A 4D input Tensor. - * @param tMin The value represented by the lowest quantized input. - * @param tMax The value represented by the highest quantized input. - * @param m A 1D mean Tensor with size matching the last dimension of t. - * @param mMin The value represented by the lowest quantized mean. - * @param mMax The value represented by the highest quantized mean. - * @param v A 1D variance Tensor with size matching the last dimension of t. - * @param vMin The value represented by the lowest quantized variance. - * @param vMax The value represented by the highest quantized variance. - * @param beta A 1D beta Tensor with size matching the last dimension of t. - * @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. - * @param gammaMin The value represented by the lowest quantized gamma. - * @param gammaMax The value represented by the highest quantized gamma. - * @param outType - * @param varianceEpsilon A small float number to avoid dividing by 0. - * @param scaleAfterNormalization A bool indicating whether the resulted tensor - * @return a new instance of QuantizedBatchNormWithGlobalNormalization - * @see org.tensorflow.op.nn.QuantizedBatchNormWithGlobalNormalization + * @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 strides 1-D of length 4. The stride of the sliding window for each dimension of + * @param rates 1-D of length 4. The input stride for atrous morphological dilation. + * @param padding The type of padding algorithm to use. + * @return a new instance of Dilation2dBackpropFilter + * @see org.tensorflow.op.nn.Dilation2dBackpropFilter */ - public QuantizedBatchNormWithGlobalNormalization quantizedBatchNormWithGlobalNormalization( - 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) { - return QuantizedBatchNormWithGlobalNormalization.create(scope, t, tMin, tMax, m, mMin, mMax, v, vMin, vMax, beta, betaMin, betaMax, gamma, gammaMin, gammaMax, outType, varianceEpsilon, scaleAfterNormalization); + public Dilation2dBackpropFilter dilation2dBackpropFilter(Operand input, + Operand filter, Operand outBackprop, List strides, List rates, + String padding) { + return Dilation2dBackpropFilter.create(scope, input, filter, outBackprop, strides, rates, padding); } /** - * Builds an {@link Selu} operation + * Builds an {@link Elu} operation * * @param features - * @return a new instance of Selu - * @see org.tensorflow.op.nn.Selu + * @return a new instance of Elu + * @see org.tensorflow.op.nn.Elu */ - public Selu selu(Operand features) { - return Selu.create(scope, features); + public Elu elu(Operand features) { + return Elu.create(scope, features); } /** - * Builds an {@link FusedResizeAndPadConv2d} operation + * Builds an {@link Dilation2d} operation * - * @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 paddings A two-column matrix specifying the padding sizes. The number of - * @param filter 4-D with shape - * @param mode - * @param strides 1-D of length 4. The stride of the sliding window for each dimension + * @param input 4-D with shape `[batch, in_height, in_width, depth]`. + * @param filter 3-D with shape `[filter_height, filter_width, depth]`. + * @param strides The stride of the sliding window for each dimension of the input + * @param rates The input stride for atrous morphological dilation. Must be: * @param padding The type of padding algorithm to use. - * @param options carries optional attributes values - * @return a new instance of FusedResizeAndPadConv2d - * @see org.tensorflow.op.nn.FusedResizeAndPadConv2d + * @return a new instance of Dilation2d + * @see org.tensorflow.op.nn.Dilation2d */ - public FusedResizeAndPadConv2d fusedResizeAndPadConv2d(Operand input, - Operand size, Operand paddings, Operand filter, String mode, - List strides, String padding, FusedResizeAndPadConv2d.Options... options) { - return FusedResizeAndPadConv2d.create(scope, input, size, paddings, filter, mode, strides, padding, options); + public Dilation2d dilation2d(Operand input, Operand filter, + List strides, List rates, String padding) { + return Dilation2d.create(scope, input, filter, strides, rates, padding); } /** @@ -1183,11 +1103,48 @@ public FusedResizeAndPadConv2d fusedResizeAndPadConv2d(Ope * @return a new instance of MaxPool3d * @see org.tensorflow.op.nn.MaxPool3d */ - public MaxPool3d maxPool3d(Operand input, List ksize, + public MaxPool3d maxPool3d(Operand input, List ksize, List strides, String padding, MaxPool3d.Options... options) { return MaxPool3d.create(scope, input, ksize, strides, padding, options); } + /** + * Builds an {@link Conv2dBackpropFilter} operation + * + * @param input 4-D with shape `[batch, in_height, in_width, in_channels]`. + * @param filterSizes An integer vector representing the tensor shape of `filter`, + * @param outBackprop 4-D with shape `[batch, out_height, out_width, out_channels]`. + * @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 + * @return a new instance of Conv2dBackpropFilter + * @see org.tensorflow.op.nn.Conv2dBackpropFilter + */ + public Conv2dBackpropFilter conv2dBackpropFilter(Operand input, + Operand filterSizes, Operand outBackprop, List strides, String padding, + Conv2dBackpropFilter.Options... options) { + return Conv2dBackpropFilter.create(scope, input, filterSizes, outBackprop, strides, padding, options); + } + + /** + * Builds an {@link CudnnRnnCanonicalToParams} operation + * + * @param numLayers + * @param numUnits + * @param inputSize + * @param weights + * @param biases + * @param options carries optional attributes values + * @return a new instance of CudnnRnnCanonicalToParams + * @see org.tensorflow.op.nn.CudnnRnnCanonicalToParams + */ + public CudnnRnnCanonicalToParams cudnnRnnCanonicalToParams( + Operand numLayers, Operand numUnits, Operand inputSize, + Iterable> weights, Iterable> biases, + CudnnRnnCanonicalToParams.Options... options) { + return CudnnRnnCanonicalToParams.create(scope, numLayers, numUnits, inputSize, weights, biases, options); + } + /** * Builds an {@link CtcGreedyDecoder} operation * @@ -1197,36 +1154,90 @@ public MaxPool3d maxPool3d(Operand input, List ks * @return a new instance of CtcGreedyDecoder * @see org.tensorflow.op.nn.CtcGreedyDecoder */ - public CtcGreedyDecoder ctcGreedyDecoder(Operand inputs, Operand sequenceLength, + public CtcGreedyDecoder ctcGreedyDecoder(Operand inputs, Operand sequenceLength, CtcGreedyDecoder.Options... options) { return CtcGreedyDecoder.create(scope, inputs, sequenceLength, options); } /** - * Builds an {@link QuantizedRelu6} operation + * Builds an {@link FusedResizeAndPadConv2d} operation * - * @param features - * @param minFeatures The float value that the lowest quantized value represents. - * @param maxFeatures The float value that the highest quantized value represents. - * @param outType - * @return a new instance of QuantizedRelu6 - * @see org.tensorflow.op.nn.QuantizedRelu6 + * @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 paddings A two-column matrix specifying the padding sizes. The number of + * @param filter 4-D with shape + * @param mode + * @param strides 1-D of length 4. The stride of the sliding window for each dimension + * @param padding The type of padding algorithm to use. + * @param options carries optional attributes values + * @return a new instance of FusedResizeAndPadConv2d + * @see org.tensorflow.op.nn.FusedResizeAndPadConv2d */ - public QuantizedRelu6 quantizedRelu6(Operand features, Operand minFeatures, - Operand maxFeatures, Class outType) { - return QuantizedRelu6.create(scope, features, minFeatures, maxFeatures, outType); + public FusedResizeAndPadConv2d fusedResizeAndPadConv2d(Operand input, + Operand size, Operand paddings, Operand filter, String mode, + List strides, String padding, FusedResizeAndPadConv2d.Options... options) { + return FusedResizeAndPadConv2d.create(scope, input, size, paddings, filter, mode, strides, padding, options); } /** - * Builds an {@link BiasAdd} operation + * Builds an {@link BatchNormWithGlobalNormalization} operation * - * @param value Any number of dimensions. - * @param bias 1-D with size the last dimension of `value`. + * @param t A 4D input Tensor. + * @param m A 1D mean Tensor with size matching the last dimension of t. + * @param v A 1D variance Tensor with size matching the last dimension of t. + * @param beta A 1D beta Tensor with size matching the last dimension of t. + * @param gamma A 1D gamma Tensor with size matching the last dimension of t. + * @param varianceEpsilon A small float number to avoid dividing by 0. + * @param scaleAfterNormalization A bool indicating whether the resulted tensor + * @return a new instance of BatchNormWithGlobalNormalization + * @see org.tensorflow.op.nn.BatchNormWithGlobalNormalization + */ + public BatchNormWithGlobalNormalization batchNormWithGlobalNormalization( + Operand t, Operand m, Operand v, Operand beta, Operand gamma, + Float varianceEpsilon, Boolean scaleAfterNormalization) { + return BatchNormWithGlobalNormalization.create(scope, t, m, v, beta, gamma, varianceEpsilon, scaleAfterNormalization); + } + + /** + * Builds an {@link FractionalMaxPool} operation + * + * @param value 4-D with shape `[batch, height, width, channels]`. + * @param poolingRatio Pooling ratio for each dimension of `value`, currently only * @param options carries optional attributes values - * @return a new instance of BiasAdd - * @see org.tensorflow.op.nn.BiasAdd + * @return a new instance of FractionalMaxPool + * @see org.tensorflow.op.nn.FractionalMaxPool */ - public BiasAdd biasAdd(Operand value, Operand bias, BiasAdd.Options... options) { - return BiasAdd.create(scope, value, bias, options); + public FractionalMaxPool fractionalMaxPool(Operand value, + List poolingRatio, FractionalMaxPool.Options... options) { + return FractionalMaxPool.create(scope, value, poolingRatio, options); + } + + /** + * Builds an {@link FusedBatchNormGrad} operation + * + * @param yBackprop A 4D Tensor for the gradient with respect to y. + * @param x A 4D Tensor for input data. + * @param scale A 1D Tensor for scaling factor, to scale the normalized x. + * @param reserveSpace1 When is_training is True, a 1D Tensor for the computed batch + * @param reserveSpace2 When is_training is True, a 1D Tensor for the computed batch + * @param options carries optional attributes values + * @return a new instance of FusedBatchNormGrad + * @see org.tensorflow.op.nn.FusedBatchNormGrad + */ + public FusedBatchNormGrad fusedBatchNormGrad( + Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, + Operand reserveSpace2, FusedBatchNormGrad.Options... options) { + return FusedBatchNormGrad.create(scope, yBackprop, x, scale, reserveSpace1, reserveSpace2, options); + } + + /** + * Builds an {@link Softsign} operation + * + * @param features + * @return a new instance of Softsign + * @see org.tensorflow.op.nn.Softsign + */ + public Softsign softsign(Operand features) { + return Softsign.create(scope, features); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java index 49afedf3717..919570b8851 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/Ops.java @@ -7,9 +7,11 @@ import java.nio.LongBuffer; import java.nio.charset.Charset; import java.util.List; +import org.tensorflow.DataType; +import org.tensorflow.EagerSession; import org.tensorflow.ExecutionEnvironment; import org.tensorflow.Operand; -import org.tensorflow.Shape; +import org.tensorflow.Tensor; import org.tensorflow.op.core.Abort; import org.tensorflow.op.core.All; import org.tensorflow.op.core.Any; @@ -262,8 +264,18 @@ import org.tensorflow.op.core.VariableShape; import org.tensorflow.op.core.Where; import org.tensorflow.op.core.Where3; +import org.tensorflow.op.core.WriteKafka; import org.tensorflow.op.core.Zeros; import org.tensorflow.op.core.ZerosLike; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building operations as {@link Op Op}s @@ -282,13 +294,13 @@ * Operand four = ops.constant(4); * // Most builders are found within a group, and accept * // Operand types as operands - * Operand nine = ops.math().add(four, ops.constant(5)); + * Operand nine = ops.math.add(four, ops.constant(5)); * // Multi-result operations however offer methods to * // select a particular result for use. * Operand result = - * ops.math().add(ops.array().unique(s, a).y(), b); + * ops.math.add(ops.unique(s, a).y(), b); * // Optional attributes - * ops.math().matMul(a, b, MatMul.transposeA(true)); + * ops.linalg.matMul(a, b, MatMul.transposeA(true)); * // Naming operators * ops.withName("foo").constant(5); // name "foo" * // Names can exist in a hierarchy @@ -328,10 +340,10 @@ public final class Ops { public final SignalOps signal; - public final QuantizationOps quantization; - public final TrainOps train; + public final QuantizationOps quantization; + private Ops(Scope scope) { this.scope = scope; nn = new NnOps(scope); @@ -348,500 +360,472 @@ private Ops(Scope scope) { math = new MathOps(scope); audio = new AudioOps(scope); signal = new SignalOps(scope); - quantization = new QuantizationOps(scope); train = new TrainOps(scope); + quantization = new QuantizationOps(scope); } /** - * Builds an {@link RemoteFusedGraphExecute} operation + * Builds an {@link MutexLock} operation * - * @param inputs Arbitrary number of tensors with arbitrary data types - * @param Toutputs - * @param serializedRemoteFusedGraphExecuteInfo Serialized protocol buffer - * @return a new instance of RemoteFusedGraphExecute - * @see org.tensorflow.op.core.RemoteFusedGraphExecute + * @param mutex The mutex resource to lock. + * @return a new instance of MutexLock + * @see org.tensorflow.op.core.MutexLock */ - public RemoteFusedGraphExecute remoteFusedGraphExecute(Iterable> inputs, - List> Toutputs, String serializedRemoteFusedGraphExecuteInfo) { - return RemoteFusedGraphExecute.create(scope, inputs, Toutputs, serializedRemoteFusedGraphExecuteInfo); + public MutexLock mutexLock(Operand mutex) { + return MutexLock.create(scope, mutex); } /** - * Builds an {@link ReadVariableOp} operation + * Builds an {@link BatchToSpace} operation * - * @param resource handle to the resource in which to store the variable. - * @param dtype the dtype of the value. - * @return a new instance of ReadVariableOp - * @see org.tensorflow.op.core.ReadVariableOp + * @param input 4-D tensor with shape + * @param crops 2-D tensor of non-negative integers with shape `[2, 2]`. It specifies + * @param blockSize + * @return a new instance of BatchToSpace + * @see org.tensorflow.op.core.BatchToSpace */ - public ReadVariableOp readVariableOp(Operand resource, Class dtype) { - return ReadVariableOp.create(scope, resource, dtype); + public BatchToSpace batchToSpace(Operand input, + Operand crops, Long blockSize) { + return BatchToSpace.create(scope, input, crops, blockSize); } /** - * Builds an {@link MutexLock} operation + * Builds an {@link ZerosLike} operation * - * @param mutex The mutex resource to lock. - * @return a new instance of MutexLock - * @see org.tensorflow.op.core.MutexLock + * @param x a tensor of type T. + * @return a new instance of ZerosLike + * @see org.tensorflow.op.core.ZerosLike */ - public MutexLock mutexLock(Operand mutex) { - return MutexLock.create(scope, mutex); + public ZerosLike zerosLike(Operand x) { + return ZerosLike.create(scope, x); } /** - * Builds an {@link OrderedMapUnstageNoKey} operation + * Builds an {@link ReduceMax} operation * - * @param indices - * @param dtypes + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range * @param options carries optional attributes values - * @return a new instance of OrderedMapUnstageNoKey - * @see org.tensorflow.op.core.OrderedMapUnstageNoKey + * @return a new instance of ReduceMax + * @see org.tensorflow.op.core.ReduceMax */ - public OrderedMapUnstageNoKey orderedMapUnstageNoKey(Operand indices, - List> dtypes, OrderedMapUnstageNoKey.Options... options) { - return OrderedMapUnstageNoKey.create(scope, indices, dtypes, options); + public ReduceMax reduceMax(Operand input, + Operand axis, ReduceMax.Options... options) { + return ReduceMax.create(scope, input, axis, options); } /** - * Builds an {@link ResourceScatterAdd} operation + * Builds an {@link Unique} operation * - * @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`. - * @return a new instance of ResourceScatterAdd - * @see org.tensorflow.op.core.ResourceScatterAdd + * @param x A `Tensor`. + * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @param outIdx + * @return a new instance of Unique + * @see org.tensorflow.op.core.Unique */ - public ResourceScatterAdd resourceScatterAdd(Operand resource, - Operand indices, Operand updates) { - return ResourceScatterAdd.create(scope, resource, indices, updates); + public Unique unique(Operand x, + Operand axis, DataType outIdx) { + return Unique.create(scope, x, axis, outIdx); } /** - * Builds an {@link TensorListFromTensor} operation + * Builds an {@link AssignSub} operation * - * @param tensor - * @param elementShape - * @return a new instance of TensorListFromTensor - * @see org.tensorflow.op.core.TensorListFromTensor + * @param ref Should be from a `Variable` node. + * @param value The value to be subtracted to the variable. + * @param options carries optional attributes values + * @return a new instance of AssignSub + * @see org.tensorflow.op.core.AssignSub */ - public TensorListFromTensor tensorListFromTensor(Operand tensor, - Operand elementShape) { - return TensorListFromTensor.create(scope, tensor, elementShape); + public AssignSub assignSub(Operand ref, Operand value, + AssignSub.Options... options) { + return AssignSub.create(scope, ref, value, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link DynamicStitch} operation * - * @param shape the tensor shape. - * @param data a buffer containing the tensor data. - * @return a float constant - * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer - * @see org.tensorflow.op.core.Constant + * @param indices + * @param data + * @return a new instance of DynamicStitch + * @see org.tensorflow.op.core.DynamicStitch */ - public Constant constant(long[] shape, FloatBuffer data) { - return Constant.create(scope, shape, data); + public DynamicStitch dynamicStitch(Iterable> indices, + Iterable> data) { + return DynamicStitch.create(scope, indices, data); } /** - * Builds an {@link MutableDenseHashTable} operation + * Builds an {@link ResourceApplyAdamWithAmsgrad} operation * - * @param emptyKey The key used to represent empty key buckets internally. Must not - * @param deletedKey - * @param valueDtype Type of the table values. + * @param var Should be from a Variable(). + * @param m Should be from a Variable(). + * @param v Should be from a Variable(). + * @param vhat Should be from a Variable(). + * @param beta1Power Must be a scalar. + * @param beta2Power Must be a scalar. + * @param lr Scaling factor. Must be a scalar. + * @param beta1 Momentum factor. Must be a scalar. + * @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 - * @return a new instance of MutableDenseHashTable - * @see org.tensorflow.op.core.MutableDenseHashTable + * @return a new instance of ResourceApplyAdamWithAmsgrad + * @see org.tensorflow.op.core.ResourceApplyAdamWithAmsgrad */ - public MutableDenseHashTable mutableDenseHashTable(Operand emptyKey, - Operand deletedKey, Class valueDtype, MutableDenseHashTable.Options... options) { - return MutableDenseHashTable.create(scope, emptyKey, deletedKey, valueDtype, options); + public ResourceApplyAdamWithAmsgrad resourceApplyAdamWithAmsgrad(Operand var, + Operand m, Operand v, Operand vhat, Operand beta1Power, Operand beta2Power, + Operand lr, Operand beta1, Operand beta2, Operand epsilon, Operand grad, + ResourceApplyAdamWithAmsgrad.Options... options) { + return ResourceApplyAdamWithAmsgrad.create(scope, var, m, v, vhat, beta1Power, beta2Power, lr, beta1, beta2, epsilon, grad, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link SetSize} operation * - * @param data The value to put into the new constant. - * @return a float constant - * @see org.tensorflow.op.core.Constant + * @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 + * @return a new instance of SetSize + * @see org.tensorflow.op.core.SetSize */ - public Constant constant(float data) { - return Constant.create(scope, data); + public SetSize setSize(Operand setIndices, Operand setValues, + Operand setShape, SetSize.Options... options) { + return SetSize.create(scope, setIndices, setValues, setShape, options); } /** - * Builds an {@link TensorListConcatV2} operation + * Builds an {@link DrawBoundingBoxesV2} operation * - * @param inputHandle - * @param elementShape - * @param leadingDims - * @param elementDtype - * @return a new instance of TensorListConcatV2 - * @see org.tensorflow.op.core.TensorListConcatV2 + * @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 colors 2-D. A list of RGBA colors to cycle through for the boxes. + * @return a new instance of DrawBoundingBoxesV2 + * @see org.tensorflow.op.core.DrawBoundingBoxesV2 */ - public TensorListConcatV2 tensorListConcatV2(Operand inputHandle, - Operand elementShape, Operand leadingDims, Class elementDtype) { - return TensorListConcatV2.create(scope, inputHandle, elementShape, leadingDims, elementDtype); + public DrawBoundingBoxesV2 drawBoundingBoxesV2(Operand images, + Operand boxes, Operand colors) { + return DrawBoundingBoxesV2.create(scope, images, boxes, colors); } /** - * Builds an {@link ReduceAny} operation + * Builds an {@link StringUpper} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range + * @param input * @param options carries optional attributes values - * @return a new instance of ReduceAny - * @see org.tensorflow.op.core.ReduceAny + * @return a new instance of StringUpper + * @see org.tensorflow.op.core.StringUpper */ - public ReduceAny reduceAny(Operand input, Operand axis, - ReduceAny.Options... options) { - return ReduceAny.create(scope, input, axis, options); + public StringUpper stringUpper(Operand input, StringUpper.Options... options) { + return StringUpper.create(scope, input, options); } /** - * Builds an {@link CudnnRNNCanonicalToParamsV2} operation + * Builds an {@link TensorArraySize} operation * - * @param numLayers - * @param numUnits - * @param inputSize - * @param weights - * @param biases - * @param options carries optional attributes values - * @return a new instance of CudnnRNNCanonicalToParamsV2 - * @see org.tensorflow.op.core.CudnnRNNCanonicalToParamsV2 + * @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 + * @see org.tensorflow.op.core.TensorArraySize */ - public CudnnRNNCanonicalToParamsV2 cudnnRNNCanonicalToParamsV2( - Operand numLayers, Operand numUnits, Operand inputSize, - Iterable> weights, Iterable> biases, - CudnnRNNCanonicalToParamsV2.Options... options) { - return CudnnRNNCanonicalToParamsV2.create(scope, numLayers, numUnits, inputSize, weights, biases, options); + public TensorArraySize tensorArraySize(Operand handle, Operand flowIn) { + return TensorArraySize.create(scope, handle, flowIn); } /** - * Builds an {@link StatefulStandardNormalV2} operation + * Builds an {@link StopGradient} operation * - * @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 StatefulStandardNormalV2 - * @see org.tensorflow.op.core.StatefulStandardNormalV2 + * @param input + * @return a new instance of StopGradient + * @see org.tensorflow.op.core.StopGradient */ - public StatefulStandardNormalV2 statefulStandardNormalV2(Operand resource, - Operand algorithm, Operand shape) { - return StatefulStandardNormalV2.create(scope, resource, algorithm, shape); + public StopGradient stopGradient(Operand input) { + return StopGradient.create(scope, input); } /** - * Builds an {@link OrderedMapIncompleteSize} operation + * Builds an {@link ReverseSequence} operation * - * @param dtypes + * @param input The input to reverse. + * @param seqLengths 1-D with length `input.dims(batch_dim)` and + * @param seqDim The dimension which is partially reversed. * @param options carries optional attributes values - * @return a new instance of OrderedMapIncompleteSize - * @see org.tensorflow.op.core.OrderedMapIncompleteSize + * @return a new instance of ReverseSequence + * @see org.tensorflow.op.core.ReverseSequence */ - public OrderedMapIncompleteSize orderedMapIncompleteSize(List> dtypes, - OrderedMapIncompleteSize.Options... options) { - return OrderedMapIncompleteSize.create(scope, dtypes, options); + public ReverseSequence reverseSequence(Operand input, + Operand seqLengths, Long seqDim, ReverseSequence.Options... options) { + return ReverseSequence.create(scope, input, seqLengths, seqDim, options); } /** - * Builds an {@link TensorListResize} operation + * Builds an {@link AssignSubVariableOp} operation * - * @param inputHandle - * @param size - * @return a new instance of TensorListResize - * @see org.tensorflow.op.core.TensorListResize + * @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 + * @see org.tensorflow.op.core.AssignSubVariableOp */ - public TensorListResize tensorListResize(Operand inputHandle, Operand size) { - return TensorListResize.create(scope, inputHandle, size); + public AssignSubVariableOp assignSubVariableOp(Operand resource, + Operand value) { + return AssignSubVariableOp.create(scope, resource, value); } /** - * Builds an {@link Constant} operation + * Builds an {@link ClipByValue} operation * - * @param data An array containing the values to put into the new constant. String elements are - * @see org.tensorflow.op.core.Constant + * @param t A `Tensor`. + * @param clipValueMin A 0-D (scalar) `Tensor`, or a `Tensor` with the same shape + * @param clipValueMax A 0-D (scalar) `Tensor`, or a `Tensor` with the same shape + * @return a new instance of ClipByValue + * @see org.tensorflow.op.core.ClipByValue */ - public Constant constant(byte[] data) { - return Constant.create(scope, data); + public ClipByValue clipByValue(Operand t, Operand clipValueMin, + Operand clipValueMax) { + return ClipByValue.create(scope, t, clipValueMin, clipValueMax); } /** - * Builds an {@link InplaceAdd} operation + * Builds an {@link BroadcastTo} operation * - * @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. - * @return a new instance of InplaceAdd - * @see org.tensorflow.op.core.InplaceAdd + * @param input A Tensor to broadcast. + * @param shape An 1-D `int` Tensor. The shape of the desired output. + * @return a new instance of BroadcastTo + * @see org.tensorflow.op.core.BroadcastTo */ - public InplaceAdd inplaceAdd(Operand x, Operand i, Operand v) { - return InplaceAdd.create(scope, x, i, v); + public BroadcastTo broadcastTo(Operand input, + Operand shape) { + return BroadcastTo.create(scope, input, shape); } /** - * Builds an {@link All} operation + * Builds an {@link TensorScatterSub} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range - * @param options carries optional attributes values - * @return a new instance of All - * @see org.tensorflow.op.core.All + * @param tensor Tensor to copy/update. + * @param indices Index tensor. + * @param updates Updates to scatter into output. + * @return a new instance of TensorScatterSub + * @see org.tensorflow.op.core.TensorScatterSub */ - public All all(Operand input, Operand axis, - All.Options... options) { - return All.create(scope, input, axis, options); - } - - /** - * Builds an {@link QuantizedReshape} operation - * - * @param tensor - * @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. - * @return a new instance of QuantizedReshape - * @see org.tensorflow.op.core.QuantizedReshape - */ - public QuantizedReshape quantizedReshape(Operand tensor, - Operand shape, Operand inputMin, Operand inputMax) { - return QuantizedReshape.create(scope, tensor, shape, inputMin, inputMax); - } - - /** - * Builds an {@link Bucketize} operation - * - * @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 - * @see org.tensorflow.op.core.Bucketize - */ - public Bucketize bucketize(Operand input, List boundaries) { - return Bucketize.create(scope, input, boundaries); - } - - /** - * Builds an {@link BatchToSpaceNd} operation - * - * @param input N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`, - * @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. - * @return a new instance of BatchToSpaceNd - * @see org.tensorflow.op.core.BatchToSpaceNd - */ - public BatchToSpaceNd batchToSpaceNd(Operand input, - Operand blockShape, Operand crops) { - return BatchToSpaceNd.create(scope, input, blockShape, crops); + public TensorScatterSub tensorScatterSub( + Operand tensor, Operand indices, Operand updates) { + return TensorScatterSub.create(scope, tensor, indices, updates); } /** - * Builds an {@link Constant} operation + * Builds an {@link FusedBatchNormGradV3} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param yBackprop A 4D Tensor for the gradient with respect to y. + * @param x A 4D Tensor for input data. + * @param scale A 1D Tensor for scaling factor, to scale the normalized x. + * @param reserveSpace1 When is_training is True, a 1D Tensor for the computed batch + * @param reserveSpace2 When is_training is True, a 1D Tensor for the computed batch + * @param reserveSpace3 When is_training is True, a 1D Tensor for some intermediate results to be reused + * @param options carries optional attributes values + * @return a new instance of FusedBatchNormGradV3 + * @see org.tensorflow.op.core.FusedBatchNormGradV3 */ - public Constant constant(int[][][] data) { - return Constant.create(scope, data); + public FusedBatchNormGradV3 fusedBatchNormGradV3( + Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, + Operand reserveSpace2, Operand reserveSpace3, FusedBatchNormGradV3.Options... options) { + return FusedBatchNormGradV3.create(scope, yBackprop, x, scale, reserveSpace1, reserveSpace2, reserveSpace3, options); } /** - * Builds an {@link Slice} operation + * Builds an {@link All} operation * - * @param input - * @param begin begin[i] specifies the offset into the 'i'th dimension of - * @param size size[i] specifies the number of elements of the 'i'th dimension - * @return a new instance of Slice - * @see org.tensorflow.op.core.Slice + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of All + * @see org.tensorflow.op.core.All */ - public Slice slice(Operand input, Operand begin, Operand size) { - return Slice.create(scope, input, begin, size); + public All all(Operand input, Operand axis, + All.Options... options) { + return All.create(scope, input, axis, options); } /** - * Builds an {@link DynamicStitch} operation + * Builds an {@link TensorArray} operation * - * @param indices - * @param data - * @return a new instance of DynamicStitch - * @see org.tensorflow.op.core.DynamicStitch + * @param size The size of the array. + * @param dtype The type of the elements on the tensor_array. + * @param options carries optional attributes values + * @return a new instance of TensorArray + * @see org.tensorflow.op.core.TensorArray */ - public DynamicStitch dynamicStitch(Iterable> indices, - Iterable> data) { - return DynamicStitch.create(scope, indices, data); + public TensorArray tensorArray(Operand size, DataType dtype, + TensorArray.Options... options) { + return TensorArray.create(scope, size, dtype, options); } /** - * Builds an {@link VarHandleOp} operation + * Builds an {@link ReduceProd} operation * - * @param dtype the type of this variable. Must agree with the dtypes - * @param shape The (possibly partially specified) shape of this variable. + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range * @param options carries optional attributes values - * @return a new instance of VarHandleOp - * @see org.tensorflow.op.core.VarHandleOp + * @return a new instance of ReduceProd + * @see org.tensorflow.op.core.ReduceProd */ - public VarHandleOp varHandleOp(Class dtype, Shape shape, VarHandleOp.Options... options) { - return VarHandleOp.create(scope, dtype, shape, options); + public ReduceProd reduceProd(Operand input, + Operand axis, ReduceProd.Options... options) { + return ReduceProd.create(scope, input, axis, options); } /** - * Builds an {@link ResourceScatterMin} operation + * Builds an {@link StatefulStandardNormal} operation * - * @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`. - * @return a new instance of ResourceScatterMin - * @see org.tensorflow.op.core.ResourceScatterMin + * @param resource The handle of the resource variable that stores the state of the RNG. + * @param shape The shape of the output tensor. + * @return a new instance of StatefulStandardNormal + * @see org.tensorflow.op.core.StatefulStandardNormal */ - public ResourceScatterMin resourceScatterMin(Operand resource, - Operand indices, Operand updates) { - return ResourceScatterMin.create(scope, resource, indices, updates); + public StatefulStandardNormal statefulStandardNormal( + Operand resource, Operand shape) { + return StatefulStandardNormal.create(scope, resource, shape); } /** - * Builds an {@link MapIncompleteSize} operation + * Builds an {@link StageClear} operation * * @param dtypes * @param options carries optional attributes values - * @return a new instance of MapIncompleteSize - * @see org.tensorflow.op.core.MapIncompleteSize + * @return a new instance of StageClear + * @see org.tensorflow.op.core.StageClear */ - public MapIncompleteSize mapIncompleteSize(List> dtypes, - MapIncompleteSize.Options... options) { - return MapIncompleteSize.create(scope, dtypes, options); + public StageClear stageClear(List> dtypes, StageClear.Options... options) { + return StageClear.create(scope, dtypes, options); } /** - * Builds an {@link TensorArrayRead} operation + * Builds an {@link Constant} operation * - * @param handle The handle to a TensorArray. - * @param index - * @param flowIn A float scalar that enforces proper chaining of operations. - * @param dtype The type of the elem that is returned. - * @return a new instance of TensorArrayRead - * @see org.tensorflow.op.core.TensorArrayRead + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public TensorArrayRead tensorArrayRead(Operand handle, Operand index, - Operand flowIn, Class dtype) { - return TensorArrayRead.create(scope, handle, index, flowIn, dtype); + public Constant constant(float[][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link Unique} operation + * Builds an {@link AssignAddVariableOp} operation * - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to - * @param outIdx - * @return a new instance of Unique - * @see org.tensorflow.op.core.Unique + * @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 + * @see org.tensorflow.op.core.AssignAddVariableOp */ - public Unique unique(Operand x, Operand axis, - Class outIdx) { - return Unique.create(scope, x, axis, outIdx); + public AssignAddVariableOp assignAddVariableOp(Operand resource, + Operand value) { + return AssignAddVariableOp.create(scope, resource, value); } /** - * Builds an {@link OneHot} operation + * Builds an {@link LinSpace} operation * - * @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 - * @return a new instance of OneHot - * @see org.tensorflow.op.core.OneHot + * @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. + * @return a new instance of LinSpace + * @see org.tensorflow.op.core.LinSpace */ - public OneHot oneHot(Operand indices, Operand depth, - Operand onValue, Operand offValue, OneHot.Options... options) { - return OneHot.create(scope, indices, depth, onValue, offValue, options); + public LinSpace linSpace(Operand start, + Operand stop, Operand num) { + return LinSpace.create(scope, start, stop, num); } /** - * Builds an {@link Constant} operation + * Builds an {@link ReduceSum} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of ReduceSum + * @see org.tensorflow.op.core.ReduceSum */ - public Constant constant(boolean[][][][][][] data) { - return Constant.create(scope, data); + public ReduceSum reduceSum(Operand input, + Operand axis, ReduceSum.Options... options) { + return ReduceSum.create(scope, input, axis, options); } /** - * Builds an {@link TensorListPushBackBatch} operation + * Builds an {@link Reverse} operation * - * @param inputHandles - * @param tensor - * @return a new instance of TensorListPushBackBatch - * @see org.tensorflow.op.core.TensorListPushBackBatch + * @param tensor Up to 8-D. + * @param axis 1-D. The indices of the dimensions to reverse. Must be in the range + * @return a new instance of Reverse + * @see org.tensorflow.op.core.Reverse */ - public TensorListPushBackBatch tensorListPushBackBatch(Operand inputHandles, - Operand tensor) { - return TensorListPushBackBatch.create(scope, inputHandles, tensor); + public Reverse reverse(Operand tensor, + Operand axis) { + return Reverse.create(scope, tensor, axis); } /** - * Builds an {@link ResourceScatterNdUpdate} operation + * Builds an {@link ResourceScatterNdSub} operation * * @param ref A resource handle. Must be from a VarHandleOp. * @param indices A Tensor. Must be one of the following types: int32, int64. - * @param updates A Tensor. Must have the same type as ref. A tensor of updated + * @param updates A Tensor. Must have the same type as ref. A tensor of * @param options carries optional attributes values - * @return a new instance of ResourceScatterNdUpdate - * @see org.tensorflow.op.core.ResourceScatterNdUpdate + * @return a new instance of ResourceScatterNdSub + * @see org.tensorflow.op.core.ResourceScatterNdSub */ - public ResourceScatterNdUpdate resourceScatterNdUpdate(Operand ref, - Operand indices, Operand updates, ResourceScatterNdUpdate.Options... options) { - return ResourceScatterNdUpdate.create(scope, ref, indices, updates, options); + public ResourceScatterNdSub resourceScatterNdSub( + Operand ref, Operand indices, Operand updates, + ResourceScatterNdSub.Options... options) { + return ResourceScatterNdSub.create(scope, ref, indices, updates, options); } /** - * Builds an {@link DeleteSessionTensor} operation + * Builds an {@link Constant} operation * - * @param handle The handle for a tensor stored in the session state. - * @return a new instance of DeleteSessionTensor - * @see org.tensorflow.op.core.DeleteSessionTensor + * @param data The string to put into the new constant. + * @return a string constant + * @see org.tensorflow.op.core.Constant */ - public DeleteSessionTensor deleteSessionTensor(Operand handle) { - return DeleteSessionTensor.create(scope, handle); + public Constant constant(String data) { + return Constant.create(scope, data); } /** - * Builds an {@link MatrixDiagPartV2} operation + * Builds an {@link StringLower} operation * - * @param input Rank `r` tensor where `r >= 2`. - * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main - * @param paddingValue The value to fill the area outside the specified diagonal band with. - * @return a new instance of MatrixDiagPartV2 - * @see org.tensorflow.op.core.MatrixDiagPartV2 + * @param input + * @param options carries optional attributes values + * @return a new instance of StringLower + * @see org.tensorflow.op.core.StringLower */ - public MatrixDiagPartV2 matrixDiagPartV2(Operand input, Operand k, - Operand paddingValue) { - return MatrixDiagPartV2.create(scope, input, k, paddingValue); + public StringLower stringLower(Operand input, StringLower.Options... options) { + return StringLower.create(scope, input, options); } /** - * Builds an {@link AssignSubVariableOp} operation + * Builds an {@link BarrierIncompleteSize} operation * - * @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 - * @see org.tensorflow.op.core.AssignSubVariableOp + * @param handle The handle to a barrier. + * @return a new instance of BarrierIncompleteSize + * @see org.tensorflow.op.core.BarrierIncompleteSize */ - public AssignSubVariableOp assignSubVariableOp(Operand resource, Operand value) { - return AssignSubVariableOp.create(scope, resource, value); + public BarrierIncompleteSize barrierIncompleteSize(Operand handle) { + return BarrierIncompleteSize.create(scope, handle); } /** - * Builds an {@link ReduceProd} operation + * Builds an {@link ScatterAdd} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range + * @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 - * @return a new instance of ReduceProd - * @see org.tensorflow.op.core.ReduceProd + * @return a new instance of ScatterAdd + * @see org.tensorflow.op.core.ScatterAdd */ - public ReduceProd reduceProd(Operand input, Operand axis, - ReduceProd.Options... options) { - return ReduceProd.create(scope, input, axis, options); + public ScatterAdd scatterAdd(Operand ref, + Operand indices, Operand updates, ScatterAdd.Options... options) { + return ScatterAdd.create(scope, ref, indices, updates, options); } /** @@ -850,237 +834,367 @@ public ReduceProd reduceProd(Operand input, Operand< * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(int[] data) { + public Constant constant(int[] data) { return Constant.create(scope, data); } /** - * Builds an {@link Unstage} operation + * Builds an {@link TensorArrayGather} operation * - * @param dtypes + * @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 - * @return a new instance of Unstage - * @see org.tensorflow.op.core.Unstage + * @return a new instance of TensorArrayGather + * @see org.tensorflow.op.core.TensorArrayGather */ - public Unstage unstage(List> dtypes, Unstage.Options... options) { - return Unstage.create(scope, dtypes, options); + public TensorArrayGather tensorArrayGather(Operand handle, + Operand indices, Operand flowIn, DataType dtype, + TensorArrayGather.Options... options) { + return TensorArrayGather.create(scope, handle, indices, flowIn, dtype, options); } /** - * Builds an {@link Tile} operation + * Builds an {@link MutableHashTableOfTensors} operation * - * @param input 1-D or higher. - * @param multiples 1-D. Length must be the same as the number of dimensions in `input` - * @return a new instance of Tile - * @see org.tensorflow.op.core.Tile + * @param keyDtype Type of the table keys. + * @param valueDtype Type of the table values. + * @param options carries optional attributes values + * @return a new instance of MutableHashTableOfTensors + * @see org.tensorflow.op.core.MutableHashTableOfTensors */ - public Tile tile(Operand input, Operand multiples) { - return Tile.create(scope, input, multiples); + public MutableHashTableOfTensors mutableHashTableOfTensors( + DataType keyDtype, DataType valueDtype, MutableHashTableOfTensors.Options... options) { + return MutableHashTableOfTensors.create(scope, keyDtype, valueDtype, options); } /** - * Builds an {@link TensorListSetItem} operation + * Builds an {@link TensorListScatterV2} operation * - * @param inputHandle - * @param index - * @param item - * @return a new instance of TensorListSetItem - * @see org.tensorflow.op.core.TensorListSetItem + * @param tensor + * @param indices + * @param elementShape + * @param numElements + * @return a new instance of TensorListScatterV2 + * @see org.tensorflow.op.core.TensorListScatterV2 */ - public TensorListSetItem tensorListSetItem(Operand inputHandle, Operand index, - Operand item) { - return TensorListSetItem.create(scope, inputHandle, index, item); + public TensorListScatterV2 tensorListScatterV2( + Operand tensor, Operand indices, Operand elementShape, + Operand numElements) { + return TensorListScatterV2.create(scope, tensor, indices, elementShape, numElements); } /** - * Builds an {@link EditDistance} operation + * Builds an {@link ResourceScatterNdAdd} operation * - * @param hypothesisIndices The indices of the hypothesis list SparseTensor. - * @param hypothesisValues The values of the hypothesis list SparseTensor. - * @param hypothesisShape The shape of the hypothesis list SparseTensor. - * @param truthIndices The indices of the truth list SparseTensor. - * @param truthValues The values of the truth list SparseTensor. - * @param truthShape truth indices, vector. + * @param ref A resource handle. Must be from a VarHandleOp. + * @param indices A Tensor. Must be one of the following types: int32, int64. + * @param updates A Tensor. Must have the same type as ref. A tensor of * @param options carries optional attributes values - * @return a new instance of EditDistance - * @see org.tensorflow.op.core.EditDistance + * @return a new instance of ResourceScatterNdAdd + * @see org.tensorflow.op.core.ResourceScatterNdAdd */ - public EditDistance editDistance(Operand hypothesisIndices, Operand hypothesisValues, - Operand hypothesisShape, Operand truthIndices, Operand truthValues, - Operand truthShape, EditDistance.Options... options) { - return EditDistance.create(scope, hypothesisIndices, hypothesisValues, hypothesisShape, truthIndices, truthValues, truthShape, options); + public ResourceScatterNdAdd resourceScatterNdAdd( + Operand ref, Operand indices, Operand updates, + ResourceScatterNdAdd.Options... options) { + return ResourceScatterNdAdd.create(scope, ref, indices, updates, options); } /** - * Builds an {@link TensorListPopBack} operation + * Builds an {@link InplaceSub} operation + * + * @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. + * @return a new instance of InplaceSub + * @see org.tensorflow.op.core.InplaceSub + */ + public InplaceSub inplaceSub(Operand x, Operand i, Operand v) { + return InplaceSub.create(scope, x, i, v); + } + + /** + * Builds an {@link ScatterNdUpdate} operation + * + * @param ref A mutable Tensor. Should be from a Variable node. + * @param indices A Tensor. Must be one of the following types: int32, int64. + * @param updates A Tensor. Must have the same type as ref. A tensor of updated + * @param options carries optional attributes values + * @return a new instance of ScatterNdUpdate + * @see org.tensorflow.op.core.ScatterNdUpdate + */ + public ScatterNdUpdate scatterNdUpdate(Operand ref, + Operand indices, Operand updates, ScatterNdUpdate.Options... options) { + return ScatterNdUpdate.create(scope, ref, indices, updates, options); + } + + /** + * Builds an {@link OrderedMapPeek} operation + * + * @param key + * @param indices + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of OrderedMapPeek + * @see org.tensorflow.op.core.OrderedMapPeek + */ + public OrderedMapPeek orderedMapPeek(Operand key, Operand indices, + List> dtypes, OrderedMapPeek.Options... options) { + return OrderedMapPeek.create(scope, key, indices, dtypes, options); + } + + /** + * Builds an {@link NextAfter} operation + * + * @param x1 + * @param x2 + * @return a new instance of NextAfter + * @see org.tensorflow.op.core.NextAfter + */ + public NextAfter nextAfter(Operand x1, Operand x2) { + return NextAfter.create(scope, x1, x2); + } + + /** + * Builds an {@link TensorListConcat} operation * * @param inputHandle - * @param elementShape * @param elementDtype - * @return a new instance of TensorListPopBack - * @see org.tensorflow.op.core.TensorListPopBack + * @param options carries optional attributes values + * @return a new instance of TensorListConcat + * @see org.tensorflow.op.core.TensorListConcat */ - public TensorListPopBack tensorListPopBack(Operand inputHandle, - Operand elementShape, Class elementDtype) { - return TensorListPopBack.create(scope, inputHandle, elementShape, elementDtype); + public TensorListConcat tensorListConcat(Operand inputHandle, + DataType elementDtype, TensorListConcat.Options... options) { + return TensorListConcat.create(scope, inputHandle, elementDtype, options); } /** - * Builds an {@link Concat} operation + * Builds an {@link Constant} operation * - * @param values List of `N` Tensors to concatenate. Their ranks and types must match, - * @param axis 0-D. The dimension along which to concatenate. Must be in the - * @return a new instance of Concat - * @see org.tensorflow.op.core.Concat + * @param shape the tensor shape. + * @param data a buffer containing the tensor data. + * @return a float constant + * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer + * @see org.tensorflow.op.core.Constant */ - public Concat concat(Iterable> values, Operand axis) { - return Concat.create(scope, values, axis); + public Constant constant(long[] shape, FloatBuffer data) { + return Constant.create(scope, shape, data); } /** - * Builds an {@link PlaceholderWithDefault} operation + * Builds an {@link LookupTableInsert} operation * - * @param input The default value to produce when `output` is not fed. - * @param shape The (possibly partial) shape of the tensor. - * @return a new instance of PlaceholderWithDefault - * @see org.tensorflow.op.core.PlaceholderWithDefault + * @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 + * @see org.tensorflow.op.core.LookupTableInsert */ - public PlaceholderWithDefault placeholderWithDefault(Operand input, Shape shape) { - return PlaceholderWithDefault.create(scope, input, shape); + public LookupTableInsert lookupTableInsert( + Operand tableHandle, Operand keys, Operand values) { + return LookupTableInsert.create(scope, tableHandle, keys, values); } /** - * Builds an {@link ResourceScatterDiv} operation + * Builds an {@link ParallelConcat} operation * - * @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`. - * @return a new instance of ResourceScatterDiv - * @see org.tensorflow.op.core.ResourceScatterDiv + * @param values Tensors to be concatenated. All must have size 1 in the first dimension + * @param shape the final shape of the result; should be equal to the shapes of any input + * @return a new instance of ParallelConcat + * @see org.tensorflow.op.core.ParallelConcat */ - public ResourceScatterDiv resourceScatterDiv(Operand resource, - Operand indices, Operand updates) { - return ResourceScatterDiv.create(scope, resource, indices, updates); + public ParallelConcat parallelConcat(Iterable> values, + Shape shape) { + return ParallelConcat.create(scope, values, shape); } /** - * Builds an {@link Fingerprint} operation + * Builds an {@link NonMaxSuppressionV5} operation * - * @param data Must have rank 1 or higher. - * @param method Fingerprint method used by this op. Currently available method is - * @return a new instance of Fingerprint - * @see org.tensorflow.op.core.Fingerprint + * @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 maxOutputSize A scalar integer tensor representing the maximum number of + * @param iouThreshold A 0-D float tensor representing the threshold for deciding whether + * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove + * @param softNmsSigma A 0-D float tensor representing the sigma parameter for Soft NMS; see Bodla et + * @param options carries optional attributes values + * @return a new instance of NonMaxSuppressionV5 + * @see org.tensorflow.op.core.NonMaxSuppressionV5 */ - public Fingerprint fingerprint(Operand data, Operand method) { - return Fingerprint.create(scope, data, method); + public NonMaxSuppressionV5 nonMaxSuppressionV5(Operand boxes, + Operand scores, Operand maxOutputSize, Operand iouThreshold, + Operand scoreThreshold, Operand softNmsSigma, NonMaxSuppressionV5.Options... options) { + return NonMaxSuppressionV5.create(scope, boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma, options); } /** - * Builds an {@link ReverseSequence} operation + * Builds an {@link AssignVariableOp} operation * - * @param input The input to reverse. - * @param seqLengths 1-D with length `input.dims(batch_dim)` and - * @param seqDim The dimension which is partially reversed. + * @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 + * @see org.tensorflow.op.core.AssignVariableOp + */ + public AssignVariableOp assignVariableOp(Operand resource, + Operand value) { + return AssignVariableOp.create(scope, resource, value); + } + + /** + * Builds an {@link TensorListPushBack} operation + * + * @param inputHandle + * @param tensor + * @return a new instance of TensorListPushBack + * @see org.tensorflow.op.core.TensorListPushBack + */ + public TensorListPushBack tensorListPushBack(Operand inputHandle, + Operand tensor) { + return TensorListPushBack.create(scope, inputHandle, tensor); + } + + /** + * Builds an {@link QuantizedConcat} operation + * + * @param concatDim 0-D. The dimension along which to concatenate. Must be in the + * @param values The `N` Tensors to concatenate. Their ranks and types must match, + * @param inputMins The minimum scalar values for each of the input tensors. + * @param inputMaxes The maximum scalar values for each of the input tensors. + * @return a new instance of QuantizedConcat + * @see org.tensorflow.op.core.QuantizedConcat + */ + public QuantizedConcat quantizedConcat(Operand concatDim, + Iterable> values, Iterable> inputMins, + Iterable> inputMaxes) { + return QuantizedConcat.create(scope, concatDim, values, inputMins, inputMaxes); + } + + /** + * Builds an {@link RefSwitch} operation + * + * @param data The ref tensor to be forwarded to the appropriate output. + * @param pred A scalar that specifies which output port will receive data. + * @return a new instance of RefSwitch + * @see org.tensorflow.op.core.RefSwitch + */ + public RefSwitch refSwitch(Operand data, Operand pred) { + return RefSwitch.create(scope, data, pred); + } + + /** + * Builds an {@link AssignAdd} operation + * + * @param ref Should be from a `Variable` node. + * @param value The value to be added to the variable. * @param options carries optional attributes values - * @return a new instance of ReverseSequence - * @see org.tensorflow.op.core.ReverseSequence + * @return a new instance of AssignAdd + * @see org.tensorflow.op.core.AssignAdd */ - public ReverseSequence reverseSequence(Operand input, - Operand seqLengths, Long seqDim, ReverseSequence.Options... options) { - return ReverseSequence.create(scope, input, seqLengths, seqDim, options); + public AssignAdd assignAdd(Operand ref, Operand value, + AssignAdd.Options... options) { + return AssignAdd.create(scope, ref, value, options); } /** - * Builds an {@link MutableHashTableOfTensors} operation + * Builds an {@link GatherNd} operation * - * @param keyDtype Type of the table keys. - * @param valueDtype Type of the table values. + * @param params The tensor from which to gather values. + * @param indices Index tensor. + * @return a new instance of GatherNd + * @see org.tensorflow.op.core.GatherNd + */ + public GatherNd gatherNd(Operand params, + Operand indices) { + return GatherNd.create(scope, params, indices); + } + + /** + * Builds an {@link OrderedMapSize} operation + * + * @param dtypes * @param options carries optional attributes values - * @return a new instance of MutableHashTableOfTensors - * @see org.tensorflow.op.core.MutableHashTableOfTensors + * @return a new instance of OrderedMapSize + * @see org.tensorflow.op.core.OrderedMapSize */ - public MutableHashTableOfTensors mutableHashTableOfTensors(Class keyDtype, - Class valueDtype, MutableHashTableOfTensors.Options... options) { - return MutableHashTableOfTensors.create(scope, keyDtype, valueDtype, options); + public OrderedMapSize orderedMapSize(List> dtypes, + OrderedMapSize.Options... options) { + return OrderedMapSize.create(scope, dtypes, options); } /** - * Builds an {@link ResourceScatterSub} operation + * Builds an {@link StatefulStandardNormalV2} operation * - * @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`. - * @return a new instance of ResourceScatterSub - * @see org.tensorflow.op.core.ResourceScatterSub + * @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. + * @return a new instance of StatefulStandardNormalV2 + * @see org.tensorflow.op.core.StatefulStandardNormalV2 */ - public ResourceScatterSub resourceScatterSub(Operand resource, - Operand indices, Operand updates) { - return ResourceScatterSub.create(scope, resource, indices, updates); + public StatefulStandardNormalV2 statefulStandardNormalV2( + Operand resource, Operand algorithm, Operand shape, DataType dtype) { + return StatefulStandardNormalV2.create(scope, resource, algorithm, shape, dtype); } /** * Builds an {@link Constant} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the + * @param data An array containing the values to put into the new constant. String elements are * @see org.tensorflow.op.core.Constant */ - public Constant constant(float[][] data) { + public Constant constant(byte[][][][][][] data) { return Constant.create(scope, data); } /** * Builds an {@link Constant} operation * - * @param shape the tensor shape. - * @param data a buffer containing the tensor data. - * @return a double constant - * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer + * @param data An array containing the values to put into the new constant. String elements are * @see org.tensorflow.op.core.Constant */ - public Constant constant(long[] shape, DoubleBuffer data) { - return Constant.create(scope, shape, data); + public Constant constant(byte[][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link Assign} operation + * Builds an {@link IsVariableInitialized} operation * * @param ref Should be from a `Variable` node. May be uninitialized. - * @param value The value to be assigned to the variable. - * @param options carries optional attributes values - * @return a new instance of Assign - * @see org.tensorflow.op.core.Assign + * @return a new instance of IsVariableInitialized + * @see org.tensorflow.op.core.IsVariableInitialized */ - public Assign assign(Operand ref, Operand value, Assign.Options... options) { - return Assign.create(scope, ref, value, options); + public IsVariableInitialized isVariableInitialized(Operand ref) { + return IsVariableInitialized.create(scope, ref); } /** - * Builds an {@link StatefulRandomBinomial} operation + * Builds an {@link Constant} operation * - * @param resource - * @param algorithm - * @param shape - * @param counts - * @param probs - * @return a new instance of StatefulRandomBinomial - * @see org.tensorflow.op.core.StatefulRandomBinomial + * @param shape the tensor shape. + * @param data a buffer containing the tensor data. + * @return a long constant + * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer + * @see org.tensorflow.op.core.Constant */ - public StatefulRandomBinomial statefulRandomBinomial( - Operand resource, Operand algorithm, Operand shape, Operand counts, - Operand probs) { - return StatefulRandomBinomial.create(scope, resource, algorithm, shape, counts, probs); + public Constant constant(long[] shape, LongBuffer data) { + return Constant.create(scope, shape, data); } /** - * Builds an {@link ExpandDims} operation + * Builds an {@link Gradients} operation * - * @param input - * @param axis 0-D (scalar). Specifies the dimension index at which to - * @return a new instance of ExpandDims - * @see org.tensorflow.op.core.ExpandDims + * @param y output of the function to derive + * @param x inputs of the function for which partial derivatives are computed + * @param options carries optional attributes values + * @return a new instance of {@code Gradients} + * @throws IllegalArgumentException if execution environment is not a graph + * @see org.tensorflow.op.core.Gradients */ - public ExpandDims expandDims(Operand input, Operand axis) { - return ExpandDims.create(scope, input, axis); + public Gradients gradients(Operand y, Iterable> x, + Gradients.Options... options) { + return Gradients.create(scope, y, x, options); } /** @@ -1089,66 +1203,55 @@ public ExpandDims expandDims(Operand input, Operand< * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(float[] data) { + public Constant constant(int[][] data) { return Constant.create(scope, data); } /** - * Builds an {@link FusedBatchNormGradV3} operation - * - * @param yBackprop A 4D Tensor for the gradient with respect to y. - * @param x A 4D Tensor for input data. - * @param scale A 1D Tensor for scaling factor, to scale the normalized x. - * @param reserveSpace1 When is_training is True, a 1D Tensor for the computed batch - * @param reserveSpace2 When is_training is True, a 1D Tensor for the computed batch - * @param reserveSpace3 When is_training is True, a 1D Tensor for some intermediate results to be reused - * @param options carries optional attributes values - * @return a new instance of FusedBatchNormGradV3 - * @see org.tensorflow.op.core.FusedBatchNormGradV3 - */ - public FusedBatchNormGradV3 fusedBatchNormGradV3( - Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, - Operand reserveSpace2, Operand reserveSpace3, FusedBatchNormGradV3.Options... options) { - return FusedBatchNormGradV3.create(scope, yBackprop, x, scale, reserveSpace1, reserveSpace2, reserveSpace3, options); - } - - /** - * Builds an {@link ScatterNdAdd} operation + * Builds an {@link DecodePaddedRaw} operation * - * @param ref A mutable Tensor. Should be from a Variable node. - * @param indices A Tensor. Must be one of the following types: int32, int64. - * @param updates A Tensor. Must have the same type as ref. A tensor of updated values - * @param options carries optional attributes values - * @return a new instance of ScatterNdAdd - * @see org.tensorflow.op.core.ScatterNdAdd + * @param inputBytes Tensor of string to be decoded. + * @param fixedLength Length in bytes for each element of the decoded output. Must be a multiple + * @param outType + * @param options carries optional attributes values + * @return a new instance of DecodePaddedRaw + * @see org.tensorflow.op.core.DecodePaddedRaw */ - public ScatterNdAdd scatterNdAdd(Operand ref, Operand indices, - Operand updates, ScatterNdAdd.Options... options) { - return ScatterNdAdd.create(scope, ref, indices, updates, options); + public DecodePaddedRaw decodePaddedRaw(Operand inputBytes, + Operand fixedLength, DataType outType, DecodePaddedRaw.Options... options) { + return DecodePaddedRaw.create(scope, inputBytes, fixedLength, outType, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link StatefulRandomBinomial} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param resource + * @param algorithm + * @param shape + * @param counts + * @param probs + * @param dtype + * @return a new instance of StatefulRandomBinomial + * @see org.tensorflow.op.core.StatefulRandomBinomial */ - public Constant constant(boolean[][][][] data) { - return Constant.create(scope, data); + public StatefulRandomBinomial statefulRandomBinomial( + Operand resource, Operand algorithm, Operand shape, Operand counts, + Operand probs, DataType dtype) { + return StatefulRandomBinomial.create(scope, resource, algorithm, shape, counts, probs, dtype); } /** - * Builds an {@link AssignAdd} operation + * Builds an {@link MatrixDiagPartV2} operation * - * @param ref Should be from a `Variable` node. - * @param value The value to be added to the variable. - * @param options carries optional attributes values - * @return a new instance of AssignAdd - * @see org.tensorflow.op.core.AssignAdd + * @param input Rank `r` tensor where `r >= 2`. + * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * @param paddingValue The value to fill the area outside the specified diagonal band with. + * @return a new instance of MatrixDiagPartV2 + * @see org.tensorflow.op.core.MatrixDiagPartV2 */ - public AssignAdd assignAdd(Operand ref, Operand value, - AssignAdd.Options... options) { - return AssignAdd.create(scope, ref, value, options); + public MatrixDiagPartV2 matrixDiagPartV2(Operand input, Operand k, + Operand paddingValue) { + return MatrixDiagPartV2.create(scope, input, k, paddingValue); } /** @@ -1160,318 +1263,320 @@ public AssignAdd assignAdd(Operand ref, Operand value, * @return a new instance of MutableHashTable * @see org.tensorflow.op.core.MutableHashTable */ - public MutableHashTable mutableHashTable(Class keyDtype, Class valueDtype, - MutableHashTable.Options... options) { + public MutableHashTable mutableHashTable(DataType keyDtype, + DataType valueDtype, MutableHashTable.Options... options) { return MutableHashTable.create(scope, keyDtype, valueDtype, options); } /** - * Builds an {@link ExtractVolumePatches} operation + * Builds an {@link Min} operation * - * @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 strides 1-D of length 5. How far the centers of two consecutive patches are in - * @param padding The type of padding algorithm to use. - * @return a new instance of ExtractVolumePatches - * @see org.tensorflow.op.core.ExtractVolumePatches + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of Min + * @see org.tensorflow.op.core.Min */ - public ExtractVolumePatches extractVolumePatches(Operand input, - List ksizes, List strides, String padding) { - return ExtractVolumePatches.create(scope, input, ksizes, strides, padding); + public Min min(Operand input, Operand axis, + Min.Options... options) { + return Min.create(scope, input, axis, options); } /** - * Builds an {@link Size} operation + * Builds an {@link Unstage} operation * - * @param input - * @return a new instance of Size - * @see org.tensorflow.op.core.Size + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of Unstage + * @see org.tensorflow.op.core.Unstage */ - public Size size(Operand input) { - return Size.create(scope, input); + public Unstage unstage(List> dtypes, Unstage.Options... options) { + return Unstage.create(scope, dtypes, options); } /** - * Builds an {@link ScatterAdd} operation + * Builds an {@link Unique} operation * - * @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 - * @return a new instance of ScatterAdd - * @see org.tensorflow.op.core.ScatterAdd + * @param x A `Tensor`. + * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @return a new instance of Unique + * @see org.tensorflow.op.core.Unique */ - public ScatterAdd scatterAdd(Operand ref, Operand indices, - Operand updates, ScatterAdd.Options... options) { - return ScatterAdd.create(scope, ref, indices, updates, options); + public Unique unique(Operand x, + Operand axis) { + return Unique.create(scope, x, axis); } /** - * Builds an {@link Constant} operation + * Builds an {@link StringNGrams} operation * - * @param object a Java object representing the constant. - * @return a constant of type `type` - * @see org.tensorflow.Tensor#create(Object) Tensor.create - * @see org.tensorflow.op.core.Constant + * @param data The values tensor of the ragged string tensor to make ngrams out of. Must be a + * @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 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 + * @param rightPad The string to use to pad the right side of the ngram sequence. Only used if + * @param padWidth The number of padding elements to add to each side of each + * @param preserveShortSequences + * @return a new instance of StringNGrams + * @see org.tensorflow.op.core.StringNGrams */ - public Constant constant(Object object, Class type) { - return Constant.create(scope, object, type); + public StringNGrams stringNGrams(Operand data, + Operand dataSplits, String separator, List ngramWidths, String leftPad, + String rightPad, Long padWidth, Boolean preserveShortSequences) { + return StringNGrams.create(scope, data, dataSplits, separator, ngramWidths, leftPad, rightPad, padWidth, preserveShortSequences); } /** - * Builds an {@link ResourceScatterMax} operation + * Builds an {@link Constant} operation * - * @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`. - * @return a new instance of ResourceScatterMax - * @see org.tensorflow.op.core.ResourceScatterMax + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public ResourceScatterMax resourceScatterMax(Operand resource, - Operand indices, Operand updates) { - return ResourceScatterMax.create(scope, resource, indices, updates); + public Constant constant(double[][][][][][] data) { + return Constant.create(scope, data); } /** * Builds an {@link Constant} operation * - * @param data An array containing the values to put into the new constant. String elements are + * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(byte[][][] data) { + public Constant constant(boolean[][] data) { return Constant.create(scope, data); } /** - * Builds an {@link UnsortedSegmentJoin} operation + * Builds an {@link TensorArrayWrite} operation * - * @param inputs The input to be joined. - * @param segmentIds A tensor whose shape is a prefix of data.shape. Negative segment ids are not - * @param numSegments A scalar. - * @param options carries optional attributes values - * @return a new instance of UnsortedSegmentJoin - * @see org.tensorflow.op.core.UnsortedSegmentJoin + * @param handle The handle to a TensorArray. + * @param index The position to write to inside the TensorArray. + * @param value The tensor to write to the TensorArray. + * @param flowIn A float scalar that enforces proper chaining of operations. + * @return a new instance of TensorArrayWrite + * @see org.tensorflow.op.core.TensorArrayWrite */ - public UnsortedSegmentJoin unsortedSegmentJoin( - Operand inputs, Operand segmentIds, Operand numSegments, - UnsortedSegmentJoin.Options... options) { - return UnsortedSegmentJoin.create(scope, inputs, segmentIds, numSegments, options); + public TensorArrayWrite tensorArrayWrite(Operand handle, + Operand index, Operand value, Operand flowIn) { + return TensorArrayWrite.create(scope, handle, index, value, flowIn); } /** - * Builds an {@link Constant} operation + * Builds an {@link StridedSliceAssign} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param ref + * @param begin + * @param end + * @param strides + * @param value + * @param options carries optional attributes values + * @return a new instance of StridedSliceAssign + * @see org.tensorflow.op.core.StridedSliceAssign */ - public Constant constant(int[][][][] data) { - return Constant.create(scope, data); + public StridedSliceAssign stridedSliceAssign( + Operand ref, Operand begin, Operand end, Operand strides, Operand value, + StridedSliceAssign.Options... options) { + return StridedSliceAssign.create(scope, ref, begin, end, strides, value, options); } /** - * Builds an {@link BroadcastTo} operation + * Builds an {@link Unstack} operation * - * @param input A Tensor to broadcast. - * @param shape An 1-D `int` Tensor. The shape of the desired output. - * @return a new instance of BroadcastTo - * @see org.tensorflow.op.core.BroadcastTo + * @param value 1-D or higher, with `axis` dimension size equal to `num`. + * @param num + * @param options carries optional attributes values + * @return a new instance of Unstack + * @see org.tensorflow.op.core.Unstack */ - public BroadcastTo broadcastTo(Operand input, Operand shape) { - return BroadcastTo.create(scope, input, shape); + public Unstack unstack(Operand value, Long num, + Unstack.Options... options) { + return Unstack.create(scope, value, num, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link ReduceAll} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of ReduceAll + * @see org.tensorflow.op.core.ReduceAll */ - public Constant constant(double[] data) { - return Constant.create(scope, data); + public ReduceAll reduceAll(Operand input, Operand axis, + ReduceAll.Options... options) { + return ReduceAll.create(scope, input, axis, options); } /** - * Builds an {@link StridedSliceGrad} operation + * Builds an {@link Constant} operation * - * @param shape - * @param begin - * @param end - * @param strides - * @param dy - * @param options carries optional attributes values - * @return a new instance of StridedSliceGrad - * @see org.tensorflow.op.core.StridedSliceGrad + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public StridedSliceGrad stridedSliceGrad(Operand shape, - Operand begin, Operand end, Operand strides, Operand dy, - StridedSliceGrad.Options... options) { - return StridedSliceGrad.create(scope, shape, begin, end, strides, dy, options); + public Constant constant(boolean[][][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link Lu} operation + * Builds an {@link Split} operation * - * @param input A tensor of shape `[..., M, M]` whose inner-most 2 dimensions form matrices of - * @return a new instance of Lu - * @see org.tensorflow.op.core.Lu + * @param axis 0-D. The dimension along which to split. Must be in the range + * @param value The tensor to split. + * @param numSplit The number of ways to split. Must evenly divide + * @return a new instance of Split + * @see org.tensorflow.op.core.Split */ - public Lu lu(Operand input) { - return Lu.create(scope, input); + public Split split(Operand axis, Operand value, Long numSplit) { + return Split.create(scope, axis, value, numSplit); } /** - * Builds an {@link Gradients} operation + * Builds an {@link ResourceGather} operation * - * @param y output of the function to derive - * @param x inputs of the function for which partial derivatives are computed + * @param resource + * @param indices + * @param dtype * @param options carries optional attributes values - * @return a new instance of {@code Gradients} - * @throws IllegalArgumentException if execution environment is not a graph - * @see org.tensorflow.op.core.Gradients + * @return a new instance of ResourceGather + * @see org.tensorflow.op.core.ResourceGather */ - public Gradients gradients(Operand y, Iterable> x, - Gradients.Options... options) { - return Gradients.create(scope, y, x, options); + public ResourceGather resourceGather(Operand resource, + Operand indices, DataType dtype, ResourceGather.Options... options) { + return ResourceGather.create(scope, resource, indices, dtype, options); } /** - * Builds an {@link Unique} operation + * Builds an {@link SwitchCond} operation * - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to - * @return a new instance of Unique - * @see org.tensorflow.op.core.Unique + * @param data The tensor to be forwarded to the appropriate output. + * @param pred A scalar that specifies which output port will receive data. + * @return a new instance of SwitchCond + * @see org.tensorflow.op.core.SwitchCond */ - public Unique unique(Operand x, Operand axis) { - return Unique.create(scope, x, axis); + public SwitchCond switchCond(Operand data, Operand pred) { + return SwitchCond.create(scope, data, pred); } /** - * Builds an {@link DecodePaddedRaw} operation + * Builds an {@link Constant} operation * - * @param inputBytes Tensor of string to be decoded. - * @param fixedLength Length in bytes for each element of the decoded output. Must be a multiple - * @param outType - * @param options carries optional attributes values - * @return a new instance of DecodePaddedRaw - * @see org.tensorflow.op.core.DecodePaddedRaw + * @param shape the tensor shape. + * @param data a buffer containing the tensor data. + * @return a double constant + * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer + * @see org.tensorflow.op.core.Constant */ - public DecodePaddedRaw decodePaddedRaw(Operand inputBytes, - Operand fixedLength, Class outType, DecodePaddedRaw.Options... options) { - return DecodePaddedRaw.create(scope, inputBytes, fixedLength, outType, options); + public Constant constant(long[] shape, DoubleBuffer data) { + return Constant.create(scope, shape, data); } /** - * Builds an {@link SelectV2} operation + * Builds an {@link BarrierReadySize} operation * - * @param condition - * @param t - * @param e - * @return a new instance of SelectV2 - * @see org.tensorflow.op.core.SelectV2 + * @param handle The handle to a barrier. + * @return a new instance of BarrierReadySize + * @see org.tensorflow.op.core.BarrierReadySize */ - public SelectV2 selectV2(Operand condition, Operand t, Operand e) { - return SelectV2.create(scope, condition, t, e); + public BarrierReadySize barrierReadySize(Operand handle) { + return BarrierReadySize.create(scope, handle); } /** - * Builds an {@link ShapeN} operation + * Builds an {@link Rank} operation * * @param input - * @param outType - * @return a new instance of ShapeN - * @see org.tensorflow.op.core.ShapeN + * @return a new instance of Rank + * @see org.tensorflow.op.core.Rank */ - public ShapeN shapeN(Iterable> input, Class outType) { - return ShapeN.create(scope, input, outType); + public Rank rank(Operand input) { + return Rank.create(scope, input); } /** - * Builds an {@link Max} operation + * Builds an {@link InitializeTable} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range - * @param options carries optional attributes values - * @return a new instance of Max - * @see org.tensorflow.op.core.Max + * @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 + * @see org.tensorflow.op.core.InitializeTable */ - public Max max(Operand input, Operand axis, - Max.Options... options) { - return Max.create(scope, input, axis, options); + public InitializeTable initializeTable(Operand tableHandle, + Operand keys, Operand values) { + return InitializeTable.create(scope, tableHandle, keys, values); } /** * Builds an {@link Constant} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the + * @param data The value to put into the new constant. + * @return a long constant * @see org.tensorflow.op.core.Constant */ - public Constant constant(float[][][][][][] data) { + public Constant constant(long data) { return Constant.create(scope, data); } /** - * Builds an {@link ResourceGatherNd} operation + * Builds an {@link Constant} operation * - * @param resource - * @param indices - * @param dtype - * @return a new instance of ResourceGatherNd - * @see org.tensorflow.op.core.ResourceGatherNd + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public ResourceGatherNd resourceGatherNd(Operand resource, - Operand indices, Class dtype) { - return ResourceGatherNd.create(scope, resource, indices, dtype); + public Constant constant(long[][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link ZerosLike} operation + * Builds an {@link SetDiff1d} operation * - * @param x a tensor of type T. - * @return a new instance of ZerosLike - * @see org.tensorflow.op.core.ZerosLike + * @param x 1-D. Values to keep. + * @param y 1-D. Values to remove. + * @return a new instance of SetDiff1d + * @see org.tensorflow.op.core.SetDiff1d */ - public ZerosLike zerosLike(Operand x) { - return ZerosLike.create(scope, x); + public SetDiff1d setDiff1d(Operand x, Operand y) { + return SetDiff1d.create(scope, x, y); } /** - * Builds an {@link IsVariableInitialized} operation + * Builds an {@link Any} operation * - * @param ref Should be from a `Variable` node. May be uninitialized. - * @return a new instance of IsVariableInitialized - * @see org.tensorflow.op.core.IsVariableInitialized + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of Any + * @see org.tensorflow.op.core.Any */ - public IsVariableInitialized isVariableInitialized(Operand ref) { - return IsVariableInitialized.create(scope, ref); + public Any any(Operand input, Operand axis, + Any.Options... options) { + return Any.create(scope, input, axis, options); } /** - * Builds an {@link TensorListStack} operation + * Builds an {@link Constant} operation * - * @param inputHandle - * @param elementShape - * @param elementDtype - * @param options carries optional attributes values - * @return a new instance of TensorListStack - * @see org.tensorflow.op.core.TensorListStack + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public TensorListStack tensorListStack(Operand inputHandle, - Operand elementShape, Class elementDtype, TensorListStack.Options... options) { - return TensorListStack.create(scope, inputHandle, elementShape, elementDtype, options); + public Constant constant(int[][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link InplaceSub} operation + * Builds an {@link TryRpc} operation * - * @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. - * @return a new instance of InplaceSub - * @see org.tensorflow.op.core.InplaceSub + * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. + * @param method `0-D` or `1-D`. The method address on the RPC server. + * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. + * @param options carries optional attributes values + * @return a new instance of TryRpc + * @see org.tensorflow.op.core.TryRpc */ - public InplaceSub inplaceSub(Operand x, Operand i, Operand v) { - return InplaceSub.create(scope, x, i, v); + public TryRpc tryRpc(Operand address, Operand method, Operand request, + TryRpc.Options... options) { + return TryRpc.create(scope, address, method, request, options); } /** @@ -1480,320 +1585,335 @@ public InplaceSub inplaceSub(Operand x, Operand i, Operand * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(double[][] data) { + public Constant constant(float[] data) { return Constant.create(scope, data); } /** - * Builds an {@link OnesLike} operation + * Builds an {@link Empty} operation * - * @param x a tensor of type T. - * @return a new instance of OnesLike - * @see org.tensorflow.op.core.OnesLike + * @param shape 1-D. Represents the shape of the output tensor. + * @param dtype + * @param options carries optional attributes values + * @return a new instance of Empty + * @see org.tensorflow.op.core.Empty */ - public OnesLike onesLike(Operand x) { - return OnesLike.create(scope, x); + public Empty empty(Operand shape, DataType dtype, + Empty.Options... options) { + return Empty.create(scope, shape, dtype, options); } /** - * Builds an {@link OrderedMapSize} operation + * Builds an {@link Constant} operation * - * @param dtypes - * @param options carries optional attributes values - * @return a new instance of OrderedMapSize - * @see org.tensorflow.op.core.OrderedMapSize + * @param data An array containing the values to put into the new constant. String elements are + * @see org.tensorflow.op.core.Constant */ - public OrderedMapSize orderedMapSize(List> dtypes, OrderedMapSize.Options... options) { - return OrderedMapSize.create(scope, dtypes, options); + public Constant constant(byte[][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link QuantizedConcat} operation + * Builds an {@link MulNoNan} operation * - * @param concatDim 0-D. The dimension along which to concatenate. Must be in the - * @param values The `N` Tensors to concatenate. Their ranks and types must match, - * @param inputMins The minimum scalar values for each of the input tensors. - * @param inputMaxes The maximum scalar values for each of the input tensors. - * @return a new instance of QuantizedConcat - * @see org.tensorflow.op.core.QuantizedConcat + * @param x + * @param y + * @return a new instance of MulNoNan + * @see org.tensorflow.op.core.MulNoNan */ - public QuantizedConcat quantizedConcat(Operand concatDim, - Iterable> values, Iterable> inputMins, - Iterable> inputMaxes) { - return QuantizedConcat.create(scope, concatDim, values, inputMins, inputMaxes); + public MulNoNan mulNoNan(Operand x, Operand y) { + return MulNoNan.create(scope, x, y); } /** - * Builds an {@link LookupTableInsert} operation + * Builds an {@link TensorListConcatV2} operation * - * @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 - * @see org.tensorflow.op.core.LookupTableInsert + * @param inputHandle + * @param elementShape + * @param leadingDims + * @param elementDtype + * @return a new instance of TensorListConcatV2 + * @see org.tensorflow.op.core.TensorListConcatV2 */ - public LookupTableInsert lookupTableInsert(Operand tableHandle, Operand keys, - Operand values) { - return LookupTableInsert.create(scope, tableHandle, keys, values); + public TensorListConcatV2 tensorListConcatV2( + Operand inputHandle, Operand elementShape, Operand leadingDims, + DataType elementDtype) { + return TensorListConcatV2.create(scope, inputHandle, elementShape, leadingDims, elementDtype); } /** - * Builds an {@link Roll} operation + * Builds an {@link Timestamp} operation * - * @param input - * @param shift Dimension must be 0-D or 1-D. `shift[i]` specifies the number of places by which - * @param axis Dimension must be 0-D or 1-D. `axis[i]` specifies the dimension that the shift - * @return a new instance of Roll - * @see org.tensorflow.op.core.Roll + * @return a new instance of Timestamp + * @see org.tensorflow.op.core.Timestamp */ - public Roll roll(Operand input, Operand shift, - Operand axis) { - return Roll.create(scope, input, shift, axis); + public Timestamp timestamp() { + return Timestamp.create(scope); } /** - * Builds an {@link HashTable} operation + * Builds an {@link PlaceholderWithDefault} operation * - * @param keyDtype Type of the table keys. - * @param valueDtype Type of the table values. - * @param options carries optional attributes values - * @return a new instance of HashTable - * @see org.tensorflow.op.core.HashTable + * @param input The default value to produce when `output` is not fed. + * @param shape The (possibly partial) shape of the tensor. + * @return a new instance of PlaceholderWithDefault + * @see org.tensorflow.op.core.PlaceholderWithDefault */ - public HashTable hashTable(Class keyDtype, Class valueDtype, - HashTable.Options... options) { - return HashTable.create(scope, keyDtype, valueDtype, options); + public PlaceholderWithDefault placeholderWithDefault(Operand input, + Shape shape) { + return PlaceholderWithDefault.create(scope, input, shape); } /** - * Builds an {@link ResourceGather} operation + * Builds an {@link BatchToSpaceNd} operation * - * @param resource - * @param indices - * @param dtype - * @param options carries optional attributes values - * @return a new instance of ResourceGather - * @see org.tensorflow.op.core.ResourceGather + * @param input N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`, + * @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. + * @return a new instance of BatchToSpaceNd + * @see org.tensorflow.op.core.BatchToSpaceNd */ - public ResourceGather resourceGather(Operand resource, - Operand indices, Class dtype, ResourceGather.Options... options) { - return ResourceGather.create(scope, resource, indices, dtype, options); + public BatchToSpaceNd batchToSpaceNd( + Operand input, Operand blockShape, Operand crops) { + return BatchToSpaceNd.create(scope, input, blockShape, crops); } /** - * Builds an {@link ClipByValue} operation + * Builds an {@link TensorListGetItem} operation * - * @param t A `Tensor`. - * @param clipValueMin A 0-D (scalar) `Tensor`, or a `Tensor` with the same shape - * @param clipValueMax A 0-D (scalar) `Tensor`, or a `Tensor` with the same shape - * @return a new instance of ClipByValue - * @see org.tensorflow.op.core.ClipByValue + * @param inputHandle + * @param index + * @param elementShape + * @param elementDtype + * @return a new instance of TensorListGetItem + * @see org.tensorflow.op.core.TensorListGetItem */ - public ClipByValue clipByValue(Operand t, Operand clipValueMin, - Operand clipValueMax) { - return ClipByValue.create(scope, t, clipValueMin, clipValueMax); + public TensorListGetItem tensorListGetItem(Operand inputHandle, + Operand index, Operand elementShape, DataType elementDtype) { + return TensorListGetItem.create(scope, inputHandle, index, elementShape, elementDtype); } /** - * Builds an {@link Constant} operation + * Builds an {@link NextIteration} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param data The tensor to be made available to the next iteration. + * @return a new instance of NextIteration + * @see org.tensorflow.op.core.NextIteration */ - public Constant constant(long[][][] data) { - return Constant.create(scope, data); + public NextIteration nextIteration(Operand data) { + return NextIteration.create(scope, data); } /** - * Builds an {@link Sum} operation + * Builds an {@link ShapeN} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range - * @param options carries optional attributes values - * @return a new instance of Sum - * @see org.tensorflow.op.core.Sum + * @param input + * @return a new instance of ShapeN + * @see org.tensorflow.op.core.ShapeN */ - public Sum sum(Operand input, Operand axis, - Sum.Options... options) { - return Sum.create(scope, input, axis, options); + public ShapeN shapeN(Iterable> input) { + return ShapeN.create(scope, input); } /** - * Builds an {@link Shape} operation + * Builds an {@link TensorScatterAdd} operation * - * @param input - * @param outType - * @return a new instance of Shape - * @see org.tensorflow.op.core.Shape + * @param tensor Tensor to copy/update. + * @param indices Index tensor. + * @param updates Updates to scatter into output. + * @return a new instance of TensorScatterAdd + * @see org.tensorflow.op.core.TensorScatterAdd */ - public org.tensorflow.op.core.Shape shape(Operand input, - Class outType) { - return org.tensorflow.op.core.Shape.create(scope, input, outType); + public TensorScatterAdd tensorScatterAdd( + Operand tensor, Operand indices, Operand updates) { + return TensorScatterAdd.create(scope, tensor, indices, updates); } /** - * Builds an {@link MapSize} operation + * Builds an {@link Constant} operation * - * @param dtypes + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant + */ + public Constant constant(double[][][][] data) { + return Constant.create(scope, data); + } + + /** + * Builds an {@link MutableDenseHashTable} operation + * + * @param emptyKey The key used to represent empty key buckets internally. Must not + * @param deletedKey + * @param valueDtype Type of the table values. * @param options carries optional attributes values - * @return a new instance of MapSize - * @see org.tensorflow.op.core.MapSize + * @return a new instance of MutableDenseHashTable + * @see org.tensorflow.op.core.MutableDenseHashTable */ - public MapSize mapSize(List> dtypes, MapSize.Options... options) { - return MapSize.create(scope, dtypes, options); + public MutableDenseHashTable mutableDenseHashTable( + Operand emptyKey, Operand deletedKey, DataType valueDtype, + MutableDenseHashTable.Options... options) { + return MutableDenseHashTable.create(scope, emptyKey, deletedKey, valueDtype, options); } /** - * Builds an {@link Timestamp} operation + * Builds an {@link TensorListReserve} operation * - * @return a new instance of Timestamp - * @see org.tensorflow.op.core.Timestamp + * @param elementShape + * @param numElements + * @param elementDtype + * @return a new instance of TensorListReserve + * @see org.tensorflow.op.core.TensorListReserve */ - public Timestamp timestamp() { - return Timestamp.create(scope); + public TensorListReserve tensorListReserve( + Operand elementShape, Operand numElements, DataType elementDtype) { + return TensorListReserve.create(scope, elementShape, numElements, elementDtype); } /** - * Builds an {@link GetSessionHandle} operation + * Builds an {@link Constant} operation * - * @param value The tensor to be stored. - * @return a new instance of GetSessionHandle - * @see org.tensorflow.op.core.GetSessionHandle + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public GetSessionHandle getSessionHandle(Operand value) { - return GetSessionHandle.create(scope, value); + public Constant constant(boolean[][][][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link BarrierReadySize} operation + * Builds an {@link Constant} operation * - * @param handle The handle to a barrier. - * @return a new instance of BarrierReadySize - * @see org.tensorflow.op.core.BarrierReadySize + * @param data An array containing the values to put into the new constant. String elements are + * @see org.tensorflow.op.core.Constant */ - public BarrierReadySize barrierReadySize(Operand handle) { - return BarrierReadySize.create(scope, handle); + public Constant constant(byte[] data) { + return Constant.create(scope, data); } /** - * Builds an {@link CountUpTo} operation + * Builds an {@link Batch} operation * - * @param ref Should be from a scalar `Variable` node. - * @param limit If incrementing ref would bring it above limit, instead generates an - * @return a new instance of CountUpTo - * @see org.tensorflow.op.core.CountUpTo + * @param inTensors + * @param numBatchThreads + * @param maxBatchSize + * @param batchTimeoutMicros + * @param gradTimeoutMicros + * @param options carries optional attributes values + * @return a new instance of Batch + * @see org.tensorflow.op.core.Batch */ - public CountUpTo countUpTo(Operand ref, Long limit) { - return CountUpTo.create(scope, ref, limit); + public Batch batch(Iterable> inTensors, Long numBatchThreads, Long maxBatchSize, + Long batchTimeoutMicros, Long gradTimeoutMicros, Batch.Options... options) { + return Batch.create(scope, inTensors, numBatchThreads, maxBatchSize, batchTimeoutMicros, gradTimeoutMicros, options); } /** - * Builds an {@link DrawBoundingBoxesV2} operation + * Builds an {@link ResourceCountUpTo} operation * - * @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 colors 2-D. A list of RGBA colors to cycle through for the boxes. - * @return a new instance of DrawBoundingBoxesV2 - * @see org.tensorflow.op.core.DrawBoundingBoxesV2 + * @param resource Should be from a scalar `Variable` node. + * @param limit If incrementing ref would bring it above limit, instead generates an + * @param T + * @return a new instance of ResourceCountUpTo + * @see org.tensorflow.op.core.ResourceCountUpTo */ - public DrawBoundingBoxesV2 drawBoundingBoxesV2(Operand images, - Operand boxes, Operand colors) { - return DrawBoundingBoxesV2.create(scope, images, boxes, colors); + public ResourceCountUpTo resourceCountUpTo(Operand resource, Long limit, + DataType T) { + return ResourceCountUpTo.create(scope, resource, limit, T); } /** - * Builds an {@link Constant} operation + * Builds an {@link UnravelIndex} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param indices An 0-D or 1-D `int` Tensor whose elements are indices into the + * @param dims An 1-D `int` Tensor. The shape of the array to use for unraveling + * @return a new instance of UnravelIndex + * @see org.tensorflow.op.core.UnravelIndex */ - public Constant constant(boolean[][][][][] data) { - return Constant.create(scope, data); + public UnravelIndex unravelIndex(Operand indices, Operand dims) { + return UnravelIndex.create(scope, indices, dims); } /** - * Builds an {@link BarrierClose} operation + * Builds an {@link CudnnRNNCanonicalToParamsV2} operation * - * @param handle The handle to a barrier. + * @param numLayers + * @param numUnits + * @param inputSize + * @param weights + * @param biases * @param options carries optional attributes values - * @return a new instance of BarrierClose - * @see org.tensorflow.op.core.BarrierClose + * @return a new instance of CudnnRNNCanonicalToParamsV2 + * @see org.tensorflow.op.core.CudnnRNNCanonicalToParamsV2 */ - public BarrierClose barrierClose(Operand handle, BarrierClose.Options... options) { - return BarrierClose.create(scope, handle, options); + public CudnnRNNCanonicalToParamsV2 cudnnRNNCanonicalToParamsV2( + Operand numLayers, Operand numUnits, Operand inputSize, + Iterable> weights, Iterable> biases, + CudnnRNNCanonicalToParamsV2.Options... options) { + return CudnnRNNCanonicalToParamsV2.create(scope, numLayers, numUnits, inputSize, weights, biases, options); } /** - * Builds an {@link Lu} operation + * Builds an {@link Max} operation * - * @param input A tensor of shape `[..., M, M]` whose inner-most 2 dimensions form matrices of - * @param outputIdxType - * @return a new instance of Lu - * @see org.tensorflow.op.core.Lu + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of Max + * @see org.tensorflow.op.core.Max */ - public Lu lu(Operand input, Class outputIdxType) { - return Lu.create(scope, input, outputIdxType); + public Max max(Operand input, Operand axis, + Max.Options... options) { + return Max.create(scope, input, axis, options); } /** - * Builds an {@link TensorListScatterV2} operation + * Builds an {@link MatrixDiagV2} operation * - * @param tensor - * @param indices - * @param elementShape - * @param numElements - * @return a new instance of TensorListScatterV2 - * @see org.tensorflow.op.core.TensorListScatterV2 + * @param diagonal Rank `r`, where `r >= 1` + * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * @param numRows The number of rows of the output matrix. If it is not provided, the op assumes + * @param numCols The number of columns of the output matrix. If it is not provided, the op + * @param paddingValue The number to fill the area outside the specified diagonal band with. + * @return a new instance of MatrixDiagV2 + * @see org.tensorflow.op.core.MatrixDiagV2 */ - public TensorListScatterV2 tensorListScatterV2(Operand tensor, - Operand indices, Operand elementShape, Operand numElements) { - return TensorListScatterV2.create(scope, tensor, indices, elementShape, numElements); + public MatrixDiagV2 matrixDiagV2(Operand diagonal, Operand k, + Operand numRows, Operand numCols, Operand paddingValue) { + return MatrixDiagV2.create(scope, diagonal, k, numRows, numCols, paddingValue); } /** - * Builds an {@link Rpc} operation + * Builds an {@link LookupTableFind} operation * - * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. - * @param method `0-D` or `1-D`. The method address on the RPC server. - * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. - * @param options carries optional attributes values - * @return a new instance of Rpc - * @see org.tensorflow.op.core.Rpc + * @param tableHandle Handle to the table. + * @param keys Any shape. Keys to look up. + * @param defaultValue + * @return a new instance of LookupTableFind + * @see org.tensorflow.op.core.LookupTableFind */ - public Rpc rpc(Operand address, Operand method, Operand request, - Rpc.Options... options) { - return Rpc.create(scope, address, method, request, options); + public LookupTableFind lookupTableFind( + Operand tableHandle, Operand keys, Operand defaultValue) { + return LookupTableFind.create(scope, tableHandle, keys, defaultValue); } /** - * Builds an {@link TensorListConcatLists} operation + * Builds an {@link VariableShape} operation * - * @param inputA - * @param inputB - * @param elementDtype - * @return a new instance of TensorListConcatLists - * @see org.tensorflow.op.core.TensorListConcatLists + * @param input + * @return a new instance of VariableShape + * @see org.tensorflow.op.core.VariableShape */ - public TensorListConcatLists tensorListConcatLists(Operand inputA, Operand inputB, - Class elementDtype) { - return TensorListConcatLists.create(scope, inputA, inputB, elementDtype); + public VariableShape variableShape(Operand input) { + return VariableShape.create(scope, input); } /** - * Builds an {@link Batch} operation + * Builds an {@link Constant} operation * - * @param inTensors - * @param numBatchThreads - * @param maxBatchSize - * @param batchTimeoutMicros - * @param gradTimeoutMicros - * @param options carries optional attributes values - * @return a new instance of Batch - * @see org.tensorflow.op.core.Batch + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public Batch batch(Iterable> inTensors, Long numBatchThreads, Long maxBatchSize, - Long batchTimeoutMicros, Long gradTimeoutMicros, Batch.Options... options) { - return Batch.create(scope, inTensors, numBatchThreads, maxBatchSize, batchTimeoutMicros, gradTimeoutMicros, options); + public Constant constant(boolean[][][] data) { + return Constant.create(scope, data); } /** @@ -1802,293 +1922,278 @@ public Batch batch(Iterable> inTensors, Long numBatchThreads, Long ma * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(int[][][][][][] data) { + public Constant constant(boolean[] data) { return Constant.create(scope, data); } /** - * Builds an {@link SetDiff1d} operation + * Builds an {@link Stage} operation * - * @param x 1-D. Values to keep. - * @param y 1-D. Values to remove. - * @param outIdx - * @return a new instance of SetDiff1d - * @see org.tensorflow.op.core.SetDiff1d + * @param values a list of tensors + * @param options carries optional attributes values + * @return a new instance of Stage + * @see org.tensorflow.op.core.Stage */ - public SetDiff1d setDiff1d(Operand x, Operand y, - Class outIdx) { - return SetDiff1d.create(scope, x, y, outIdx); + public Stage stage(Iterable> values, Stage.Options... options) { + return Stage.create(scope, values, options); } /** - * Builds an {@link Einsum} operation + * Builds an {@link Fill} operation * - * @param inputs List of 1 or 2 Tensors. - * @param equation String describing the Einstein Summation operation; in the format of np.einsum. - * @return a new instance of Einsum - * @see org.tensorflow.op.core.Einsum + * @param dims 1-D. Represents the shape of the output tensor. + * @param value 0-D (scalar). Value to fill the returned tensor. + * @return a new instance of Fill + * @see org.tensorflow.op.core.Fill */ - public Einsum einsum(Iterable> inputs, String equation) { - return Einsum.create(scope, inputs, equation); + public Fill fill(Operand dims, Operand value) { + return Fill.create(scope, dims, value); } /** - * Builds an {@link LinSpace} operation + * Builds an {@link TensorArrayConcat} operation * - * @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. - * @return a new instance of LinSpace - * @see org.tensorflow.op.core.LinSpace + * @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 + * @return a new instance of TensorArrayConcat + * @see org.tensorflow.op.core.TensorArrayConcat */ - public LinSpace linSpace(Operand start, - Operand stop, Operand num) { - return LinSpace.create(scope, start, stop, num); + public TensorArrayConcat tensorArrayConcat(Operand handle, + Operand flowIn, DataType dtype, TensorArrayConcat.Options... options) { + return TensorArrayConcat.create(scope, handle, flowIn, dtype, options); } /** - * Builds an {@link StatefulStandardNormal} operation + * Builds an {@link DeepCopy} operation * - * @param resource The handle of the resource variable that stores the state of the RNG. - * @param shape The shape of the output tensor. - * @return a new instance of StatefulStandardNormal - * @see org.tensorflow.op.core.StatefulStandardNormal + * @param x The source tensor of type `T`. + * @return a new instance of DeepCopy + * @see org.tensorflow.op.core.DeepCopy */ - public StatefulStandardNormal statefulStandardNormal(Operand resource, - Operand shape) { - return StatefulStandardNormal.create(scope, resource, shape); + public DeepCopy deepCopy(Operand x) { + return DeepCopy.create(scope, x); } /** - * Builds an {@link Empty} operation + * Builds an {@link ResourceScatterAdd} operation * - * @param shape 1-D. Represents the shape of the output tensor. - * @param dtype - * @param options carries optional attributes values - * @return a new instance of Empty - * @see org.tensorflow.op.core.Empty + * @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`. + * @return a new instance of ResourceScatterAdd + * @see org.tensorflow.op.core.ResourceScatterAdd */ - public Empty empty(Operand shape, Class dtype, Empty.Options... options) { - return Empty.create(scope, shape, dtype, options); + public ResourceScatterAdd resourceScatterAdd( + Operand resource, Operand indices, Operand updates) { + return ResourceScatterAdd.create(scope, resource, indices, updates); } /** * Builds an {@link Constant} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the + * @param data The value to put into the new constant. + * @return a float constant * @see org.tensorflow.op.core.Constant */ - public Constant constant(long[] data) { + public Constant constant(float data) { return Constant.create(scope, data); } /** - * Builds an {@link Stack} operation - * - * @param values Must be of same shape and type. - * @param options carries optional attributes values - * @return a new instance of Stack - * @see org.tensorflow.op.core.Stack - */ - public Stack stack(Iterable> values, Stack.Options... options) { - return Stack.create(scope, values, options); - } - - /** - * Builds an {@link BarrierInsertMany} operation + * Builds an {@link OnesLike} operation * - * @param handle The handle to a barrier. - * @param keys A one-dimensional tensor of keys, with length n. - * @param values An any-dimensional tensor of values, which are associated with the - * @param componentIndex The component of the barrier elements that is being assigned. - * @return a new instance of BarrierInsertMany - * @see org.tensorflow.op.core.BarrierInsertMany + * @param x a tensor of type T. + * @return a new instance of OnesLike + * @see org.tensorflow.op.core.OnesLike */ - public BarrierInsertMany barrierInsertMany(Operand handle, Operand keys, - Operand values, Long componentIndex) { - return BarrierInsertMany.create(scope, handle, keys, values, componentIndex); + public OnesLike onesLike(Operand x) { + return OnesLike.create(scope, x); } /** - * Builds an {@link Constant} operation + * Builds an {@link Bucketize} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @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 + * @see org.tensorflow.op.core.Bucketize */ - public Constant constant(long[][][][][] data) { - return Constant.create(scope, data); + public Bucketize bucketize(Operand input, List boundaries) { + return Bucketize.create(scope, input, boundaries); } /** - * Builds an {@link Stage} operation + * Builds an {@link Slice} operation * - * @param values a list of tensors - * @param options carries optional attributes values - * @return a new instance of Stage - * @see org.tensorflow.op.core.Stage + * @param input + * @param begin begin[i] specifies the offset into the 'i'th dimension of + * @param size size[i] specifies the number of elements of the 'i'th dimension + * @return a new instance of Slice + * @see org.tensorflow.op.core.Slice */ - public Stage stage(Iterable> values, Stage.Options... options) { - return Stage.create(scope, values, options); + public Slice slice(Operand input, Operand begin, + Operand size) { + return Slice.create(scope, input, begin, size); } /** - * Builds an {@link TensorArraySplit} operation + * Builds an {@link CountUpTo} operation * - * @param handle The handle to a TensorArray. - * @param value The concatenated tensor to write to the TensorArray. - * @param lengths The vector of lengths, how to split the rows of value into the - * @param flowIn A float scalar that enforces proper chaining of operations. - * @return a new instance of TensorArraySplit - * @see org.tensorflow.op.core.TensorArraySplit + * @param ref Should be from a scalar `Variable` node. + * @param limit If incrementing ref would bring it above limit, instead generates an + * @return a new instance of CountUpTo + * @see org.tensorflow.op.core.CountUpTo */ - public TensorArraySplit tensorArraySplit(Operand handle, Operand value, - Operand lengths, Operand flowIn) { - return TensorArraySplit.create(scope, handle, value, lengths, flowIn); + public CountUpTo countUpTo(Operand ref, Long limit) { + return CountUpTo.create(scope, ref, limit); } /** - * Builds an {@link TensorArrayGather} operation + * Builds an {@link ScatterMin} operation * - * @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 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 - * @return a new instance of TensorArrayGather - * @see org.tensorflow.op.core.TensorArrayGather + * @return a new instance of ScatterMin + * @see org.tensorflow.op.core.ScatterMin */ - public TensorArrayGather tensorArrayGather(Operand handle, Operand indices, - Operand flowIn, Class dtype, TensorArrayGather.Options... options) { - return TensorArrayGather.create(scope, handle, indices, flowIn, dtype, options); + public ScatterMin scatterMin(Operand ref, + Operand indices, Operand updates, ScatterMin.Options... options) { + return ScatterMin.create(scope, ref, indices, updates, options); } /** - * Builds an {@link ParallelDynamicStitch} operation + * Builds an {@link MapPeek} operation * + * @param key * @param indices - * @param data - * @return a new instance of ParallelDynamicStitch - * @see org.tensorflow.op.core.ParallelDynamicStitch + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of MapPeek + * @see org.tensorflow.op.core.MapPeek */ - public ParallelDynamicStitch parallelDynamicStitch(Iterable> indices, - Iterable> data) { - return ParallelDynamicStitch.create(scope, indices, data); + public MapPeek mapPeek(Operand key, Operand indices, List> dtypes, + MapPeek.Options... options) { + return MapPeek.create(scope, key, indices, dtypes, options); } /** - * Builds an {@link Any} operation + * Builds an {@link ScaleAndTranslate} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range + * @param images + * @param size + * @param scale + * @param translation * @param options carries optional attributes values - * @return a new instance of Any - * @see org.tensorflow.op.core.Any + * @return a new instance of ScaleAndTranslate + * @see org.tensorflow.op.core.ScaleAndTranslate */ - public Any any(Operand input, Operand axis, - Any.Options... options) { - return Any.create(scope, input, axis, options); + public ScaleAndTranslate scaleAndTranslate(Operand images, + Operand size, Operand scale, Operand translation, + ScaleAndTranslate.Options... options) { + return ScaleAndTranslate.create(scope, images, size, scale, translation, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link Concat} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param values List of `N` Tensors to concatenate. Their ranks and types must match, + * @param axis 0-D. The dimension along which to concatenate. Must be in the + * @return a new instance of Concat + * @see org.tensorflow.op.core.Concat */ - public Constant constant(double[][][] data) { - return Constant.create(scope, data); + public Concat concat(Iterable> values, + Operand axis) { + return Concat.create(scope, values, axis); } /** - * Builds an {@link Constant} operation + * Builds an {@link AssertThat} operation * - * @param type the tensor datatype. - * @param shape the tensor shape. - * @param data a buffer containing the tensor data. - * @return a constant of type `type` - * @throws IllegalArgumentException If the tensor datatype or shape is not compatible with the - * @see org.tensorflow.op.core.Constant + * @param condition The condition to evaluate. + * @param data The tensors to print out when condition is false. + * @param options carries optional attributes values + * @return a new instance of AssertThat + * @see org.tensorflow.op.core.AssertThat */ - public Constant constant(Class type, long[] shape, ByteBuffer data) { - return Constant.create(scope, type, shape, data); + public AssertThat assertThat(Operand condition, Iterable> data, + AssertThat.Options... options) { + return AssertThat.create(scope, condition, data, options); } /** - * Builds an {@link GuaranteeConst} operation + * Builds an {@link Stack} operation * - * @param input - * @return a new instance of GuaranteeConst - * @see org.tensorflow.op.core.GuaranteeConst + * @param values Must be of same shape and type. + * @param options carries optional attributes values + * @return a new instance of Stack + * @see org.tensorflow.op.core.Stack */ - public GuaranteeConst guaranteeConst(Operand input) { - return GuaranteeConst.create(scope, input); + public Stack stack(Iterable> values, Stack.Options... options) { + return Stack.create(scope, values, options); } /** - * Builds an {@link TensorListConcat} operation + * Builds an {@link ScatterMul} operation * - * @param inputHandle - * @param elementDtype + * @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 - * @return a new instance of TensorListConcat - * @see org.tensorflow.op.core.TensorListConcat + * @return a new instance of ScatterMul + * @see org.tensorflow.op.core.ScatterMul */ - public TensorListConcat tensorListConcat(Operand inputHandle, Class elementDtype, - TensorListConcat.Options... options) { - return TensorListConcat.create(scope, inputHandle, elementDtype, options); + public ScatterMul scatterMul(Operand ref, + Operand indices, Operand updates, ScatterMul.Options... options) { + return ScatterMul.create(scope, ref, indices, updates, options); } /** - * Builds an {@link QuantizedConcatV2} operation + * Builds an {@link Prod} operation * - * @param values - * @param axis - * @param inputMins - * @param inputMaxes - * @return a new instance of QuantizedConcatV2 - * @see org.tensorflow.op.core.QuantizedConcatV2 + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of Prod + * @see org.tensorflow.op.core.Prod */ - public QuantizedConcatV2 quantizedConcatV2(Iterable> values, - Operand axis, Iterable> inputMins, Iterable> inputMaxes) { - return QuantizedConcatV2.create(scope, values, axis, inputMins, inputMaxes); + public Prod prod(Operand input, Operand axis, + Prod.Options... options) { + return Prod.create(scope, input, axis, options); } /** - * Builds an {@link TensorScatterAdd} operation + * Builds an {@link Constant} operation * - * @param tensor Tensor to copy/update. - * @param indices Index tensor. - * @param updates Updates to scatter into output. - * @return a new instance of TensorScatterAdd - * @see org.tensorflow.op.core.TensorScatterAdd + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public TensorScatterAdd tensorScatterAdd(Operand tensor, - Operand indices, Operand updates) { - return TensorScatterAdd.create(scope, tensor, indices, updates); + public Constant constant(long[] data) { + return Constant.create(scope, data); } /** - * Builds an {@link RefNextIteration} operation + * Builds an {@link Snapshot} operation * - * @param data The tensor to be made available to the next iteration. - * @return a new instance of RefNextIteration - * @see org.tensorflow.op.core.RefNextIteration + * @param input + * @return a new instance of Snapshot + * @see org.tensorflow.op.core.Snapshot */ - public RefNextIteration refNextIteration(Operand data) { - return RefNextIteration.create(scope, data); + public Snapshot snapshot(Operand input) { + return Snapshot.create(scope, input); } /** - * Builds an {@link Unstack} operation + * Builds an {@link Constant} operation * - * @param value 1-D or higher, with `axis` dimension size equal to `num`. - * @param num - * @param options carries optional attributes values - * @return a new instance of Unstack - * @see org.tensorflow.op.core.Unstack + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public Unstack unstack(Operand value, Long num, Unstack.Options... options) { - return Unstack.create(scope, value, num, options); + public Constant constant(double[] data) { + return Constant.create(scope, data); } /** @@ -2102,36 +2207,34 @@ public Unstack unstack(Operand value, Long num, Unstack.Options... opt * @return a new instance of Unbatch * @see org.tensorflow.op.core.Unbatch */ - public Unbatch unbatch(Operand batchedTensor, Operand batchIndex, - Operand id, Long timeoutMicros, Unbatch.Options... options) { + public Unbatch unbatch(Operand batchedTensor, Operand batchIndex, + Operand id, Long timeoutMicros, Unbatch.Options... options) { return Unbatch.create(scope, batchedTensor, batchIndex, id, timeoutMicros, options); } /** - * Builds an {@link ParallelConcat} operation + * Builds an {@link TensorListConcatLists} operation * - * @param values Tensors to be concatenated. All must have size 1 in the first dimension - * @param shape the final shape of the result; should be equal to the shapes of any input - * @return a new instance of ParallelConcat - * @see org.tensorflow.op.core.ParallelConcat + * @param inputA + * @param inputB + * @param elementDtype + * @return a new instance of TensorListConcatLists + * @see org.tensorflow.op.core.TensorListConcatLists */ - public ParallelConcat parallelConcat(Iterable> values, Shape shape) { - return ParallelConcat.create(scope, values, shape); + public TensorListConcatLists tensorListConcatLists(Operand inputA, + Operand inputB, DataType elementDtype) { + return TensorListConcatLists.create(scope, inputA, inputB, elementDtype); } /** - * Builds an {@link ScatterDiv} operation + * Builds an {@link Merge} operation * - * @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 - * @return a new instance of ScatterDiv - * @see org.tensorflow.op.core.ScatterDiv + * @param inputs The input tensors, exactly one of which will become available. + * @return a new instance of Merge + * @see org.tensorflow.op.core.Merge */ - public ScatterDiv scatterDiv(Operand ref, Operand indices, - Operand updates, ScatterDiv.Options... options) { - return ScatterDiv.create(scope, ref, indices, updates, options); + public Merge merge(Iterable> inputs) { + return Merge.create(scope, inputs); } /** @@ -2156,116 +2259,56 @@ public Gradients gradients(Iterable> y, Iterable ResourceApplyKerasMomentum resourceApplyKerasMomentum(Operand var, Operand accum, - Operand lr, Operand grad, Operand momentum, - ResourceApplyKerasMomentum.Options... options) { - return ResourceApplyKerasMomentum.create(scope, var, accum, lr, grad, momentum, options); - } - - /** - * Builds an {@link TemporaryVariable} operation - * - * @param shape The shape of the variable tensor. - * @param dtype The type of elements in the variable tensor. - * @param options carries optional attributes values - * @return a new instance of TemporaryVariable - * @see org.tensorflow.op.core.TemporaryVariable - */ - public TemporaryVariable temporaryVariable(Shape shape, Class dtype, - TemporaryVariable.Options... options) { - return TemporaryVariable.create(scope, shape, dtype, options); - } - - /** - * Builds an {@link TensorListLength} operation - * - * @param inputHandle - * @return a new instance of TensorListLength - * @see org.tensorflow.op.core.TensorListLength - */ - public TensorListLength tensorListLength(Operand inputHandle) { - return TensorListLength.create(scope, inputHandle); - } - - /** - * Builds an {@link Min} operation - * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range - * @param options carries optional attributes values - * @return a new instance of Min - * @see org.tensorflow.op.core.Min - */ - public Min min(Operand input, Operand axis, - Min.Options... options) { - return Min.create(scope, input, axis, options); + return NoOp.create(scope); } /** - * Builds an {@link StopGradient} operation + * Builds an {@link Tile} operation * - * @param input - * @return a new instance of StopGradient - * @see org.tensorflow.op.core.StopGradient + * @param input 1-D or higher. + * @param multiples 1-D. Length must be the same as the number of dimensions in `input` + * @return a new instance of Tile + * @see org.tensorflow.op.core.Tile */ - public StopGradient stopGradient(Operand input) { - return StopGradient.create(scope, input); + public Tile tile(Operand input, Operand multiples) { + return Tile.create(scope, input, multiples); } /** - * Builds an {@link CudnnRNNParamsToCanonicalV2} operation + * Builds an {@link TensorListLength} operation * - * @param numLayers - * @param numUnits - * @param inputSize - * @param params - * @param numParamsWeights - * @param numParamsBiases - * @param options carries optional attributes values - * @return a new instance of CudnnRNNParamsToCanonicalV2 - * @see org.tensorflow.op.core.CudnnRNNParamsToCanonicalV2 + * @param inputHandle + * @return a new instance of TensorListLength + * @see org.tensorflow.op.core.TensorListLength */ - public CudnnRNNParamsToCanonicalV2 cudnnRNNParamsToCanonicalV2( - Operand numLayers, Operand numUnits, Operand inputSize, - Operand params, Long numParamsWeights, Long numParamsBiases, - CudnnRNNParamsToCanonicalV2.Options... options) { - return CudnnRNNParamsToCanonicalV2.create(scope, numLayers, numUnits, inputSize, params, numParamsWeights, numParamsBiases, options); + public TensorListLength tensorListLength(Operand inputHandle) { + return TensorListLength.create(scope, inputHandle); } /** - * Builds an {@link Identity} operation + * Builds an {@link OrderedMapClear} operation * - * @param input - * @return a new instance of Identity - * @see org.tensorflow.op.core.Identity + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of OrderedMapClear + * @see org.tensorflow.op.core.OrderedMapClear */ - public Identity identity(Operand input) { - return Identity.create(scope, input); + public OrderedMapClear orderedMapClear(List> dtypes, + OrderedMapClear.Options... options) { + return OrderedMapClear.create(scope, dtypes, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link Lu} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param input A tensor of shape `[..., M, M]` whose inner-most 2 dimensions form matrices of + * @param outputIdxType + * @return a new instance of Lu + * @see org.tensorflow.op.core.Lu */ - public Constant constant(long[][][][] data) { - return Constant.create(scope, data); + public Lu lu(Operand input, + DataType outputIdxType) { + return Lu.create(scope, input, outputIdxType); } /** @@ -2293,187 +2336,241 @@ public TensorArrayClose tensorArrayClose(Operand handle) { } /** - * Builds an {@link StatefulStandardNormalV2} operation + * Builds an {@link Size} operation * - * @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. - * @return a new instance of StatefulStandardNormalV2 - * @see org.tensorflow.op.core.StatefulStandardNormalV2 + * @param input + * @param outType + * @return a new instance of Size + * @see org.tensorflow.op.core.Size */ - public StatefulStandardNormalV2 statefulStandardNormalV2(Operand resource, - Operand algorithm, Operand shape, Class dtype) { - return StatefulStandardNormalV2.create(scope, resource, algorithm, shape, dtype); + public Size size(Operand input, DataType outType) { + return Size.create(scope, input, outType); } /** - * Builds an {@link Constant} operation + * Builds an {@link QuantizedConcatV2} operation * - * @param data The string to put into the new constant. - * @return a string constant - * @see org.tensorflow.op.core.Constant + * @param values + * @param axis + * @param inputMins + * @param inputMaxes + * @return a new instance of QuantizedConcatV2 + * @see org.tensorflow.op.core.QuantizedConcatV2 */ - public Constant constant(String data) { - return Constant.create(scope, data); + public QuantizedConcatV2 quantizedConcatV2( + Iterable> values, Operand axis, Iterable> inputMins, + Iterable> inputMaxes) { + return QuantizedConcatV2.create(scope, values, axis, inputMins, inputMaxes); } /** - * Builds an {@link Prod} operation + * Builds an {@link TensorListStack} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range + * @param inputHandle + * @param elementShape + * @param elementDtype * @param options carries optional attributes values - * @return a new instance of Prod - * @see org.tensorflow.op.core.Prod + * @return a new instance of TensorListStack + * @see org.tensorflow.op.core.TensorListStack */ - public Prod prod(Operand input, Operand axis, - Prod.Options... options) { - return Prod.create(scope, input, axis, options); + public TensorListStack tensorListStack(Operand inputHandle, + Operand elementShape, DataType elementDtype, TensorListStack.Options... options) { + return TensorListStack.create(scope, inputHandle, elementShape, elementDtype, options); + } + + /** + * Builds an {@link EnsureShape} operation + * + * @param input A tensor, whose shape is to be validated. + * @param shape The expected (possibly partially specified) shape of the input tensor. + * @return a new instance of EnsureShape + * @see org.tensorflow.op.core.EnsureShape + */ + public EnsureShape ensureShape(Operand input, Shape shape) { + return EnsureShape.create(scope, input, shape); + } + + /** + * Builds an {@link Print} operation + * + * @param input The string scalar to print. + * @param options carries optional attributes values + * @return a new instance of Print + * @see org.tensorflow.op.core.Print + */ + public Print print(Operand input, Print.Options... options) { + return Print.create(scope, input, options); } /** * Builds an {@link Constant} operation * - * @param data An array containing the values to put into the new constant. String elements are + * @param object a Java object representing the constant. + * @return a constant of type `type` + * @see org.tensorflow.Tensor#create(Object) Tensor.create * @see org.tensorflow.op.core.Constant */ - public Constant constant(byte[][][][][][] data) { - return Constant.create(scope, data); + public Constant constant(Object object, DataType type) { + return Constant.create(scope, object, type); } /** - * Builds an {@link SetSize} operation + * Builds an {@link InitializeTableFromTextFile} operation * - * @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 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 valueIndex Column index that represents information of a line to get the table * @param options carries optional attributes values - * @return a new instance of SetSize - * @see org.tensorflow.op.core.SetSize + * @return a new instance of InitializeTableFromTextFile + * @see org.tensorflow.op.core.InitializeTableFromTextFile */ - public SetSize setSize(Operand setIndices, Operand setValues, Operand setShape, - SetSize.Options... options) { - return SetSize.create(scope, setIndices, setValues, setShape, options); + public InitializeTableFromTextFile initializeTableFromTextFile(Operand tableHandle, + Operand filename, Long keyIndex, Long valueIndex, + InitializeTableFromTextFile.Options... options) { + return InitializeTableFromTextFile.create(scope, tableHandle, filename, keyIndex, valueIndex, options); } /** - * Builds an {@link LookupTableExport} operation + * Builds an {@link Einsum} operation * - * @param tableHandle Handle to the table. - * @param Tkeys - * @param Tvalues - * @return a new instance of LookupTableExport - * @see org.tensorflow.op.core.LookupTableExport + * @param inputs List of 1 or 2 Tensors. + * @param equation String describing the Einstein Summation operation; in the format of np.einsum. + * @return a new instance of Einsum + * @see org.tensorflow.op.core.Einsum */ - public LookupTableExport lookupTableExport(Operand tableHandle, Class Tkeys, - Class Tvalues) { - return LookupTableExport.create(scope, tableHandle, Tkeys, Tvalues); + public Einsum einsum(Iterable> inputs, String equation) { + return Einsum.create(scope, inputs, equation); } /** - * Builds an {@link Fill} operation + * Builds an {@link InplaceAdd} operation * - * @param dims 1-D. Represents the shape of the output tensor. - * @param value 0-D (scalar). Value to fill the returned tensor. - * @return a new instance of Fill - * @see org.tensorflow.op.core.Fill + * @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. + * @return a new instance of InplaceAdd + * @see org.tensorflow.op.core.InplaceAdd */ - public Fill fill(Operand dims, Operand value) { - return Fill.create(scope, dims, value); + public InplaceAdd inplaceAdd(Operand x, Operand i, Operand v) { + return InplaceAdd.create(scope, x, i, v); } /** - * Builds an {@link AssignAddVariableOp} operation + * Builds an {@link StatefulRandomBinomial} operation * - * @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 - * @see org.tensorflow.op.core.AssignAddVariableOp + * @param resource + * @param algorithm + * @param shape + * @param counts + * @param probs + * @return a new instance of StatefulRandomBinomial + * @see org.tensorflow.op.core.StatefulRandomBinomial */ - public AssignAddVariableOp assignAddVariableOp(Operand resource, Operand value) { - return AssignAddVariableOp.create(scope, resource, value); + public StatefulRandomBinomial statefulRandomBinomial( + Operand resource, Operand algorithm, Operand shape, Operand counts, + Operand probs) { + return StatefulRandomBinomial.create(scope, resource, algorithm, shape, counts, probs); } /** - * Builds an {@link AssignSub} operation + * Builds an {@link Mutex} operation * - * @param ref Should be from a `Variable` node. - * @param value The value to be subtracted to the variable. * @param options carries optional attributes values - * @return a new instance of AssignSub - * @see org.tensorflow.op.core.AssignSub + * @return a new instance of Mutex + * @see org.tensorflow.op.core.Mutex */ - public AssignSub assignSub(Operand ref, Operand value, - AssignSub.Options... options) { - return AssignSub.create(scope, ref, value, options); + public Mutex mutex(Mutex.Options... options) { + return Mutex.create(scope, options); } /** - * Builds an {@link LoopCond} operation + * Builds an {@link ResourceScatterNdUpdate} operation * - * @param input A boolean scalar, representing the branch predicate of the Switch op. - * @return a new instance of LoopCond - * @see org.tensorflow.op.core.LoopCond + * @param ref A resource handle. Must be from a VarHandleOp. + * @param indices A Tensor. Must be one of the following types: int32, int64. + * @param updates A Tensor. Must have the same type as ref. A tensor of updated + * @param options carries optional attributes values + * @return a new instance of ResourceScatterNdUpdate + * @see org.tensorflow.op.core.ResourceScatterNdUpdate */ - public LoopCond loopCond(Operand input) { - return LoopCond.create(scope, input); + public ResourceScatterNdUpdate resourceScatterNdUpdate( + Operand ref, Operand indices, Operand updates, + ResourceScatterNdUpdate.Options... options) { + return ResourceScatterNdUpdate.create(scope, ref, indices, updates, options); } /** - * Builds an {@link BarrierTakeMany} operation + * Builds an {@link ShapeN} operation * - * @param handle The handle to a barrier. - * @param numElements A single-element tensor containing the number of elements to - * @param componentTypes The type of each component in a value. + * @param input + * @param outType + * @return a new instance of ShapeN + * @see org.tensorflow.op.core.ShapeN + */ + public ShapeN shapeN(Iterable> input, + DataType outType) { + return ShapeN.create(scope, input, outType); + } + + /** + * Builds an {@link RemoteFusedGraphExecute} operation + * + * @param inputs Arbitrary number of tensors with arbitrary data types + * @param Toutputs + * @param serializedRemoteFusedGraphExecuteInfo Serialized protocol buffer + * @return a new instance of RemoteFusedGraphExecute + * @see org.tensorflow.op.core.RemoteFusedGraphExecute + */ + public RemoteFusedGraphExecute remoteFusedGraphExecute(Iterable> inputs, + List> Toutputs, String serializedRemoteFusedGraphExecuteInfo) { + return RemoteFusedGraphExecute.create(scope, inputs, Toutputs, serializedRemoteFusedGraphExecuteInfo); + } + + /** + * Builds an {@link TensorStridedSliceUpdate} operation + * + * @param input + * @param begin + * @param end + * @param strides + * @param value * @param options carries optional attributes values - * @return a new instance of BarrierTakeMany - * @see org.tensorflow.op.core.BarrierTakeMany + * @return a new instance of TensorStridedSliceUpdate + * @see org.tensorflow.op.core.TensorStridedSliceUpdate */ - public BarrierTakeMany barrierTakeMany(Operand handle, Operand numElements, - List> componentTypes, BarrierTakeMany.Options... options) { - return BarrierTakeMany.create(scope, handle, numElements, componentTypes, options); + public TensorStridedSliceUpdate tensorStridedSliceUpdate( + Operand input, Operand begin, Operand end, Operand strides, Operand value, + TensorStridedSliceUpdate.Options... options) { + return TensorStridedSliceUpdate.create(scope, input, begin, end, strides, value, options); } /** - * Builds an {@link MapUnstage} operation + * Builds an {@link ScatterMax} operation * - * @param key - * @param indices - * @param dtypes + * @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 - * @return a new instance of MapUnstage - * @see org.tensorflow.op.core.MapUnstage + * @return a new instance of ScatterMax + * @see org.tensorflow.op.core.ScatterMax */ - public MapUnstage mapUnstage(Operand key, Operand indices, List> dtypes, - MapUnstage.Options... options) { - return MapUnstage.create(scope, key, indices, dtypes, options); + public ScatterMax scatterMax(Operand ref, + Operand indices, Operand updates, ScatterMax.Options... options) { + return ScatterMax.create(scope, ref, indices, updates, options); } /** - * Builds an {@link TensorArrayGradWithShape} operation + * Builds an {@link TensorArrayGrad} operation * * @param handle The handle to the forward TensorArray. * @param flowIn A float scalar that enforces proper chaining of operations. - * @param shapeToPrepend An int32 vector representing a shape. Elements in the gradient accumulator will * @param source The gradient source string, used to decide which gradient TensorArray - * @return a new instance of TensorArrayGradWithShape - * @see org.tensorflow.op.core.TensorArrayGradWithShape - */ - public TensorArrayGradWithShape tensorArrayGradWithShape(Operand handle, Operand flowIn, - Operand shapeToPrepend, String source) { - return TensorArrayGradWithShape.create(scope, handle, flowIn, shapeToPrepend, source); - } - - /** - * Builds an {@link Mutex} operation - * - * @param options carries optional attributes values - * @return a new instance of Mutex - * @see org.tensorflow.op.core.Mutex + * @return a new instance of TensorArrayGrad + * @see org.tensorflow.op.core.TensorArrayGrad */ - public Mutex mutex(Mutex.Options... options) { - return Mutex.create(scope, options); + public TensorArrayGrad tensorArrayGrad(Operand handle, Operand flowIn, String source) { + return TensorArrayGrad.create(scope, handle, flowIn, source); } /** @@ -2484,11 +2581,26 @@ public Mutex mutex(Mutex.Options... options) { * @return a new instance of UniqueWithCounts * @see org.tensorflow.op.core.UniqueWithCounts */ - public UniqueWithCounts uniqueWithCounts(Operand x, - Operand axis) { + public UniqueWithCounts uniqueWithCounts( + Operand x, Operand axis) { return UniqueWithCounts.create(scope, x, axis); } + /** + * Builds an {@link ScatterNdAdd} operation + * + * @param ref A mutable Tensor. Should be from a Variable node. + * @param indices A Tensor. Must be one of the following types: int32, int64. + * @param updates A Tensor. Must have the same type as ref. A tensor of updated values + * @param options carries optional attributes values + * @return a new instance of ScatterNdAdd + * @see org.tensorflow.op.core.ScatterNdAdd + */ + public ScatterNdAdd scatterNdAdd(Operand ref, + Operand indices, Operand updates, ScatterNdAdd.Options... options) { + return ScatterNdAdd.create(scope, ref, indices, updates, options); + } + /** * Builds an {@link HistogramFixedWidth} operation * @@ -2499,138 +2611,88 @@ public UniqueWithCounts uniqueWithCounts(Opera * @return a new instance of HistogramFixedWidth * @see org.tensorflow.op.core.HistogramFixedWidth */ - public HistogramFixedWidth histogramFixedWidth( - Operand values, Operand valueRange, Operand nbins, Class dtype) { + public HistogramFixedWidth histogramFixedWidth( + Operand values, Operand valueRange, Operand nbins, DataType dtype) { return HistogramFixedWidth.create(scope, values, valueRange, nbins, dtype); } - /** - * Builds an {@link MatrixDiagV2} operation - * - * @param diagonal Rank `r`, where `r >= 1` - * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main - * @param numRows The number of rows of the output matrix. If it is not provided, the op assumes - * @param numCols The number of columns of the output matrix. If it is not provided, the op - * @param paddingValue The number to fill the area outside the specified diagonal band with. - * @return a new instance of MatrixDiagV2 - * @see org.tensorflow.op.core.MatrixDiagV2 - */ - public MatrixDiagV2 matrixDiagV2(Operand diagonal, Operand k, - Operand numRows, Operand numCols, Operand paddingValue) { - return MatrixDiagV2.create(scope, diagonal, k, numRows, numCols, paddingValue); - } - - /** - * Builds an {@link TensorScatterSub} operation - * - * @param tensor Tensor to copy/update. - * @param indices Index tensor. - * @param updates Updates to scatter into output. - * @return a new instance of TensorScatterSub - * @see org.tensorflow.op.core.TensorScatterSub - */ - public TensorScatterSub tensorScatterSub(Operand tensor, - Operand indices, Operand updates) { - return TensorScatterSub.create(scope, tensor, indices, updates); - } - - /** - * Builds an {@link Constant} operation - * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant - */ - public Constant constant(boolean[] data) { - return Constant.create(scope, data); - } - - /** - * Builds an {@link Constant} operation - * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant - */ - public Constant constant(double[][][][][][] data) { - return Constant.create(scope, data); - } - /** * Builds an {@link Constant} operation * - * @param data An array containing the values to put into the new constant. String elements are + * @param data The value to put into the new constant. + * @return an integer constant * @see org.tensorflow.op.core.Constant */ - public Constant constant(byte[][][][][] data) { + public Constant constant(int data) { return Constant.create(scope, data); } /** - * Builds an {@link Constant} operation + * Builds an {@link CudnnRNNParamsToCanonicalV2} operation * - * @param shape the tensor shape. - * @param data a buffer containing the tensor data. - * @return an integer constant - * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer - * @see org.tensorflow.op.core.Constant + * @param numLayers + * @param numUnits + * @param inputSize + * @param params + * @param numParamsWeights + * @param numParamsBiases + * @param options carries optional attributes values + * @return a new instance of CudnnRNNParamsToCanonicalV2 + * @see org.tensorflow.op.core.CudnnRNNParamsToCanonicalV2 */ - public Constant constant(long[] shape, IntBuffer data) { - return Constant.create(scope, shape, data); + public CudnnRNNParamsToCanonicalV2 cudnnRNNParamsToCanonicalV2( + Operand numLayers, Operand numUnits, Operand inputSize, + Operand params, Long numParamsWeights, Long numParamsBiases, + CudnnRNNParamsToCanonicalV2.Options... options) { + return CudnnRNNParamsToCanonicalV2.create(scope, numLayers, numUnits, inputSize, params, numParamsWeights, numParamsBiases, options); } /** - * Builds an {@link LookupTableFind} operation + * Builds an {@link Size} operation * - * @param tableHandle Handle to the table. - * @param keys Any shape. Keys to look up. - * @param defaultValue - * @return a new instance of LookupTableFind - * @see org.tensorflow.op.core.LookupTableFind + * @param input + * @return a new instance of Size + * @see org.tensorflow.op.core.Size */ - public LookupTableFind lookupTableFind(Operand tableHandle, Operand keys, - Operand defaultValue) { - return LookupTableFind.create(scope, tableHandle, keys, defaultValue); + public Size size(Operand input) { + return Size.create(scope, input); } /** - * Builds an {@link TensorArrayUnpack} operation + * Builds an {@link OrderedMapUnstageNoKey} operation * - * @param handle - * @param value - * @param flowIn - * @return a new instance of TensorArrayUnpack - * @see org.tensorflow.op.core.TensorArrayUnpack + * @param indices + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of OrderedMapUnstageNoKey + * @see org.tensorflow.op.core.OrderedMapUnstageNoKey */ - public TensorArrayUnpack tensorArrayUnpack(Operand handle, Operand value, - Operand flowIn) { - return TensorArrayUnpack.create(scope, handle, value, flowIn); + public OrderedMapUnstageNoKey orderedMapUnstageNoKey(Operand indices, + List> dtypes, OrderedMapUnstageNoKey.Options... options) { + return OrderedMapUnstageNoKey.create(scope, indices, dtypes, options); } /** - * Builds an {@link DynamicPartition} operation + * Builds an {@link BroadcastDynamicShape} operation * - * @param data - * @param partitions Any shape. Indices in the range `[0, num_partitions)`. - * @param numPartitions The number of partitions to output. - * @return a new instance of DynamicPartition - * @see org.tensorflow.op.core.DynamicPartition + * @param s0 + * @param s1 + * @return a new instance of BroadcastDynamicShape + * @see org.tensorflow.op.core.BroadcastDynamicShape */ - public DynamicPartition dynamicPartition(Operand data, Operand partitions, - Long numPartitions) { - return DynamicPartition.create(scope, data, partitions, numPartitions); + public BroadcastDynamicShape broadcastDynamicShape(Operand s0, + Operand s1) { + return BroadcastDynamicShape.create(scope, s0, s1); } /** - * Builds an {@link SpaceToBatchNd} operation + * Builds an {@link Constant} operation * - * @param input N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`, - * @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. - * @return a new instance of SpaceToBatchNd - * @see org.tensorflow.op.core.SpaceToBatchNd + * @param data An array containing the values to put into the new constant. String elements are + * @see org.tensorflow.op.core.Constant */ - public SpaceToBatchNd spaceToBatchNd(Operand input, - Operand blockShape, Operand paddings) { - return SpaceToBatchNd.create(scope, input, blockShape, paddings); + public Constant constant(byte[][] data) { + return Constant.create(scope, data); } /** @@ -2642,296 +2704,234 @@ public SpaceToBatchNd spaceToBatchNd( * @return a new instance of TensorListScatterIntoExistingList * @see org.tensorflow.op.core.TensorListScatterIntoExistingList */ - public TensorListScatterIntoExistingList tensorListScatterIntoExistingList( - Operand inputHandle, Operand tensor, Operand indices) { + public TensorListScatterIntoExistingList tensorListScatterIntoExistingList( + Operand inputHandle, Operand tensor, Operand indices) { return TensorListScatterIntoExistingList.create(scope, inputHandle, tensor, indices); } /** - * Builds an {@link NonMaxSuppressionV5} operation - * - * @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 maxOutputSize A scalar integer tensor representing the maximum number of - * @param iouThreshold A 0-D float tensor representing the threshold for deciding whether - * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove - * @param softNmsSigma A 0-D float tensor representing the sigma parameter for Soft NMS; see Bodla et - * @param options carries optional attributes values - * @return a new instance of NonMaxSuppressionV5 - * @see org.tensorflow.op.core.NonMaxSuppressionV5 - */ - public NonMaxSuppressionV5 nonMaxSuppressionV5(Operand boxes, - Operand scores, Operand maxOutputSize, Operand iouThreshold, - Operand scoreThreshold, Operand softNmsSigma, NonMaxSuppressionV5.Options... options) { - return NonMaxSuppressionV5.create(scope, boxes, scores, maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma, options); - } - - /** - * Builds an {@link Pad} operation - * - * @param input - * @param paddings - * @param constantValues - * @return a new instance of Pad - * @see org.tensorflow.op.core.Pad - */ - public Pad pad(Operand input, Operand paddings, - Operand constantValues) { - return Pad.create(scope, input, paddings, constantValues); - } - - /** - * Builds an {@link RefSelect} operation - * - * @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`. - * @return a new instance of RefSelect - * @see org.tensorflow.op.core.RefSelect - */ - public RefSelect refSelect(Operand index, Iterable> inputs) { - return RefSelect.create(scope, index, inputs); - } - - /** - * Builds an {@link ScatterNdUpdate} operation + * Builds an {@link Rpc} operation * - * @param ref A mutable Tensor. Should be from a Variable node. - * @param indices A Tensor. Must be one of the following types: int32, int64. - * @param updates A Tensor. Must have the same type as ref. A tensor of updated + * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. + * @param method `0-D` or `1-D`. The method address on the RPC server. + * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. * @param options carries optional attributes values - * @return a new instance of ScatterNdUpdate - * @see org.tensorflow.op.core.ScatterNdUpdate + * @return a new instance of Rpc + * @see org.tensorflow.op.core.Rpc */ - public ScatterNdUpdate scatterNdUpdate(Operand ref, - Operand indices, Operand updates, ScatterNdUpdate.Options... options) { - return ScatterNdUpdate.create(scope, ref, indices, updates, options); + public Rpc rpc(Operand address, Operand method, Operand request, + Rpc.Options... options) { + return Rpc.create(scope, address, method, request, options); } /** - * Builds an {@link ReduceMax} operation + * Builds an {@link DestroyResourceOp} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range + * @param resource handle to the resource to delete. * @param options carries optional attributes values - * @return a new instance of ReduceMax - * @see org.tensorflow.op.core.ReduceMax + * @return a new instance of DestroyResourceOp + * @see org.tensorflow.op.core.DestroyResourceOp */ - public ReduceMax reduceMax(Operand input, Operand axis, - ReduceMax.Options... options) { - return ReduceMax.create(scope, input, axis, options); + public DestroyResourceOp destroyResourceOp(Operand resource, + DestroyResourceOp.Options... options) { + return DestroyResourceOp.create(scope, resource, options); } /** - * Builds an {@link ScatterNd} operation + * Builds an {@link TensorArrayScatter} operation * - * @param indices Index tensor. - * @param updates Updates to scatter into output. - * @param shape 1-D. The shape of the resulting tensor. - * @return a new instance of ScatterNd - * @see org.tensorflow.op.core.ScatterNd + * @param handle The handle to a TensorArray. + * @param indices The locations at which to write the tensor elements. + * @param value The concatenated tensor to write to the TensorArray. + * @param flowIn A float scalar that enforces proper chaining of operations. + * @return a new instance of TensorArrayScatter + * @see org.tensorflow.op.core.TensorArrayScatter */ - public ScatterNd scatterNd(Operand indices, Operand updates, - Operand shape) { - return ScatterNd.create(scope, indices, updates, shape); + public TensorArrayScatter tensorArrayScatter(Operand handle, + Operand indices, Operand value, Operand flowIn) { + return TensorArrayScatter.create(scope, handle, indices, value, flowIn); } /** - * Builds an {@link Size} operation + * Builds an {@link BarrierInsertMany} operation * - * @param input - * @param outType - * @return a new instance of Size - * @see org.tensorflow.op.core.Size + * @param handle The handle to a barrier. + * @param keys A one-dimensional tensor of keys, with length n. + * @param values An any-dimensional tensor of values, which are associated with the + * @param componentIndex The component of the barrier elements that is being assigned. + * @return a new instance of BarrierInsertMany + * @see org.tensorflow.op.core.BarrierInsertMany */ - public Size size(Operand input, Class outType) { - return Size.create(scope, input, outType); + public BarrierInsertMany barrierInsertMany(Operand handle, + Operand keys, Operand values, Long componentIndex) { + return BarrierInsertMany.create(scope, handle, keys, values, componentIndex); } /** - * Builds an {@link LookupTableImport} operation + * Builds an {@link QuantizedReshape} operation * - * @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 - * @see org.tensorflow.op.core.LookupTableImport + * @param tensor + * @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. + * @return a new instance of QuantizedReshape + * @see org.tensorflow.op.core.QuantizedReshape */ - public LookupTableImport lookupTableImport(Operand tableHandle, Operand keys, - Operand values) { - return LookupTableImport.create(scope, tableHandle, keys, values); + public QuantizedReshape quantizedReshape( + Operand tensor, Operand shape, Operand inputMin, Operand inputMax) { + return QuantizedReshape.create(scope, tensor, shape, inputMin, inputMax); } /** - * Builds an {@link Constant} operation + * Builds an {@link Placeholder} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param dtype The type of elements in the tensor. + * @param options carries optional attributes values + * @return a new instance of Placeholder + * @see org.tensorflow.op.core.Placeholder */ - public Constant constant(boolean[][] data) { - return Constant.create(scope, data); + public Placeholder placeholder(DataType dtype, + Placeholder.Options... options) { + return Placeholder.create(scope, dtype, options); } /** - * Builds an {@link BroadcastDynamicShape} operation + * Builds an {@link ConsumeMutexLock} operation * - * @param s0 - * @param s1 - * @return a new instance of BroadcastDynamicShape - * @see org.tensorflow.op.core.BroadcastDynamicShape + * @param mutexLock A tensor returned by `MutexLock`. + * @return a new instance of ConsumeMutexLock + * @see org.tensorflow.op.core.ConsumeMutexLock */ - public BroadcastDynamicShape broadcastDynamicShape(Operand s0, - Operand s1) { - return BroadcastDynamicShape.create(scope, s0, s1); + public ConsumeMutexLock consumeMutexLock(Operand mutexLock) { + return ConsumeMutexLock.create(scope, mutexLock); } /** - * Builds an {@link TensorArrayPack} operation + * Builds an {@link MirrorPad} operation * - * @param handle - * @param flowIn - * @param dtype - * @param options carries optional attributes values - * @return a new instance of TensorArrayPack - * @see org.tensorflow.op.core.TensorArrayPack + * @param input The input tensor to be padded. + * @param paddings A two-column matrix specifying the padding sizes. The number of + * @param mode Either `REFLECT` or `SYMMETRIC`. In reflect mode the padded regions + * @return a new instance of MirrorPad + * @see org.tensorflow.op.core.MirrorPad */ - public TensorArrayPack tensorArrayPack(Operand handle, Operand flowIn, - Class dtype, TensorArrayPack.Options... options) { - return TensorArrayPack.create(scope, handle, flowIn, dtype, options); + public MirrorPad mirrorPad(Operand input, + Operand paddings, String mode) { + return MirrorPad.create(scope, input, paddings, mode); } /** - * Builds an {@link ScatterNdSub} operation + * Builds an {@link ResourceScatterUpdate} operation * - * @param ref A mutable Tensor. Should be from a Variable node. - * @param indices A Tensor. Must be one of the following types: int32, int64. - * @param updates A Tensor. Must have the same type as ref. A tensor of updated values - * @param options carries optional attributes values - * @return a new instance of ScatterNdSub - * @see org.tensorflow.op.core.ScatterNdSub + * @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`. + * @return a new instance of ResourceScatterUpdate + * @see org.tensorflow.op.core.ResourceScatterUpdate */ - public ScatterNdSub scatterNdSub(Operand ref, Operand indices, - Operand updates, ScatterNdSub.Options... options) { - return ScatterNdSub.create(scope, ref, indices, updates, options); + public ResourceScatterUpdate resourceScatterUpdate( + Operand resource, Operand indices, Operand updates) { + return ResourceScatterUpdate.create(scope, resource, indices, updates); } /** - * Builds an {@link DestroyResourceOp} operation + * Builds an {@link TensorListScatter} operation * - * @param resource handle to the resource to delete. - * @param options carries optional attributes values - * @return a new instance of DestroyResourceOp - * @see org.tensorflow.op.core.DestroyResourceOp + * @param tensor + * @param indices + * @param elementShape + * @return a new instance of TensorListScatter + * @see org.tensorflow.op.core.TensorListScatter */ - public DestroyResourceOp destroyResourceOp(Operand resource, - DestroyResourceOp.Options... options) { - return DestroyResourceOp.create(scope, resource, options); + public TensorListScatter tensorListScatter(Operand tensor, + Operand indices, Operand elementShape) { + return TensorListScatter.create(scope, tensor, indices, elementShape); } /** - * Builds an {@link ResourceSparseApplyKerasMomentum} operation + * Builds an {@link MapSize} operation * - * @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 momentum Momentum. Must be a scalar. + * @param dtypes * @param options carries optional attributes values - * @return a new instance of ResourceSparseApplyKerasMomentum - * @see org.tensorflow.op.core.ResourceSparseApplyKerasMomentum - */ - public ResourceSparseApplyKerasMomentum resourceSparseApplyKerasMomentum( - Operand var, Operand accum, Operand lr, Operand grad, Operand indices, - Operand momentum, ResourceSparseApplyKerasMomentum.Options... options) { - return ResourceSparseApplyKerasMomentum.create(scope, var, accum, lr, grad, indices, momentum, options); - } - - /** - * Builds an {@link Constant} operation - * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @return a new instance of MapSize + * @see org.tensorflow.op.core.MapSize */ - public Constant constant(float[][][][] data) { - return Constant.create(scope, data); + public MapSize mapSize(List> dtypes, MapSize.Options... options) { + return MapSize.create(scope, dtypes, options); } /** - * Builds an {@link StringNGrams} operation + * Builds an {@link EuclideanNorm} operation * - * @param data The values tensor of the ragged string tensor to make ngrams out of. Must be a - * @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 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 - * @param rightPad The string to use to pad the right side of the ngram sequence. Only used if - * @param padWidth The number of padding elements to add to each side of each - * @param preserveShortSequences - * @return a new instance of StringNGrams - * @see org.tensorflow.op.core.StringNGrams + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of EuclideanNorm + * @see org.tensorflow.op.core.EuclideanNorm */ - public StringNGrams stringNGrams(Operand data, - Operand dataSplits, String separator, List ngramWidths, String leftPad, - String rightPad, Long padWidth, Boolean preserveShortSequences) { - return StringNGrams.create(scope, data, dataSplits, separator, ngramWidths, leftPad, rightPad, padWidth, preserveShortSequences); + public EuclideanNorm euclideanNorm(Operand input, + Operand axis, EuclideanNorm.Options... options) { + return EuclideanNorm.create(scope, input, axis, options); } /** - * Builds an {@link BarrierIncompleteSize} operation + * Builds an {@link ResourceScatterSub} operation * - * @param handle The handle to a barrier. - * @return a new instance of BarrierIncompleteSize - * @see org.tensorflow.op.core.BarrierIncompleteSize + * @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`. + * @return a new instance of ResourceScatterSub + * @see org.tensorflow.op.core.ResourceScatterSub */ - public BarrierIncompleteSize barrierIncompleteSize(Operand handle) { - return BarrierIncompleteSize.create(scope, handle); + public ResourceScatterSub resourceScatterSub( + Operand resource, Operand indices, Operand updates) { + return ResourceScatterSub.create(scope, resource, indices, updates); } /** - * Builds an {@link MapClear} operation + * Builds an {@link VarHandleOp} operation * - * @param dtypes + * @param dtype the type of this variable. Must agree with the dtypes + * @param shape The (possibly partially specified) shape of this variable. * @param options carries optional attributes values - * @return a new instance of MapClear - * @see org.tensorflow.op.core.MapClear + * @return a new instance of VarHandleOp + * @see org.tensorflow.op.core.VarHandleOp */ - public MapClear mapClear(List> dtypes, MapClear.Options... options) { - return MapClear.create(scope, dtypes, options); + public VarHandleOp varHandleOp(DataType dtype, Shape shape, + VarHandleOp.Options... options) { + return VarHandleOp.create(scope, dtype, shape, options); } /** - * Builds an {@link ConsumeMutexLock} operation + * Builds an {@link Constant} operation * - * @param mutexLock A tensor returned by `MutexLock`. - * @return a new instance of ConsumeMutexLock - * @see org.tensorflow.op.core.ConsumeMutexLock + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public ConsumeMutexLock consumeMutexLock(Operand mutexLock) { - return ConsumeMutexLock.create(scope, mutexLock); + public Constant constant(double[][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link UnravelIndex} operation + * Builds an {@link Constant} operation * - * @param indices An 0-D or 1-D `int` Tensor whose elements are indices into the - * @param dims An 1-D `int` Tensor. The shape of the array to use for unraveling - * @return a new instance of UnravelIndex - * @see org.tensorflow.op.core.UnravelIndex + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public UnravelIndex unravelIndex(Operand indices, Operand dims) { - return UnravelIndex.create(scope, indices, dims); + public Constant constant(float[][][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link DestroyTemporaryVariable} operation + * Builds an {@link Squeeze} operation * - * @param ref A reference to the temporary variable tensor. - * @param varName Name of the temporary variable, usually the name of the matching - * @return a new instance of DestroyTemporaryVariable - * @see org.tensorflow.op.core.DestroyTemporaryVariable + * @param input The `input` to squeeze. + * @param options carries optional attributes values + * @return a new instance of Squeeze + * @see org.tensorflow.op.core.Squeeze */ - public DestroyTemporaryVariable destroyTemporaryVariable(Operand ref, String varName) { - return DestroyTemporaryVariable.create(scope, ref, varName); + public Squeeze squeeze(Operand input, Squeeze.Options... options) { + return Squeeze.create(scope, input, options); } /** @@ -2943,414 +2943,429 @@ public DestroyTemporaryVariable destroyTemporaryVariable(Operand ref, * @return a new instance of StatefulStandardNormal * @see org.tensorflow.op.core.StatefulStandardNormal */ - public StatefulStandardNormal statefulStandardNormal(Operand resource, - Operand shape, Class dtype) { + public StatefulStandardNormal statefulStandardNormal( + Operand resource, Operand shape, DataType dtype) { return StatefulStandardNormal.create(scope, resource, shape, dtype); } /** - * Builds an {@link ResourceScatterNdSub} operation + * Builds an {@link Constant} operation * - * @param ref A resource handle. Must be from a VarHandleOp. - * @param indices A Tensor. Must be one of the following types: int32, int64. - * @param updates A Tensor. Must have the same type as ref. A tensor of + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant + */ + public Constant constant(double[][][][][] data) { + return Constant.create(scope, data); + } + + /** + * Builds an {@link ResourceSparseApplyKerasMomentum} operation + * + * @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 momentum Momentum. Must be a scalar. * @param options carries optional attributes values - * @return a new instance of ResourceScatterNdSub - * @see org.tensorflow.op.core.ResourceScatterNdSub + * @return a new instance of ResourceSparseApplyKerasMomentum + * @see org.tensorflow.op.core.ResourceSparseApplyKerasMomentum */ - public ResourceScatterNdSub resourceScatterNdSub(Operand ref, - Operand indices, Operand updates, ResourceScatterNdSub.Options... options) { - return ResourceScatterNdSub.create(scope, ref, indices, updates, options); + public ResourceSparseApplyKerasMomentum resourceSparseApplyKerasMomentum( + Operand var, Operand accum, Operand lr, Operand grad, Operand indices, + Operand momentum, ResourceSparseApplyKerasMomentum.Options... options) { + return ResourceSparseApplyKerasMomentum.create(scope, var, accum, lr, grad, indices, momentum, options); } /** - * Builds an {@link Bitcast} operation + * Builds an {@link TensorListResize} operation * - * @param input - * @param type - * @return a new instance of Bitcast - * @see org.tensorflow.op.core.Bitcast + * @param inputHandle + * @param size + * @return a new instance of TensorListResize + * @see org.tensorflow.op.core.TensorListResize */ - public Bitcast bitcast(Operand input, Class type) { - return Bitcast.create(scope, input, type); + public TensorListResize tensorListResize(Operand inputHandle, Operand size) { + return TensorListResize.create(scope, inputHandle, size); } /** - * Builds an {@link Constant} operation + * Builds an {@link OrderedMapUnstage} operation * - * @param data The value to put into the new constant. - * @return an integer constant - * @see org.tensorflow.op.core.Constant + * @param key + * @param indices + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of OrderedMapUnstage + * @see org.tensorflow.op.core.OrderedMapUnstage */ - public Constant constant(int data) { - return Constant.create(scope, data); + public OrderedMapUnstage orderedMapUnstage(Operand key, Operand indices, + List> dtypes, OrderedMapUnstage.Options... options) { + return OrderedMapUnstage.create(scope, key, indices, dtypes, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link FusedBatchNormV3} operation * - * @param data An array containing the values to put into the new constant. String elements are - * @see org.tensorflow.op.core.Constant + * @param x A 4D Tensor for input data. + * @param scale A 1D Tensor for scaling factor, to scale the normalized x. + * @param offset A 1D Tensor for offset, to shift to the normalized x. + * @param mean A 1D Tensor for population mean. Used for inference only; + * @param variance A 1D Tensor for population variance. Used for inference only; + * @param options carries optional attributes values + * @return a new instance of FusedBatchNormV3 + * @see org.tensorflow.op.core.FusedBatchNormV3 */ - public Constant constant(byte[][][][] data) { - return Constant.create(scope, data); + public FusedBatchNormV3 fusedBatchNormV3( + Operand x, Operand scale, Operand offset, Operand mean, Operand variance, + FusedBatchNormV3.Options... options) { + return FusedBatchNormV3.create(scope, x, scale, offset, mean, variance, options); } /** - * Builds an {@link ScatterUpdate} operation + * Builds an {@link Abort} operation * - * @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 - * @return a new instance of ScatterUpdate - * @see org.tensorflow.op.core.ScatterUpdate + * @return a new instance of Abort + * @see org.tensorflow.op.core.Abort */ - public ScatterUpdate scatterUpdate(Operand ref, Operand indices, - Operand updates, ScatterUpdate.Options... options) { - return ScatterUpdate.create(scope, ref, indices, updates, options); + public Abort abort(Abort.Options... options) { + return Abort.create(scope, options); } /** - * Builds an {@link ScatterMul} operation + * Builds an {@link Where} operation * - * @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 - * @return a new instance of ScatterMul - * @see org.tensorflow.op.core.ScatterMul + * @param condition + * @return a new instance of Where + * @see org.tensorflow.op.core.Where */ - public ScatterMul scatterMul(Operand ref, Operand indices, - Operand updates, ScatterMul.Options... options) { - return ScatterMul.create(scope, ref, indices, updates, options); + public Where where(Operand condition) { + return Where.create(scope, condition); } /** - * Builds an {@link AssertThat} operation + * Builds an {@link Shape} operation * - * @param condition The condition to evaluate. - * @param data The tensors to print out when condition is false. - * @param options carries optional attributes values - * @return a new instance of AssertThat - * @see org.tensorflow.op.core.AssertThat + * @param input + * @return a new instance of Shape + * @see org.tensorflow.op.core.Shape */ - public AssertThat assertThat(Operand condition, Iterable> data, - AssertThat.Options... options) { - return AssertThat.create(scope, condition, data, options); + public org.tensorflow.op.core.Shape shape(Operand input) { + return org.tensorflow.op.core.Shape.create(scope, input); } /** - * Builds an {@link BatchMatMulV2} operation + * Builds an {@link TensorArrayPack} operation * - * @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 handle + * @param flowIn + * @param dtype * @param options carries optional attributes values - * @return a new instance of BatchMatMulV2 - * @see org.tensorflow.op.core.BatchMatMulV2 + * @return a new instance of TensorArrayPack + * @see org.tensorflow.op.core.TensorArrayPack */ - public BatchMatMulV2 batchMatMulV2(Operand x, Operand y, - BatchMatMulV2.Options... options) { - return BatchMatMulV2.create(scope, x, y, options); + public TensorArrayPack tensorArrayPack(Operand handle, + Operand flowIn, DataType dtype, TensorArrayPack.Options... options) { + return TensorArrayPack.create(scope, handle, flowIn, dtype, options); } /** - * Builds an {@link ImmutableConst} operation + * Builds an {@link Constant} operation * - * @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 - * @return a new instance of ImmutableConst - * @see org.tensorflow.op.core.ImmutableConst + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public ImmutableConst immutableConst(Class dtype, Shape shape, - String memoryRegionName) { - return ImmutableConst.create(scope, dtype, shape, memoryRegionName); + public Constant constant(long[][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link OrderedMapStage} operation + * Builds an {@link Constant} operation * - * @param key int64 - * @param indices - * @param values a list of tensors - * @param dtypes - * @param options carries optional attributes values - * @return a new instance of OrderedMapStage - * @see org.tensorflow.op.core.OrderedMapStage + * @param data An array containing the values to put into the new constant. String elements are + * @see org.tensorflow.op.core.Constant */ - public OrderedMapStage orderedMapStage(Operand key, Operand indices, - Iterable> values, List> dtypes, OrderedMapStage.Options... options) { - return OrderedMapStage.create(scope, key, indices, values, dtypes, options); + public Constant constant(byte[][][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link TensorArrayConcat} operation + * Builds an {@link VarIsInitializedOp} operation * - * @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 - * @return a new instance of TensorArrayConcat - * @see org.tensorflow.op.core.TensorArrayConcat + * @param resource the input resource handle. + * @return a new instance of VarIsInitializedOp + * @see org.tensorflow.op.core.VarIsInitializedOp */ - public TensorArrayConcat tensorArrayConcat(Operand handle, Operand flowIn, - Class dtype, TensorArrayConcat.Options... options) { - return TensorArrayConcat.create(scope, handle, flowIn, dtype, options); + public VarIsInitializedOp varIsInitializedOp(Operand resource) { + return VarIsInitializedOp.create(scope, resource); } /** - * Builds an {@link VariableShape} operation + * Builds an {@link OrderedMapIncompleteSize} operation * - * @param input - * @return a new instance of VariableShape - * @see org.tensorflow.op.core.VariableShape + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of OrderedMapIncompleteSize + * @see org.tensorflow.op.core.OrderedMapIncompleteSize */ - public VariableShape variableShape(Operand input) { - return VariableShape.create(scope, input); + public OrderedMapIncompleteSize orderedMapIncompleteSize(List> dtypes, + OrderedMapIncompleteSize.Options... options) { + return OrderedMapIncompleteSize.create(scope, dtypes, options); } /** - * Builds an {@link RefSwitch} operation + * Builds an {@link TensorListElementShape} operation * - * @param data The ref tensor to be forwarded to the appropriate output. - * @param pred A scalar that specifies which output port will receive data. - * @return a new instance of RefSwitch - * @see org.tensorflow.op.core.RefSwitch + * @param inputHandle + * @param shapeType + * @return a new instance of TensorListElementShape + * @see org.tensorflow.op.core.TensorListElementShape */ - public RefSwitch refSwitch(Operand data, Operand pred) { - return RefSwitch.create(scope, data, pred); + public TensorListElementShape tensorListElementShape( + Operand inputHandle, DataType shapeType) { + return TensorListElementShape.create(scope, inputHandle, shapeType); } /** - * Builds an {@link Abort} operation + * Builds an {@link ResourceScatterMax} operation * - * @param options carries optional attributes values - * @return a new instance of Abort - * @see org.tensorflow.op.core.Abort + * @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`. + * @return a new instance of ResourceScatterMax + * @see org.tensorflow.op.core.ResourceScatterMax */ - public Abort abort(Abort.Options... options) { - return Abort.create(scope, options); + public ResourceScatterMax resourceScatterMax( + Operand resource, Operand indices, Operand updates) { + return ResourceScatterMax.create(scope, resource, indices, updates); } /** - * Builds an {@link ScatterNdNonAliasingAdd} operation + * Builds an {@link TensorArrayGradWithShape} operation * - * @param input A Tensor. - * @param indices A Tensor. Must be one of the following types: `int32`, `int64`. - * @param updates A Tensor. Must have the same type as ref. A tensor of updated values - * @return a new instance of ScatterNdNonAliasingAdd - * @see org.tensorflow.op.core.ScatterNdNonAliasingAdd + * @param handle The handle to the forward TensorArray. + * @param flowIn A float scalar that enforces proper chaining of operations. + * @param shapeToPrepend An int32 vector representing a shape. Elements in the gradient accumulator will + * @param source The gradient source string, used to decide which gradient TensorArray + * @return a new instance of TensorArrayGradWithShape + * @see org.tensorflow.op.core.TensorArrayGradWithShape */ - public ScatterNdNonAliasingAdd scatterNdNonAliasingAdd(Operand input, - Operand indices, Operand updates) { - return ScatterNdNonAliasingAdd.create(scope, input, indices, updates); + public TensorArrayGradWithShape tensorArrayGradWithShape(Operand handle, + Operand flowIn, Operand shapeToPrepend, String source) { + return TensorArrayGradWithShape.create(scope, handle, flowIn, shapeToPrepend, source); } /** - * Builds an {@link VarIsInitializedOp} operation + * Builds an {@link LookupTableExport} operation * - * @param resource the input resource handle. - * @return a new instance of VarIsInitializedOp - * @see org.tensorflow.op.core.VarIsInitializedOp + * @param tableHandle Handle to the table. + * @param Tkeys + * @param Tvalues + * @return a new instance of LookupTableExport + * @see org.tensorflow.op.core.LookupTableExport */ - public VarIsInitializedOp varIsInitializedOp(Operand resource) { - return VarIsInitializedOp.create(scope, resource); + public LookupTableExport lookupTableExport( + Operand tableHandle, DataType Tkeys, DataType Tvalues) { + return LookupTableExport.create(scope, tableHandle, Tkeys, Tvalues); } /** - * Builds an {@link ScatterSub} operation + * Builds an {@link UniqueWithCounts} operation * - * @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 - * @return a new instance of ScatterSub - * @see org.tensorflow.op.core.ScatterSub + * @param x A `Tensor`. + * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to + * @param outIdx + * @return a new instance of UniqueWithCounts + * @see org.tensorflow.op.core.UniqueWithCounts */ - public ScatterSub scatterSub(Operand ref, Operand indices, - Operand updates, ScatterSub.Options... options) { - return ScatterSub.create(scope, ref, indices, updates, options); + public UniqueWithCounts uniqueWithCounts( + Operand x, Operand axis, DataType outIdx) { + return UniqueWithCounts.create(scope, x, axis, outIdx); } /** - * Builds an {@link ScatterMin} operation + * Builds an {@link HashTable} operation * - * @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 keyDtype Type of the table keys. + * @param valueDtype Type of the table values. * @param options carries optional attributes values - * @return a new instance of ScatterMin - * @see org.tensorflow.op.core.ScatterMin + * @return a new instance of HashTable + * @see org.tensorflow.op.core.HashTable */ - public ScatterMin scatterMin(Operand ref, - Operand indices, Operand updates, ScatterMin.Options... options) { - return ScatterMin.create(scope, ref, indices, updates, options); + public HashTable hashTable(DataType keyDtype, + DataType valueDtype, HashTable.Options... options) { + return HashTable.create(scope, keyDtype, valueDtype, options); } /** - * Builds an {@link EmptyTensorList} operation + * Builds an {@link Assign} operation * - * @param elementShape - * @param maxNumElements - * @param elementDtype - * @return a new instance of EmptyTensorList - * @see org.tensorflow.op.core.EmptyTensorList + * @param ref Should be from a `Variable` node. May be uninitialized. + * @param value The value to be assigned to the variable. + * @param options carries optional attributes values + * @return a new instance of Assign + * @see org.tensorflow.op.core.Assign */ - public EmptyTensorList emptyTensorList(Operand elementShape, - Operand maxNumElements, Class elementDtype) { - return EmptyTensorList.create(scope, elementShape, maxNumElements, elementDtype); + public Assign assign(Operand ref, Operand value, + Assign.Options... options) { + return Assign.create(scope, ref, value, options); } /** - * Builds an {@link TensorArrayWrite} operation + * Builds an {@link Zeros} operation * - * @param handle The handle to a TensorArray. - * @param index The position to write to inside the TensorArray. - * @param value The tensor to write to the TensorArray. - * @param flowIn A float scalar that enforces proper chaining of operations. - * @return a new instance of TensorArrayWrite - * @see org.tensorflow.op.core.TensorArrayWrite + * @param dims a 1-D operand that represents the shape of the output tensor + * @param type the output tensor datatype + * @return a constant tensor initialized with zeros + * @throws IllegalArgumentException if the tensor type or shape cannot be initialized with zeros. + * @see org.tensorflow.op.core.Zeros */ - public TensorArrayWrite tensorArrayWrite(Operand handle, Operand index, - Operand value, Operand flowIn) { - return TensorArrayWrite.create(scope, handle, index, value, flowIn); + public Zeros zeros(Operand dims, DataType type) { + return Zeros.create(scope, dims, type); } /** - * Builds an {@link TensorListGetItem} operation + * Builds an {@link OrderedMapStage} operation * - * @param inputHandle - * @param index - * @param elementShape - * @param elementDtype - * @return a new instance of TensorListGetItem - * @see org.tensorflow.op.core.TensorListGetItem + * @param key int64 + * @param indices + * @param values a list of tensors + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of OrderedMapStage + * @see org.tensorflow.op.core.OrderedMapStage */ - public TensorListGetItem tensorListGetItem(Operand inputHandle, Operand index, - Operand elementShape, Class elementDtype) { - return TensorListGetItem.create(scope, inputHandle, index, elementShape, elementDtype); + public OrderedMapStage orderedMapStage(Operand key, Operand indices, + Iterable> values, List> dtypes, OrderedMapStage.Options... options) { + return OrderedMapStage.create(scope, key, indices, values, dtypes, options); } /** - * Builds an {@link ReduceMin} operation + * Builds an {@link ResourceScatterMin} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range - * @param options carries optional attributes values - * @return a new instance of ReduceMin - * @see org.tensorflow.op.core.ReduceMin + * @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`. + * @return a new instance of ResourceScatterMin + * @see org.tensorflow.op.core.ResourceScatterMin */ - public ReduceMin reduceMin(Operand input, Operand axis, - ReduceMin.Options... options) { - return ReduceMin.create(scope, input, axis, options); + public ResourceScatterMin resourceScatterMin( + Operand resource, Operand indices, Operand updates) { + return ResourceScatterMin.create(scope, resource, indices, updates); } /** - * Builds an {@link Print} operation + * Builds an {@link MapStage} operation * - * @param input The string scalar to print. + * @param key int64 + * @param indices + * @param values a list of tensors + * @param dtypes * @param options carries optional attributes values - * @return a new instance of Print - * @see org.tensorflow.op.core.Print + * @return a new instance of MapStage + * @see org.tensorflow.op.core.MapStage */ - public Print print(Operand input, Print.Options... options) { - return Print.create(scope, input, options); + public MapStage mapStage(Operand key, Operand indices, + Iterable> values, List> dtypes, MapStage.Options... options) { + return MapStage.create(scope, key, indices, values, dtypes, options); } /** - * Builds an {@link UniqueWithCounts} operation + * Builds an {@link UnsortedSegmentJoin} operation * - * @param x A `Tensor`. - * @param axis A `Tensor` of type `int32` (default: None). The axis of the Tensor to - * @param outIdx - * @return a new instance of UniqueWithCounts - * @see org.tensorflow.op.core.UniqueWithCounts + * @param inputs The input to be joined. + * @param segmentIds A tensor whose shape is a prefix of data.shape. Negative segment ids are not + * @param numSegments A scalar. + * @param options carries optional attributes values + * @return a new instance of UnsortedSegmentJoin + * @see org.tensorflow.op.core.UnsortedSegmentJoin */ - public UniqueWithCounts uniqueWithCounts( - Operand x, Operand axis, Class outIdx) { - return UniqueWithCounts.create(scope, x, axis, outIdx); + public UnsortedSegmentJoin unsortedSegmentJoin( + Operand inputs, Operand segmentIds, Operand numSegments, + UnsortedSegmentJoin.Options... options) { + return UnsortedSegmentJoin.create(scope, inputs, segmentIds, numSegments, options); } /** - * Builds an {@link TensorArrayScatter} operation + * Builds an {@link ResourceStridedSliceAssign} operation * - * @param handle The handle to a TensorArray. - * @param indices The locations at which to write the tensor elements. - * @param value The concatenated tensor to write to the TensorArray. - * @param flowIn A float scalar that enforces proper chaining of operations. - * @return a new instance of TensorArrayScatter - * @see org.tensorflow.op.core.TensorArrayScatter + * @param ref + * @param begin + * @param end + * @param strides + * @param value + * @param options carries optional attributes values + * @return a new instance of ResourceStridedSliceAssign + * @see org.tensorflow.op.core.ResourceStridedSliceAssign */ - public TensorArrayScatter tensorArrayScatter(Operand handle, Operand indices, - Operand value, Operand flowIn) { - return TensorArrayScatter.create(scope, handle, indices, value, flowIn); + public ResourceStridedSliceAssign resourceStridedSliceAssign( + Operand ref, Operand begin, Operand end, Operand strides, Operand value, + ResourceStridedSliceAssign.Options... options) { + return ResourceStridedSliceAssign.create(scope, ref, begin, end, strides, value, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link Fingerprint} operation * - * @param charset The encoding from String to bytes. - * @param data The string to put into the new constant. - * @return a string constant - * @see org.tensorflow.op.core.Constant + * @param data Must have rank 1 or higher. + * @param method Fingerprint method used by this op. Currently available method is + * @return a new instance of Fingerprint + * @see org.tensorflow.op.core.Fingerprint */ - public Constant constant(String data, Charset charset) { - return Constant.create(scope, data, charset); + public Fingerprint fingerprint(Operand data, Operand method) { + return Fingerprint.create(scope, data, method); } /** - * Builds an {@link ResourceScatterNdAdd} operation + * Builds an {@link ExpandDims} operation * - * @param ref A resource handle. Must be from a VarHandleOp. - * @param indices A Tensor. Must be one of the following types: int32, int64. - * @param updates A Tensor. Must have the same type as ref. A tensor of - * @param options carries optional attributes values - * @return a new instance of ResourceScatterNdAdd - * @see org.tensorflow.op.core.ResourceScatterNdAdd + * @param input + * @param axis 0-D (scalar). Specifies the dimension index at which to + * @return a new instance of ExpandDims + * @see org.tensorflow.op.core.ExpandDims */ - public ResourceScatterNdAdd resourceScatterNdAdd(Operand ref, - Operand indices, Operand updates, ResourceScatterNdAdd.Options... options) { - return ResourceScatterNdAdd.create(scope, ref, indices, updates, options); + public ExpandDims expandDims(Operand input, + Operand axis) { + return ExpandDims.create(scope, input, axis); } /** - * Builds an {@link FusedBatchNormV3} operation + * Builds an {@link GuaranteeConst} operation * - * @param x A 4D Tensor for input data. - * @param scale A 1D Tensor for scaling factor, to scale the normalized x. - * @param offset A 1D Tensor for offset, to shift to the normalized x. - * @param mean A 1D Tensor for population mean. Used for inference only; - * @param variance A 1D Tensor for population variance. Used for inference only; - * @param options carries optional attributes values - * @return a new instance of FusedBatchNormV3 - * @see org.tensorflow.op.core.FusedBatchNormV3 + * @param input + * @return a new instance of GuaranteeConst + * @see org.tensorflow.op.core.GuaranteeConst */ - public FusedBatchNormV3 fusedBatchNormV3(Operand x, - Operand scale, Operand offset, Operand mean, Operand variance, - FusedBatchNormV3.Options... options) { - return FusedBatchNormV3.create(scope, x, scale, offset, mean, variance, options); + public GuaranteeConst guaranteeConst(Operand input) { + return GuaranteeConst.create(scope, input); } /** - * Builds an {@link ShapeN} operation + * Builds an {@link Reshape} operation * - * @param input - * @return a new instance of ShapeN - * @see org.tensorflow.op.core.ShapeN + * @param tensor + * @param shape Defines the shape of the output tensor. + * @return a new instance of Reshape + * @see org.tensorflow.op.core.Reshape */ - public ShapeN shapeN(Iterable> input) { - return ShapeN.create(scope, input); + public Reshape reshape(Operand tensor, + Operand shape) { + return Reshape.create(scope, tensor, shape); } /** - * Builds an {@link Constant} operation + * Builds an {@link DynamicPartition} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param data + * @param partitions Any shape. Indices in the range `[0, num_partitions)`. + * @param numPartitions The number of partitions to output. + * @return a new instance of DynamicPartition + * @see org.tensorflow.op.core.DynamicPartition */ - public Constant constant(int[][] data) { - return Constant.create(scope, data); + public DynamicPartition dynamicPartition(Operand data, + Operand partitions, Long numPartitions) { + return DynamicPartition.create(scope, data, partitions, numPartitions); } /** @@ -3359,191 +3374,172 @@ public Constant constant(int[][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(double[][][][][] data) { + public Constant constant(float[][][][][][] data) { return Constant.create(scope, data); } /** - * Builds an {@link StageSize} operation - * - * @param dtypes - * @param options carries optional attributes values - * @return a new instance of StageSize - * @see org.tensorflow.op.core.StageSize - */ - public StageSize stageSize(List> dtypes, StageSize.Options... options) { - return StageSize.create(scope, dtypes, options); - } - - /** - * Builds an {@link InitializeTable} operation + * Builds an {@link Constant} operation * - * @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 - * @see org.tensorflow.op.core.InitializeTable + * @param tensor a Tensor holding the constant value + * @return a constant of the same data type as `tensor` + * @see org.tensorflow.op.core.Constant */ - public InitializeTable initializeTable(Operand tableHandle, Operand keys, - Operand values) { - return InitializeTable.create(scope, tableHandle, keys, values); + public Constant constant(Tensor tensor) { + return Constant.create(scope, tensor); } /** - * Builds an {@link MulNoNan} operation + * Builds an {@link LookupTableImport} operation * - * @param x - * @param y - * @return a new instance of MulNoNan - * @see org.tensorflow.op.core.MulNoNan + * @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 + * @see org.tensorflow.op.core.LookupTableImport */ - public MulNoNan mulNoNan(Operand x, Operand y) { - return MulNoNan.create(scope, x, y); + public LookupTableImport lookupTableImport( + Operand tableHandle, Operand keys, Operand values) { + return LookupTableImport.create(scope, tableHandle, keys, values); } /** * Builds an {@link Constant} operation * - * @param data The value to put into the new constant. - * @return a double constant + * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(double data) { + public Constant constant(int[][][][][] data) { return Constant.create(scope, data); } /** - * Builds an {@link NextAfter} operation + * Builds an {@link Constant} operation * - * @param x1 - * @param x2 - * @return a new instance of NextAfter - * @see org.tensorflow.op.core.NextAfter + * @param shape the tensor shape. + * @param data a buffer containing the tensor data. + * @return an integer constant + * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer + * @see org.tensorflow.op.core.Constant */ - public NextAfter nextAfter(Operand x1, Operand x2) { - return NextAfter.create(scope, x1, x2); + public Constant constant(long[] shape, IntBuffer data) { + return Constant.create(scope, shape, data); } /** - * Builds an {@link StringLower} operation + * Builds an {@link Constant} operation * - * @param input - * @param options carries optional attributes values - * @return a new instance of StringLower - * @see org.tensorflow.op.core.StringLower + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public StringLower stringLower(Operand input, StringLower.Options... options) { - return StringLower.create(scope, input, options); + public Constant constant(long[][][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link TensorListGather} operation + * Builds an {@link SetDiff1d} operation * - * @param inputHandle - * @param indices - * @param elementShape - * @param elementDtype - * @return a new instance of TensorListGather - * @see org.tensorflow.op.core.TensorListGather + * @param x 1-D. Values to keep. + * @param y 1-D. Values to remove. + * @param outIdx + * @return a new instance of SetDiff1d + * @see org.tensorflow.op.core.SetDiff1d */ - public TensorListGather tensorListGather(Operand inputHandle, Operand indices, - Operand elementShape, Class elementDtype) { - return TensorListGather.create(scope, inputHandle, indices, elementShape, elementDtype); + public SetDiff1d setDiff1d(Operand x, Operand y, + DataType outIdx) { + return SetDiff1d.create(scope, x, y, outIdx); } /** - * Builds an {@link Reverse} operation + * Builds an {@link HistogramFixedWidth} operation * - * @param tensor Up to 8-D. - * @param axis 1-D. The indices of the dimensions to reverse. Must be in the range - * @return a new instance of Reverse - * @see org.tensorflow.op.core.Reverse + * @param values Numeric `Tensor`. + * @param valueRange Shape [2] `Tensor` of same `dtype` as `values`. + * @param nbins Scalar `int32 Tensor`. Number of histogram bins. + * @return a new instance of HistogramFixedWidth + * @see org.tensorflow.op.core.HistogramFixedWidth */ - public Reverse reverse(Operand tensor, Operand axis) { - return Reverse.create(scope, tensor, axis); + public HistogramFixedWidth histogramFixedWidth(Operand values, + Operand valueRange, Operand nbins) { + return HistogramFixedWidth.create(scope, values, valueRange, nbins); } /** - * Builds an {@link SplitV} operation + * Builds an {@link Constant} operation * - * @param value The tensor to split. - * @param sizeSplits list containing the sizes of each output tensor along the split - * @param axis 0-D. The dimension along which to split. Must be in the range - * @param numSplit - * @return a new instance of SplitV - * @see org.tensorflow.op.core.SplitV + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public SplitV splitV(Operand value, Operand sizeSplits, - Operand axis, Long numSplit) { - return SplitV.create(scope, value, sizeSplits, axis, numSplit); + public Constant constant(boolean[][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link ScaleAndTranslate} operation + * Builds an {@link MapUnstage} operation * - * @param images - * @param size - * @param scale - * @param translation + * @param key + * @param indices + * @param dtypes * @param options carries optional attributes values - * @return a new instance of ScaleAndTranslate - * @see org.tensorflow.op.core.ScaleAndTranslate + * @return a new instance of MapUnstage + * @see org.tensorflow.op.core.MapUnstage */ - public ScaleAndTranslate scaleAndTranslate(Operand images, - Operand size, Operand scale, Operand translation, - ScaleAndTranslate.Options... options) { - return ScaleAndTranslate.create(scope, images, size, scale, translation, options); + public MapUnstage mapUnstage(Operand key, Operand indices, + List> dtypes, MapUnstage.Options... options) { + return MapUnstage.create(scope, key, indices, dtypes, options); } /** - * Builds an {@link Barrier} operation + * Builds an {@link VariableShape} operation * - * @param componentTypes The type of each component in a value. - * @param options carries optional attributes values - * @return a new instance of Barrier - * @see org.tensorflow.op.core.Barrier + * @param input + * @param outType + * @return a new instance of VariableShape + * @see org.tensorflow.op.core.VariableShape */ - public Barrier barrier(List> componentTypes, Barrier.Options... options) { - return Barrier.create(scope, componentTypes, options); + public VariableShape variableShape(Operand input, DataType outType) { + return VariableShape.create(scope, input, outType); } /** - * Builds an {@link Constant} operation + * Builds an {@link ScatterNd} operation * - * @param shape the tensor shape. - * @param data a buffer containing the tensor data. - * @return a long constant - * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer - * @see org.tensorflow.op.core.Constant + * @param indices Index tensor. + * @param updates Updates to scatter into output. + * @param shape 1-D. The shape of the resulting tensor. + * @return a new instance of ScatterNd + * @see org.tensorflow.op.core.ScatterNd */ - public Constant constant(long[] shape, LongBuffer data) { - return Constant.create(scope, shape, data); + public ScatterNd scatterNd(Operand indices, + Operand updates, Operand shape) { + return ScatterNd.create(scope, indices, updates, shape); } /** - * Builds an {@link ReduceSum} operation + * Builds an {@link ScatterSub} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range + * @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 - * @return a new instance of ReduceSum - * @see org.tensorflow.op.core.ReduceSum + * @return a new instance of ScatterSub + * @see org.tensorflow.op.core.ScatterSub */ - public ReduceSum reduceSum(Operand input, Operand axis, - ReduceSum.Options... options) { - return ReduceSum.create(scope, input, axis, options); + public ScatterSub scatterSub(Operand ref, + Operand indices, Operand updates, ScatterSub.Options... options) { + return ScatterSub.create(scope, ref, indices, updates, options); } /** - * Builds an {@link EnsureShape} operation + * Builds an {@link BarrierClose} operation * - * @param input A tensor, whose shape is to be validated. - * @param shape The expected (possibly partially specified) shape of the input tensor. - * @return a new instance of EnsureShape - * @see org.tensorflow.op.core.EnsureShape + * @param handle The handle to a barrier. + * @param options carries optional attributes values + * @return a new instance of BarrierClose + * @see org.tensorflow.op.core.BarrierClose */ - public EnsureShape ensureShape(Operand input, Shape shape) { - return EnsureShape.create(scope, input, shape); + public BarrierClose barrierClose(Operand handle, BarrierClose.Options... options) { + return BarrierClose.create(scope, handle, options); } /** @@ -3557,313 +3553,347 @@ public EnsureShape ensureShape(Operand input, Shape shape) { * @return a new instance of UnbatchGrad * @see org.tensorflow.op.core.UnbatchGrad */ - public UnbatchGrad unbatchGrad(Operand originalInput, Operand batchIndex, - Operand grad, Operand id, UnbatchGrad.Options... options) { + public UnbatchGrad unbatchGrad(Operand originalInput, + Operand batchIndex, Operand grad, Operand id, + UnbatchGrad.Options... options) { return UnbatchGrad.create(scope, originalInput, batchIndex, grad, id, options); } /** - * Builds an {@link StringUpper} operation + * Builds an {@link Constant} operation + * + * @param type the tensor datatype. + * @param shape the tensor shape. + * @param data a buffer containing the tensor data. + * @return a constant of type `type` + * @throws IllegalArgumentException If the tensor datatype or shape is not compatible with the + * @see org.tensorflow.op.core.Constant + */ + public Constant constant(DataType type, long[] shape, ByteBuffer data) { + return Constant.create(scope, type, shape, data); + } + + /** + * Builds an {@link IdentityN} operation * * @param input - * @param options carries optional attributes values - * @return a new instance of StringUpper - * @see org.tensorflow.op.core.StringUpper + * @return a new instance of IdentityN + * @see org.tensorflow.op.core.IdentityN */ - public StringUpper stringUpper(Operand input, StringUpper.Options... options) { - return StringUpper.create(scope, input, options); + public IdentityN identityN(Iterable> input) { + return IdentityN.create(scope, input); } /** - * Builds an {@link Constant} operation + * Builds an {@link StridedSlice} operation * - * @param data The value to put into the new constant. - * @return a long constant - * @see org.tensorflow.op.core.Constant + * @param input + * @param begin `begin[k]` specifies the offset into the `k`th range specification. + * @param end `end[i]` is like `begin` with the exception that `end_mask` is + * @param strides `strides[i]` specifies the increment in the `i`th specification + * @param options carries optional attributes values + * @return a new instance of StridedSlice + * @see org.tensorflow.op.core.StridedSlice */ - public Constant constant(long data) { - return Constant.create(scope, data); + public StridedSlice stridedSlice(Operand input, + Operand begin, Operand end, Operand strides, StridedSlice.Options... options) { + return StridedSlice.create(scope, input, begin, end, strides, options); } /** - * Builds an {@link Where} operation + * Builds an {@link ReadVariableOp} operation * - * @param condition - * @return a new instance of Where - * @see org.tensorflow.op.core.Where + * @param resource handle to the resource in which to store the variable. + * @param dtype the dtype of the value. + * @return a new instance of ReadVariableOp + * @see org.tensorflow.op.core.ReadVariableOp */ - public Where where(Operand condition) { - return Where.create(scope, condition); + public ReadVariableOp readVariableOp(Operand resource, + DataType dtype) { + return ReadVariableOp.create(scope, resource, dtype); } /** - * Builds an {@link VariableShape} operation + * Builds an {@link RefNextIteration} operation * - * @param input - * @param outType - * @return a new instance of VariableShape - * @see org.tensorflow.op.core.VariableShape + * @param data The tensor to be made available to the next iteration. + * @return a new instance of RefNextIteration + * @see org.tensorflow.op.core.RefNextIteration */ - public VariableShape variableShape(Operand input, Class outType) { - return VariableShape.create(scope, input, outType); + public RefNextIteration refNextIteration(Operand data) { + return RefNextIteration.create(scope, data); } /** - * Builds an {@link MapPeek} operation + * Builds an {@link RefSelect} operation * - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values - * @return a new instance of MapPeek - * @see org.tensorflow.op.core.MapPeek + * @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`. + * @return a new instance of RefSelect + * @see org.tensorflow.op.core.RefSelect */ - public MapPeek mapPeek(Operand key, Operand indices, List> dtypes, - MapPeek.Options... options) { - return MapPeek.create(scope, key, indices, dtypes, options); + public RefSelect refSelect(Operand index, + Iterable> inputs) { + return RefSelect.create(scope, index, inputs); } /** - * Builds an {@link ScatterMax} operation + * Builds an {@link ScatterNdSub} operation * - * @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 ref A mutable Tensor. Should be from a Variable node. + * @param indices A Tensor. Must be one of the following types: int32, int64. + * @param updates A Tensor. Must have the same type as ref. A tensor of updated values * @param options carries optional attributes values - * @return a new instance of ScatterMax - * @see org.tensorflow.op.core.ScatterMax + * @return a new instance of ScatterNdSub + * @see org.tensorflow.op.core.ScatterNdSub */ - public ScatterMax scatterMax(Operand ref, - Operand indices, Operand updates, ScatterMax.Options... options) { - return ScatterMax.create(scope, ref, indices, updates, options); + public ScatterNdSub scatterNdSub(Operand ref, + Operand indices, Operand updates, ScatterNdSub.Options... options) { + return ScatterNdSub.create(scope, ref, indices, updates, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link TemporaryVariable} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param shape The shape of the variable tensor. + * @param dtype The type of elements in the variable tensor. + * @param options carries optional attributes values + * @return a new instance of TemporaryVariable + * @see org.tensorflow.op.core.TemporaryVariable */ - public Constant constant(float[][][][][] data) { - return Constant.create(scope, data); + public TemporaryVariable temporaryVariable(Shape shape, DataType dtype, + TemporaryVariable.Options... options) { + return TemporaryVariable.create(scope, shape, dtype, options); } /** - * Builds an {@link TensorListScatter} operation + * Builds an {@link ResourceApplyKerasMomentum} operation * - * @param tensor - * @param indices - * @param elementShape - * @return a new instance of TensorListScatter - * @see org.tensorflow.op.core.TensorListScatter + * @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 + * @return a new instance of ResourceApplyKerasMomentum + * @see org.tensorflow.op.core.ResourceApplyKerasMomentum */ - public TensorListScatter tensorListScatter(Operand tensor, - Operand indices, Operand elementShape) { - return TensorListScatter.create(scope, tensor, indices, elementShape); + public ResourceApplyKerasMomentum resourceApplyKerasMomentum(Operand var, + Operand accum, Operand lr, Operand grad, Operand momentum, + ResourceApplyKerasMomentum.Options... options) { + return ResourceApplyKerasMomentum.create(scope, var, accum, lr, grad, momentum, options); } /** - * Builds an {@link CombinedNonMaxSuppression} operation + * Builds an {@link Constant} operation * - * @param boxes A 4-D float tensor of shape `[batch_size, num_boxes, q, 4]`. If `q` is 1 then - * @param scores A 3-D float tensor of shape `[batch_size, num_boxes, num_classes]` - * @param maxOutputSizePerClass A scalar integer tensor representing the maximum number of - * @param maxTotalSize A scalar representing maximum number of boxes retained over all classes. - * @param iouThreshold A 0-D float tensor representing the threshold for deciding whether - * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove - * @param options carries optional attributes values - * @return a new instance of CombinedNonMaxSuppression - * @see org.tensorflow.op.core.CombinedNonMaxSuppression + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public CombinedNonMaxSuppression combinedNonMaxSuppression(Operand boxes, - Operand scores, Operand maxOutputSizePerClass, Operand maxTotalSize, - Operand iouThreshold, Operand scoreThreshold, - CombinedNonMaxSuppression.Options... options) { - return CombinedNonMaxSuppression.create(scope, boxes, scores, maxOutputSizePerClass, maxTotalSize, iouThreshold, scoreThreshold, options); + public Constant constant(int[][][][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link StridedSlice} operation + * Builds an {@link GetSessionTensor} operation * - * @param input - * @param begin `begin[k]` specifies the offset into the `k`th range specification. - * @param end `end[i]` is like `begin` with the exception that `end_mask` is - * @param strides `strides[i]` specifies the increment in the `i`th specification - * @param options carries optional attributes values - * @return a new instance of StridedSlice - * @see org.tensorflow.op.core.StridedSlice + * @param handle The handle for a tensor stored in the session state. + * @param dtype The type of the output value. + * @return a new instance of GetSessionTensor + * @see org.tensorflow.op.core.GetSessionTensor */ - public StridedSlice stridedSlice(Operand input, Operand begin, - Operand end, Operand strides, StridedSlice.Options... options) { - return StridedSlice.create(scope, input, begin, end, strides, options); + public GetSessionTensor getSessionTensor(Operand handle, + DataType dtype) { + return GetSessionTensor.create(scope, handle, dtype); } /** - * Builds an {@link Shape} operation + * Builds an {@link StagePeek} operation * - * @param input - * @return a new instance of Shape - * @see org.tensorflow.op.core.Shape + * @param index + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of StagePeek + * @see org.tensorflow.op.core.StagePeek */ - public org.tensorflow.op.core.Shape shape(Operand input) { - return org.tensorflow.op.core.Shape.create(scope, input); + public StagePeek stagePeek(Operand index, List> dtypes, + StagePeek.Options... options) { + return StagePeek.create(scope, index, dtypes, options); } /** - * Builds an {@link GatherNd} operation + * Builds an {@link Constant} operation * - * @param params The tensor from which to gather values. - * @param indices Index tensor. - * @return a new instance of GatherNd - * @see org.tensorflow.op.core.GatherNd + * @param data The value to put into the new constant. + * @return a double constant + * @see org.tensorflow.op.core.Constant */ - public GatherNd gatherNd(Operand params, Operand indices) { - return GatherNd.create(scope, params, indices); + public Constant constant(double data) { + return Constant.create(scope, data); } /** - * Builds an {@link SwitchCond} operation + * Builds an {@link ScatterUpdate} operation * - * @param data The tensor to be forwarded to the appropriate output. - * @param pred A scalar that specifies which output port will receive data. - * @return a new instance of SwitchCond - * @see org.tensorflow.op.core.SwitchCond + * @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 + * @return a new instance of ScatterUpdate + * @see org.tensorflow.op.core.ScatterUpdate */ - public SwitchCond switchCond(Operand data, Operand pred) { - return SwitchCond.create(scope, data, pred); + public ScatterUpdate scatterUpdate(Operand ref, + Operand indices, Operand updates, ScatterUpdate.Options... options) { + return ScatterUpdate.create(scope, ref, indices, updates, options); } /** - * Builds an {@link ResourceCountUpTo} operation + * Builds an {@link Roll} operation * - * @param resource Should be from a scalar `Variable` node. - * @param limit If incrementing ref would bring it above limit, instead generates an - * @param T - * @return a new instance of ResourceCountUpTo - * @see org.tensorflow.op.core.ResourceCountUpTo + * @param input + * @param shift Dimension must be 0-D or 1-D. `shift[i]` specifies the number of places by which + * @param axis Dimension must be 0-D or 1-D. `axis[i]` specifies the dimension that the shift + * @return a new instance of Roll + * @see org.tensorflow.op.core.Roll */ - public ResourceCountUpTo resourceCountUpTo(Operand resource, Long limit, - Class T) { - return ResourceCountUpTo.create(scope, resource, limit, T); + public Roll roll(Operand input, + Operand shift, Operand axis) { + return Roll.create(scope, input, shift, axis); } /** - * Builds an {@link Where3} operation + * Builds an {@link SelectV2} operation * * @param condition - * @param x = A `Tensor` which may have the same shape as `condition`. - * @param y = A `Tensor` with the same type and shape as `x`. - * @return a new instance of Where3 - * @see org.tensorflow.op.core.Where3 + * @param t + * @param e + * @return a new instance of SelectV2 + * @see org.tensorflow.op.core.SelectV2 */ - public Where3 where3(Operand condition, Operand x, Operand y) { - return Where3.create(scope, condition, x, y); + public SelectV2 selectV2(Operand condition, Operand t, + Operand e) { + return SelectV2.create(scope, condition, t, e); } /** - * Builds an {@link InitializeTableFromTextFile} operation + * Builds an {@link Bitcast} operation * - * @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 valueIndex Column index that represents information of a line to get the table - * @param options carries optional attributes values - * @return a new instance of InitializeTableFromTextFile - * @see org.tensorflow.op.core.InitializeTableFromTextFile + * @param input + * @param type + * @return a new instance of Bitcast + * @see org.tensorflow.op.core.Bitcast */ - public InitializeTableFromTextFile initializeTableFromTextFile(Operand tableHandle, - Operand filename, Long keyIndex, Long valueIndex, - InitializeTableFromTextFile.Options... options) { - return InitializeTableFromTextFile.create(scope, tableHandle, filename, keyIndex, valueIndex, options); + public Bitcast bitcast(Operand input, DataType type) { + return Bitcast.create(scope, input, type); } /** - * Builds an {@link ResourceScatterUpdate} operation + * Builds an {@link MapIncompleteSize} operation * - * @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`. - * @return a new instance of ResourceScatterUpdate - * @see org.tensorflow.op.core.ResourceScatterUpdate + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of MapIncompleteSize + * @see org.tensorflow.op.core.MapIncompleteSize */ - public ResourceScatterUpdate resourceScatterUpdate(Operand resource, - Operand indices, Operand updates) { - return ResourceScatterUpdate.create(scope, resource, indices, updates); + public MapIncompleteSize mapIncompleteSize(List> dtypes, + MapIncompleteSize.Options... options) { + return MapIncompleteSize.create(scope, dtypes, options); } /** - * Builds an {@link IdentityN} operation + * Builds an {@link TensorListPopBack} operation * - * @param input - * @return a new instance of IdentityN - * @see org.tensorflow.op.core.IdentityN + * @param inputHandle + * @param elementShape + * @param elementDtype + * @return a new instance of TensorListPopBack + * @see org.tensorflow.op.core.TensorListPopBack */ - public IdentityN identityN(Iterable> input) { - return IdentityN.create(scope, input); + public TensorListPopBack tensorListPopBack(Operand inputHandle, + Operand elementShape, DataType elementDtype) { + return TensorListPopBack.create(scope, inputHandle, elementShape, elementDtype); } /** - * Builds an {@link BatchToSpace} operation + * Builds an {@link MapUnstageNoKey} operation * - * @param input 4-D tensor with shape - * @param crops 2-D tensor of non-negative integers with shape `[2, 2]`. It specifies - * @param blockSize - * @return a new instance of BatchToSpace - * @see org.tensorflow.op.core.BatchToSpace + * @param indices + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of MapUnstageNoKey + * @see org.tensorflow.op.core.MapUnstageNoKey */ - public BatchToSpace batchToSpace(Operand input, Operand crops, - Long blockSize) { - return BatchToSpace.create(scope, input, crops, blockSize); + public MapUnstageNoKey mapUnstageNoKey(Operand indices, List> dtypes, + MapUnstageNoKey.Options... options) { + return MapUnstageNoKey.create(scope, indices, dtypes, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link StatefulStandardNormalV2} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @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 StatefulStandardNormalV2 + * @see org.tensorflow.op.core.StatefulStandardNormalV2 */ - public Constant constant(boolean[][][] data) { - return Constant.create(scope, data); + public StatefulStandardNormalV2 statefulStandardNormalV2( + Operand resource, Operand algorithm, Operand shape) { + return StatefulStandardNormalV2.create(scope, resource, algorithm, shape); } /** - * Builds an {@link StageClear} operation + * Builds an {@link ReduceMin} operation * - * @param dtypes + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range * @param options carries optional attributes values - * @return a new instance of StageClear - * @see org.tensorflow.op.core.StageClear + * @return a new instance of ReduceMin + * @see org.tensorflow.op.core.ReduceMin */ - public StageClear stageClear(List> dtypes, StageClear.Options... options) { - return StageClear.create(scope, dtypes, options); + public ReduceMin reduceMin(Operand input, + Operand axis, ReduceMin.Options... options) { + return ReduceMin.create(scope, input, axis, options); } /** - * Builds an {@link TryRpc} operation + * Builds an {@link ExtractVolumePatches} operation * - * @param address `0-D` or `1-D`. The address (i.e. host_name:port) of the RPC server. - * @param method `0-D` or `1-D`. The method address on the RPC server. - * @param request `0-D` or `1-D`. Serialized proto strings: the rpc request argument. - * @param options carries optional attributes values - * @return a new instance of TryRpc - * @see org.tensorflow.op.core.TryRpc + * @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 strides 1-D of length 5. How far the centers of two consecutive patches are in + * @param padding The type of padding algorithm to use. + * @return a new instance of ExtractVolumePatches + * @see org.tensorflow.op.core.ExtractVolumePatches */ - public TryRpc tryRpc(Operand address, Operand method, Operand request, - TryRpc.Options... options) { - return TryRpc.create(scope, address, method, request, options); + public ExtractVolumePatches extractVolumePatches(Operand input, + List ksizes, List strides, String padding) { + return ExtractVolumePatches.create(scope, input, ksizes, strides, padding); } /** - * Builds an {@link InplaceUpdate} operation + * Builds an {@link Identity} operation * - * @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. - * @return a new instance of InplaceUpdate - * @see org.tensorflow.op.core.InplaceUpdate + * @param input + * @return a new instance of Identity + * @see org.tensorflow.op.core.Identity */ - public InplaceUpdate inplaceUpdate(Operand x, Operand i, Operand v) { - return InplaceUpdate.create(scope, x, i, v); + public Identity identity(Operand input) { + return Identity.create(scope, input); + } + + /** + * Builds an {@link TensorScatterUpdate} operation + * + * @param tensor Tensor to copy/update. + * @param indices Index tensor. + * @param updates Updates to scatter into output. + * @return a new instance of TensorScatterUpdate + * @see org.tensorflow.op.core.TensorScatterUpdate + */ + public TensorScatterUpdate tensorScatterUpdate( + Operand tensor, Operand indices, Operand updates) { + return TensorScatterUpdate.create(scope, tensor, indices, updates); } /** @@ -3872,211 +3902,201 @@ public InplaceUpdate inplaceUpdate(Operand x, Operand i, Oper * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(double[][][][] data) { + public Constant constant(float[][] data) { return Constant.create(scope, data); } /** - * Builds an {@link DeepCopy} operation + * Builds an {@link ScatterDiv} operation * - * @param x The source tensor of type `T`. - * @return a new instance of DeepCopy - * @see org.tensorflow.op.core.DeepCopy + * @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 + * @return a new instance of ScatterDiv + * @see org.tensorflow.op.core.ScatterDiv */ - public DeepCopy deepCopy(Operand x) { - return DeepCopy.create(scope, x); + public ScatterDiv scatterDiv(Operand ref, + Operand indices, Operand updates, ScatterDiv.Options... options) { + return ScatterDiv.create(scope, ref, indices, updates, options); } /** - * Builds an {@link TensorArrayGrad} operation + * Builds an {@link ResourceScatterMul} operation * - * @param handle The handle to the forward TensorArray. - * @param flowIn A float scalar that enforces proper chaining of operations. - * @param source The gradient source string, used to decide which gradient TensorArray - * @return a new instance of TensorArrayGrad - * @see org.tensorflow.op.core.TensorArrayGrad + * @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`. + * @return a new instance of ResourceScatterMul + * @see org.tensorflow.op.core.ResourceScatterMul */ - public TensorArrayGrad tensorArrayGrad(Operand handle, Operand flowIn, String source) { - return TensorArrayGrad.create(scope, handle, flowIn, source); + public ResourceScatterMul resourceScatterMul( + Operand resource, Operand indices, Operand updates) { + return ResourceScatterMul.create(scope, resource, indices, updates); } /** - * Builds an {@link ResourceApplyAdamWithAmsgrad} operation + * Builds an {@link TensorArrayRead} operation * - * @param var Should be from a Variable(). - * @param m Should be from a Variable(). - * @param v Should be from a Variable(). - * @param vhat Should be from a Variable(). - * @param beta1Power Must be a scalar. - * @param beta2Power Must be a scalar. - * @param lr Scaling factor. Must be a scalar. - * @param beta1 Momentum factor. Must be a scalar. - * @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 - * @return a new instance of ResourceApplyAdamWithAmsgrad - * @see org.tensorflow.op.core.ResourceApplyAdamWithAmsgrad + * @param handle The handle to a TensorArray. + * @param index + * @param flowIn A float scalar that enforces proper chaining of operations. + * @param dtype The type of the elem that is returned. + * @return a new instance of TensorArrayRead + * @see org.tensorflow.op.core.TensorArrayRead */ - public ResourceApplyAdamWithAmsgrad resourceApplyAdamWithAmsgrad(Operand var, Operand m, - Operand v, Operand vhat, Operand beta1Power, Operand beta2Power, Operand lr, - Operand beta1, Operand beta2, Operand epsilon, Operand grad, - ResourceApplyAdamWithAmsgrad.Options... options) { - return ResourceApplyAdamWithAmsgrad.create(scope, var, m, v, vhat, beta1Power, beta2Power, lr, beta1, beta2, epsilon, grad, options); + public TensorArrayRead tensorArrayRead(Operand handle, + Operand index, Operand flowIn, DataType dtype) { + return TensorArrayRead.create(scope, handle, index, flowIn, dtype); } /** - * Builds an {@link TensorArray} operation + * Builds an {@link StridedSliceGrad} operation * - * @param size The size of the array. - * @param dtype The type of the elements on the tensor_array. + * @param shape + * @param begin + * @param end + * @param strides + * @param dy * @param options carries optional attributes values - * @return a new instance of TensorArray - * @see org.tensorflow.op.core.TensorArray + * @return a new instance of StridedSliceGrad + * @see org.tensorflow.op.core.StridedSliceGrad */ - public TensorArray tensorArray(Operand size, Class dtype, - TensorArray.Options... options) { - return TensorArray.create(scope, size, dtype, options); + public StridedSliceGrad stridedSliceGrad(Operand shape, + Operand begin, Operand end, Operand strides, Operand dy, + StridedSliceGrad.Options... options) { + return StridedSliceGrad.create(scope, shape, begin, end, strides, dy, options); } /** - * Builds an {@link StagePeek} operation + * Builds an {@link SpaceToBatchNd} operation * - * @param index - * @param dtypes - * @param options carries optional attributes values - * @return a new instance of StagePeek - * @see org.tensorflow.op.core.StagePeek + * @param input N-D with shape `input_shape = [batch] + spatial_shape + remaining_shape`, + * @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. + * @return a new instance of SpaceToBatchNd + * @see org.tensorflow.op.core.SpaceToBatchNd */ - public StagePeek stagePeek(Operand index, List> dtypes, - StagePeek.Options... options) { - return StagePeek.create(scope, index, dtypes, options); + public SpaceToBatchNd spaceToBatchNd( + Operand input, Operand blockShape, Operand paddings) { + return SpaceToBatchNd.create(scope, input, blockShape, paddings); } /** - * Builds an {@link OrderedMapUnstage} operation + * Builds an {@link TensorListGather} operation * - * @param key + * @param inputHandle * @param indices - * @param dtypes - * @param options carries optional attributes values - * @return a new instance of OrderedMapUnstage - * @see org.tensorflow.op.core.OrderedMapUnstage + * @param elementShape + * @param elementDtype + * @return a new instance of TensorListGather + * @see org.tensorflow.op.core.TensorListGather */ - public OrderedMapUnstage orderedMapUnstage(Operand key, Operand indices, - List> dtypes, OrderedMapUnstage.Options... options) { - return OrderedMapUnstage.create(scope, key, indices, dtypes, options); + public TensorListGather tensorListGather(Operand inputHandle, + Operand indices, Operand elementShape, DataType elementDtype) { + return TensorListGather.create(scope, inputHandle, indices, elementShape, elementDtype); } /** - * Builds an {@link EuclideanNorm} operation + * Builds an {@link Lu} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range - * @param options carries optional attributes values - * @return a new instance of EuclideanNorm - * @see org.tensorflow.op.core.EuclideanNorm + * @param input A tensor of shape `[..., M, M]` whose inner-most 2 dimensions form matrices of + * @return a new instance of Lu + * @see org.tensorflow.op.core.Lu */ - public EuclideanNorm euclideanNorm(Operand input, Operand axis, - EuclideanNorm.Options... options) { - return EuclideanNorm.create(scope, input, axis, options); + public Lu lu(Operand input) { + return Lu.create(scope, input); } /** * Builds an {@link Constant} operation * - * @param data An array containing the values to put into the new constant. String elements are + * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(byte[][] data) { + public Constant constant(int[][][] data) { return Constant.create(scope, data); } /** - * Builds an {@link OrderedMapPeek} operation - * - * @param key - * @param indices - * @param dtypes - * @param options carries optional attributes values - * @return a new instance of OrderedMapPeek - * @see org.tensorflow.op.core.OrderedMapPeek - */ - public OrderedMapPeek orderedMapPeek(Operand key, Operand indices, - List> dtypes, OrderedMapPeek.Options... options) { - return OrderedMapPeek.create(scope, key, indices, dtypes, options); - } - - /** - * Builds an {@link AssignVariableOp} operation + * Builds an {@link EmptyTensorList} operation * - * @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 - * @see org.tensorflow.op.core.AssignVariableOp + * @param elementShape + * @param maxNumElements + * @param elementDtype + * @return a new instance of EmptyTensorList + * @see org.tensorflow.op.core.EmptyTensorList */ - public AssignVariableOp assignVariableOp(Operand resource, Operand value) { - return AssignVariableOp.create(scope, resource, value); + public EmptyTensorList emptyTensorList( + Operand elementShape, Operand maxNumElements, DataType elementDtype) { + return EmptyTensorList.create(scope, elementShape, maxNumElements, elementDtype); } /** - * Builds an {@link GetSessionTensor} operation + * Builds an {@link MatrixSetDiagV2} operation * - * @param handle The handle for a tensor stored in the session state. - * @param dtype The type of the output value. - * @return a new instance of GetSessionTensor - * @see org.tensorflow.op.core.GetSessionTensor + * @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`. + * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main + * @return a new instance of MatrixSetDiagV2 + * @see org.tensorflow.op.core.MatrixSetDiagV2 */ - public GetSessionTensor getSessionTensor(Operand handle, Class dtype) { - return GetSessionTensor.create(scope, handle, dtype); + public MatrixSetDiagV2 matrixSetDiagV2(Operand input, Operand diagonal, + Operand k) { + return MatrixSetDiagV2.create(scope, input, diagonal, k); } /** - * Builds an {@link Constant} operation + * Builds an {@link Gather} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param params The tensor from which to gather values. Must be at least rank + * @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 + * @param options carries optional attributes values + * @return a new instance of Gather + * @see org.tensorflow.op.core.Gather */ - public Constant constant(float[][][] data) { - return Constant.create(scope, data); + public Gather gather(Operand params, + Operand indices, Operand axis, Gather.Options... options) { + return Gather.create(scope, params, indices, axis, options); } /** - * Builds an {@link MapUnstageNoKey} operation + * Builds an {@link Variable} operation * - * @param indices - * @param dtypes + * @param shape The shape of the variable tensor. + * @param dtype The type of elements in the variable tensor. * @param options carries optional attributes values - * @return a new instance of MapUnstageNoKey - * @see org.tensorflow.op.core.MapUnstageNoKey + * @return a new instance of Variable + * @see org.tensorflow.op.core.Variable */ - public MapUnstageNoKey mapUnstageNoKey(Operand indices, List> dtypes, - MapUnstageNoKey.Options... options) { - return MapUnstageNoKey.create(scope, indices, dtypes, options); + public Variable variable(Shape shape, DataType dtype, + Variable.Options... options) { + return Variable.create(scope, shape, dtype, options); } /** - * Builds an {@link Constant} operation + * Builds an {@link DeleteSessionTensor} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the - * @see org.tensorflow.op.core.Constant + * @param handle The handle for a tensor stored in the session state. + * @return a new instance of DeleteSessionTensor + * @see org.tensorflow.op.core.DeleteSessionTensor */ - public Constant constant(long[][] data) { - return Constant.create(scope, data); + public DeleteSessionTensor deleteSessionTensor(Operand handle) { + return DeleteSessionTensor.create(scope, handle); } /** - * Builds an {@link MirrorPad} operation + * Builds an {@link TensorListPushBackBatch} operation * - * @param input The input tensor to be padded. - * @param paddings A two-column matrix specifying the padding sizes. The number of - * @param mode Either `REFLECT` or `SYMMETRIC`. In reflect mode the padded regions - * @return a new instance of MirrorPad - * @see org.tensorflow.op.core.MirrorPad + * @param inputHandles + * @param tensor + * @return a new instance of TensorListPushBackBatch + * @see org.tensorflow.op.core.TensorListPushBackBatch */ - public MirrorPad mirrorPad(Operand input, Operand paddings, - String mode) { - return MirrorPad.create(scope, input, paddings, mode); + public TensorListPushBackBatch tensorListPushBackBatch(Operand inputHandles, + Operand tensor) { + return TensorListPushBackBatch.create(scope, inputHandles, tensor); } /** @@ -4088,112 +4108,133 @@ public MirrorPad mirrorPad(Operand input, Operand * @return a new instance of TensorListSplit * @see org.tensorflow.op.core.TensorListSplit */ - public TensorListSplit tensorListSplit(Operand tensor, - Operand elementShape, Operand lengths) { + public TensorListSplit tensorListSplit(Operand tensor, + Operand elementShape, Operand lengths) { return TensorListSplit.create(scope, tensor, elementShape, lengths); } /** - * Builds an {@link StridedSliceAssign} operation + * Builds an {@link TensorListFromTensor} operation * - * @param ref - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values - * @return a new instance of StridedSliceAssign - * @see org.tensorflow.op.core.StridedSliceAssign + * @param tensor + * @param elementShape + * @return a new instance of TensorListFromTensor + * @see org.tensorflow.op.core.TensorListFromTensor */ - public StridedSliceAssign stridedSliceAssign(Operand ref, - Operand begin, Operand end, Operand strides, Operand value, - StridedSliceAssign.Options... options) { - return StridedSliceAssign.create(scope, ref, begin, end, strides, value, options); + public TensorListFromTensor tensorListFromTensor( + Operand tensor, Operand elementShape) { + return TensorListFromTensor.create(scope, tensor, elementShape); } /** - * Builds an {@link MapStage} operation + * Builds an {@link ImmutableConst} operation * - * @param key int64 - * @param indices - * @param values a list of tensors - * @param dtypes - * @param options carries optional attributes values - * @return a new instance of MapStage - * @see org.tensorflow.op.core.MapStage + * @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 + * @return a new instance of ImmutableConst + * @see org.tensorflow.op.core.ImmutableConst */ - public MapStage mapStage(Operand key, Operand indices, Iterable> values, - List> dtypes, MapStage.Options... options) { - return MapStage.create(scope, key, indices, values, dtypes, options); + public ImmutableConst immutableConst(DataType dtype, Shape shape, + String memoryRegionName) { + return ImmutableConst.create(scope, dtype, shape, memoryRegionName); } /** - * Builds an {@link ReduceAll} operation + * Builds an {@link Pad} operation * - * @param input The tensor to reduce. - * @param axis The dimensions to reduce. Must be in the range - * @param options carries optional attributes values - * @return a new instance of ReduceAll - * @see org.tensorflow.op.core.ReduceAll + * @param input + * @param paddings + * @param constantValues + * @return a new instance of Pad + * @see org.tensorflow.op.core.Pad */ - public ReduceAll reduceAll(Operand input, Operand axis, - ReduceAll.Options... options) { - return ReduceAll.create(scope, input, axis, options); + public Pad pad(Operand input, Operand paddings, + Operand constantValues) { + return Pad.create(scope, input, paddings, constantValues); } /** - * Builds an {@link TensorListPushBack} operation + * Builds an {@link Range} operation * - * @param inputHandle - * @param tensor - * @return a new instance of TensorListPushBack - * @see org.tensorflow.op.core.TensorListPushBack + * @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`. + * @return a new instance of Range + * @see org.tensorflow.op.core.Range */ - public TensorListPushBack tensorListPushBack(Operand inputHandle, Operand tensor) { - return TensorListPushBack.create(scope, inputHandle, tensor); + public Range range(Operand start, Operand limit, Operand delta) { + return Range.create(scope, start, limit, delta); } /** - * Builds an {@link TensorScatterUpdate} operation + * Builds an {@link WriteKafka} operation * - * @param tensor Tensor to copy/update. - * @param indices Index tensor. - * @param updates Updates to scatter into output. - * @return a new instance of TensorScatterUpdate - * @see org.tensorflow.op.core.TensorScatterUpdate + * @param message + * @param topic + * @param servers + * @return a new instance of WriteKafka + * @see org.tensorflow.op.core.WriteKafka */ - public TensorScatterUpdate tensorScatterUpdate(Operand tensor, - Operand indices, Operand updates) { - return TensorScatterUpdate.create(scope, tensor, indices, updates); + public WriteKafka writeKafka(Operand message, Operand topic, + Operand servers) { + return WriteKafka.create(scope, message, topic, servers); } /** - * Builds an {@link ResourceStridedSliceAssign} operation + * Builds an {@link BarrierTakeMany} operation * - * @param ref - * @param begin - * @param end - * @param strides - * @param value + * @param handle The handle to a barrier. + * @param numElements A single-element tensor containing the number of elements to + * @param componentTypes The type of each component in a value. * @param options carries optional attributes values - * @return a new instance of ResourceStridedSliceAssign - * @see org.tensorflow.op.core.ResourceStridedSliceAssign + * @return a new instance of BarrierTakeMany + * @see org.tensorflow.op.core.BarrierTakeMany */ - public ResourceStridedSliceAssign resourceStridedSliceAssign(Operand ref, - Operand begin, Operand end, Operand strides, Operand value, - ResourceStridedSliceAssign.Options... options) { - return ResourceStridedSliceAssign.create(scope, ref, begin, end, strides, value, options); + public BarrierTakeMany barrierTakeMany(Operand handle, Operand numElements, + List> componentTypes, BarrierTakeMany.Options... options) { + return BarrierTakeMany.create(scope, handle, numElements, componentTypes, options); } /** - * Builds an {@link Rank} operation + * Builds an {@link BatchMatMulV2} operation + * + * @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 + * @return a new instance of BatchMatMulV2 + * @see org.tensorflow.op.core.BatchMatMulV2 + */ + public BatchMatMulV2 batchMatMulV2(Operand x, Operand y, + BatchMatMulV2.Options... options) { + return BatchMatMulV2.create(scope, x, y, options); + } + + /** + * Builds an {@link Sum} operation + * + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of Sum + * @see org.tensorflow.op.core.Sum + */ + public Sum sum(Operand input, Operand axis, + Sum.Options... options) { + return Sum.create(scope, input, axis, options); + } + + /** + * Builds an {@link Shape} operation * * @param input - * @return a new instance of Rank - * @see org.tensorflow.op.core.Rank + * @param outType + * @return a new instance of Shape + * @see org.tensorflow.op.core.Shape */ - public Rank rank(Operand input) { - return Rank.create(scope, input); + public org.tensorflow.op.core.Shape shape( + Operand input, DataType outType) { + return org.tensorflow.op.core.Shape.create(scope, input, outType); } /** @@ -4202,72 +4243,74 @@ public Rank rank(Operand input) { * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(int[][][][][] data) { + public Constant constant(double[][][] data) { return Constant.create(scope, data); } /** - * Builds an {@link Gather} operation + * Builds an {@link GetSessionHandle} operation * - * @param params The tensor from which to gather values. Must be at least rank - * @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 - * @param options carries optional attributes values - * @return a new instance of Gather - * @see org.tensorflow.op.core.Gather + * @param value The tensor to be stored. + * @return a new instance of GetSessionHandle + * @see org.tensorflow.op.core.GetSessionHandle */ - public Gather gather(Operand params, - Operand indices, Operand axis, Gather.Options... options) { - return Gather.create(scope, params, indices, axis, options); + public GetSessionHandle getSessionHandle(Operand value) { + return GetSessionHandle.create(scope, value); } /** - * Builds an {@link TensorListReserve} operation + * Builds an {@link EditDistance} operation * - * @param elementShape - * @param numElements - * @param elementDtype - * @return a new instance of TensorListReserve - * @see org.tensorflow.op.core.TensorListReserve + * @param hypothesisIndices The indices of the hypothesis list SparseTensor. + * @param hypothesisValues The values of the hypothesis list SparseTensor. + * @param hypothesisShape The shape of the hypothesis list SparseTensor. + * @param truthIndices The indices of the truth list SparseTensor. + * @param truthValues The values of the truth list SparseTensor. + * @param truthShape truth indices, vector. + * @param options carries optional attributes values + * @return a new instance of EditDistance + * @see org.tensorflow.op.core.EditDistance */ - public TensorListReserve tensorListReserve(Operand elementShape, - Operand numElements, Class elementDtype) { - return TensorListReserve.create(scope, elementShape, numElements, elementDtype); + public EditDistance editDistance(Operand hypothesisIndices, + Operand hypothesisValues, Operand hypothesisShape, Operand truthIndices, + Operand truthValues, Operand truthShape, EditDistance.Options... options) { + return EditDistance.create(scope, hypothesisIndices, hypothesisValues, hypothesisShape, truthIndices, truthValues, truthShape, options); } /** * Builds an {@link Constant} operation * - * @param data The value to put into the new constant. - * @return a boolean constant + * @param data An array containing the values to put into the new constant. The dimensions of the * @see org.tensorflow.op.core.Constant */ - public Constant constant(boolean data) { + public Constant constant(float[][][][] data) { return Constant.create(scope, data); } /** - * Builds an {@link Zeros} operation + * Builds an {@link TensorArrayUnpack} operation * - * @param dims a 1-D operand that represents the shape of the output tensor - * @param type the output tensor datatype - * @return a constant tensor initialized with zeros - * @throws IllegalArgumentException if the tensor type or shape cannot be initialized with zeros. - * @see org.tensorflow.op.core.Zeros + * @param handle + * @param value + * @param flowIn + * @return a new instance of TensorArrayUnpack + * @see org.tensorflow.op.core.TensorArrayUnpack */ - public Zeros zeros(Operand dims, Class type) { - return Zeros.create(scope, dims, type); + public TensorArrayUnpack tensorArrayUnpack(Operand handle, + Operand value, Operand flowIn) { + return TensorArrayUnpack.create(scope, handle, value, flowIn); } /** - * Builds an {@link Snapshot} operation + * Builds an {@link MapClear} operation * - * @param input - * @return a new instance of Snapshot - * @see org.tensorflow.op.core.Snapshot + * @param dtypes + * @param options carries optional attributes values + * @return a new instance of MapClear + * @see org.tensorflow.op.core.MapClear */ - public Snapshot snapshot(Operand input) { - return Snapshot.create(scope, input); + public MapClear mapClear(List> dtypes, MapClear.Options... options) { + return MapClear.create(scope, dtypes, options); } /** @@ -4277,253 +4320,285 @@ public Snapshot snapshot(Operand input) { * @return a new instance of LookupTableSize * @see org.tensorflow.op.core.LookupTableSize */ - public LookupTableSize lookupTableSize(Operand tableHandle) { - return LookupTableSize.create(scope, tableHandle); + public LookupTableSize lookupTableSize(Operand tableHandle) { + return LookupTableSize.create(scope, tableHandle); + } + + /** + * Builds an {@link ReduceAny} operation + * + * @param input The tensor to reduce. + * @param axis The dimensions to reduce. Must be in the range + * @param options carries optional attributes values + * @return a new instance of ReduceAny + * @see org.tensorflow.op.core.ReduceAny + */ + public ReduceAny reduceAny(Operand input, Operand axis, + ReduceAny.Options... options) { + return ReduceAny.create(scope, input, axis, options); + } + + /** + * Builds an {@link ParallelDynamicStitch} operation + * + * @param indices + * @param data + * @return a new instance of ParallelDynamicStitch + * @see org.tensorflow.op.core.ParallelDynamicStitch + */ + public ParallelDynamicStitch parallelDynamicStitch( + Iterable> indices, Iterable> data) { + return ParallelDynamicStitch.create(scope, indices, data); + } + + /** + * Builds an {@link CombinedNonMaxSuppression} operation + * + * @param boxes A 4-D float tensor of shape `[batch_size, num_boxes, q, 4]`. If `q` is 1 then + * @param scores A 3-D float tensor of shape `[batch_size, num_boxes, num_classes]` + * @param maxOutputSizePerClass A scalar integer tensor representing the maximum number of + * @param maxTotalSize A scalar representing maximum number of boxes retained over all classes. + * @param iouThreshold A 0-D float tensor representing the threshold for deciding whether + * @param scoreThreshold A 0-D float tensor representing the threshold for deciding when to remove + * @param options carries optional attributes values + * @return a new instance of CombinedNonMaxSuppression + * @see org.tensorflow.op.core.CombinedNonMaxSuppression + */ + public CombinedNonMaxSuppression combinedNonMaxSuppression(Operand boxes, + Operand scores, Operand maxOutputSizePerClass, Operand maxTotalSize, + Operand iouThreshold, Operand scoreThreshold, + CombinedNonMaxSuppression.Options... options) { + return CombinedNonMaxSuppression.create(scope, boxes, scores, maxOutputSizePerClass, maxTotalSize, iouThreshold, scoreThreshold, options); } /** - * Builds an {@link SetDiff1d} operation + * Builds an {@link ScatterNdNonAliasingAdd} operation * - * @param x 1-D. Values to keep. - * @param y 1-D. Values to remove. - * @return a new instance of SetDiff1d - * @see org.tensorflow.op.core.SetDiff1d + * @param input A Tensor. + * @param indices A Tensor. Must be one of the following types: `int32`, `int64`. + * @param updates A Tensor. Must have the same type as ref. A tensor of updated values + * @return a new instance of ScatterNdNonAliasingAdd + * @see org.tensorflow.op.core.ScatterNdNonAliasingAdd */ - public SetDiff1d setDiff1d(Operand x, Operand y) { - return SetDiff1d.create(scope, x, y); + public ScatterNdNonAliasingAdd scatterNdNonAliasingAdd( + Operand input, Operand indices, Operand updates) { + return ScatterNdNonAliasingAdd.create(scope, input, indices, updates); } /** - * Builds an {@link Reshape} operation + * Builds an {@link Constant} operation * - * @param tensor - * @param shape Defines the shape of the output tensor. - * @return a new instance of Reshape - * @see org.tensorflow.op.core.Reshape + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public Reshape reshape(Operand tensor, Operand shape) { - return Reshape.create(scope, tensor, shape); + public Constant constant(long[][][][][][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link MatrixSetDiagV2} operation + * Builds an {@link SplitV} operation * - * @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`. - * @param k Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main - * @return a new instance of MatrixSetDiagV2 - * @see org.tensorflow.op.core.MatrixSetDiagV2 + * @param value The tensor to split. + * @param sizeSplits list containing the sizes of each output tensor along the split + * @param axis 0-D. The dimension along which to split. Must be in the range + * @param numSplit + * @return a new instance of SplitV + * @see org.tensorflow.op.core.SplitV */ - public MatrixSetDiagV2 matrixSetDiagV2(Operand input, Operand diagonal, - Operand k) { - return MatrixSetDiagV2.create(scope, input, diagonal, k); + public SplitV splitV(Operand value, + Operand sizeSplits, Operand axis, Long numSplit) { + return SplitV.create(scope, value, sizeSplits, axis, numSplit); } /** - * Builds an {@link ResourceScatterMul} operation + * Builds an {@link DestroyTemporaryVariable} operation * - * @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`. - * @return a new instance of ResourceScatterMul - * @see org.tensorflow.op.core.ResourceScatterMul + * @param ref A reference to the temporary variable tensor. + * @param varName Name of the temporary variable, usually the name of the matching + * @return a new instance of DestroyTemporaryVariable + * @see org.tensorflow.op.core.DestroyTemporaryVariable */ - public ResourceScatterMul resourceScatterMul(Operand resource, - Operand indices, Operand updates) { - return ResourceScatterMul.create(scope, resource, indices, updates); + public DestroyTemporaryVariable destroyTemporaryVariable(Operand ref, + String varName) { + return DestroyTemporaryVariable.create(scope, ref, varName); } /** - * Builds an {@link Squeeze} operation + * Builds an {@link StageSize} operation * - * @param input The `input` to squeeze. + * @param dtypes * @param options carries optional attributes values - * @return a new instance of Squeeze - * @see org.tensorflow.op.core.Squeeze + * @return a new instance of StageSize + * @see org.tensorflow.op.core.StageSize */ - public Squeeze squeeze(Operand input, Squeeze.Options... options) { - return Squeeze.create(scope, input, options); + public StageSize stageSize(List> dtypes, StageSize.Options... options) { + return StageSize.create(scope, dtypes, options); } /** - * Builds an {@link NextIteration} operation + * Builds an {@link InplaceUpdate} operation * - * @param data The tensor to be made available to the next iteration. - * @return a new instance of NextIteration - * @see org.tensorflow.op.core.NextIteration + * @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. + * @return a new instance of InplaceUpdate + * @see org.tensorflow.op.core.InplaceUpdate */ - public NextIteration nextIteration(Operand data) { - return NextIteration.create(scope, data); + public InplaceUpdate inplaceUpdate(Operand x, Operand i, + Operand v) { + return InplaceUpdate.create(scope, x, i, v); } /** - * Builds an {@link TensorStridedSliceUpdate} operation + * Builds an {@link Constant} operation * - * @param input - * @param begin - * @param end - * @param strides - * @param value - * @param options carries optional attributes values - * @return a new instance of TensorStridedSliceUpdate - * @see org.tensorflow.op.core.TensorStridedSliceUpdate + * @param data An array containing the values to put into the new constant. The dimensions of the + * @see org.tensorflow.op.core.Constant */ - public TensorStridedSliceUpdate tensorStridedSliceUpdate( - Operand input, Operand begin, Operand end, Operand strides, Operand value, - TensorStridedSliceUpdate.Options... options) { - return TensorStridedSliceUpdate.create(scope, input, begin, end, strides, value, options); + public Constant constant(long[][] data) { + return Constant.create(scope, data); } /** - * Builds an {@link TensorArraySize} operation + * Builds an {@link LoopCond} operation * - * @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 - * @see org.tensorflow.op.core.TensorArraySize + * @param input A boolean scalar, representing the branch predicate of the Switch op. + * @return a new instance of LoopCond + * @see org.tensorflow.op.core.LoopCond */ - public TensorArraySize tensorArraySize(Operand handle, Operand flowIn) { - return TensorArraySize.create(scope, handle, flowIn); + public LoopCond loopCond(Operand input) { + return LoopCond.create(scope, input); } /** - * Builds an {@link StatefulRandomBinomial} operation + * Builds an {@link ResourceGatherNd} operation * * @param resource - * @param algorithm - * @param shape - * @param counts - * @param probs + * @param indices * @param dtype - * @return a new instance of StatefulRandomBinomial - * @see org.tensorflow.op.core.StatefulRandomBinomial + * @return a new instance of ResourceGatherNd + * @see org.tensorflow.op.core.ResourceGatherNd */ - public StatefulRandomBinomial statefulRandomBinomial( - Operand resource, Operand algorithm, Operand shape, Operand counts, - Operand probs, Class dtype) { - return StatefulRandomBinomial.create(scope, resource, algorithm, shape, counts, probs, dtype); + public ResourceGatherNd resourceGatherNd( + Operand resource, Operand indices, DataType dtype) { + return ResourceGatherNd.create(scope, resource, indices, dtype); } /** - * Builds an {@link Merge} operation + * Builds an {@link TensorArraySplit} operation * - * @param inputs The input tensors, exactly one of which will become available. - * @return a new instance of Merge - * @see org.tensorflow.op.core.Merge + * @param handle The handle to a TensorArray. + * @param value The concatenated tensor to write to the TensorArray. + * @param lengths The vector of lengths, how to split the rows of value into the + * @param flowIn A float scalar that enforces proper chaining of operations. + * @return a new instance of TensorArraySplit + * @see org.tensorflow.op.core.TensorArraySplit */ - public Merge merge(Iterable> inputs) { - return Merge.create(scope, inputs); + public TensorArraySplit tensorArraySplit(Operand handle, Operand value, + Operand lengths, Operand flowIn) { + return TensorArraySplit.create(scope, handle, value, lengths, flowIn); } /** - * Builds an {@link TensorListElementShape} operation + * Builds an {@link ResourceScatterDiv} operation * - * @param inputHandle - * @param shapeType - * @return a new instance of TensorListElementShape - * @see org.tensorflow.op.core.TensorListElementShape + * @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`. + * @return a new instance of ResourceScatterDiv + * @see org.tensorflow.op.core.ResourceScatterDiv */ - public TensorListElementShape tensorListElementShape(Operand inputHandle, - Class shapeType) { - return TensorListElementShape.create(scope, inputHandle, shapeType); + public ResourceScatterDiv resourceScatterDiv( + Operand resource, Operand indices, Operand updates) { + return ResourceScatterDiv.create(scope, resource, indices, updates); } /** - * Builds an {@link Variable} operation + * Builds an {@link Barrier} operation * - * @param shape The shape of the variable tensor. - * @param dtype The type of elements in the variable tensor. + * @param componentTypes The type of each component in a value. * @param options carries optional attributes values - * @return a new instance of Variable - * @see org.tensorflow.op.core.Variable - */ - public Variable variable(Shape shape, Class dtype, Variable.Options... options) { - return Variable.create(scope, shape, dtype, options); - } - - /** - * Builds an {@link HistogramFixedWidth} operation - * - * @param values Numeric `Tensor`. - * @param valueRange Shape [2] `Tensor` of same `dtype` as `values`. - * @param nbins Scalar `int32 Tensor`. Number of histogram bins. - * @return a new instance of HistogramFixedWidth - * @see org.tensorflow.op.core.HistogramFixedWidth + * @return a new instance of Barrier + * @see org.tensorflow.op.core.Barrier */ - public HistogramFixedWidth histogramFixedWidth(Operand values, - Operand valueRange, Operand nbins) { - return HistogramFixedWidth.create(scope, values, valueRange, nbins); + public Barrier barrier(List> componentTypes, Barrier.Options... options) { + return Barrier.create(scope, componentTypes, options); } /** * Builds an {@link Constant} operation * - * @param data An array containing the values to put into the new constant. The dimensions of the + * @param charset The encoding from String to bytes. + * @param data The string to put into the new constant. + * @return a string constant * @see org.tensorflow.op.core.Constant */ - public Constant constant(long[][][][][][] data) { - return Constant.create(scope, data); + public Constant constant(String data, Charset charset) { + return Constant.create(scope, data, charset); } /** - * Builds an {@link OrderedMapClear} operation + * Builds an {@link TensorListSetItem} operation * - * @param dtypes - * @param options carries optional attributes values - * @return a new instance of OrderedMapClear - * @see org.tensorflow.op.core.OrderedMapClear + * @param inputHandle + * @param index + * @param item + * @return a new instance of TensorListSetItem + * @see org.tensorflow.op.core.TensorListSetItem */ - public OrderedMapClear orderedMapClear(List> dtypes, - OrderedMapClear.Options... options) { - return OrderedMapClear.create(scope, dtypes, options); + public TensorListSetItem tensorListSetItem(Operand inputHandle, + Operand index, Operand item) { + return TensorListSetItem.create(scope, inputHandle, index, item); } /** - * Builds an {@link Split} operation + * Builds an {@link Where3} operation * - * @param axis 0-D. The dimension along which to split. Must be in the range - * @param value The tensor to split. - * @param numSplit The number of ways to split. Must evenly divide - * @return a new instance of Split - * @see org.tensorflow.op.core.Split + * @param condition + * @param x = A `Tensor` which may have the same shape as `condition`. + * @param y = A `Tensor` with the same type and shape as `x`. + * @return a new instance of Where3 + * @see org.tensorflow.op.core.Where3 */ - public Split split(Operand axis, Operand value, Long numSplit) { - return Split.create(scope, axis, value, numSplit); + public Where3 where3(Operand condition, Operand x, Operand y) { + return Where3.create(scope, condition, x, y); } /** - * Builds an {@link Range} operation + * Builds an {@link ControlTrigger} operation * - * @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`. - * @return a new instance of Range - * @see org.tensorflow.op.core.Range + * @return a new instance of ControlTrigger + * @see org.tensorflow.op.core.ControlTrigger */ - public Range range(Operand start, Operand limit, Operand delta) { - return Range.create(scope, start, limit, delta); + public ControlTrigger controlTrigger() { + return ControlTrigger.create(scope); } /** - * Builds an {@link Placeholder} operation + * Builds an {@link Constant} operation * - * @param dtype The type of elements in the tensor. - * @param options carries optional attributes values - * @return a new instance of Placeholder - * @see org.tensorflow.op.core.Placeholder + * @param data The value to put into the new constant. + * @return a boolean constant + * @see org.tensorflow.op.core.Constant */ - public Placeholder placeholder(Class dtype, Placeholder.Options... options) { - return Placeholder.create(scope, dtype, options); + public Constant constant(boolean data) { + return Constant.create(scope, data); } /** - * Builds an {@link ControlTrigger} operation + * Builds an {@link OneHot} operation * - * @return a new instance of ControlTrigger - * @see org.tensorflow.op.core.ControlTrigger + * @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 + * @return a new instance of OneHot + * @see org.tensorflow.op.core.OneHot */ - public ControlTrigger controlTrigger() { - return ControlTrigger.create(scope); + public OneHot oneHot(Operand indices, + Operand depth, Operand onValue, Operand offValue, OneHot.Options... options) { + return OneHot.create(scope, indices, depth, onValue, offValue, options); } /** @@ -4658,6 +4733,13 @@ public final SignalOps signal() { return signal; } + /** + * Returns an API for building {@code train} operations + */ + public final TrainOps train() { + return train; + } + /** * Returns an API for building {@code quantization} operations */ @@ -4666,16 +4748,18 @@ public final QuantizationOps quantization() { } /** - * Returns an API for building {@code train} operations + * Creates an API for building operations in the provided execution environment */ - public final TrainOps train() { - return train; + public static Ops create(ExecutionEnvironment env) { + return new Ops(new Scope(env)); } /** - * Creates an API for building operations in the provided environment + * Creates an API for building operations in the default eager execution environment + * + *

Invoking this method is equivalent to {@code Ops.create(EagerSession.getDefault())}. */ - public static Ops create(ExecutionEnvironment env) { - return new Ops(new Scope(env)); + public static Ops create() { + return new Ops(new Scope(EagerSession.getDefault())); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java index 2a868f4a96a..2428de18109 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/QuantizationOps.java @@ -1,5 +1,6 @@ package org.tensorflow.op; +import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.op.quantization.Dequantize; import org.tensorflow.op.quantization.FakeQuantWithMinMaxArgs; @@ -13,6 +14,10 @@ import org.tensorflow.op.quantization.QuantizeDownAndShrinkRange; import org.tensorflow.op.quantization.RequantizationRange; import org.tensorflow.op.quantization.Requantize; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code quantization} operations as {@link Op Op}s @@ -27,65 +32,67 @@ public final class QuantizationOps { } /** - * Builds an {@link Dequantize} operation + * Builds an {@link FakeQuantWithMinMaxArgsGradient} operation * - * @param input - * @param minRange The minimum scalar value possibly produced for the input. - * @param maxRange The maximum scalar value possibly produced for the input. + * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxArgs operation. + * @param inputs Values passed as inputs to the FakeQuantWithMinMaxArgs operation. * @param options carries optional attributes values - * @return a new instance of Dequantize - * @see org.tensorflow.op.quantization.Dequantize + * @return a new instance of FakeQuantWithMinMaxArgsGradient + * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxArgsGradient */ - public Dequantize dequantize(Operand input, Operand minRange, - Operand maxRange, Dequantize.Options... options) { - return Dequantize.create(scope, input, minRange, maxRange, options); + public FakeQuantWithMinMaxArgsGradient fakeQuantWithMinMaxArgsGradient(Operand gradients, + Operand inputs, FakeQuantWithMinMaxArgsGradient.Options... options) { + return FakeQuantWithMinMaxArgsGradient.create(scope, gradients, inputs, options); } /** - * Builds an {@link Quantize} operation + * Builds an {@link FakeQuantWithMinMaxVarsGradient} operation * - * @param input - * @param minRange The minimum scalar value possibly produced for the input. - * @param maxRange The maximum scalar value possibly produced for the input. - * @param T + * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxVars operation. + * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation. + * @param min + * @param max * @param options carries optional attributes values - * @return a new instance of Quantize - * @see org.tensorflow.op.quantization.Quantize + * @return a new instance of FakeQuantWithMinMaxVarsGradient + * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsGradient */ - public Quantize quantize(Operand input, Operand minRange, - Operand maxRange, Class T, Quantize.Options... options) { - return Quantize.create(scope, input, minRange, maxRange, T, options); + public FakeQuantWithMinMaxVarsGradient fakeQuantWithMinMaxVarsGradient(Operand gradients, + Operand inputs, Operand min, Operand max, + FakeQuantWithMinMaxVarsGradient.Options... options) { + return FakeQuantWithMinMaxVarsGradient.create(scope, gradients, inputs, min, max, options); } /** - * Builds an {@link FakeQuantWithMinMaxVars} operation + * Builds an {@link Requantize} operation * - * @param inputs - * @param min - * @param max - * @param options carries optional attributes values - * @return a new instance of FakeQuantWithMinMaxVars - * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxVars + * @param input + * @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. + * @return a new instance of Requantize + * @see org.tensorflow.op.quantization.Requantize */ - public FakeQuantWithMinMaxVars fakeQuantWithMinMaxVars(Operand inputs, Operand min, - Operand max, FakeQuantWithMinMaxVars.Options... options) { - return FakeQuantWithMinMaxVars.create(scope, inputs, min, max, options); + public Requantize requantize(Operand input, + Operand inputMin, Operand inputMax, Operand requestedOutputMin, + Operand requestedOutputMax, DataType outType) { + return Requantize.create(scope, input, inputMin, inputMax, requestedOutputMin, requestedOutputMax, outType); } /** - * Builds an {@link FakeQuantWithMinMaxVarsPerChannel} operation + * Builds an {@link Dequantize} operation * - * @param inputs - * @param min - * @param max + * @param input + * @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 FakeQuantWithMinMaxVarsPerChannel - * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannel + * @return a new instance of Dequantize + * @see org.tensorflow.op.quantization.Dequantize */ - public FakeQuantWithMinMaxVarsPerChannel fakeQuantWithMinMaxVarsPerChannel(Operand inputs, - Operand min, Operand max, - FakeQuantWithMinMaxVarsPerChannel.Options... options) { - return FakeQuantWithMinMaxVarsPerChannel.create(scope, inputs, min, max, options); + public Dequantize dequantize(Operand input, Operand minRange, + Operand maxRange, Dequantize.Options... options) { + return Dequantize.create(scope, input, minRange, maxRange, options); } /** @@ -99,8 +106,8 @@ public FakeQuantWithMinMaxVarsPerChannel fakeQuantWithMinMaxVarsPerChannel(Opera * @return a new instance of QuantizeAndDequantize * @see org.tensorflow.op.quantization.QuantizeAndDequantize */ - public QuantizeAndDequantize quantizeAndDequantize(Operand input, - Operand inputMin, Operand inputMax, Operand numBits, + public QuantizeAndDequantize quantizeAndDequantize(Operand input, + Operand inputMin, Operand inputMax, Operand numBits, QuantizeAndDequantize.Options... options) { return QuantizeAndDequantize.create(scope, input, inputMin, inputMax, numBits, options); } @@ -117,11 +124,27 @@ public QuantizeAndDequantize quantizeAndDequantize(Operand * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannelGradient */ public FakeQuantWithMinMaxVarsPerChannelGradient fakeQuantWithMinMaxVarsPerChannelGradient( - Operand gradients, Operand inputs, Operand min, Operand max, + Operand gradients, Operand inputs, Operand min, Operand max, FakeQuantWithMinMaxVarsPerChannelGradient.Options... options) { return FakeQuantWithMinMaxVarsPerChannelGradient.create(scope, gradients, inputs, min, max, options); } + /** + * Builds an {@link FakeQuantWithMinMaxVarsPerChannel} operation + * + * @param inputs + * @param min + * @param max + * @param options carries optional attributes values + * @return a new instance of FakeQuantWithMinMaxVarsPerChannel + * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannel + */ + public FakeQuantWithMinMaxVarsPerChannel fakeQuantWithMinMaxVarsPerChannel(Operand inputs, + Operand min, Operand max, + FakeQuantWithMinMaxVarsPerChannel.Options... options) { + return FakeQuantWithMinMaxVarsPerChannel.create(scope, inputs, min, max, options); + } + /** * Builds an {@link FakeQuantWithMinMaxArgs} operation * @@ -130,58 +153,54 @@ public FakeQuantWithMinMaxVarsPerChannelGradient fakeQuantWithMinMaxVarsPerChann * @return a new instance of FakeQuantWithMinMaxArgs * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxArgs */ - public FakeQuantWithMinMaxArgs fakeQuantWithMinMaxArgs(Operand inputs, + public FakeQuantWithMinMaxArgs fakeQuantWithMinMaxArgs(Operand inputs, FakeQuantWithMinMaxArgs.Options... options) { return FakeQuantWithMinMaxArgs.create(scope, inputs, options); } /** - * Builds an {@link Requantize} operation + * Builds an {@link RequantizationRange} operation * * @param input * @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. - * @return a new instance of Requantize - * @see org.tensorflow.op.quantization.Requantize + * @return a new instance of RequantizationRange + * @see org.tensorflow.op.quantization.RequantizationRange */ - public Requantize requantize(Operand input, Operand inputMin, - Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, - Class outType) { - return Requantize.create(scope, input, inputMin, inputMax, requestedOutputMin, requestedOutputMax, outType); + public RequantizationRange requantizationRange(Operand input, + Operand inputMin, Operand inputMax) { + return RequantizationRange.create(scope, input, inputMin, inputMax); } /** - * Builds an {@link FakeQuantWithMinMaxArgsGradient} operation + * Builds an {@link Quantize} operation * - * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxArgs operation. - * @param inputs Values passed as inputs to the FakeQuantWithMinMaxArgs operation. + * @param input + * @param minRange The minimum scalar value possibly produced for the input. + * @param maxRange The maximum scalar value possibly produced for the input. + * @param T * @param options carries optional attributes values - * @return a new instance of FakeQuantWithMinMaxArgsGradient - * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxArgsGradient + * @return a new instance of Quantize + * @see org.tensorflow.op.quantization.Quantize */ - public FakeQuantWithMinMaxArgsGradient fakeQuantWithMinMaxArgsGradient(Operand gradients, - Operand inputs, FakeQuantWithMinMaxArgsGradient.Options... options) { - return FakeQuantWithMinMaxArgsGradient.create(scope, gradients, inputs, options); + public Quantize quantize(Operand input, Operand minRange, + Operand maxRange, DataType T, Quantize.Options... options) { + return Quantize.create(scope, input, minRange, maxRange, T, options); } /** - * Builds an {@link FakeQuantWithMinMaxVarsGradient} operation + * Builds an {@link FakeQuantWithMinMaxVars} operation * - * @param gradients Backpropagated gradients above the FakeQuantWithMinMaxVars operation. - * @param inputs Values passed as inputs to the FakeQuantWithMinMaxVars operation. + * @param inputs * @param min * @param max * @param options carries optional attributes values - * @return a new instance of FakeQuantWithMinMaxVarsGradient - * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsGradient + * @return a new instance of FakeQuantWithMinMaxVars + * @see org.tensorflow.op.quantization.FakeQuantWithMinMaxVars */ - public FakeQuantWithMinMaxVarsGradient fakeQuantWithMinMaxVarsGradient(Operand gradients, - Operand inputs, Operand min, Operand max, - FakeQuantWithMinMaxVarsGradient.Options... options) { - return FakeQuantWithMinMaxVarsGradient.create(scope, gradients, inputs, min, max, options); + public FakeQuantWithMinMaxVars fakeQuantWithMinMaxVars(Operand inputs, + Operand min, Operand max, FakeQuantWithMinMaxVars.Options... options) { + return FakeQuantWithMinMaxVars.create(scope, inputs, min, max, options); } /** @@ -194,22 +213,8 @@ public FakeQuantWithMinMaxVarsGradient fakeQuantWithMinMaxVarsGradient(Operand QuantizeDownAndShrinkRange quantizeDownAndShrinkRange(Operand input, - Operand inputMin, Operand inputMax, Class outType) { + public QuantizeDownAndShrinkRange quantizeDownAndShrinkRange( + Operand input, Operand inputMin, Operand inputMax, DataType outType) { return QuantizeDownAndShrinkRange.create(scope, input, inputMin, inputMax, outType); } - - /** - * Builds an {@link RequantizationRange} operation - * - * @param input - * @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 - * @see org.tensorflow.op.quantization.RequantizationRange - */ - public RequantizationRange requantizationRange(Operand input, Operand inputMin, - Operand inputMax) { - return RequantizationRange.create(scope, input, inputMin, inputMax); - } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java index 558531f55a6..5bfb10e32b0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/RandomOps.java @@ -1,5 +1,6 @@ package org.tensorflow.op; +import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.op.random.AllCandidateSampler; import org.tensorflow.op.random.LogUniformCandidateSampler; @@ -18,6 +19,11 @@ import org.tensorflow.op.random.StatelessTruncatedNormal; import org.tensorflow.op.random.TruncatedNormal; import org.tensorflow.op.random.UniformCandidateSampler; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code random} operations as {@link Op Op}s @@ -32,56 +38,64 @@ public final class RandomOps { } /** - * Builds an {@link RandomShuffle} operation + * Builds an {@link RandomUniformInt} operation * - * @param value The tensor to be shuffled. + * @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 - * @return a new instance of RandomShuffle - * @see org.tensorflow.op.random.RandomShuffle + * @return a new instance of RandomUniformInt + * @see org.tensorflow.op.random.RandomUniformInt */ - public RandomShuffle randomShuffle(Operand value, RandomShuffle.Options... options) { - return RandomShuffle.create(scope, value, options); + public RandomUniformInt randomUniformInt( + Operand shape, Operand minval, Operand maxval, RandomUniformInt.Options... options) { + return RandomUniformInt.create(scope, shape, minval, maxval, options); } /** - * Builds an {@link RandomUniform} operation + * Builds an {@link RandomGamma} operation * - * @param shape The shape of the output tensor. - * @param dtype The type of the output. + * @param shape 1-D integer tensor. Shape of independent samples to draw from each + * @param alpha A tensor in which each scalar is a "shape" parameter describing the * @param options carries optional attributes values - * @return a new instance of RandomUniform - * @see org.tensorflow.op.random.RandomUniform + * @return a new instance of RandomGamma + * @see org.tensorflow.op.random.RandomGamma */ - public RandomUniform randomUniform(Operand shape, - Class dtype, RandomUniform.Options... options) { - return RandomUniform.create(scope, shape, dtype, options); + public RandomGamma randomGamma(Operand shape, + Operand alpha, RandomGamma.Options... options) { + return RandomGamma.create(scope, shape, alpha, options); } /** - * Builds an {@link StatelessRandomNormal} operation + * Builds an {@link RandomPoisson} operation * - * @param shape The shape of the output tensor. - * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessRandomNormal - * @see org.tensorflow.op.random.StatelessRandomNormal + * @param shape 1-D integer tensor. Shape of independent samples to draw from each + * @param rate A tensor in which each scalar is a "rate" parameter describing the + * @param options carries optional attributes values + * @return a new instance of RandomPoisson + * @see org.tensorflow.op.random.RandomPoisson */ - public StatelessRandomNormal statelessRandomNormal( - Operand shape, Operand seed) { - return StatelessRandomNormal.create(scope, shape, seed); + public RandomPoisson randomPoisson( + Operand shape, Operand rate, RandomPoisson.Options... options) { + return RandomPoisson.create(scope, shape, rate, options); } /** - * Builds an {@link StatelessTruncatedNormal} operation + * Builds an {@link ParameterizedTruncatedNormal} operation * - * @param shape The shape of the output tensor. - * @param seed 2 seeds (shape [2]). - * @param dtype The type of the output. - * @return a new instance of StatelessTruncatedNormal - * @see org.tensorflow.op.random.StatelessTruncatedNormal + * @param shape The shape of the output tensor. Batches are indexed by the 0th dimension. + * @param means The mean parameter of each batch. + * @param stdevs The standard deviation parameter of each batch. Must be greater than 0. + * @param minvals The minimum cutoff. May be -infinity. + * @param maxvals The maximum cutoff. May be +infinity, and must be more than the minval + * @param options carries optional attributes values + * @return a new instance of ParameterizedTruncatedNormal + * @see org.tensorflow.op.random.ParameterizedTruncatedNormal */ - public StatelessTruncatedNormal statelessTruncatedNormal( - Operand shape, Operand seed, Class dtype) { - return StatelessTruncatedNormal.create(scope, shape, seed, dtype); + public ParameterizedTruncatedNormal parameterizedTruncatedNormal( + Operand shape, Operand means, Operand stdevs, Operand minvals, Operand maxvals, + ParameterizedTruncatedNormal.Options... options) { + return ParameterizedTruncatedNormal.create(scope, shape, means, stdevs, minvals, maxvals, options); } /** @@ -89,57 +103,87 @@ public StatelessTruncated * * @param shape 1-D integer tensor. Shape of independent samples to draw from each * @param rate A tensor in which each scalar is a "rate" parameter describing the + * @param dtype * @param options carries optional attributes values * @return a new instance of RandomPoisson * @see org.tensorflow.op.random.RandomPoisson */ - public RandomPoisson randomPoisson(Operand shape, - Operand rate, RandomPoisson.Options... options) { - return RandomPoisson.create(scope, shape, rate, options); + public RandomPoisson randomPoisson( + Operand shape, Operand rate, DataType dtype, RandomPoisson.Options... options) { + return RandomPoisson.create(scope, shape, rate, dtype, options); } /** - * Builds an {@link RandomUniformInt} operation + * Builds an {@link AllCandidateSampler} operation + * + * @param trueClasses A batch_size * num_true matrix, in which each row contains the + * @param numTrue Number of true labels per context. + * @param numSampled Number of candidates to produce. + * @param unique If unique is true, we sample with rejection, so that all sampled + * @param options carries optional attributes values + * @return a new instance of AllCandidateSampler + * @see org.tensorflow.op.random.AllCandidateSampler + */ + public AllCandidateSampler allCandidateSampler(Operand trueClasses, Long numTrue, + Long numSampled, Boolean unique, AllCandidateSampler.Options... options) { + return AllCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, options); + } + + /** + * Builds an {@link StatelessTruncatedNormal} operation * * @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 seed 2 seeds (shape [2]). + * @return a new instance of StatelessTruncatedNormal + * @see org.tensorflow.op.random.StatelessTruncatedNormal + */ + public StatelessTruncatedNormal statelessTruncatedNormal( + Operand shape, Operand seed) { + return StatelessTruncatedNormal.create(scope, shape, seed); + } + + /** + * Builds an {@link UniformCandidateSampler} operation + * + * @param trueClasses A batch_size * num_true matrix, in which each row contains the + * @param numTrue Number of true labels per context. + * @param numSampled Number of candidates to randomly sample. + * @param unique If unique is true, we sample with rejection, so that all sampled + * @param rangeMax The sampler will sample integers from the interval [0, range_max). * @param options carries optional attributes values - * @return a new instance of RandomUniformInt - * @see org.tensorflow.op.random.RandomUniformInt + * @return a new instance of UniformCandidateSampler + * @see org.tensorflow.op.random.UniformCandidateSampler */ - public RandomUniformInt randomUniformInt(Operand shape, - Operand minval, Operand maxval, RandomUniformInt.Options... options) { - return RandomUniformInt.create(scope, shape, minval, maxval, options); + public UniformCandidateSampler uniformCandidateSampler(Operand trueClasses, Long numTrue, + Long numSampled, Boolean unique, Long rangeMax, UniformCandidateSampler.Options... options) { + return UniformCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, rangeMax, options); } /** - * Builds an {@link StatelessMultinomial} operation + * Builds an {@link StatelessRandomNormal} operation * - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` - * @param numSamples 0-D. Number of independent samples to draw for each row slice. + * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). - * @param outputDtype - * @return a new instance of StatelessMultinomial - * @see org.tensorflow.op.random.StatelessMultinomial + * @return a new instance of StatelessRandomNormal + * @see org.tensorflow.op.random.StatelessRandomNormal */ - public StatelessMultinomial statelessMultinomial( - Operand logits, Operand numSamples, Operand seed, Class outputDtype) { - return StatelessMultinomial.create(scope, logits, numSamples, seed, outputDtype); + public StatelessRandomNormal statelessRandomNormal( + Operand shape, Operand seed) { + return StatelessRandomNormal.create(scope, shape, seed); } /** - * Builds an {@link RandomStandardNormal} operation + * Builds an {@link TruncatedNormal} operation * * @param shape The shape of the output tensor. * @param dtype The type of the output. * @param options carries optional attributes values - * @return a new instance of RandomStandardNormal - * @see org.tensorflow.op.random.RandomStandardNormal + * @return a new instance of TruncatedNormal + * @see org.tensorflow.op.random.TruncatedNormal */ - public RandomStandardNormal randomStandardNormal( - Operand shape, Class dtype, RandomStandardNormal.Options... options) { - return RandomStandardNormal.create(scope, shape, dtype, options); + public TruncatedNormal truncatedNormal(Operand shape, + DataType dtype, TruncatedNormal.Options... options) { + return TruncatedNormal.create(scope, shape, dtype, options); } /** @@ -154,52 +198,25 @@ public RandomStandardNormal randomStanda * @return a new instance of LogUniformCandidateSampler * @see org.tensorflow.op.random.LogUniformCandidateSampler */ - public LogUniformCandidateSampler logUniformCandidateSampler(Operand trueClasses, + public LogUniformCandidateSampler logUniformCandidateSampler(Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, LogUniformCandidateSampler.Options... options) { return LogUniformCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, rangeMax, options); } /** - * Builds an {@link RandomGamma} operation - * - * @param shape 1-D integer tensor. Shape of independent samples to draw from each - * @param alpha A tensor in which each scalar is a "shape" parameter describing the - * @param options carries optional attributes values - * @return a new instance of RandomGamma - * @see org.tensorflow.op.random.RandomGamma - */ - public RandomGamma randomGamma(Operand shape, - Operand alpha, RandomGamma.Options... options) { - return RandomGamma.create(scope, shape, alpha, options); - } - - /** - * Builds an {@link Multinomial} operation + * Builds an {@link StatelessMultinomial} operation * * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` * @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 - * @see org.tensorflow.op.random.Multinomial - */ - public Multinomial multinomial(Operand logits, - Operand numSamples, Multinomial.Options... options) { - return Multinomial.create(scope, logits, numSamples, options); - } - - /** - * Builds an {@link TruncatedNormal} operation - * - * @param shape The shape of the output tensor. - * @param dtype The type of the output. - * @param options carries optional attributes values - * @return a new instance of TruncatedNormal - * @see org.tensorflow.op.random.TruncatedNormal + * @param seed 2 seeds (shape [2]). + * @param outputDtype + * @return a new instance of StatelessMultinomial + * @see org.tensorflow.op.random.StatelessMultinomial */ - public TruncatedNormal truncatedNormal(Operand shape, - Class dtype, TruncatedNormal.Options... options) { - return TruncatedNormal.create(scope, shape, dtype, options); + public StatelessMultinomial statelessMultinomial( + Operand logits, Operand numSamples, Operand seed, DataType outputDtype) { + return StatelessMultinomial.create(scope, logits, numSamples, seed, outputDtype); } /** @@ -207,42 +224,42 @@ public TruncatedNormal truncatedNormal(O * * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). + * @param dtype The type of the output. * @return a new instance of StatelessTruncatedNormal * @see org.tensorflow.op.random.StatelessTruncatedNormal */ - public StatelessTruncatedNormal statelessTruncatedNormal( - Operand shape, Operand seed) { - return StatelessTruncatedNormal.create(scope, shape, seed); + public StatelessTruncatedNormal statelessTruncatedNormal( + Operand shape, Operand seed, DataType dtype) { + return StatelessTruncatedNormal.create(scope, shape, seed, dtype); } /** - * Builds an {@link StatelessRandomNormal} operation + * Builds an {@link StatelessRandomUniform} operation * * @param shape The shape of the output tensor. * @param seed 2 seeds (shape [2]). * @param dtype The type of the output. - * @return a new instance of StatelessRandomNormal - * @see org.tensorflow.op.random.StatelessRandomNormal + * @return a new instance of StatelessRandomUniform + * @see org.tensorflow.op.random.StatelessRandomUniform */ - public StatelessRandomNormal statelessRandomNormal( - Operand shape, Operand seed, Class dtype) { - return StatelessRandomNormal.create(scope, shape, seed, dtype); + public StatelessRandomUniform statelessRandomUniform( + Operand shape, Operand seed, DataType dtype) { + return StatelessRandomUniform.create(scope, shape, seed, dtype); } /** - * Builds an {@link AllCandidateSampler} operation + * Builds an {@link Multinomial} operation * - * @param trueClasses A batch_size * num_true matrix, in which each row contains the - * @param numTrue Number of true labels per context. - * @param numSampled Number of candidates to produce. - * @param unique If unique is true, we sample with rejection, so that all sampled + * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @param numSamples 0-D. Number of independent samples to draw for each row slice. + * @param outputDtype * @param options carries optional attributes values - * @return a new instance of AllCandidateSampler - * @see org.tensorflow.op.random.AllCandidateSampler + * @return a new instance of Multinomial + * @see org.tensorflow.op.random.Multinomial */ - public AllCandidateSampler allCandidateSampler(Operand trueClasses, Long numTrue, - Long numSampled, Boolean unique, AllCandidateSampler.Options... options) { - return AllCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, options); + public Multinomial multinomial(Operand logits, + Operand numSamples, DataType outputDtype, Multinomial.Options... options) { + return Multinomial.create(scope, logits, numSamples, outputDtype, options); } /** @@ -254,101 +271,91 @@ public AllCandidateSampler allCandidateSampler(Operand trueClasses, Long n * @return a new instance of StatelessMultinomial * @see org.tensorflow.op.random.StatelessMultinomial */ - public StatelessMultinomial statelessMultinomial( - Operand logits, Operand numSamples, Operand seed) { + public StatelessMultinomial statelessMultinomial( + Operand logits, Operand numSamples, Operand seed) { return StatelessMultinomial.create(scope, logits, numSamples, seed); } /** - * Builds an {@link Multinomial} operation + * Builds an {@link StatelessRandomNormal} operation * - * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` - * @param numSamples 0-D. Number of independent samples to draw for each row slice. - * @param outputDtype - * @param options carries optional attributes values - * @return a new instance of Multinomial - * @see org.tensorflow.op.random.Multinomial + * @param shape The shape of the output tensor. + * @param seed 2 seeds (shape [2]). + * @param dtype The type of the output. + * @return a new instance of StatelessRandomNormal + * @see org.tensorflow.op.random.StatelessRandomNormal */ - public Multinomial multinomial(Operand logits, - Operand numSamples, Class outputDtype, Multinomial.Options... options) { - return Multinomial.create(scope, logits, numSamples, outputDtype, options); + public StatelessRandomNormal statelessRandomNormal( + Operand shape, Operand seed, DataType dtype) { + return StatelessRandomNormal.create(scope, shape, seed, dtype); } /** - * Builds an {@link RandomPoisson} operation + * Builds an {@link Multinomial} operation * - * @param shape 1-D integer tensor. Shape of independent samples to draw from each - * @param rate A tensor in which each scalar is a "rate" parameter describing the - * @param dtype + * @param logits 2-D Tensor with shape `[batch_size, num_classes]`. Each slice `[i, :]` + * @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 RandomPoisson - * @see org.tensorflow.op.random.RandomPoisson + * @return a new instance of Multinomial + * @see org.tensorflow.op.random.Multinomial */ - public RandomPoisson randomPoisson( - Operand shape, Operand rate, Class dtype, RandomPoisson.Options... options) { - return RandomPoisson.create(scope, shape, rate, dtype, options); + public Multinomial multinomial(Operand logits, + Operand numSamples, Multinomial.Options... options) { + return Multinomial.create(scope, logits, numSamples, options); } /** - * Builds an {@link ParameterizedTruncatedNormal} operation + * Builds an {@link StatelessRandomUniform} operation * - * @param shape The shape of the output tensor. Batches are indexed by the 0th dimension. - * @param means The mean parameter of each batch. - * @param stdevs The standard deviation parameter of each batch. Must be greater than 0. - * @param minvals The minimum cutoff. May be -infinity. - * @param maxvals The maximum cutoff. May be +infinity, and must be more than the minval - * @param options carries optional attributes values - * @return a new instance of ParameterizedTruncatedNormal - * @see org.tensorflow.op.random.ParameterizedTruncatedNormal + * @param shape The shape of the output tensor. + * @param seed 2 seeds (shape [2]). + * @return a new instance of StatelessRandomUniform + * @see org.tensorflow.op.random.StatelessRandomUniform */ - public ParameterizedTruncatedNormal parameterizedTruncatedNormal( - Operand shape, Operand means, Operand stdevs, Operand minvals, Operand maxvals, - ParameterizedTruncatedNormal.Options... options) { - return ParameterizedTruncatedNormal.create(scope, shape, means, stdevs, minvals, maxvals, options); + public StatelessRandomUniform statelessRandomUniform( + Operand shape, Operand seed) { + return StatelessRandomUniform.create(scope, shape, seed); } /** - * Builds an {@link StatelessRandomUniform} operation + * Builds an {@link RandomStandardNormal} operation * * @param shape The shape of the output tensor. - * @param seed 2 seeds (shape [2]). * @param dtype The type of the output. - * @return a new instance of StatelessRandomUniform - * @see org.tensorflow.op.random.StatelessRandomUniform + * @param options carries optional attributes values + * @return a new instance of RandomStandardNormal + * @see org.tensorflow.op.random.RandomStandardNormal */ - public StatelessRandomUniform statelessRandomUniform( - Operand shape, Operand seed, Class dtype) { - return StatelessRandomUniform.create(scope, shape, seed, dtype); + public RandomStandardNormal randomStandardNormal( + Operand shape, DataType dtype, RandomStandardNormal.Options... options) { + return RandomStandardNormal.create(scope, shape, dtype, options); } /** - * Builds an {@link StatelessRandomUniform} operation + * Builds an {@link RandomUniform} operation * * @param shape The shape of the output tensor. - * @param seed 2 seeds (shape [2]). - * @return a new instance of StatelessRandomUniform - * @see org.tensorflow.op.random.StatelessRandomUniform + * @param dtype The type of the output. + * @param options carries optional attributes values + * @return a new instance of RandomUniform + * @see org.tensorflow.op.random.RandomUniform */ - public StatelessRandomUniform statelessRandomUniform( - Operand shape, Operand seed) { - return StatelessRandomUniform.create(scope, shape, seed); + public RandomUniform randomUniform(Operand shape, + DataType dtype, RandomUniform.Options... options) { + return RandomUniform.create(scope, shape, dtype, options); } /** - * Builds an {@link UniformCandidateSampler} operation + * Builds an {@link RandomShuffle} operation * - * @param trueClasses A batch_size * num_true matrix, in which each row contains the - * @param numTrue Number of true labels per context. - * @param numSampled Number of candidates to randomly sample. - * @param unique If unique is true, we sample with rejection, so that all sampled - * @param rangeMax The sampler will sample integers from the interval [0, range_max). + * @param value The tensor to be shuffled. * @param options carries optional attributes values - * @return a new instance of UniformCandidateSampler - * @see org.tensorflow.op.random.UniformCandidateSampler + * @return a new instance of RandomShuffle + * @see org.tensorflow.op.random.RandomShuffle */ - public UniformCandidateSampler uniformCandidateSampler(Operand trueClasses, Long numTrue, - Long numSampled, Boolean unique, Long rangeMax, UniformCandidateSampler.Options... options) { - return UniformCandidateSampler.create(scope, trueClasses, numTrue, numSampled, unique, rangeMax, options); + public RandomShuffle randomShuffle(Operand value, + RandomShuffle.Options... options) { + return RandomShuffle.create(scope, value, options); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SignalOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SignalOps.java index aae6e7e6755..a6899c8cf78 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SignalOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SignalOps.java @@ -19,6 +19,9 @@ import org.tensorflow.op.signal.Rfft; import org.tensorflow.op.signal.Rfft2d; import org.tensorflow.op.signal.Rfft3d; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * An API for building {@code signal} operations as {@link Op Op}s @@ -50,67 +53,10 @@ public BatchIfft batchIfft(Operand input) { * @return a new instance of Ifft2d * @see org.tensorflow.op.signal.Ifft2d */ - public Ifft2d ifft2d(Operand input) { + public Ifft2d ifft2d(Operand input) { return Ifft2d.create(scope, input); } - /** - * Builds an {@link Ifft3d} operation - * - * @param input A complex64 tensor. - * @return a new instance of Ifft3d - * @see org.tensorflow.op.signal.Ifft3d - */ - public Ifft3d ifft3d(Operand input) { - return Ifft3d.create(scope, input); - } - - /** - * Builds an {@link Fft2d} operation - * - * @param input A complex tensor. - * @return a new instance of Fft2d - * @see org.tensorflow.op.signal.Fft2d - */ - public Fft2d fft2d(Operand input) { - return Fft2d.create(scope, input); - } - - /** - * Builds an {@link Ifft} operation - * - * @param input A complex tensor. - * @return a new instance of Ifft - * @see org.tensorflow.op.signal.Ifft - */ - public Ifft ifft(Operand input) { - return Ifft.create(scope, input); - } - - /** - * Builds an {@link Irfft2d} operation - * - * @param input A complex64 tensor. - * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @return a new instance of Irfft2d - * @see org.tensorflow.op.signal.Irfft2d - */ - public Irfft2d irfft2d(Operand input, Operand fftLength) { - return Irfft2d.create(scope, input, fftLength); - } - - /** - * Builds an {@link Rfft2d} operation - * - * @param input A float32 tensor. - * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. - * @return a new instance of Rfft2d - * @see org.tensorflow.op.signal.Rfft2d - */ - public Rfft2d rfft2d(Operand input, Operand fftLength) { - return Rfft2d.create(scope, input, fftLength); - } - /** * Builds an {@link Rfft} operation * @@ -119,22 +65,10 @@ public Rfft2d rfft2d(Operand input, Operand fftLength) { * @return a new instance of Rfft * @see org.tensorflow.op.signal.Rfft */ - public Rfft rfft(Operand input, Operand fftLength) { + public Rfft rfft(Operand input, Operand fftLength) { return Rfft.create(scope, input, fftLength); } - /** - * Builds an {@link Irfft3d} operation - * - * @param input A complex64 tensor. - * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @return a new instance of Irfft3d - * @see org.tensorflow.op.signal.Irfft3d - */ - public Irfft3d irfft3d(Operand input, Operand fftLength) { - return Irfft3d.create(scope, input, fftLength); - } - /** * Builds an {@link BatchIfft3d} operation * @@ -147,15 +81,15 @@ public BatchIfft3d batchIfft3d(Operand input) { } /** - * Builds an {@link Rfft3d} operation + * Builds an {@link Irfft2d} operation * - * @param input A float32 tensor. - * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. - * @return a new instance of Rfft3d - * @see org.tensorflow.op.signal.Rfft3d + * @param input A complex64 tensor. + * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. + * @return a new instance of Irfft2d + * @see org.tensorflow.op.signal.Irfft2d */ - public Rfft3d rfft3d(Operand input, Operand fftLength) { - return Rfft3d.create(scope, input, fftLength); + public Irfft2d irfft2d(Operand input, Operand fftLength) { + return Irfft2d.create(scope, input, fftLength); } /** @@ -176,10 +110,21 @@ public BatchFft3d batchFft3d(Operand input) { * @return a new instance of Fft * @see org.tensorflow.op.signal.Fft */ - public Fft fft(Operand input) { + public Fft fft(Operand input) { return Fft.create(scope, input); } + /** + * Builds an {@link Fft3d} operation + * + * @param input A complex64 tensor. + * @return a new instance of Fft3d + * @see org.tensorflow.op.signal.Fft3d + */ + public Fft3d fft3d(Operand input) { + return Fft3d.create(scope, input); + } + /** * Builds an {@link BatchFft2d} operation * @@ -192,25 +137,25 @@ public BatchFft2d batchFft2d(Operand input) { } /** - * Builds an {@link Fft3d} operation + * Builds an {@link Ifft} operation * - * @param input A complex64 tensor. - * @return a new instance of Fft3d - * @see org.tensorflow.op.signal.Fft3d + * @param input A complex tensor. + * @return a new instance of Ifft + * @see org.tensorflow.op.signal.Ifft */ - public Fft3d fft3d(Operand input) { - return Fft3d.create(scope, input); + public Ifft ifft(Operand input) { + return Ifft.create(scope, input); } /** - * Builds an {@link BatchFft} operation + * Builds an {@link Fft2d} operation * - * @param input - * @return a new instance of BatchFft - * @see org.tensorflow.op.signal.BatchFft + * @param input A complex tensor. + * @return a new instance of Fft2d + * @see org.tensorflow.op.signal.Fft2d */ - public BatchFft batchFft(Operand input) { - return BatchFft.create(scope, input); + public Fft2d fft2d(Operand input) { + return Fft2d.create(scope, input); } /** @@ -221,10 +166,21 @@ public BatchFft batchFft(Operand input) { * @return a new instance of Irfft * @see org.tensorflow.op.signal.Irfft */ - public Irfft irfft(Operand input, Operand fftLength) { + public Irfft irfft(Operand input, Operand fftLength) { return Irfft.create(scope, input, fftLength); } + /** + * Builds an {@link BatchFft} operation + * + * @param input + * @return a new instance of BatchFft + * @see org.tensorflow.op.signal.BatchFft + */ + public BatchFft batchFft(Operand input) { + return BatchFft.create(scope, input); + } + /** * Builds an {@link BatchIfft2d} operation * @@ -235,4 +191,51 @@ public Irfft irfft(Operand input, Operand fftLength) { public BatchIfft2d batchIfft2d(Operand input) { return BatchIfft2d.create(scope, input); } + + /** + * Builds an {@link Ifft3d} operation + * + * @param input A complex64 tensor. + * @return a new instance of Ifft3d + * @see org.tensorflow.op.signal.Ifft3d + */ + public Ifft3d ifft3d(Operand input) { + return Ifft3d.create(scope, input); + } + + /** + * Builds an {@link Irfft3d} operation + * + * @param input A complex64 tensor. + * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. + * @return a new instance of Irfft3d + * @see org.tensorflow.op.signal.Irfft3d + */ + public Irfft3d irfft3d(Operand input, Operand fftLength) { + return Irfft3d.create(scope, input, fftLength); + } + + /** + * Builds an {@link Rfft2d} operation + * + * @param input A float32 tensor. + * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. + * @return a new instance of Rfft2d + * @see org.tensorflow.op.signal.Rfft2d + */ + public Rfft2d rfft2d(Operand input, Operand fftLength) { + return Rfft2d.create(scope, input, fftLength); + } + + /** + * Builds an {@link Rfft3d} operation + * + * @param input A float32 tensor. + * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. + * @return a new instance of Rfft3d + * @see org.tensorflow.op.signal.Rfft3d + */ + public Rfft3d rfft3d(Operand input, Operand fftLength) { + return Rfft3d.create(scope, input, fftLength); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SparseOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SparseOps.java index 837dd7f328d..245efbfb927 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SparseOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SparseOps.java @@ -1,7 +1,7 @@ package org.tensorflow.op; +import org.tensorflow.DataType; import org.tensorflow.Operand; -import org.tensorflow.Shape; import org.tensorflow.op.sparse.AddManySparseToTensorsMap; import org.tensorflow.op.sparse.AddSparseToTensorsMap; import org.tensorflow.op.sparse.DenseToDenseSetOperation; @@ -45,6 +45,12 @@ import org.tensorflow.op.sparse.SparseToDense; import org.tensorflow.op.sparse.SparseToSparseSetOperation; import org.tensorflow.op.sparse.TakeManySparseFromTensorsMap; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code sparse} operations as {@link Op Op}s @@ -59,20 +65,79 @@ public final class SparseOps { } /** - * Builds an {@link SparseReduceSum} operation + * Builds an {@link SparseDenseCwiseMul} operation * - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a - * @param inputValues 1-D. `N` non-empty values corresponding to `input_indices`. - * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. + * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param spValues 1-D. `N` non-empty values corresponding to `sp_indices`. + * @param spShape 1-D. Shape of the input SparseTensor. + * @param dense `R`-D. The dense Tensor operand. + * @return a new instance of SparseDenseCwiseMul + * @see org.tensorflow.op.sparse.SparseDenseCwiseMul + */ + public SparseDenseCwiseMul sparseDenseCwiseMul(Operand spIndices, + Operand spValues, Operand spShape, Operand dense) { + return SparseDenseCwiseMul.create(scope, spIndices, spValues, spShape, dense); + } + + /** + * Builds an {@link SparseSliceGrad} operation + * + * @param backpropValGrad 1-D. The gradient with respect to + * @param inputIndices 2-D. The `indices` of the input `SparseTensor`. + * @param inputStart 1-D. tensor represents the start of the slice. + * @param outputIndices 2-D. The `indices` of the sliced `SparseTensor`. + * @return a new instance of SparseSliceGrad + * @see org.tensorflow.op.sparse.SparseSliceGrad + */ + public SparseSliceGrad sparseSliceGrad(Operand backpropValGrad, + Operand inputIndices, Operand inputStart, Operand outputIndices) { + return SparseSliceGrad.create(scope, backpropValGrad, inputIndices, inputStart, outputIndices); + } + + /** + * Builds an {@link SparseToDense} operation + * + * @param sparseIndices 0-D, 1-D, or 2-D. `sparse_indices[i]` contains the complete + * @param outputShape 1-D. Shape of the dense output tensor. + * @param sparseValues 1-D. Values corresponding to each row of `sparse_indices`, + * @param defaultValue Scalar value to set for indices not specified in * @param options carries optional attributes values - * @return a new instance of SparseReduceSum - * @see org.tensorflow.op.sparse.SparseReduceSum + * @return a new instance of SparseToDense + * @see org.tensorflow.op.sparse.SparseToDense */ - public SparseReduceSum sparseReduceSum(Operand inputIndices, Operand inputValues, - Operand inputShape, Operand reductionAxes, - SparseReduceSum.Options... options) { - return SparseReduceSum.create(scope, inputIndices, inputValues, inputShape, reductionAxes, options); + public SparseToDense sparseToDense( + Operand sparseIndices, Operand outputShape, Operand sparseValues, + Operand defaultValue, SparseToDense.Options... options) { + return SparseToDense.create(scope, sparseIndices, outputShape, sparseValues, defaultValue, options); + } + + /** + * Builds an {@link SparseSegmentMean} operation + * + * @param data + * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @return a new instance of SparseSegmentMean + * @see org.tensorflow.op.sparse.SparseSegmentMean + */ + public SparseSegmentMean sparseSegmentMean( + Operand data, Operand indices, Operand segmentIds) { + return SparseSegmentMean.create(scope, data, indices, segmentIds); + } + + /** + * Builds an {@link SparseFillEmptyRows} operation + * + * @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]` + * @return a new instance of SparseFillEmptyRows + * @see org.tensorflow.op.sparse.SparseFillEmptyRows + */ + public SparseFillEmptyRows sparseFillEmptyRows(Operand indices, + Operand values, Operand denseShape, Operand defaultValue) { + return SparseFillEmptyRows.create(scope, indices, values, denseShape, defaultValue); } /** @@ -85,24 +150,23 @@ public SparseReduceSum sparseReduceSum(Operand inputIndices, Operan * @return a new instance of SparseSegmentMeanGrad * @see org.tensorflow.op.sparse.SparseSegmentMeanGrad */ - public SparseSegmentMeanGrad sparseSegmentMeanGrad( - Operand grad, Operand indices, Operand segmentIds, - Operand outputDim0) { + public SparseSegmentMeanGrad sparseSegmentMeanGrad( + Operand grad, Operand indices, Operand segmentIds, Operand outputDim0) { return SparseSegmentMeanGrad.create(scope, grad, indices, segmentIds, outputDim0); } /** - * Builds an {@link SparseReshape} operation + * Builds an {@link SparseSoftmax} operation * - * @param inputIndices 2-D. `N x R_in` matrix with the indices of non-empty values in a - * @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. - * @return a new instance of SparseReshape - * @see org.tensorflow.op.sparse.SparseReshape + * @param spIndices 2-D. `NNZ x R` matrix with the indices of non-empty values in a + * @param spValues 1-D. `NNZ` non-empty values corresponding to `sp_indices`. + * @param spShape 1-D. Shape of the input SparseTensor. + * @return a new instance of SparseSoftmax + * @see org.tensorflow.op.sparse.SparseSoftmax */ - public SparseReshape sparseReshape(Operand inputIndices, Operand inputShape, - Operand newShape) { - return SparseReshape.create(scope, inputIndices, inputShape, newShape); + public SparseSoftmax sparseSoftmax(Operand spIndices, + Operand spValues, Operand spShape) { + return SparseSoftmax.create(scope, spIndices, spValues, spShape); } /** @@ -115,132 +179,116 @@ public SparseReshape sparseReshape(Operand inputIndices, Operand inp * @return a new instance of SparseDenseCwiseAdd * @see org.tensorflow.op.sparse.SparseDenseCwiseAdd */ - public SparseDenseCwiseAdd sparseDenseCwiseAdd(Operand spIndices, - Operand spValues, Operand spShape, Operand dense) { + public SparseDenseCwiseAdd sparseDenseCwiseAdd(Operand spIndices, + Operand spValues, Operand spShape, Operand dense) { return SparseDenseCwiseAdd.create(scope, spIndices, spValues, spShape, dense); } /** - * Builds an {@link AddSparseToTensorsMap} operation - * - * @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 - * @return a new instance of AddSparseToTensorsMap - * @see org.tensorflow.op.sparse.AddSparseToTensorsMap - */ - public AddSparseToTensorsMap addSparseToTensorsMap(Operand sparseIndices, - Operand sparseValues, Operand sparseShape, - AddSparseToTensorsMap.Options... options) { - return AddSparseToTensorsMap.create(scope, sparseIndices, sparseValues, sparseShape, options); - } - - /** - * Builds an {@link SparseFillEmptyRows} operation + * Builds an {@link SparseSegmentMeanWithNumSegments} operation * - * @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]` - * @return a new instance of SparseFillEmptyRows - * @see org.tensorflow.op.sparse.SparseFillEmptyRows + * @param data + * @param indices A 1-D tensor. Has same rank as `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. + * @return a new instance of SparseSegmentMeanWithNumSegments + * @see org.tensorflow.op.sparse.SparseSegmentMeanWithNumSegments */ - public SparseFillEmptyRows sparseFillEmptyRows(Operand indices, Operand values, - Operand denseShape, Operand defaultValue) { - return SparseFillEmptyRows.create(scope, indices, values, denseShape, defaultValue); + public SparseSegmentMeanWithNumSegments sparseSegmentMeanWithNumSegments( + Operand data, Operand indices, Operand segmentIds, Operand numSegments) { + return SparseSegmentMeanWithNumSegments.create(scope, data, indices, segmentIds, numSegments); } /** - * Builds an {@link SparseTensorDenseAdd} operation + * Builds an {@link SparseReshape} operation * - * @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`. - * @return a new instance of SparseTensorDenseAdd - * @see org.tensorflow.op.sparse.SparseTensorDenseAdd + * @param inputIndices 2-D. `N x R_in` matrix with the indices of non-empty values in a + * @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. + * @return a new instance of SparseReshape + * @see org.tensorflow.op.sparse.SparseReshape */ - public SparseTensorDenseAdd sparseTensorDenseAdd(Operand aIndices, - Operand aValues, Operand aShape, Operand b) { - return SparseTensorDenseAdd.create(scope, aIndices, aValues, aShape, b); + public SparseReshape sparseReshape(Operand inputIndices, Operand inputShape, + Operand newShape) { + return SparseReshape.create(scope, inputIndices, inputShape, newShape); } /** - * Builds an {@link SparseFillEmptyRowsGrad} operation + * Builds an {@link SparseAccumulatorApplyGradient} operation * - * @param reverseIndexMap 1-D. The reverse index map from SparseFillEmptyRows. - * @param gradValues 1-D. The gradients from backprop. - * @return a new instance of SparseFillEmptyRowsGrad - * @see org.tensorflow.op.sparse.SparseFillEmptyRowsGrad + * @param handle The handle to a accumulator. + * @param localStep The local_step value at which the sparse gradient was computed. + * @param gradientIndices Indices of the sparse gradient to be accumulated. Must be a + * @param gradientValues Values are the non-zero slices of the gradient, and must have + * @param gradientShape Shape of the sparse gradient to be accumulated. + * @param hasKnownShape Boolean indicating whether gradient_shape is unknown, in which + * @return a new instance of SparseAccumulatorApplyGradient + * @see org.tensorflow.op.sparse.SparseAccumulatorApplyGradient */ - public SparseFillEmptyRowsGrad sparseFillEmptyRowsGrad(Operand reverseIndexMap, - Operand gradValues) { - return SparseFillEmptyRowsGrad.create(scope, reverseIndexMap, gradValues); + public SparseAccumulatorApplyGradient sparseAccumulatorApplyGradient( + Operand handle, Operand localStep, Operand gradientIndices, + Operand gradientValues, Operand gradientShape, Boolean hasKnownShape) { + return SparseAccumulatorApplyGradient.create(scope, handle, localStep, gradientIndices, gradientValues, gradientShape, hasKnownShape); } /** - * Builds an {@link SparseAddGrad} operation + * Builds an {@link AddSparseToTensorsMap} operation * - * @param backpropValGrad 1-D with shape `[nnz(sum)]`. The gradient with respect to - * @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 - * @return a new instance of SparseAddGrad - * @see org.tensorflow.op.sparse.SparseAddGrad + * @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 + * @return a new instance of AddSparseToTensorsMap + * @see org.tensorflow.op.sparse.AddSparseToTensorsMap */ - public SparseAddGrad sparseAddGrad(Operand backpropValGrad, Operand aIndices, - Operand bIndices, Operand sumIndices) { - return SparseAddGrad.create(scope, backpropValGrad, aIndices, bIndices, sumIndices); + public AddSparseToTensorsMap addSparseToTensorsMap( + Operand sparseIndices, Operand sparseValues, Operand sparseShape, + AddSparseToTensorsMap.Options... options) { + return AddSparseToTensorsMap.create(scope, sparseIndices, sparseValues, sparseShape, options); } /** - * Builds an {@link SparseSparseMinimum} operation + * Builds an {@link SparseDenseCwiseDiv} operation * - * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a - * @param aValues 1-D. `N` non-empty values corresponding to `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. - * @return a new instance of SparseSparseMinimum - * @see org.tensorflow.op.sparse.SparseSparseMinimum + * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param spValues 1-D. `N` non-empty values corresponding to `sp_indices`. + * @param spShape 1-D. Shape of the input SparseTensor. + * @param dense `R`-D. The dense Tensor operand. + * @return a new instance of SparseDenseCwiseDiv + * @see org.tensorflow.op.sparse.SparseDenseCwiseDiv */ - public SparseSparseMinimum sparseSparseMinimum(Operand aIndices, Operand aValues, - Operand aShape, Operand bIndices, Operand bValues, Operand bShape) { - return SparseSparseMinimum.create(scope, aIndices, aValues, aShape, bIndices, bValues, bShape); + public SparseDenseCwiseDiv sparseDenseCwiseDiv(Operand spIndices, + Operand spValues, Operand spShape, Operand dense) { + return SparseDenseCwiseDiv.create(scope, spIndices, spValues, spShape, dense); } /** - * Builds an {@link SparseReduceMaxSparse} operation + * Builds an {@link SparseConditionalAccumulator} operation * - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a - * @param inputValues 1-D. `N` non-empty values corresponding to `input_indices`. - * @param inputShape 1-D. Shape of the input SparseTensor. - * @param reductionAxes 1-D. Length-`K` vector containing the reduction axes. + * @param dtype The type of the value being accumulated. + * @param shape The shape of the values. * @param options carries optional attributes values - * @return a new instance of SparseReduceMaxSparse - * @see org.tensorflow.op.sparse.SparseReduceMaxSparse + * @return a new instance of SparseConditionalAccumulator + * @see org.tensorflow.op.sparse.SparseConditionalAccumulator */ - public SparseReduceMaxSparse sparseReduceMaxSparse( - Operand inputIndices, Operand inputValues, Operand inputShape, - Operand reductionAxes, SparseReduceMaxSparse.Options... options) { - return SparseReduceMaxSparse.create(scope, inputIndices, inputValues, inputShape, reductionAxes, options); + public SparseConditionalAccumulator sparseConditionalAccumulator( + DataType dtype, Shape shape, SparseConditionalAccumulator.Options... options) { + return SparseConditionalAccumulator.create(scope, dtype, shape, options); } /** - * Builds an {@link SparseSegmentSumWithNumSegments} operation + * Builds an {@link SparseSegmentSqrtNGrad} operation * - * @param data - * @param indices A 1-D tensor. Has same rank as `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. - * @return a new instance of SparseSegmentSumWithNumSegments - * @see org.tensorflow.op.sparse.SparseSegmentSumWithNumSegments + * @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. + * @return a new instance of SparseSegmentSqrtNGrad + * @see org.tensorflow.op.sparse.SparseSegmentSqrtNGrad */ - public SparseSegmentSumWithNumSegments sparseSegmentSumWithNumSegments( - Operand data, Operand indices, Operand segmentIds, Operand numSegments) { - return SparseSegmentSumWithNumSegments.create(scope, data, indices, segmentIds, numSegments); + public SparseSegmentSqrtNGrad sparseSegmentSqrtNGrad( + Operand grad, Operand indices, Operand segmentIds, Operand outputDim0) { + return SparseSegmentSqrtNGrad.create(scope, grad, indices, segmentIds, outputDim0); } /** @@ -254,98 +302,124 @@ public SparseSegmentSumWi * @return a new instance of SparseReduceSumSparse * @see org.tensorflow.op.sparse.SparseReduceSumSparse */ - public SparseReduceSumSparse sparseReduceSumSparse(Operand inputIndices, - Operand inputValues, Operand inputShape, Operand reductionAxes, - SparseReduceSumSparse.Options... options) { + public SparseReduceSumSparse sparseReduceSumSparse( + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, SparseReduceSumSparse.Options... options) { return SparseReduceSumSparse.create(scope, inputIndices, inputValues, inputShape, reductionAxes, options); } /** - * Builds an {@link SparseSliceGrad} operation + * Builds an {@link SparseSplit} operation * - * @param backpropValGrad 1-D. The gradient with respect to - * @param inputIndices 2-D. The `indices` of the input `SparseTensor`. - * @param inputStart 1-D. tensor represents the start of the slice. - * @param outputIndices 2-D. The `indices` of the sliced `SparseTensor`. - * @return a new instance of SparseSliceGrad - * @see org.tensorflow.op.sparse.SparseSliceGrad + * @param splitDim 0-D. The dimension along which to split. Must be in the range + * @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 numSplit The number of ways to split. + * @return a new instance of SparseSplit + * @see org.tensorflow.op.sparse.SparseSplit */ - public SparseSliceGrad sparseSliceGrad(Operand backpropValGrad, - Operand inputIndices, Operand inputStart, Operand outputIndices) { - return SparseSliceGrad.create(scope, backpropValGrad, inputIndices, inputStart, outputIndices); + public SparseSplit sparseSplit(Operand splitDim, + Operand indices, Operand values, Operand shape, Long numSplit) { + return SparseSplit.create(scope, splitDim, indices, values, shape, numSplit); } /** - * Builds an {@link SparseSegmentSqrtNGrad} operation + * Builds an {@link SparseAddGrad} operation * - * @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. - * @return a new instance of SparseSegmentSqrtNGrad - * @see org.tensorflow.op.sparse.SparseSegmentSqrtNGrad + * @param backpropValGrad 1-D with shape `[nnz(sum)]`. The gradient with respect to + * @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 + * @return a new instance of SparseAddGrad + * @see org.tensorflow.op.sparse.SparseAddGrad */ - public SparseSegmentSqrtNGrad sparseSegmentSqrtNGrad( - Operand grad, Operand indices, Operand segmentIds, - Operand outputDim0) { - return SparseSegmentSqrtNGrad.create(scope, grad, indices, segmentIds, outputDim0); + public SparseAddGrad sparseAddGrad(Operand backpropValGrad, + Operand aIndices, Operand bIndices, Operand sumIndices) { + return SparseAddGrad.create(scope, backpropValGrad, aIndices, bIndices, sumIndices); } /** - * Builds an {@link SparseDenseCwiseDiv} operation + * Builds an {@link SparseConcat} operation * - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a - * @param spValues 1-D. `N` non-empty values corresponding to `sp_indices`. - * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. - * @return a new instance of SparseDenseCwiseDiv - * @see org.tensorflow.op.sparse.SparseDenseCwiseDiv + * @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 concatDim Dimension to concatenate along. Must be in range [-rank, rank), + * @return a new instance of SparseConcat + * @see org.tensorflow.op.sparse.SparseConcat */ - public SparseDenseCwiseDiv sparseDenseCwiseDiv(Operand spIndices, - Operand spValues, Operand spShape, Operand dense) { - return SparseDenseCwiseDiv.create(scope, spIndices, spValues, spShape, dense); + public SparseConcat sparseConcat(Iterable> indices, + Iterable> values, Iterable> shapes, Long concatDim) { + return SparseConcat.create(scope, indices, values, shapes, concatDim); } /** - * Builds an {@link SparseSegmentSum} operation + * Builds an {@link SparseSlice} operation * - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. - * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. - * @return a new instance of SparseSegmentSum - * @see org.tensorflow.op.sparse.SparseSegmentSum + * @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. + * @return a new instance of SparseSlice + * @see org.tensorflow.op.sparse.SparseSlice */ - public SparseSegmentSum sparseSegmentSum(Operand data, - Operand indices, Operand segmentIds) { - return SparseSegmentSum.create(scope, data, indices, segmentIds); + public SparseSlice sparseSlice(Operand indices, Operand values, + Operand shape, Operand start, Operand size) { + return SparseSlice.create(scope, indices, values, shape, start, size); } /** - * Builds an {@link SparseMatMul} operation + * Builds an {@link SparseToSparseSetOperation} operation * - * @param a - * @param b + * @param set1Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + * @param set1Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set1Shape 1D `Tensor`, shape of a `SparseTensor`. `set1_shape[0...n-1]` must + * @param set2Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major + * @param set2Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major + * @param set2Shape 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must + * @param setOperation * @param options carries optional attributes values - * @return a new instance of SparseMatMul - * @see org.tensorflow.op.sparse.SparseMatMul + * @return a new instance of SparseToSparseSetOperation + * @see org.tensorflow.op.sparse.SparseToSparseSetOperation */ - public SparseMatMul sparseMatMul(Operand a, Operand b, - SparseMatMul.Options... options) { - return SparseMatMul.create(scope, a, b, options); + public SparseToSparseSetOperation sparseToSparseSetOperation( + Operand set1Indices, Operand set1Values, Operand set1Shape, + Operand set2Indices, Operand set2Values, Operand set2Shape, + String setOperation, SparseToSparseSetOperation.Options... options) { + return SparseToSparseSetOperation.create(scope, set1Indices, set1Values, set1Shape, set2Indices, set2Values, set2Shape, setOperation, options); } /** - * Builds an {@link SparseAccumulatorTakeGradient} operation + * Builds an {@link SparseReduceSum} operation * - * @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 - * @return a new instance of SparseAccumulatorTakeGradient - * @see org.tensorflow.op.sparse.SparseAccumulatorTakeGradient + * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param inputValues 1-D. `N` non-empty values corresponding to `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 + * @return a new instance of SparseReduceSum + * @see org.tensorflow.op.sparse.SparseReduceSum */ - public SparseAccumulatorTakeGradient sparseAccumulatorTakeGradient(Operand handle, - Operand numRequired, Class dtype) { - return SparseAccumulatorTakeGradient.create(scope, handle, numRequired, dtype); + public SparseReduceSum sparseReduceSum(Operand inputIndices, + Operand inputValues, Operand inputShape, Operand reductionAxes, + SparseReduceSum.Options... options) { + return SparseReduceSum.create(scope, inputIndices, inputValues, inputShape, reductionAxes, options); + } + + /** + * Builds an {@link SparseReorder} operation + * + * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param inputValues 1-D. `N` non-empty values corresponding to `input_indices`. + * @param inputShape 1-D. Shape of the input SparseTensor. + * @return a new instance of SparseReorder + * @see org.tensorflow.op.sparse.SparseReorder + */ + public SparseReorder sparseReorder(Operand inputIndices, + Operand inputValues, Operand inputShape) { + return SparseReorder.create(scope, inputIndices, inputValues, inputShape); } /** @@ -358,24 +432,43 @@ public SparseAccumulatorTakeGradient sparseAccumulatorTakeGradient(Operan * @return a new instance of AddManySparseToTensorsMap * @see org.tensorflow.op.sparse.AddManySparseToTensorsMap */ - public AddManySparseToTensorsMap addManySparseToTensorsMap(Operand sparseIndices, - Operand sparseValues, Operand sparseShape, + public AddManySparseToTensorsMap addManySparseToTensorsMap( + Operand sparseIndices, Operand sparseValues, Operand sparseShape, AddManySparseToTensorsMap.Options... options) { return AddManySparseToTensorsMap.create(scope, sparseIndices, sparseValues, sparseShape, options); } /** - * Builds an {@link SparseConditionalAccumulator} operation + * Builds an {@link SparseAdd} operation * - * @param dtype The type of the value being accumulated. - * @param shape The shape of the values. - * @param options carries optional attributes values - * @return a new instance of SparseConditionalAccumulator - * @see org.tensorflow.op.sparse.SparseConditionalAccumulator + * @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 thresh 0-D. The magnitude threshold that determines if an output value/index + * @return a new instance of SparseAdd + * @see org.tensorflow.op.sparse.SparseAdd */ - public SparseConditionalAccumulator sparseConditionalAccumulator(Class dtype, Shape shape, - SparseConditionalAccumulator.Options... options) { - return SparseConditionalAccumulator.create(scope, dtype, shape, options); + public SparseAdd sparseAdd(Operand aIndices, + Operand aValues, Operand aShape, Operand bIndices, Operand bValues, + Operand bShape, Operand thresh) { + return SparseAdd.create(scope, aIndices, aValues, aShape, bIndices, bValues, bShape, thresh); + } + + /** + * Builds an {@link SparseSegmentSum} operation + * + * @param data + * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @return a new instance of SparseSegmentSum + * @see org.tensorflow.op.sparse.SparseSegmentSum + */ + public SparseSegmentSum sparseSegmentSum( + Operand data, Operand indices, Operand segmentIds) { + return SparseSegmentSum.create(scope, data, indices, segmentIds); } /** @@ -390,12 +483,25 @@ public SparseConditionalAccumulator sparseConditionalAccumulator(Class dt * @return a new instance of DenseToSparseSetOperation * @see org.tensorflow.op.sparse.DenseToSparseSetOperation */ - public DenseToSparseSetOperation denseToSparseSetOperation(Operand set1, - Operand set2Indices, Operand set2Values, Operand set2Shape, + public DenseToSparseSetOperation denseToSparseSetOperation(Operand set1, + Operand set2Indices, Operand set2Values, Operand set2Shape, String setOperation, DenseToSparseSetOperation.Options... options) { return DenseToSparseSetOperation.create(scope, set1, set2Indices, set2Values, set2Shape, setOperation, options); } + /** + * Builds an {@link SparseFillEmptyRowsGrad} operation + * + * @param reverseIndexMap 1-D. The reverse index map from SparseFillEmptyRows. + * @param gradValues 1-D. The gradients from backprop. + * @return a new instance of SparseFillEmptyRowsGrad + * @see org.tensorflow.op.sparse.SparseFillEmptyRowsGrad + */ + public SparseFillEmptyRowsGrad sparseFillEmptyRowsGrad( + Operand reverseIndexMap, Operand gradValues) { + return SparseFillEmptyRowsGrad.create(scope, reverseIndexMap, gradValues); + } + /** * Builds an {@link SparseReduceMax} operation * @@ -407,47 +513,28 @@ public DenseToSparseSetOperation denseToSparseSetOperation(Operand set * @return a new instance of SparseReduceMax * @see org.tensorflow.op.sparse.SparseReduceMax */ - public SparseReduceMax sparseReduceMax(Operand inputIndices, - Operand inputValues, Operand inputShape, Operand reductionAxes, + public SparseReduceMax sparseReduceMax(Operand inputIndices, + Operand inputValues, Operand inputShape, Operand reductionAxes, SparseReduceMax.Options... options) { return SparseReduceMax.create(scope, inputIndices, inputValues, inputShape, reductionAxes, options); } /** - * Builds an {@link SparseToSparseSetOperation} operation - * - * @param set1Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major - * @param set1Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major - * @param set1Shape 1D `Tensor`, shape of a `SparseTensor`. `set1_shape[0...n-1]` must - * @param set2Indices 2D `Tensor`, indices of a `SparseTensor`. Must be in row-major - * @param set2Values 1D `Tensor`, values of a `SparseTensor`. Must be in row-major - * @param set2Shape 1D `Tensor`, shape of a `SparseTensor`. `set2_shape[0...n-1]` must - * @param setOperation - * @param options carries optional attributes values - * @return a new instance of SparseToSparseSetOperation - * @see org.tensorflow.op.sparse.SparseToSparseSetOperation - */ - public SparseToSparseSetOperation sparseToSparseSetOperation(Operand set1Indices, - Operand set1Values, Operand set1Shape, Operand set2Indices, - Operand set2Values, Operand set2Shape, String setOperation, - SparseToSparseSetOperation.Options... options) { - return SparseToSparseSetOperation.create(scope, set1Indices, set1Values, set1Shape, set2Indices, set2Values, set2Shape, setOperation, options); - } - - /** - * Builds an {@link SparseSplit} operation + * Builds an {@link SparseSparseMaximum} operation * - * @param splitDim 0-D. The dimension along which to split. Must be in the range - * @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 numSplit The number of ways to split. - * @return a new instance of SparseSplit - * @see org.tensorflow.op.sparse.SparseSplit + * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param aValues 1-D. `N` non-empty values corresponding to `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. + * @return a new instance of SparseSparseMaximum + * @see org.tensorflow.op.sparse.SparseSparseMaximum */ - public SparseSplit sparseSplit(Operand splitDim, Operand indices, - Operand values, Operand shape, Long numSplit) { - return SparseSplit.create(scope, splitDim, indices, values, shape, numSplit); + public SparseSparseMaximum sparseSparseMaximum(Operand aIndices, + Operand aValues, Operand aShape, Operand bIndices, Operand bValues, + Operand bShape) { + return SparseSparseMaximum.create(scope, aIndices, aValues, aShape, bIndices, bValues, bShape); } /** @@ -458,102 +545,91 @@ public SparseSplit sparseSplit(Operand splitDim, Operand indi * @return a new instance of DeserializeSparse * @see org.tensorflow.op.sparse.DeserializeSparse */ - public DeserializeSparse deserializeSparse(Operand serializedSparse, - Class dtype) { + public DeserializeSparse deserializeSparse( + Operand serializedSparse, DataType dtype) { return DeserializeSparse.create(scope, serializedSparse, dtype); } /** - * Builds an {@link SparseToDense} operation + * Builds an {@link TakeManySparseFromTensorsMap} operation * - * @param sparseIndices 0-D, 1-D, or 2-D. `sparse_indices[i]` contains the complete - * @param outputShape 1-D. Shape of the dense output tensor. - * @param sparseValues 1-D. Values corresponding to each row of `sparse_indices`, - * @param defaultValue Scalar value to set for indices not specified in + * @param sparseHandles 1-D, The `N` serialized `SparseTensor` objects. + * @param dtype The `dtype` of the `SparseTensor` objects stored in the * @param options carries optional attributes values - * @return a new instance of SparseToDense - * @see org.tensorflow.op.sparse.SparseToDense + * @return a new instance of TakeManySparseFromTensorsMap + * @see org.tensorflow.op.sparse.TakeManySparseFromTensorsMap */ - public SparseToDense sparseToDense(Operand sparseIndices, - Operand outputShape, Operand sparseValues, Operand defaultValue, - SparseToDense.Options... options) { - return SparseToDense.create(scope, sparseIndices, outputShape, sparseValues, defaultValue, options); + public TakeManySparseFromTensorsMap takeManySparseFromTensorsMap( + Operand sparseHandles, DataType dtype, + TakeManySparseFromTensorsMap.Options... options) { + return TakeManySparseFromTensorsMap.create(scope, sparseHandles, dtype, options); } /** - * Builds an {@link SparseSegmentMeanWithNumSegments} operation + * Builds an {@link SparseSegmentSumWithNumSegments} operation * * @param data * @param indices A 1-D tensor. Has same rank as `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. - * @return a new instance of SparseSegmentMeanWithNumSegments - * @see org.tensorflow.op.sparse.SparseSegmentMeanWithNumSegments - */ - public SparseSegmentMeanWithNumSegments sparseSegmentMeanWithNumSegments( - Operand data, Operand indices, Operand segmentIds, Operand numSegments) { - return SparseSegmentMeanWithNumSegments.create(scope, data, indices, segmentIds, numSegments); - } - - /** - * Builds an {@link SparseSegmentMean} operation - * - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. - * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. - * @return a new instance of SparseSegmentMean - * @see org.tensorflow.op.sparse.SparseSegmentMean + * @return a new instance of SparseSegmentSumWithNumSegments + * @see org.tensorflow.op.sparse.SparseSegmentSumWithNumSegments */ - public SparseSegmentMean sparseSegmentMean( - Operand data, Operand indices, Operand segmentIds) { - return SparseSegmentMean.create(scope, data, indices, segmentIds); + public SparseSegmentSumWithNumSegments sparseSegmentSumWithNumSegments( + Operand data, Operand indices, Operand segmentIds, Operand numSegments) { + return SparseSegmentSumWithNumSegments.create(scope, data, indices, segmentIds, numSegments); } /** - * Builds an {@link DenseToDenseSetOperation} operation + * Builds an {@link SparseReduceMaxSparse} operation * - * @param set1 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`. - * @param set2 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set1`. - * @param setOperation + * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param inputValues 1-D. `N` non-empty values corresponding to `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 - * @return a new instance of DenseToDenseSetOperation - * @see org.tensorflow.op.sparse.DenseToDenseSetOperation + * @return a new instance of SparseReduceMaxSparse + * @see org.tensorflow.op.sparse.SparseReduceMaxSparse */ - public DenseToDenseSetOperation denseToDenseSetOperation(Operand set1, Operand set2, - String setOperation, DenseToDenseSetOperation.Options... options) { - return DenseToDenseSetOperation.create(scope, set1, set2, setOperation, options); + public SparseReduceMaxSparse sparseReduceMaxSparse( + Operand inputIndices, Operand inputValues, Operand inputShape, + Operand reductionAxes, SparseReduceMaxSparse.Options... options) { + return SparseReduceMaxSparse.create(scope, inputIndices, inputValues, inputShape, reductionAxes, options); } /** - * Builds an {@link SparseAccumulatorApplyGradient} operation + * Builds an {@link SparseTensorDenseMatMul} operation * - * @param handle The handle to a accumulator. - * @param localStep The local_step value at which the sparse gradient was computed. - * @param gradientIndices Indices of the sparse gradient to be accumulated. Must be a - * @param gradientValues Values are the non-zero slices of the gradient, and must have - * @param gradientShape Shape of the sparse gradient to be accumulated. - * @param hasKnownShape Boolean indicating whether gradient_shape is unknown, in which - * @return a new instance of SparseAccumulatorApplyGradient - * @see org.tensorflow.op.sparse.SparseAccumulatorApplyGradient + * @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 b 2-D. A dense Matrix. + * @param options carries optional attributes values + * @return a new instance of SparseTensorDenseMatMul + * @see org.tensorflow.op.sparse.SparseTensorDenseMatMul */ - public SparseAccumulatorApplyGradient sparseAccumulatorApplyGradient(Operand handle, - Operand localStep, Operand gradientIndices, Operand gradientValues, - Operand gradientShape, Boolean hasKnownShape) { - return SparseAccumulatorApplyGradient.create(scope, handle, localStep, gradientIndices, gradientValues, gradientShape, hasKnownShape); + public SparseTensorDenseMatMul sparseTensorDenseMatMul( + Operand aIndices, Operand aValues, Operand aShape, Operand b, + SparseTensorDenseMatMul.Options... options) { + return SparseTensorDenseMatMul.create(scope, aIndices, aValues, aShape, b, options); } /** - * Builds an {@link SparseReorder} operation + * Builds an {@link SparseSparseMinimum} operation * - * @param inputIndices 2-D. `N x R` matrix with the indices of non-empty values in a - * @param inputValues 1-D. `N` non-empty values corresponding to `input_indices`. - * @param inputShape 1-D. Shape of the input SparseTensor. - * @return a new instance of SparseReorder - * @see org.tensorflow.op.sparse.SparseReorder + * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a + * @param aValues 1-D. `N` non-empty values corresponding to `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. + * @return a new instance of SparseSparseMinimum + * @see org.tensorflow.op.sparse.SparseSparseMinimum */ - public SparseReorder sparseReorder(Operand inputIndices, Operand inputValues, - Operand inputShape) { - return SparseReorder.create(scope, inputIndices, inputValues, inputShape); + public SparseSparseMinimum sparseSparseMinimum(Operand aIndices, + Operand aValues, Operand aShape, Operand bIndices, Operand bValues, + Operand bShape) { + return SparseSparseMinimum.create(scope, aIndices, aValues, aShape, bIndices, bValues, bShape); } /** @@ -571,57 +647,13 @@ public SparseReorder sparseReorder(Operand inputIndices, Operand * @return a new instance of SparseCross * @see org.tensorflow.op.sparse.SparseCross */ - public SparseCross sparseCross(Iterable> indices, - Iterable> values, Iterable> shapes, Iterable> denseInputs, - Boolean hashedOutput, Long numBuckets, Long hashKey, Class outType, - Class internalType) { + public SparseCross sparseCross( + Iterable> indices, Iterable> values, + Iterable> shapes, Iterable> denseInputs, Boolean hashedOutput, + Long numBuckets, Long hashKey, DataType outType, DataType internalType) { return SparseCross.create(scope, indices, values, shapes, denseInputs, hashedOutput, numBuckets, hashKey, outType, internalType); } - /** - * Builds an {@link SparseSegmentSqrtN} operation - * - * @param data - * @param indices A 1-D tensor. Has same rank as `segment_ids`. - * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. - * @return a new instance of SparseSegmentSqrtN - * @see org.tensorflow.op.sparse.SparseSegmentSqrtN - */ - public SparseSegmentSqrtN sparseSegmentSqrtN( - Operand data, Operand indices, Operand segmentIds) { - return SparseSegmentSqrtN.create(scope, data, indices, segmentIds); - } - - /** - * Builds an {@link SparseSlice} operation - * - * @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. - * @return a new instance of SparseSlice - * @see org.tensorflow.op.sparse.SparseSlice - */ - public SparseSlice sparseSlice(Operand indices, Operand values, - Operand shape, Operand start, Operand size) { - return SparseSlice.create(scope, indices, values, shape, start, size); - } - - /** - * Builds an {@link SparseSoftmax} operation - * - * @param spIndices 2-D. `NNZ x R` matrix with the indices of non-empty values in a - * @param spValues 1-D. `NNZ` non-empty values corresponding to `sp_indices`. - * @param spShape 1-D. Shape of the input SparseTensor. - * @return a new instance of SparseSoftmax - * @see org.tensorflow.op.sparse.SparseSoftmax - */ - public SparseSoftmax sparseSoftmax(Operand spIndices, - Operand spValues, Operand spShape) { - return SparseSoftmax.create(scope, spIndices, spValues, spShape); - } - /** * Builds an {@link SparseSegmentSqrtNWithNumSegments} operation * @@ -632,107 +664,80 @@ public SparseSoftmax sparseSoftmax(Operand spIndices * @return a new instance of SparseSegmentSqrtNWithNumSegments * @see org.tensorflow.op.sparse.SparseSegmentSqrtNWithNumSegments */ - public SparseSegmentSqrtNWithNumSegments sparseSegmentSqrtNWithNumSegments( - Operand data, Operand indices, Operand segmentIds, Operand numSegments) { + public SparseSegmentSqrtNWithNumSegments sparseSegmentSqrtNWithNumSegments( + Operand data, Operand indices, Operand segmentIds, Operand numSegments) { return SparseSegmentSqrtNWithNumSegments.create(scope, data, indices, segmentIds, numSegments); } /** - * Builds an {@link TakeManySparseFromTensorsMap} operation + * Builds an {@link SparseAccumulatorTakeGradient} operation * - * @param sparseHandles 1-D, The `N` serialized `SparseTensor` objects. - * @param dtype The `dtype` of the `SparseTensor` objects stored in the - * @param options carries optional attributes values - * @return a new instance of TakeManySparseFromTensorsMap - * @see org.tensorflow.op.sparse.TakeManySparseFromTensorsMap + * @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 + * @return a new instance of SparseAccumulatorTakeGradient + * @see org.tensorflow.op.sparse.SparseAccumulatorTakeGradient */ - public TakeManySparseFromTensorsMap takeManySparseFromTensorsMap( - Operand sparseHandles, Class dtype, - TakeManySparseFromTensorsMap.Options... options) { - return TakeManySparseFromTensorsMap.create(scope, sparseHandles, dtype, options); + public SparseAccumulatorTakeGradient sparseAccumulatorTakeGradient( + Operand handle, Operand numRequired, DataType dtype) { + return SparseAccumulatorTakeGradient.create(scope, handle, numRequired, dtype); } /** - * Builds an {@link SparseTensorDenseMatMul} operation + * Builds an {@link SparseMatMul} operation * - * @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 b 2-D. A dense Matrix. + * @param a + * @param b * @param options carries optional attributes values - * @return a new instance of SparseTensorDenseMatMul - * @see org.tensorflow.op.sparse.SparseTensorDenseMatMul - */ - public SparseTensorDenseMatMul sparseTensorDenseMatMul( - Operand aIndices, Operand aValues, Operand aShape, Operand b, - SparseTensorDenseMatMul.Options... options) { - return SparseTensorDenseMatMul.create(scope, aIndices, aValues, aShape, b, options); - } - - /** - * Builds an {@link SparseSparseMaximum} operation - * - * @param aIndices 2-D. `N x R` matrix with the indices of non-empty values in a - * @param aValues 1-D. `N` non-empty values corresponding to `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. - * @return a new instance of SparseSparseMaximum - * @see org.tensorflow.op.sparse.SparseSparseMaximum + * @return a new instance of SparseMatMul + * @see org.tensorflow.op.sparse.SparseMatMul */ - public SparseSparseMaximum sparseSparseMaximum(Operand aIndices, - Operand aValues, Operand aShape, Operand bIndices, Operand bValues, - Operand bShape) { - return SparseSparseMaximum.create(scope, aIndices, aValues, aShape, bIndices, bValues, bShape); + public SparseMatMul sparseMatMul(Operand a, + Operand b, SparseMatMul.Options... options) { + return SparseMatMul.create(scope, a, b, options); } /** - * Builds an {@link SparseDenseCwiseMul} operation + * Builds an {@link DenseToDenseSetOperation} operation * - * @param spIndices 2-D. `N x R` matrix with the indices of non-empty values in a - * @param spValues 1-D. `N` non-empty values corresponding to `sp_indices`. - * @param spShape 1-D. Shape of the input SparseTensor. - * @param dense `R`-D. The dense Tensor operand. - * @return a new instance of SparseDenseCwiseMul - * @see org.tensorflow.op.sparse.SparseDenseCwiseMul + * @param set1 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set2`. + * @param set2 `Tensor` with rank `n`. 1st `n-1` dimensions must be the same as `set1`. + * @param setOperation + * @param options carries optional attributes values + * @return a new instance of DenseToDenseSetOperation + * @see org.tensorflow.op.sparse.DenseToDenseSetOperation */ - public SparseDenseCwiseMul sparseDenseCwiseMul(Operand spIndices, - Operand spValues, Operand spShape, Operand dense) { - return SparseDenseCwiseMul.create(scope, spIndices, spValues, spShape, dense); + public DenseToDenseSetOperation denseToDenseSetOperation(Operand set1, + Operand set2, String setOperation, DenseToDenseSetOperation.Options... options) { + return DenseToDenseSetOperation.create(scope, set1, set2, setOperation, options); } /** - * Builds an {@link SparseAdd} operation + * Builds an {@link SparseSegmentSqrtN} operation * - * @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 thresh 0-D. The magnitude threshold that determines if an output value/index - * @return a new instance of SparseAdd - * @see org.tensorflow.op.sparse.SparseAdd + * @param data + * @param indices A 1-D tensor. Has same rank as `segment_ids`. + * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. + * @return a new instance of SparseSegmentSqrtN + * @see org.tensorflow.op.sparse.SparseSegmentSqrtN */ - public SparseAdd sparseAdd(Operand aIndices, Operand aValues, - Operand aShape, Operand bIndices, Operand bValues, Operand bShape, - Operand thresh) { - return SparseAdd.create(scope, aIndices, aValues, aShape, bIndices, bValues, bShape, thresh); + public SparseSegmentSqrtN sparseSegmentSqrtN( + Operand data, Operand indices, Operand segmentIds) { + return SparseSegmentSqrtN.create(scope, data, indices, segmentIds); } /** - * Builds an {@link SparseConcat} operation + * Builds an {@link SparseTensorDenseAdd} operation * - * @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 concatDim Dimension to concatenate along. Must be in range [-rank, rank), - * @return a new instance of SparseConcat - * @see org.tensorflow.op.sparse.SparseConcat + * @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`. + * @return a new instance of SparseTensorDenseAdd + * @see org.tensorflow.op.sparse.SparseTensorDenseAdd */ - public SparseConcat sparseConcat(Iterable> indices, - Iterable> values, Iterable> shapes, Long concatDim) { - return SparseConcat.create(scope, indices, values, shapes, concatDim); + public SparseTensorDenseAdd sparseTensorDenseAdd( + Operand aIndices, Operand aValues, Operand aShape, Operand b) { + return SparseTensorDenseAdd.create(scope, aIndices, aValues, aShape, b); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java index cb91a10752c..58fce0ef005 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/StringsOps.java @@ -1,6 +1,7 @@ package org.tensorflow.op; import java.util.List; +import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.op.strings.Join; import org.tensorflow.op.strings.ReduceJoin; @@ -17,6 +18,10 @@ import org.tensorflow.op.strings.ToNumber; import org.tensorflow.op.strings.UnicodeScript; import org.tensorflow.op.strings.UnicodeTranscode; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; /** * An API for building {@code strings} operations as {@link Op Op}s @@ -31,15 +36,30 @@ public final class StringsOps { } /** - * Builds an {@link StringLength} operation + * Builds an {@link Substr} operation * - * @param input The string for which to compute the length. + * @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 - * @return a new instance of StringLength - * @see org.tensorflow.op.strings.StringLength + * @return a new instance of Substr + * @see org.tensorflow.op.strings.Substr */ - public StringLength stringLength(Operand input, StringLength.Options... options) { - return StringLength.create(scope, input, options); + public Substr substr(Operand input, Operand pos, Operand len, + Substr.Options... options) { + return Substr.create(scope, input, pos, len, options); + } + + /** + * Builds an {@link Join} operation + * + * @param inputs A list of string tensors. The tensors must all have the same shape, + * @param options carries optional attributes values + * @return a new instance of Join + * @see org.tensorflow.op.strings.Join + */ + public Join join(Iterable> inputs, Join.Options... options) { + return Join.create(scope, inputs, options); } /** @@ -62,47 +82,31 @@ public StringFormat stringFormat(Iterable> inputs, StringFormat.Optio * @return a new instance of ToHashBucketFast * @see org.tensorflow.op.strings.ToHashBucketFast */ - public ToHashBucketFast toHashBucketFast(Operand input, Long numBuckets) { + public ToHashBucketFast toHashBucketFast(Operand input, Long numBuckets) { return ToHashBucketFast.create(scope, input, numBuckets); } /** - * Builds an {@link Join} operation - * - * @param inputs A list of string tensors. The tensors must all have the same shape, - * @param options carries optional attributes values - * @return a new instance of Join - * @see org.tensorflow.op.strings.Join - */ - public Join join(Iterable> inputs, Join.Options... options) { - return Join.create(scope, inputs, options); - } - - /** - * Builds an {@link ToHashBucket} operation + * Builds an {@link Strip} operation * - * @param stringTensor - * @param numBuckets The number of buckets. - * @return a new instance of ToHashBucket - * @see org.tensorflow.op.strings.ToHashBucket + * @param input A string `Tensor` of any shape. + * @return a new instance of Strip + * @see org.tensorflow.op.strings.Strip */ - public ToHashBucket toHashBucket(Operand stringTensor, Long numBuckets) { - return ToHashBucket.create(scope, stringTensor, numBuckets); + public Strip strip(Operand input) { + return Strip.create(scope, input); } /** - * Builds an {@link RegexReplace} operation + * Builds an {@link RegexFullMatch} operation * - * @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 - * @param options carries optional attributes values - * @return a new instance of RegexReplace - * @see org.tensorflow.op.strings.RegexReplace + * @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 + * @see org.tensorflow.op.strings.RegexFullMatch */ - public RegexReplace regexReplace(Operand input, Operand pattern, - Operand rewrite, RegexReplace.Options... options) { - return RegexReplace.create(scope, input, pattern, rewrite, options); + public RegexFullMatch regexFullMatch(Operand input, Operand pattern) { + return RegexFullMatch.create(scope, input, pattern); } /** @@ -112,22 +116,10 @@ public RegexReplace regexReplace(Operand input, Operand pattern, * @return a new instance of ToNumber * @see org.tensorflow.op.strings.ToNumber */ - public ToNumber toNumber(Operand stringTensor) { + public ToNumber toNumber(Operand stringTensor) { return ToNumber.create(scope, stringTensor); } - /** - * Builds an {@link ToNumber} operation - * - * @param stringTensor - * @param outType The numeric type to interpret each string in `string_tensor` as. - * @return a new instance of ToNumber - * @see org.tensorflow.op.strings.ToNumber - */ - public ToNumber toNumber(Operand stringTensor, Class outType) { - return ToNumber.create(scope, stringTensor, outType); - } - /** * Builds an {@link UnicodeTranscode} operation * @@ -138,57 +130,61 @@ public ToNumber toNumber(Operand stringTensor, Cla * @return a new instance of UnicodeTranscode * @see org.tensorflow.op.strings.UnicodeTranscode */ - public UnicodeTranscode unicodeTranscode(Operand input, String inputEncoding, + public UnicodeTranscode unicodeTranscode(Operand input, String inputEncoding, String outputEncoding, UnicodeTranscode.Options... options) { return UnicodeTranscode.create(scope, input, inputEncoding, outputEncoding, options); } /** - * Builds an {@link Strip} operation + * Builds an {@link RegexReplace} operation * - * @param input A string `Tensor` of any shape. - * @return a new instance of Strip - * @see org.tensorflow.op.strings.Strip + * @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 + * @param options carries optional attributes values + * @return a new instance of RegexReplace + * @see org.tensorflow.op.strings.RegexReplace */ - public Strip strip(Operand input) { - return Strip.create(scope, input); + public RegexReplace regexReplace(Operand input, Operand pattern, + Operand rewrite, RegexReplace.Options... options) { + return RegexReplace.create(scope, input, pattern, rewrite, options); } /** - * Builds an {@link UnicodeScript} operation + * Builds an {@link ToHashBucket} operation * - * @param input A Tensor of int32 Unicode code points. - * @return a new instance of UnicodeScript - * @see org.tensorflow.op.strings.UnicodeScript + * @param stringTensor + * @param numBuckets The number of buckets. + * @return a new instance of ToHashBucket + * @see org.tensorflow.op.strings.ToHashBucket */ - public UnicodeScript unicodeScript(Operand input) { - return UnicodeScript.create(scope, input); + public ToHashBucket toHashBucket(Operand stringTensor, Long numBuckets) { + return ToHashBucket.create(scope, stringTensor, numBuckets); } /** - * Builds an {@link ReduceJoin} operation + * Builds an {@link StringSplit} operation * - * @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 + * @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 - * @return a new instance of ReduceJoin - * @see org.tensorflow.op.strings.ReduceJoin + * @return a new instance of StringSplit + * @see org.tensorflow.op.strings.StringSplit */ - public ReduceJoin reduceJoin(Operand inputs, Operand reductionIndices, - ReduceJoin.Options... options) { - return ReduceJoin.create(scope, inputs, reductionIndices, options); + public StringSplit stringSplit(Operand input, Operand sep, + StringSplit.Options... options) { + return StringSplit.create(scope, input, sep, options); } /** - * Builds an {@link RegexFullMatch} operation + * Builds an {@link UnicodeScript} operation * - * @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 - * @see org.tensorflow.op.strings.RegexFullMatch + * @param input A Tensor of int32 Unicode code points. + * @return a new instance of UnicodeScript + * @see org.tensorflow.op.strings.UnicodeScript */ - public RegexFullMatch regexFullMatch(Operand input, Operand pattern) { - return RegexFullMatch.create(scope, input, pattern); + public UnicodeScript unicodeScript(Operand input) { + return UnicodeScript.create(scope, input); } /** @@ -200,37 +196,47 @@ public RegexFullMatch regexFullMatch(Operand input, Operand patt * @return a new instance of ToHashBucketStrong * @see org.tensorflow.op.strings.ToHashBucketStrong */ - public ToHashBucketStrong toHashBucketStrong(Operand input, Long numBuckets, + public ToHashBucketStrong toHashBucketStrong(Operand input, Long numBuckets, List key) { return ToHashBucketStrong.create(scope, input, numBuckets, key); } /** - * Builds an {@link Substr} operation + * Builds an {@link ToNumber} operation * - * @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 stringTensor + * @param outType The numeric type to interpret each string in `string_tensor` as. + * @return a new instance of ToNumber + * @see org.tensorflow.op.strings.ToNumber + */ + public ToNumber toNumber(Operand stringTensor, + DataType outType) { + return ToNumber.create(scope, stringTensor, outType); + } + + /** + * Builds an {@link ReduceJoin} operation + * + * @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 * @param options carries optional attributes values - * @return a new instance of Substr - * @see org.tensorflow.op.strings.Substr + * @return a new instance of ReduceJoin + * @see org.tensorflow.op.strings.ReduceJoin */ - public Substr substr(Operand input, Operand pos, Operand len, - Substr.Options... options) { - return Substr.create(scope, input, pos, len, options); + public ReduceJoin reduceJoin(Operand inputs, Operand reductionIndices, + ReduceJoin.Options... options) { + return ReduceJoin.create(scope, inputs, reductionIndices, options); } /** - * Builds an {@link StringSplit} operation + * Builds an {@link StringLength} operation * - * @param input `1-D` string `Tensor`, the strings to split. - * @param sep `0-D` string `Tensor`, the delimiter character. + * @param input The string for which to compute the length. * @param options carries optional attributes values - * @return a new instance of StringSplit - * @see org.tensorflow.op.strings.StringSplit + * @return a new instance of StringLength + * @see org.tensorflow.op.strings.StringLength */ - public StringSplit stringSplit(Operand input, Operand sep, - StringSplit.Options... options) { - return StringSplit.create(scope, input, sep, options); + public StringLength stringLength(Operand input, StringLength.Options... options) { + return StringLength.create(scope, input, options); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SummaryOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SummaryOps.java index e3ca7af8684..3d93ab59453 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SummaryOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/SummaryOps.java @@ -7,6 +7,10 @@ import org.tensorflow.op.summary.MergeSummary; import org.tensorflow.op.summary.ScalarSummary; import org.tensorflow.op.summary.TensorSummary; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code summary} operations as {@link Op Op}s @@ -21,16 +25,18 @@ public final class SummaryOps { } /** - * Builds an {@link HistogramSummary} operation + * Builds an {@link AudioSummary} operation * - * @param tag Scalar. Tag to use for the `Summary.Value`. - * @param values Any shape. Values to use to build the histogram. - * @return a new instance of HistogramSummary - * @see org.tensorflow.op.summary.HistogramSummary + * @param tag Scalar. Used to build the `tag` attribute of the summary values. + * @param tensor 2-D of shape `[batch_size, frames]`. + * @param sampleRate The sample rate of the signal in hertz. + * @param options carries optional attributes values + * @return a new instance of AudioSummary + * @see org.tensorflow.op.summary.AudioSummary */ - public HistogramSummary histogramSummary(Operand tag, - Operand values) { - return HistogramSummary.create(scope, tag, values); + public AudioSummary audioSummary(Operand tag, Operand tensor, + Operand sampleRate, AudioSummary.Options... options) { + return AudioSummary.create(scope, tag, tensor, sampleRate, options); } /** @@ -42,37 +48,11 @@ public HistogramSummary histogramSummary(Operand tag, * @return a new instance of TensorSummary * @see org.tensorflow.op.summary.TensorSummary */ - public TensorSummary tensorSummary(Operand tag, Operand tensor, - Operand serializedSummaryMetadata) { + public TensorSummary tensorSummary(Operand tag, Operand tensor, + Operand serializedSummaryMetadata) { return TensorSummary.create(scope, tag, tensor, serializedSummaryMetadata); } - /** - * Builds an {@link MergeSummary} operation - * - * @param inputs Can be of any shape. Each must contain serialized `Summary` protocol - * @return a new instance of MergeSummary - * @see org.tensorflow.op.summary.MergeSummary - */ - public MergeSummary mergeSummary(Iterable> inputs) { - return MergeSummary.create(scope, inputs); - } - - /** - * Builds an {@link AudioSummary} operation - * - * @param tag Scalar. Used to build the `tag` attribute of the summary values. - * @param tensor 2-D of shape `[batch_size, frames]`. - * @param sampleRate The sample rate of the signal in hertz. - * @param options carries optional attributes values - * @return a new instance of AudioSummary - * @see org.tensorflow.op.summary.AudioSummary - */ - public AudioSummary audioSummary(Operand tag, Operand tensor, - Operand sampleRate, AudioSummary.Options... options) { - return AudioSummary.create(scope, tag, tensor, sampleRate, options); - } - /** * Builds an {@link ImageSummary} operation * @@ -82,11 +62,24 @@ public AudioSummary audioSummary(Operand tag, Operand tensor, * @return a new instance of ImageSummary * @see org.tensorflow.op.summary.ImageSummary */ - public ImageSummary imageSummary(Operand tag, Operand tensor, + public ImageSummary imageSummary(Operand tag, Operand tensor, ImageSummary.Options... options) { return ImageSummary.create(scope, tag, tensor, options); } + /** + * Builds an {@link HistogramSummary} operation + * + * @param tag Scalar. Tag to use for the `Summary.Value`. + * @param values Any shape. Values to use to build the histogram. + * @return a new instance of HistogramSummary + * @see org.tensorflow.op.summary.HistogramSummary + */ + public HistogramSummary histogramSummary(Operand tag, + Operand values) { + return HistogramSummary.create(scope, tag, values); + } + /** * Builds an {@link ScalarSummary} operation * @@ -95,7 +88,18 @@ public ImageSummary imageSummary(Operand tag, Operand * @return a new instance of ScalarSummary * @see org.tensorflow.op.summary.ScalarSummary */ - public ScalarSummary scalarSummary(Operand tags, Operand values) { + public ScalarSummary scalarSummary(Operand tags, Operand values) { return ScalarSummary.create(scope, tags, values); } + + /** + * Builds an {@link MergeSummary} operation + * + * @param inputs Can be of any shape. Each must contain serialized `Summary` protocol + * @return a new instance of MergeSummary + * @see org.tensorflow.op.summary.MergeSummary + */ + public MergeSummary mergeSummary(Iterable> inputs) { + return MergeSummary.create(scope, inputs); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TrainOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TrainOps.java index 1e4d2016f68..c73f3d3b5fa 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TrainOps.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/TrainOps.java @@ -1,8 +1,8 @@ package org.tensorflow.op; import java.util.List; +import org.tensorflow.DataType; import org.tensorflow.Operand; -import org.tensorflow.Shape; import org.tensorflow.op.train.AccumulatorApplyGradient; import org.tensorflow.op.train.AccumulatorNumAccumulated; import org.tensorflow.op.train.AccumulatorSetGlobalStep; @@ -63,6 +63,13 @@ import org.tensorflow.op.train.SparseApplyProximalGradientDescent; import org.tensorflow.op.train.SparseApplyRmsProp; import org.tensorflow.op.train.TileGrad; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An API for building {@code train} operations as {@link Op Op}s @@ -77,26 +84,47 @@ public final class TrainOps { } /** - * Builds an {@link ResourceSparseApplyAdagradDa} operation + * Builds an {@link SparseApplyFtrl} operation * * @param var Should be from a Variable(). - * @param gradientAccumulator Should be from a Variable(). - * @param gradientSquaredAccumulator Should be from a Variable(). + * @param accum Should be from a Variable(). + * @param linear Should be from a Variable(). * @param grad The gradient. * @param indices A vector of indices into the first dimension of var and accum. - * @param lr Learning rate. Must be a scalar. + * @param lr Scaling factor. Must be a scalar. * @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 l2 L2 shrinkage regulariation. Must be a scalar. + * @param l2Shrinkage + * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attributes values - * @return a new instance of ResourceSparseApplyAdagradDa - * @see org.tensorflow.op.train.ResourceSparseApplyAdagradDa + * @return a new instance of SparseApplyFtrl + * @see org.tensorflow.op.train.SparseApplyFtrl */ - public ResourceSparseApplyAdagradDa resourceSparseApplyAdagradDa( - Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, - Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, - Operand globalStep, ResourceSparseApplyAdagradDa.Options... options) { - return ResourceSparseApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, indices, lr, l1, l2, globalStep, options); + public SparseApplyFtrl sparseApplyFtrl(Operand var, + Operand accum, Operand linear, Operand grad, Operand indices, Operand lr, + Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, + SparseApplyFtrl.Options... options) { + return SparseApplyFtrl.create(scope, var, accum, linear, grad, indices, lr, l1, l2, l2Shrinkage, lrPower, options); + } + + /** + * Builds an {@link ApplyPowerSign} operation + * + * @param var Should be from a Variable(). + * @param m Should be from a Variable(). + * @param lr Scaling factor. Must be a scalar. + * @param logbase Must be a scalar. + * @param signDecay Must be a scalar. + * @param beta Must be a scalar. + * @param grad The gradient. + * @param options carries optional attributes values + * @return a new instance of ApplyPowerSign + * @see org.tensorflow.op.train.ApplyPowerSign + */ + public ApplyPowerSign applyPowerSign(Operand var, Operand m, + Operand lr, Operand logbase, Operand signDecay, Operand beta, Operand grad, + ApplyPowerSign.Options... options) { + return ApplyPowerSign.create(scope, var, m, lr, logbase, signDecay, beta, grad, options); } /** @@ -111,155 +139,140 @@ public ResourceSparseApplyAdagradDa resourceSparseApplyAda * @return a new instance of ResourceSparseApplyAdagrad * @see org.tensorflow.op.train.ResourceSparseApplyAdagrad */ - public ResourceSparseApplyAdagrad resourceSparseApplyAdagrad(Operand var, - Operand accum, Operand lr, Operand grad, Operand indices, + public ResourceSparseApplyAdagrad resourceSparseApplyAdagrad( + Operand var, Operand accum, Operand lr, Operand grad, Operand indices, ResourceSparseApplyAdagrad.Options... options) { return ResourceSparseApplyAdagrad.create(scope, var, accum, lr, grad, indices, options); } /** - * Builds an {@link ApplyMomentum} operation + * Builds an {@link ApplyCenteredRmsProp} operation * * @param var Should be from a Variable(). - * @param accum Should be from a Variable(). + * @param mg 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 epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param momentum Momentum. Must be a scalar. * @param options carries optional attributes values - * @return a new instance of ApplyMomentum - * @see org.tensorflow.op.train.ApplyMomentum - */ - public ApplyMomentum applyMomentum(Operand var, Operand accum, Operand lr, - Operand grad, Operand momentum, ApplyMomentum.Options... options) { - return ApplyMomentum.create(scope, var, accum, lr, grad, momentum, options); - } - - /** - * Builds an {@link AccumulatorApplyGradient} operation - * - * @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 - * @see org.tensorflow.op.train.AccumulatorApplyGradient + * @return a new instance of ApplyCenteredRmsProp + * @see org.tensorflow.op.train.ApplyCenteredRmsProp */ - public AccumulatorApplyGradient accumulatorApplyGradient(Operand handle, - Operand localStep, Operand gradient) { - return AccumulatorApplyGradient.create(scope, handle, localStep, gradient); + public ApplyCenteredRmsProp applyCenteredRmsProp(Operand var, + Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, + Operand momentum, Operand epsilon, Operand grad, + ApplyCenteredRmsProp.Options... options) { + return ApplyCenteredRmsProp.create(scope, var, mg, ms, mom, lr, rho, momentum, epsilon, grad, options); } /** - * Builds an {@link ApplyAddSign} operation + * Builds an {@link ResourceApplyPowerSign} operation * * @param var Should be from a Variable(). * @param m Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. - * @param alpha Must be a scalar. + * @param logbase Must be a scalar. * @param signDecay Must be a scalar. * @param beta Must be a scalar. * @param grad The gradient. * @param options carries optional attributes values - * @return a new instance of ApplyAddSign - * @see org.tensorflow.op.train.ApplyAddSign + * @return a new instance of ResourceApplyPowerSign + * @see org.tensorflow.op.train.ResourceApplyPowerSign */ - public ApplyAddSign applyAddSign(Operand var, Operand m, Operand lr, - Operand alpha, Operand signDecay, Operand beta, Operand grad, - ApplyAddSign.Options... options) { - return ApplyAddSign.create(scope, var, m, lr, alpha, signDecay, beta, grad, options); + public ResourceApplyPowerSign resourceApplyPowerSign(Operand var, + Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, + Operand grad, ResourceApplyPowerSign.Options... options) { + return ResourceApplyPowerSign.create(scope, var, m, lr, logbase, signDecay, beta, grad, options); } /** - * Builds an {@link ResourceApplyAddSign} operation + * Builds an {@link ResourceSparseApplyFtrl} operation * * @param var Should be from a Variable(). - * @param m Should be from a Variable(). - * @param lr Scaling factor. Must be a scalar. - * @param alpha Must be a scalar. - * @param signDecay Must be a scalar. - * @param beta Must be a scalar. + * @param accum Should be from a Variable(). + * @param linear Should be from a Variable(). * @param grad The gradient. + * @param indices A vector of indices into the first dimension of var and accum. + * @param lr Scaling factor. Must be a scalar. + * @param l1 L1 regularization. Must be a scalar. + * @param l2 L2 shrinkage regulariation. Must be a scalar. + * @param l2Shrinkage + * @param lrPower Scaling factor. Must be a scalar. * @param options carries optional attributes values - * @return a new instance of ResourceApplyAddSign - * @see org.tensorflow.op.train.ResourceApplyAddSign + * @return a new instance of ResourceSparseApplyFtrl + * @see org.tensorflow.op.train.ResourceSparseApplyFtrl */ - public ResourceApplyAddSign resourceApplyAddSign(Operand var, Operand m, Operand lr, - Operand alpha, Operand signDecay, Operand beta, Operand grad, - ResourceApplyAddSign.Options... options) { - return ResourceApplyAddSign.create(scope, var, m, lr, alpha, signDecay, beta, grad, options); + public ResourceSparseApplyFtrl resourceSparseApplyFtrl( + Operand var, Operand accum, Operand linear, Operand grad, Operand indices, + Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, + ResourceSparseApplyFtrl.Options... options) { + return ResourceSparseApplyFtrl.create(scope, var, accum, linear, grad, indices, lr, l1, l2, l2Shrinkage, lrPower, options); } /** - * Builds an {@link ApplyAdam} operation + * Builds an {@link ResourceApplyCenteredRmsProp} operation * * @param var Should be from a Variable(). - * @param m Should be from a Variable(). - * @param v Should be from a Variable(). - * @param beta1Power Must be a scalar. - * @param beta2Power Must be a scalar. + * @param mg 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 beta1 Momentum factor. Must be a scalar. - * @param beta2 Momentum factor. Must be a scalar. + * @param rho Decay rate. Must be a scalar. + * @param momentum * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attributes values - * @return a new instance of ApplyAdam - * @see org.tensorflow.op.train.ApplyAdam - */ - public ApplyAdam applyAdam(Operand var, Operand m, Operand v, - Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, - Operand beta2, Operand epsilon, Operand grad, ApplyAdam.Options... options) { - return ApplyAdam.create(scope, var, m, v, beta1Power, beta2Power, lr, beta1, beta2, epsilon, grad, options); - } - - /** - * Builds an {@link SaveSlices} operation - * - * @param filename Must have a single element. The name of the file to which we write the - * @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 data `N` tensors to save. - * @return a new instance of SaveSlices - * @see org.tensorflow.op.train.SaveSlices + * @return a new instance of ResourceApplyCenteredRmsProp + * @see org.tensorflow.op.train.ResourceApplyCenteredRmsProp */ - public SaveSlices saveSlices(Operand filename, Operand tensorNames, - Operand shapesAndSlices, Iterable> data) { - return SaveSlices.create(scope, filename, tensorNames, shapesAndSlices, data); + public ResourceApplyCenteredRmsProp resourceApplyCenteredRmsProp(Operand var, + Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, + Operand momentum, Operand epsilon, Operand grad, + ResourceApplyCenteredRmsProp.Options... options) { + return ResourceApplyCenteredRmsProp.create(scope, var, mg, ms, mom, lr, rho, momentum, epsilon, grad, options); } /** - * Builds an {@link AccumulatorTakeGradient} operation + * Builds an {@link ApplyFtrl} operation * - * @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 - * @return a new instance of AccumulatorTakeGradient - * @see org.tensorflow.op.train.AccumulatorTakeGradient + * @param var Should be from a Variable(). + * @param accum Should be from a Variable(). + * @param linear Should be from a Variable(). + * @param grad The gradient. + * @param lr Scaling factor. Must be a scalar. + * @param l1 L1 regulariation. Must be a scalar. + * @param l2 L2 shrinkage regulariation. Must be a scalar. + * @param l2Shrinkage + * @param lrPower Scaling factor. Must be a scalar. + * @param options carries optional attributes values + * @return a new instance of ApplyFtrl + * @see org.tensorflow.op.train.ApplyFtrl */ - public AccumulatorTakeGradient accumulatorTakeGradient(Operand handle, - Operand numRequired, Class dtype) { - return AccumulatorTakeGradient.create(scope, handle, numRequired, dtype); + public ApplyFtrl applyFtrl(Operand var, Operand accum, + Operand linear, Operand grad, Operand lr, Operand l1, Operand l2, + Operand l2Shrinkage, Operand lrPower, ApplyFtrl.Options... options) { + return ApplyFtrl.create(scope, var, accum, linear, grad, lr, l1, l2, l2Shrinkage, lrPower, options); } /** - * Builds an {@link NegTrain} operation + * Builds an {@link AccumulatorApplyGradient} operation * - * @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 vocabCount Count of words in the vocabulary. - * @param numNegativeSamples Number of negative samples per example. - * @return a new instance of NegTrain - * @see org.tensorflow.op.train.NegTrain + * @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 + * @see org.tensorflow.op.train.AccumulatorApplyGradient */ - public NegTrain negTrain(Operand wIn, Operand wOut, Operand examples, - Operand labels, Operand lr, List vocabCount, Long numNegativeSamples) { - return NegTrain.create(scope, wIn, wOut, examples, labels, lr, vocabCount, numNegativeSamples); + public AccumulatorApplyGradient accumulatorApplyGradient( + Operand handle, Operand localStep, Operand gradient) { + return AccumulatorApplyGradient.create(scope, handle, localStep, gradient); } /** - * Builds an {@link ResourceSparseApplyRmsProp} operation + * Builds an {@link SparseApplyRmsProp} operation * * @param var Should be from a Variable(). * @param ms Should be from a Variable(). @@ -271,50 +284,14 @@ public NegTrain negTrain(Operand wIn, Operand wOut, Operand ResourceSparseApplyRmsProp resourceSparseApplyRmsProp(Operand var, - Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, - Operand epsilon, Operand grad, Operand indices, - ResourceSparseApplyRmsProp.Options... options) { - return ResourceSparseApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, indices, options); - } - - /** - * Builds an {@link SparseApplyProximalAdagrad} operation - * - * @param var Should be from a Variable(). - * @param accum Should be from a Variable(). - * @param lr Learning rate. Must be a scalar. - * @param l1 L1 regularization. Must be a scalar. - * @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 - * @return a new instance of SparseApplyProximalAdagrad - * @see org.tensorflow.op.train.SparseApplyProximalAdagrad - */ - public SparseApplyProximalAdagrad sparseApplyProximalAdagrad( - Operand var, Operand accum, Operand lr, Operand l1, Operand l2, - Operand grad, Operand indices, SparseApplyProximalAdagrad.Options... options) { - return SparseApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, indices, options); - } - - /** - * Builds an {@link ResourceApplyAdagrad} operation - * - * @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 - * @return a new instance of ResourceApplyAdagrad - * @see org.tensorflow.op.train.ResourceApplyAdagrad + * @return a new instance of SparseApplyRmsProp + * @see org.tensorflow.op.train.SparseApplyRmsProp */ - public ResourceApplyAdagrad resourceApplyAdagrad(Operand var, Operand accum, - Operand lr, Operand grad, ResourceApplyAdagrad.Options... options) { - return ResourceApplyAdagrad.create(scope, var, accum, lr, grad, options); + public SparseApplyRmsProp sparseApplyRmsProp( + Operand var, Operand ms, Operand mom, Operand lr, Operand rho, + Operand momentum, Operand epsilon, Operand grad, Operand indices, + SparseApplyRmsProp.Options... options) { + return SparseApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, indices, options); } /** @@ -333,49 +310,32 @@ public ResourceApplyAdagrad resourceApplyAdagrad(Operand var, Operand * @return a new instance of ResourceApplyFtrl * @see org.tensorflow.op.train.ResourceApplyFtrl */ - public ResourceApplyFtrl resourceApplyFtrl(Operand var, Operand accum, + public ResourceApplyFtrl resourceApplyFtrl(Operand var, Operand accum, Operand linear, Operand grad, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, ResourceApplyFtrl.Options... options) { return ResourceApplyFtrl.create(scope, var, accum, linear, grad, lr, l1, l2, l2Shrinkage, lrPower, options); } /** - * Builds an {@link SparseApplyMomentum} operation + * Builds an {@link SparseApplyAdagrad} operation * * @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 momentum Momentum. Must be a scalar. - * @param options carries optional attributes values - * @return a new instance of SparseApplyMomentum - * @see org.tensorflow.op.train.SparseApplyMomentum - */ - public SparseApplyMomentum sparseApplyMomentum(Operand var, - Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, - SparseApplyMomentum.Options... options) { - return SparseApplyMomentum.create(scope, var, accum, lr, grad, indices, momentum, options); - } - - /** - * Builds an {@link ApplyAdagrad} operation - * - * @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 - * @return a new instance of ApplyAdagrad - * @see org.tensorflow.op.train.ApplyAdagrad + * @return a new instance of SparseApplyAdagrad + * @see org.tensorflow.op.train.SparseApplyAdagrad */ - public ApplyAdagrad applyAdagrad(Operand var, Operand accum, Operand lr, - Operand grad, ApplyAdagrad.Options... options) { - return ApplyAdagrad.create(scope, var, accum, lr, grad, options); + public SparseApplyAdagrad sparseApplyAdagrad( + Operand var, Operand accum, Operand lr, Operand grad, Operand indices, + SparseApplyAdagrad.Options... options) { + return SparseApplyAdagrad.create(scope, var, accum, lr, grad, indices, options); } /** - * Builds an {@link ResourceApplyRmsProp} operation + * Builds an {@link ApplyRmsProp} operation * * @param var Should be from a Variable(). * @param ms Should be from a Variable(). @@ -386,108 +346,84 @@ public ApplyAdagrad applyAdagrad(Operand var, Operand accum, Operan * @param epsilon Ridge term. Must be a scalar. * @param grad The gradient. * @param options carries optional attributes values - * @return a new instance of ResourceApplyRmsProp - * @see org.tensorflow.op.train.ResourceApplyRmsProp + * @return a new instance of ApplyRmsProp + * @see org.tensorflow.op.train.ApplyRmsProp */ - public ResourceApplyRmsProp resourceApplyRmsProp(Operand var, Operand ms, - Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, - Operand grad, ResourceApplyRmsProp.Options... options) { - return ResourceApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, options); + public ApplyRmsProp applyRmsProp(Operand var, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, + Operand grad, ApplyRmsProp.Options... options) { + return ApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, options); } /** - * Builds an {@link ApplyProximalAdagrad} operation + * Builds an {@link RestoreSlice} operation * - * @param var Should be from a Variable(). - * @param accum Should be from a Variable(). - * @param lr Scaling factor. Must be a scalar. - * @param l1 L1 regularization. Must be a scalar. - * @param l2 L2 regularization. Must be a scalar. - * @param grad The gradient. + * @param filePattern Must have a single element. The pattern of the files from + * @param tensorName Must have a single element. The name of the tensor to be + * @param shapeAndSlice Scalar. The shapes and slice specifications to use when + * @param dt The type of the tensor to be restored. * @param options carries optional attributes values - * @return a new instance of ApplyProximalAdagrad - * @see org.tensorflow.op.train.ApplyProximalAdagrad - */ - public ApplyProximalAdagrad applyProximalAdagrad(Operand var, Operand accum, - Operand lr, Operand l1, Operand l2, Operand grad, - ApplyProximalAdagrad.Options... options) { - return ApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, options); - } - - /** - * Builds an {@link Save} operation - * - * @param prefix Must have a single element. The prefix of the V2 checkpoint to which we - * @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. - * @param tensors `N` tensors to save. - * @return a new instance of Save - * @see org.tensorflow.op.train.Save + * @return a new instance of RestoreSlice + * @see org.tensorflow.op.train.RestoreSlice */ - public Save save(Operand prefix, Operand tensorNames, - Operand shapeAndSlices, Iterable> tensors) { - return Save.create(scope, prefix, tensorNames, shapeAndSlices, tensors); + public RestoreSlice restoreSlice(Operand filePattern, + Operand tensorName, Operand shapeAndSlice, DataType dt, + RestoreSlice.Options... options) { + return RestoreSlice.create(scope, filePattern, tensorName, shapeAndSlice, dt, options); } /** - * Builds an {@link SparseApplyRmsProp} operation + * Builds an {@link ResourceApplyGradientDescent} operation * * @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 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 alpha Scaling factor. Must be a scalar. + * @param delta The change. * @param options carries optional attributes values - * @return a new instance of SparseApplyRmsProp - * @see org.tensorflow.op.train.SparseApplyRmsProp + * @return a new instance of ResourceApplyGradientDescent + * @see org.tensorflow.op.train.ResourceApplyGradientDescent */ - public SparseApplyRmsProp sparseApplyRmsProp(Operand var, - Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, - Operand epsilon, Operand grad, Operand indices, - SparseApplyRmsProp.Options... options) { - return SparseApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, indices, options); + public ResourceApplyGradientDescent resourceApplyGradientDescent(Operand var, + Operand alpha, Operand delta, ResourceApplyGradientDescent.Options... options) { + return ResourceApplyGradientDescent.create(scope, var, alpha, delta, options); } /** - * Builds an {@link ApplyPowerSign} operation + * Builds an {@link SparseApplyAdagradDa} operation * * @param var Should be from a Variable(). - * @param m Should be from a Variable(). - * @param lr Scaling factor. Must be a scalar. - * @param logbase Must be a scalar. - * @param signDecay Must be a scalar. - * @param beta Must be a scalar. + * @param gradientAccumulator Should be from a Variable(). + * @param gradientSquaredAccumulator Should be from a Variable(). * @param grad The gradient. + * @param indices A vector of indices into the first dimension of var and accum. + * @param lr Learning rate. Must be a scalar. + * @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 - * @return a new instance of ApplyPowerSign - * @see org.tensorflow.op.train.ApplyPowerSign + * @return a new instance of SparseApplyAdagradDa + * @see org.tensorflow.op.train.SparseApplyAdagradDa */ - public ApplyPowerSign applyPowerSign(Operand var, Operand m, Operand lr, - Operand logbase, Operand signDecay, Operand beta, Operand grad, - ApplyPowerSign.Options... options) { - return ApplyPowerSign.create(scope, var, m, lr, logbase, signDecay, beta, grad, options); + public SparseApplyAdagradDa sparseApplyAdagradDa( + Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, + Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, + Operand globalStep, SparseApplyAdagradDa.Options... options) { + return SparseApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, indices, lr, l1, l2, globalStep, options); } /** - * Builds an {@link SparseApplyAdagrad} operation + * Builds an {@link ApplyAdagrad} operation * * @param var Should be from a Variable(). * @param accum Should be from a Variable(). - * @param lr Learning rate. Must be a scalar. + * @param lr Scaling 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 - * @return a new instance of SparseApplyAdagrad - * @see org.tensorflow.op.train.SparseApplyAdagrad + * @return a new instance of ApplyAdagrad + * @see org.tensorflow.op.train.ApplyAdagrad */ - public SparseApplyAdagrad sparseApplyAdagrad(Operand var, - Operand accum, Operand lr, Operand grad, Operand indices, - SparseApplyAdagrad.Options... options) { - return SparseApplyAdagrad.create(scope, var, accum, lr, grad, indices, options); + public ApplyAdagrad applyAdagrad(Operand var, Operand accum, + Operand lr, Operand grad, ApplyAdagrad.Options... options) { + return ApplyAdagrad.create(scope, var, accum, lr, grad, options); } /** @@ -503,126 +439,164 @@ public SparseApplyAdagrad sparseApplyAdagrad(Operand * @return a new instance of SparseApplyProximalGradientDescent * @see org.tensorflow.op.train.SparseApplyProximalGradientDescent */ - public SparseApplyProximalGradientDescent sparseApplyProximalGradientDescent( + public SparseApplyProximalGradientDescent sparseApplyProximalGradientDescent( Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, Operand indices, SparseApplyProximalGradientDescent.Options... options) { return SparseApplyProximalGradientDescent.create(scope, var, alpha, l1, l2, grad, indices, options); } /** - * Builds an {@link ApplyAdadelta} operation + * Builds an {@link PreventGradient} operation + * + * @param input any tensor. + * @param options carries optional attributes values + * @return a new instance of PreventGradient + * @see org.tensorflow.op.train.PreventGradient + */ + public PreventGradient preventGradient(Operand input, + PreventGradient.Options... options) { + return PreventGradient.create(scope, input, options); + } + + /** + * Builds an {@link ResourceSparseApplyAdagradDa} operation * * @param var Should be from a Variable(). - * @param accum Should be from a Variable(). - * @param accumUpdate Should be from a Variable(). - * @param lr Scaling factor. Must be a scalar. - * @param rho Decay factor. Must be a scalar. - * @param epsilon Constant factor. Must be a scalar. + * @param gradientAccumulator Should be from a Variable(). + * @param gradientSquaredAccumulator Should be from a Variable(). * @param grad The gradient. + * @param indices A vector of indices into the first dimension of var and accum. + * @param lr Learning rate. Must be a scalar. + * @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 - * @return a new instance of ApplyAdadelta - * @see org.tensorflow.op.train.ApplyAdadelta + * @return a new instance of ResourceSparseApplyAdagradDa + * @see org.tensorflow.op.train.ResourceSparseApplyAdagradDa */ - public ApplyAdadelta applyAdadelta(Operand var, Operand accum, - Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, - ApplyAdadelta.Options... options) { - return ApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, options); + public ResourceSparseApplyAdagradDa resourceSparseApplyAdagradDa( + Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, + Operand grad, Operand indices, Operand lr, Operand l1, Operand l2, + Operand globalStep, ResourceSparseApplyAdagradDa.Options... options) { + return ResourceSparseApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, indices, lr, l1, l2, globalStep, options); } /** - * Builds an {@link SdcaShrinkL1} operation + * Builds an {@link ApplyProximalGradientDescent} operation * - * @param weights a list of vectors where each value is the weight associated with a - * @param l1 Symmetric l1 regularization strength. - * @param l2 Symmetric l2 regularization strength. Should be a positive float. - * @return a new instance of SdcaShrinkL1 - * @see org.tensorflow.op.train.SdcaShrinkL1 + * @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 + * @return a new instance of ApplyProximalGradientDescent + * @see org.tensorflow.op.train.ApplyProximalGradientDescent */ - public SdcaShrinkL1 sdcaShrinkL1(Iterable> weights, Float l1, Float l2) { - return SdcaShrinkL1.create(scope, weights, l1, l2); + public ApplyProximalGradientDescent applyProximalGradientDescent( + Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, + ApplyProximalGradientDescent.Options... options) { + return ApplyProximalGradientDescent.create(scope, var, alpha, l1, l2, delta, options); } /** - * Builds an {@link Restore} operation + * Builds an {@link GenerateVocabRemapping} operation * - * @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. - * @param shapeAndSlices shape {N}. The slice specs of the tensors to be restored. - * @param dtypes shape {N}. The list of expected dtype for the tensors. Must match - * @return a new instance of Restore - * @see org.tensorflow.op.train.Restore + * @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 + * @return a new instance of GenerateVocabRemapping + * @see org.tensorflow.op.train.GenerateVocabRemapping */ - public Restore restore(Operand prefix, Operand tensorNames, - Operand shapeAndSlices, List> dtypes) { - return Restore.create(scope, prefix, tensorNames, shapeAndSlices, dtypes); + public GenerateVocabRemapping generateVocabRemapping(Operand newVocabFile, + Operand oldVocabFile, Long newVocabOffset, Long numNewVocab, + GenerateVocabRemapping.Options... options) { + return GenerateVocabRemapping.create(scope, newVocabFile, oldVocabFile, newVocabOffset, numNewVocab, options); } /** - * Builds an {@link ResourceSparseApplyAdadelta} operation + * Builds an {@link ResourceApplyProximalGradientDescent} operation * - * @param var - * @param accum Should be from a Variable(). - * @param accumUpdate : Should be from a Variable(). - * @param lr Learning rate. Must be a scalar. - * @param rho Decay factor. Must be a scalar. - * @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 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 - * @return a new instance of ResourceSparseApplyAdadelta - * @see org.tensorflow.op.train.ResourceSparseApplyAdadelta + * @return a new instance of ResourceApplyProximalGradientDescent + * @see org.tensorflow.op.train.ResourceApplyProximalGradientDescent */ - public ResourceSparseApplyAdadelta resourceSparseApplyAdadelta( - Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, - Operand epsilon, Operand grad, Operand indices, - ResourceSparseApplyAdadelta.Options... options) { - return ResourceSparseApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, indices, options); + public ResourceApplyProximalGradientDescent resourceApplyProximalGradientDescent( + Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, + ResourceApplyProximalGradientDescent.Options... options) { + return ResourceApplyProximalGradientDescent.create(scope, var, alpha, l1, l2, delta, options); } /** - * Builds an {@link ResourceApplyCenteredRmsProp} operation + * Builds an {@link Save} operation + * + * @param prefix Must have a single element. The prefix of the V2 checkpoint to which we + * @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. + * @param tensors `N` tensors to save. + * @return a new instance of Save + * @see org.tensorflow.op.train.Save + */ + public Save save(Operand prefix, Operand tensorNames, + Operand shapeAndSlices, Iterable> tensors) { + return Save.create(scope, prefix, tensorNames, shapeAndSlices, tensors); + } + + /** + * Builds an {@link ResourceApplyAddSign} operation * * @param var Should be from a Variable(). - * @param mg Should be from a Variable(). - * @param ms Should be from a Variable(). - * @param mom Should be from a Variable(). + * @param m Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. - * @param rho Decay rate. Must be a scalar. - * @param momentum - * @param epsilon Ridge term. Must be a scalar. + * @param alpha Must be a scalar. + * @param signDecay Must be a scalar. + * @param beta Must be a scalar. * @param grad The gradient. * @param options carries optional attributes values - * @return a new instance of ResourceApplyCenteredRmsProp - * @see org.tensorflow.op.train.ResourceApplyCenteredRmsProp + * @return a new instance of ResourceApplyAddSign + * @see org.tensorflow.op.train.ResourceApplyAddSign */ - public ResourceApplyCenteredRmsProp resourceApplyCenteredRmsProp(Operand var, - Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, - Operand momentum, Operand epsilon, Operand grad, - ResourceApplyCenteredRmsProp.Options... options) { - return ResourceApplyCenteredRmsProp.create(scope, var, mg, ms, mom, lr, rho, momentum, epsilon, grad, options); + public ResourceApplyAddSign resourceApplyAddSign(Operand var, Operand m, + Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, + ResourceApplyAddSign.Options... options) { + return ResourceApplyAddSign.create(scope, var, m, lr, alpha, signDecay, beta, grad, options); } /** - * Builds an {@link SparseApplyAdagradDa} operation + * Builds an {@link SaveSlices} operation * - * @param var Should be from a Variable(). - * @param gradientAccumulator Should be from a Variable(). - * @param gradientSquaredAccumulator Should be from a Variable(). - * @param grad The gradient. - * @param indices A vector of indices into the first dimension of var and accum. - * @param lr Learning rate. Must be a scalar. - * @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 - * @return a new instance of SparseApplyAdagradDa - * @see org.tensorflow.op.train.SparseApplyAdagradDa + * @param filename Must have a single element. The name of the file to which we write the + * @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 data `N` tensors to save. + * @return a new instance of SaveSlices + * @see org.tensorflow.op.train.SaveSlices */ - public SparseApplyAdagradDa sparseApplyAdagradDa(Operand var, - Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, - Operand indices, Operand lr, Operand l1, Operand l2, Operand globalStep, - SparseApplyAdagradDa.Options... options) { - return SparseApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, indices, lr, l1, l2, globalStep, options); + public SaveSlices saveSlices(Operand filename, Operand tensorNames, + Operand shapesAndSlices, Iterable> data) { + return SaveSlices.create(scope, filename, tensorNames, shapesAndSlices, data); + } + + /** + * Builds an {@link Restore} operation + * + * @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. + * @param shapeAndSlices shape {N}. The slice specs of the tensors to be restored. + * @param dtypes shape {N}. The list of expected dtype for the tensors. Must match + * @return a new instance of Restore + * @see org.tensorflow.op.train.Restore + */ + public Restore restore(Operand prefix, Operand tensorNames, + Operand shapeAndSlices, List> dtypes) { + return Restore.create(scope, prefix, tensorNames, shapeAndSlices, dtypes); } /** @@ -633,171 +607,157 @@ public SparseApplyAdagradDa sparseApplyAdagradDa(Operan * @return a new instance of AccumulatorSetGlobalStep * @see org.tensorflow.op.train.AccumulatorSetGlobalStep */ - public AccumulatorSetGlobalStep accumulatorSetGlobalStep(Operand handle, - Operand newGlobalStep) { + public AccumulatorSetGlobalStep accumulatorSetGlobalStep(Operand handle, + Operand newGlobalStep) { return AccumulatorSetGlobalStep.create(scope, handle, newGlobalStep); } /** - * Builds an {@link ResourceSparseApplyFtrl} operation + * Builds an {@link MergeV2Checkpoints} operation * - * @param var Should be from a Variable(). - * @param accum Should be from a Variable(). - * @param linear Should be from a Variable(). - * @param grad The gradient. - * @param indices A vector of indices into the first dimension of var and accum. - * @param lr Scaling factor. Must be a scalar. - * @param l1 L1 regularization. Must be a scalar. - * @param l2 L2 shrinkage regulariation. Must be a scalar. - * @param l2Shrinkage - * @param lrPower Scaling factor. Must be a scalar. + * @param checkpointPrefixes prefixes of V2 checkpoints to merge. + * @param destinationPrefix scalar. The desired final prefix. Allowed to be the same * @param options carries optional attributes values - * @return a new instance of ResourceSparseApplyFtrl - * @see org.tensorflow.op.train.ResourceSparseApplyFtrl + * @return a new instance of MergeV2Checkpoints + * @see org.tensorflow.op.train.MergeV2Checkpoints */ - public ResourceSparseApplyFtrl resourceSparseApplyFtrl(Operand var, - Operand accum, Operand linear, Operand grad, Operand indices, Operand lr, - Operand l1, Operand l2, Operand l2Shrinkage, Operand lrPower, - ResourceSparseApplyFtrl.Options... options) { - return ResourceSparseApplyFtrl.create(scope, var, accum, linear, grad, indices, lr, l1, l2, l2Shrinkage, lrPower, options); + public MergeV2Checkpoints mergeV2Checkpoints(Operand checkpointPrefixes, + Operand destinationPrefix, MergeV2Checkpoints.Options... options) { + return MergeV2Checkpoints.create(scope, checkpointPrefixes, destinationPrefix, options); } /** - * Builds an {@link ApplyFtrl} operation + * Builds an {@link AccumulatorNumAccumulated} operation * - * @param var Should be from a Variable(). - * @param accum Should be from a Variable(). - * @param linear Should be from a Variable(). - * @param grad The gradient. - * @param lr Scaling factor. Must be a scalar. - * @param l1 L1 regulariation. Must be a scalar. - * @param l2 L2 shrinkage regulariation. Must be a scalar. - * @param l2Shrinkage - * @param lrPower Scaling factor. Must be a scalar. - * @param options carries optional attributes values - * @return a new instance of ApplyFtrl - * @see org.tensorflow.op.train.ApplyFtrl + * @param handle The handle to an accumulator. + * @return a new instance of AccumulatorNumAccumulated + * @see org.tensorflow.op.train.AccumulatorNumAccumulated */ - public ApplyFtrl applyFtrl(Operand var, Operand accum, Operand linear, - Operand grad, Operand lr, Operand l1, Operand l2, Operand l2Shrinkage, - Operand lrPower, ApplyFtrl.Options... options) { - return ApplyFtrl.create(scope, var, accum, linear, grad, lr, l1, l2, l2Shrinkage, lrPower, options); + public AccumulatorNumAccumulated accumulatorNumAccumulated(Operand handle) { + return AccumulatorNumAccumulated.create(scope, handle); } /** - * Builds an {@link ResourceApplyMomentum} operation + * Builds an {@link ResourceApplyRmsProp} operation * * @param var Should be from a Variable(). - * @param accum 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 epsilon Ridge term. Must be a scalar. * @param grad The gradient. - * @param momentum Momentum. Must be a scalar. - * @param options carries optional attributes values - * @return a new instance of ResourceApplyMomentum - * @see org.tensorflow.op.train.ResourceApplyMomentum - */ - public ResourceApplyMomentum resourceApplyMomentum(Operand var, Operand accum, - Operand lr, Operand grad, Operand momentum, - ResourceApplyMomentum.Options... options) { - return ResourceApplyMomentum.create(scope, var, accum, lr, grad, momentum, options); - } - - /** - * Builds an {@link RestoreSlice} operation - * - * @param filePattern Must have a single element. The pattern of the files from - * @param tensorName Must have a single element. The name of the tensor to be - * @param shapeAndSlice Scalar. The shapes and slice specifications to use when - * @param dt The type of the tensor to be restored. * @param options carries optional attributes values - * @return a new instance of RestoreSlice - * @see org.tensorflow.op.train.RestoreSlice + * @return a new instance of ResourceApplyRmsProp + * @see org.tensorflow.op.train.ResourceApplyRmsProp */ - public RestoreSlice restoreSlice(Operand filePattern, Operand tensorName, - Operand shapeAndSlice, Class dt, RestoreSlice.Options... options) { - return RestoreSlice.create(scope, filePattern, tensorName, shapeAndSlice, dt, options); + public ResourceApplyRmsProp resourceApplyRmsProp(Operand var, Operand ms, + Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, + Operand grad, ResourceApplyRmsProp.Options... options) { + return ResourceApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, options); } /** - * Builds an {@link ResourceSparseApplyMomentum} operation + * Builds an {@link SparseApplyAdadelta} operation * - * @param var Should be from a Variable(). + * @param var * @param accum Should be from a Variable(). + * @param accumUpdate : Should be from a Variable(). * @param lr Learning rate. Must be a scalar. + * @param rho Decay factor. Must be a scalar. + * @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 momentum Momentum. Must be a scalar. * @param options carries optional attributes values - * @return a new instance of ResourceSparseApplyMomentum - * @see org.tensorflow.op.train.ResourceSparseApplyMomentum + * @return a new instance of SparseApplyAdadelta + * @see org.tensorflow.op.train.SparseApplyAdadelta */ - public ResourceSparseApplyMomentum resourceSparseApplyMomentum( - Operand var, Operand accum, Operand lr, Operand grad, Operand indices, - Operand momentum, ResourceSparseApplyMomentum.Options... options) { - return ResourceSparseApplyMomentum.create(scope, var, accum, lr, grad, indices, momentum, options); + public SparseApplyAdadelta sparseApplyAdadelta( + Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, + Operand epsilon, Operand grad, Operand indices, + SparseApplyAdadelta.Options... options) { + return SparseApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, indices, options); } /** - * Builds an {@link ResourceApplyGradientDescent} operation + * Builds an {@link SparseApplyCenteredRmsProp} operation * * @param var Should be from a Variable(). - * @param alpha Scaling factor. Must be a scalar. - * @param delta The change. + * @param mg 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 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 - * @return a new instance of ResourceApplyGradientDescent - * @see org.tensorflow.op.train.ResourceApplyGradientDescent + * @return a new instance of SparseApplyCenteredRmsProp + * @see org.tensorflow.op.train.SparseApplyCenteredRmsProp */ - public ResourceApplyGradientDescent resourceApplyGradientDescent(Operand var, - Operand alpha, Operand delta, ResourceApplyGradientDescent.Options... options) { - return ResourceApplyGradientDescent.create(scope, var, alpha, delta, options); + public SparseApplyCenteredRmsProp sparseApplyCenteredRmsProp( + Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, + Operand momentum, Operand epsilon, Operand grad, Operand indices, + SparseApplyCenteredRmsProp.Options... options) { + return SparseApplyCenteredRmsProp.create(scope, var, mg, ms, mom, lr, rho, momentum, epsilon, grad, indices, options); } /** - * Builds an {@link AccumulatorNumAccumulated} operation + * Builds an {@link ApplyAdadelta} operation * - * @param handle The handle to an accumulator. - * @return a new instance of AccumulatorNumAccumulated - * @see org.tensorflow.op.train.AccumulatorNumAccumulated + * @param var Should be from a Variable(). + * @param accum Should be from a Variable(). + * @param accumUpdate Should be from a Variable(). + * @param lr Scaling factor. Must be a scalar. + * @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 + * @return a new instance of ApplyAdadelta + * @see org.tensorflow.op.train.ApplyAdadelta */ - public AccumulatorNumAccumulated accumulatorNumAccumulated(Operand handle) { - return AccumulatorNumAccumulated.create(scope, handle); + public ApplyAdadelta applyAdadelta(Operand var, Operand accum, + Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, + ApplyAdadelta.Options... options) { + return ApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, options); } /** - * Builds an {@link PreventGradient} operation + * Builds an {@link TileGrad} operation * - * @param input any tensor. - * @param options carries optional attributes values - * @return a new instance of PreventGradient - * @see org.tensorflow.op.train.PreventGradient + * @param input + * @param multiples + * @return a new instance of TileGrad + * @see org.tensorflow.op.train.TileGrad */ - public PreventGradient preventGradient(Operand input, - PreventGradient.Options... options) { - return PreventGradient.create(scope, input, options); + public TileGrad tileGrad(Operand input, Operand multiples) { + return TileGrad.create(scope, input, multiples); } /** - * Builds an {@link ResourceApplyAdadelta} operation + * Builds an {@link ResourceSparseApplyProximalAdagrad} operation * * @param var Should be from a Variable(). * @param accum Should be from a Variable(). - * @param accumUpdate Should be from a Variable(). - * @param lr Scaling factor. Must be a scalar. - * @param rho Decay factor. Must be a scalar. - * @param epsilon Constant factor. Must be a scalar. + * @param lr Learning rate. Must be a scalar. + * @param l1 L1 regularization. Must be a scalar. + * @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 - * @return a new instance of ResourceApplyAdadelta - * @see org.tensorflow.op.train.ResourceApplyAdadelta + * @return a new instance of ResourceSparseApplyProximalAdagrad + * @see org.tensorflow.op.train.ResourceSparseApplyProximalAdagrad */ - public ResourceApplyAdadelta resourceApplyAdadelta(Operand var, Operand accum, - Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, - ResourceApplyAdadelta.Options... options) { - return ResourceApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, options); + public ResourceSparseApplyProximalAdagrad resourceSparseApplyProximalAdagrad( + Operand var, Operand accum, Operand lr, Operand l1, Operand l2, + Operand grad, Operand indices, ResourceSparseApplyProximalAdagrad.Options... options) { + return ResourceSparseApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, indices, options); } /** - * Builds an {@link ResourceApplyAdagradDa} operation + * Builds an {@link ApplyAdagradDa} operation * * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -808,250 +768,255 @@ public ResourceApplyAdadelta resourceApplyAdadelta(Operand var, Operand ResourceApplyAdagradDa resourceApplyAdagradDa(Operand var, - Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, - Operand lr, Operand l1, Operand l2, Operand globalStep, - ResourceApplyAdagradDa.Options... options) { - return ResourceApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, lr, l1, l2, globalStep, options); + public ApplyAdagradDa applyAdagradDa(Operand var, + Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, + Operand lr, Operand l1, Operand l2, Operand globalStep, + ApplyAdagradDa.Options... options) { + return ApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, lr, l1, l2, globalStep, options); } /** - * Builds an {@link ApplyGradientDescent} operation + * Builds an {@link ResourceSparseApplyMomentum} operation * * @param var Should be from a Variable(). - * @param alpha Scaling factor. Must be a scalar. - * @param delta The change. + * @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 momentum Momentum. Must be a scalar. * @param options carries optional attributes values - * @return a new instance of ApplyGradientDescent - * @see org.tensorflow.op.train.ApplyGradientDescent + * @return a new instance of ResourceSparseApplyMomentum + * @see org.tensorflow.op.train.ResourceSparseApplyMomentum */ - public ApplyGradientDescent applyGradientDescent(Operand var, Operand alpha, - Operand delta, ApplyGradientDescent.Options... options) { - return ApplyGradientDescent.create(scope, var, alpha, delta, options); + public ResourceSparseApplyMomentum resourceSparseApplyMomentum( + Operand var, Operand accum, Operand lr, Operand grad, Operand indices, + Operand momentum, ResourceSparseApplyMomentum.Options... options) { + return ResourceSparseApplyMomentum.create(scope, var, accum, lr, grad, indices, momentum, options); } /** - * Builds an {@link ResourceApplyProximalGradientDescent} operation + * Builds an {@link ResourceApplyProximalAdagrad} operation * * @param var Should be from a Variable(). - * @param alpha Scaling factor. Must be a scalar. + * @param accum Should be from a Variable(). + * @param lr 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 grad The gradient. * @param options carries optional attributes values - * @return a new instance of ResourceApplyProximalGradientDescent - * @see org.tensorflow.op.train.ResourceApplyProximalGradientDescent + * @return a new instance of ResourceApplyProximalAdagrad + * @see org.tensorflow.op.train.ResourceApplyProximalAdagrad */ - public ResourceApplyProximalGradientDescent resourceApplyProximalGradientDescent( - Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, - ResourceApplyProximalGradientDescent.Options... options) { - return ResourceApplyProximalGradientDescent.create(scope, var, alpha, l1, l2, delta, options); + public ResourceApplyProximalAdagrad resourceApplyProximalAdagrad(Operand var, + Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, + ResourceApplyProximalAdagrad.Options... options) { + return ResourceApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, options); } /** - * Builds an {@link ResourceApplyAdam} operation + * Builds an {@link NegTrain} operation * - * @param var Should be from a Variable(). - * @param m Should be from a Variable(). - * @param v Should be from a Variable(). - * @param beta1Power Must be a scalar. - * @param beta2Power Must be a scalar. - * @param lr Scaling factor. Must be a scalar. - * @param beta1 Momentum factor. Must be a scalar. - * @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 - * @return a new instance of ResourceApplyAdam - * @see org.tensorflow.op.train.ResourceApplyAdam + * @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 vocabCount Count of words in the vocabulary. + * @param numNegativeSamples Number of negative samples per example. + * @return a new instance of NegTrain + * @see org.tensorflow.op.train.NegTrain */ - public ResourceApplyAdam resourceApplyAdam(Operand var, Operand m, Operand v, - Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, - Operand beta2, Operand epsilon, Operand grad, ResourceApplyAdam.Options... options) { - return ResourceApplyAdam.create(scope, var, m, v, beta1Power, beta2Power, lr, beta1, beta2, epsilon, grad, options); + public NegTrain negTrain(Operand wIn, Operand wOut, Operand examples, + Operand labels, Operand lr, List vocabCount, Long numNegativeSamples) { + return NegTrain.create(scope, wIn, wOut, examples, labels, lr, vocabCount, numNegativeSamples); } /** - * Builds an {@link SdcaFprint} operation + * Builds an {@link SdcaShrinkL1} operation * - * @param input vector of strings to compute fingerprints on. - * @return a new instance of SdcaFprint - * @see org.tensorflow.op.train.SdcaFprint + * @param weights a list of vectors where each value is the weight associated with a + * @param l1 Symmetric l1 regularization strength. + * @param l2 Symmetric l2 regularization strength. Should be a positive float. + * @return a new instance of SdcaShrinkL1 + * @see org.tensorflow.op.train.SdcaShrinkL1 */ - public SdcaFprint sdcaFprint(Operand input) { - return SdcaFprint.create(scope, input); + public SdcaShrinkL1 sdcaShrinkL1(Iterable> weights, Float l1, Float l2) { + return SdcaShrinkL1.create(scope, weights, l1, l2); } /** - * Builds an {@link ResourceSparseApplyProximalAdagrad} operation + * Builds an {@link ConditionalAccumulator} operation * - * @param var Should be from a Variable(). - * @param accum Should be from a Variable(). - * @param lr Learning rate. Must be a scalar. - * @param l1 L1 regularization. Must be a scalar. - * @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 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 - * @return a new instance of ResourceSparseApplyProximalAdagrad - * @see org.tensorflow.op.train.ResourceSparseApplyProximalAdagrad + * @return a new instance of ConditionalAccumulator + * @see org.tensorflow.op.train.ConditionalAccumulator */ - public ResourceSparseApplyProximalAdagrad resourceSparseApplyProximalAdagrad( - Operand var, Operand accum, Operand lr, Operand l1, Operand l2, - Operand grad, Operand indices, ResourceSparseApplyProximalAdagrad.Options... options) { - return ResourceSparseApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, indices, options); + public ConditionalAccumulator conditionalAccumulator(DataType dtype, + Shape shape, ConditionalAccumulator.Options... options) { + return ConditionalAccumulator.create(scope, dtype, shape, options); } /** - * Builds an {@link ResourceSparseApplyProximalGradientDescent} operation + * Builds an {@link SparseApplyProximalAdagrad} operation * * @param var Should be from a Variable(). - * @param alpha Scaling factor. Must be a scalar. + * @param accum Should be from a Variable(). + * @param lr Learning rate. Must be a scalar. * @param l1 L1 regularization. Must be a scalar. * @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 - * @return a new instance of ResourceSparseApplyProximalGradientDescent - * @see org.tensorflow.op.train.ResourceSparseApplyProximalGradientDescent + * @return a new instance of SparseApplyProximalAdagrad + * @see org.tensorflow.op.train.SparseApplyProximalAdagrad */ - public ResourceSparseApplyProximalGradientDescent resourceSparseApplyProximalGradientDescent( - Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, - Operand indices, ResourceSparseApplyProximalGradientDescent.Options... options) { - return ResourceSparseApplyProximalGradientDescent.create(scope, var, alpha, l1, l2, grad, indices, options); + public SparseApplyProximalAdagrad sparseApplyProximalAdagrad( + Operand var, Operand accum, Operand lr, Operand l1, Operand l2, + Operand grad, Operand indices, SparseApplyProximalAdagrad.Options... options) { + return SparseApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, indices, options); } /** - * Builds an {@link ApplyRmsProp} operation + * Builds an {@link ApplyAdam} operation * * @param var Should be from a Variable(). - * @param ms Should be from a Variable(). - * @param mom Should be from a Variable(). + * @param m Should be from a Variable(). + * @param v Should be from a Variable(). + * @param beta1Power Must be a scalar. + * @param beta2Power Must be a scalar. * @param lr Scaling factor. Must be a scalar. - * @param rho Decay rate. Must be a scalar. - * @param momentum + * @param beta1 Momentum factor. Must be a scalar. + * @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 - * @return a new instance of ApplyRmsProp - * @see org.tensorflow.op.train.ApplyRmsProp + * @param options carries optional attributes values + * @return a new instance of ApplyAdam + * @see org.tensorflow.op.train.ApplyAdam */ - public ApplyRmsProp applyRmsProp(Operand var, Operand ms, Operand mom, - Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, - ApplyRmsProp.Options... options) { - return ApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, options); + public ApplyAdam applyAdam(Operand var, Operand m, Operand v, + Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, + Operand beta2, Operand epsilon, Operand grad, ApplyAdam.Options... options) { + return ApplyAdam.create(scope, var, m, v, beta1Power, beta2Power, lr, beta1, beta2, epsilon, grad, options); } /** - * Builds an {@link GenerateVocabRemapping} operation + * Builds an {@link ResourceApplyAdagrad} operation * - * @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 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 - * @return a new instance of GenerateVocabRemapping - * @see org.tensorflow.op.train.GenerateVocabRemapping + * @return a new instance of ResourceApplyAdagrad + * @see org.tensorflow.op.train.ResourceApplyAdagrad */ - public GenerateVocabRemapping generateVocabRemapping(Operand newVocabFile, - Operand oldVocabFile, Long newVocabOffset, Long numNewVocab, - GenerateVocabRemapping.Options... options) { - return GenerateVocabRemapping.create(scope, newVocabFile, oldVocabFile, newVocabOffset, numNewVocab, options); + public ResourceApplyAdagrad resourceApplyAdagrad(Operand var, + Operand accum, Operand lr, Operand grad, ResourceApplyAdagrad.Options... options) { + return ResourceApplyAdagrad.create(scope, var, accum, lr, grad, options); } /** - * Builds an {@link SparseApplyAdadelta} operation + * Builds an {@link ApplyProximalAdagrad} operation * - * @param var + * @param var Should be from a Variable(). * @param accum Should be from a Variable(). - * @param accumUpdate : Should be from a Variable(). - * @param lr Learning rate. Must be a scalar. - * @param rho Decay factor. Must be a scalar. - * @param epsilon Constant factor. Must be a scalar. + * @param lr Scaling factor. Must be a scalar. + * @param l1 L1 regularization. Must be a scalar. + * @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 - * @return a new instance of SparseApplyAdadelta - * @see org.tensorflow.op.train.SparseApplyAdadelta + * @return a new instance of ApplyProximalAdagrad + * @see org.tensorflow.op.train.ApplyProximalAdagrad */ - public SparseApplyAdadelta sparseApplyAdadelta(Operand var, - Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, - Operand grad, Operand indices, SparseApplyAdadelta.Options... options) { - return SparseApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, indices, options); + public ApplyProximalAdagrad applyProximalAdagrad(Operand var, + Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, + ApplyProximalAdagrad.Options... options) { + return ApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, options); } /** - * Builds an {@link ResourceApplyProximalAdagrad} operation + * Builds an {@link ResourceApplyAdam} operation * * @param var Should be from a Variable(). - * @param accum Should be from a Variable(). + * @param m Should be from a Variable(). + * @param v Should be from a Variable(). + * @param beta1Power Must be a scalar. + * @param beta2Power Must be a scalar. * @param lr Scaling factor. Must be a scalar. - * @param l1 L1 regularization. Must be a scalar. - * @param l2 L2 regularization. Must be a scalar. + * @param beta1 Momentum factor. Must be a scalar. + * @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 - * @return a new instance of ResourceApplyProximalAdagrad - * @see org.tensorflow.op.train.ResourceApplyProximalAdagrad + * @return a new instance of ResourceApplyAdam + * @see org.tensorflow.op.train.ResourceApplyAdam */ - public ResourceApplyProximalAdagrad resourceApplyProximalAdagrad(Operand var, - Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, - ResourceApplyProximalAdagrad.Options... options) { - return ResourceApplyProximalAdagrad.create(scope, var, accum, lr, l1, l2, grad, options); + public ResourceApplyAdam resourceApplyAdam(Operand var, Operand m, + Operand v, Operand beta1Power, Operand beta2Power, Operand lr, Operand beta1, + Operand beta2, Operand epsilon, Operand grad, ResourceApplyAdam.Options... options) { + return ResourceApplyAdam.create(scope, var, m, v, beta1Power, beta2Power, lr, beta1, beta2, epsilon, grad, options); } /** - * Builds an {@link ConditionalAccumulator} operation + * Builds an {@link ResourceSparseApplyProximalGradientDescent} operation * - * @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 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 grad The gradient. + * @param indices A vector of indices into the first dimension of var and accum. * @param options carries optional attributes values - * @return a new instance of ConditionalAccumulator - * @see org.tensorflow.op.train.ConditionalAccumulator + * @return a new instance of ResourceSparseApplyProximalGradientDescent + * @see org.tensorflow.op.train.ResourceSparseApplyProximalGradientDescent */ - public ConditionalAccumulator conditionalAccumulator(Class dtype, Shape shape, - ConditionalAccumulator.Options... options) { - return ConditionalAccumulator.create(scope, dtype, shape, options); + public ResourceSparseApplyProximalGradientDescent resourceSparseApplyProximalGradientDescent( + Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, + Operand indices, ResourceSparseApplyProximalGradientDescent.Options... options) { + return ResourceSparseApplyProximalGradientDescent.create(scope, var, alpha, l1, l2, grad, indices, options); } /** - * Builds an {@link ResourceApplyPowerSign} operation + * Builds an {@link ResourceApplyAdadelta} operation * * @param var Should be from a Variable(). - * @param m Should be from a Variable(). + * @param accum Should be from a Variable(). + * @param accumUpdate Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. - * @param logbase Must be a scalar. - * @param signDecay Must be a scalar. - * @param beta Must be a scalar. + * @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 - * @return a new instance of ResourceApplyPowerSign - * @see org.tensorflow.op.train.ResourceApplyPowerSign + * @return a new instance of ResourceApplyAdadelta + * @see org.tensorflow.op.train.ResourceApplyAdadelta */ - public ResourceApplyPowerSign resourceApplyPowerSign(Operand var, Operand m, - Operand lr, Operand logbase, Operand signDecay, Operand beta, Operand grad, - ResourceApplyPowerSign.Options... options) { - return ResourceApplyPowerSign.create(scope, var, m, lr, logbase, signDecay, beta, grad, options); + public ResourceApplyAdadelta resourceApplyAdadelta(Operand var, + Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, + Operand grad, ResourceApplyAdadelta.Options... options) { + return ResourceApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, options); } /** - * Builds an {@link ApplyProximalGradientDescent} operation + * Builds an {@link ResourceApplyMomentum} operation * * @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 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 - * @return a new instance of ApplyProximalGradientDescent - * @see org.tensorflow.op.train.ApplyProximalGradientDescent + * @return a new instance of ResourceApplyMomentum + * @see org.tensorflow.op.train.ResourceApplyMomentum */ - public ApplyProximalGradientDescent applyProximalGradientDescent(Operand var, - Operand alpha, Operand l1, Operand l2, Operand delta, - ApplyProximalGradientDescent.Options... options) { - return ApplyProximalGradientDescent.create(scope, var, alpha, l1, l2, delta, options); + public ResourceApplyMomentum resourceApplyMomentum(Operand var, + Operand accum, Operand lr, Operand grad, Operand momentum, + ResourceApplyMomentum.Options... options) { + return ResourceApplyMomentum.create(scope, var, accum, lr, grad, momentum, options); } /** @@ -1071,7 +1036,7 @@ public ApplyProximalGradientDescent applyProximalGradientDescent(Operand< * @return a new instance of ResourceSparseApplyCenteredRmsProp * @see org.tensorflow.op.train.ResourceSparseApplyCenteredRmsProp */ - public ResourceSparseApplyCenteredRmsProp resourceSparseApplyCenteredRmsProp( + public ResourceSparseApplyCenteredRmsProp resourceSparseApplyCenteredRmsProp( Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, ResourceSparseApplyCenteredRmsProp.Options... options) { @@ -1079,34 +1044,40 @@ public ResourceSparseApplyCenteredRmsProp resourceSparseAp } /** - * Builds an {@link SparseApplyFtrl} operation + * Builds an {@link ApplyAddSign} operation * * @param var Should be from a Variable(). - * @param accum Should be from a Variable(). - * @param linear Should be from a Variable(). - * @param grad The gradient. - * @param indices A vector of indices into the first dimension of var and accum. + * @param m Should be from a Variable(). * @param lr Scaling factor. Must be a scalar. - * @param l1 L1 regularization. Must be a scalar. - * @param l2 L2 shrinkage regulariation. Must be a scalar. - * @param l2Shrinkage - * @param lrPower Scaling factor. Must be a scalar. + * @param alpha Must be a scalar. + * @param signDecay Must be a scalar. + * @param beta Must be a scalar. + * @param grad The gradient. * @param options carries optional attributes values - * @return a new instance of SparseApplyFtrl - * @see org.tensorflow.op.train.SparseApplyFtrl + * @return a new instance of ApplyAddSign + * @see org.tensorflow.op.train.ApplyAddSign */ - public SparseApplyFtrl sparseApplyFtrl(Operand var, Operand accum, - Operand linear, Operand grad, Operand indices, Operand lr, Operand l1, - Operand l2, Operand l2Shrinkage, Operand lrPower, - SparseApplyFtrl.Options... options) { - return SparseApplyFtrl.create(scope, var, accum, linear, grad, indices, lr, l1, l2, l2Shrinkage, lrPower, options); + public ApplyAddSign applyAddSign(Operand var, Operand m, Operand lr, + Operand alpha, Operand signDecay, Operand beta, Operand grad, + ApplyAddSign.Options... options) { + return ApplyAddSign.create(scope, var, m, lr, alpha, signDecay, beta, grad, options); } /** - * Builds an {@link SparseApplyCenteredRmsProp} operation + * Builds an {@link SdcaFprint} operation + * + * @param input vector of strings to compute fingerprints on. + * @return a new instance of SdcaFprint + * @see org.tensorflow.op.train.SdcaFprint + */ + public SdcaFprint sdcaFprint(Operand input) { + return SdcaFprint.create(scope, input); + } + + /** + * Builds an {@link ResourceSparseApplyRmsProp} operation * * @param var Should be from a Variable(). - * @param mg 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. @@ -1116,32 +1087,35 @@ public SparseApplyFtrl sparseApplyFtrl(Operand var, * @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 - * @return a new instance of SparseApplyCenteredRmsProp - * @see org.tensorflow.op.train.SparseApplyCenteredRmsProp + * @return a new instance of ResourceSparseApplyRmsProp + * @see org.tensorflow.op.train.ResourceSparseApplyRmsProp */ - public SparseApplyCenteredRmsProp sparseApplyCenteredRmsProp( - Operand var, Operand mg, Operand ms, Operand mom, Operand lr, Operand rho, + public ResourceSparseApplyRmsProp resourceSparseApplyRmsProp( + Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Operand indices, - SparseApplyCenteredRmsProp.Options... options) { - return SparseApplyCenteredRmsProp.create(scope, var, mg, ms, mom, lr, rho, momentum, epsilon, grad, indices, options); + ResourceSparseApplyRmsProp.Options... options) { + return ResourceSparseApplyRmsProp.create(scope, var, ms, mom, lr, rho, momentum, epsilon, grad, indices, options); } /** - * Builds an {@link MergeV2Checkpoints} operation + * Builds an {@link ApplyMomentum} operation * - * @param checkpointPrefixes prefixes of V2 checkpoints to merge. - * @param destinationPrefix scalar. The desired final prefix. Allowed to be the same + * @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 - * @return a new instance of MergeV2Checkpoints - * @see org.tensorflow.op.train.MergeV2Checkpoints + * @return a new instance of ApplyMomentum + * @see org.tensorflow.op.train.ApplyMomentum */ - public MergeV2Checkpoints mergeV2Checkpoints(Operand checkpointPrefixes, - Operand destinationPrefix, MergeV2Checkpoints.Options... options) { - return MergeV2Checkpoints.create(scope, checkpointPrefixes, destinationPrefix, options); + public ApplyMomentum applyMomentum(Operand var, Operand accum, + Operand lr, Operand grad, Operand momentum, ApplyMomentum.Options... options) { + return ApplyMomentum.create(scope, var, accum, lr, grad, momentum, options); } /** - * Builds an {@link ApplyAdagradDa} operation + * Builds an {@link ResourceApplyAdagradDa} operation * * @param var Should be from a Variable(). * @param gradientAccumulator Should be from a Variable(). @@ -1152,46 +1126,83 @@ public MergeV2Checkpoints mergeV2Checkpoints(Operand checkpointPrefixes, * @param l2 L2 regularization. Must be a scalar. * @param globalStep Training step number. Must be a scalar. * @param options carries optional attributes values - * @return a new instance of ApplyAdagradDa - * @see org.tensorflow.op.train.ApplyAdagradDa + * @return a new instance of ResourceApplyAdagradDa + * @see org.tensorflow.op.train.ResourceApplyAdagradDa */ - public ApplyAdagradDa applyAdagradDa(Operand var, Operand gradientAccumulator, - Operand gradientSquaredAccumulator, Operand grad, Operand lr, Operand l1, - Operand l2, Operand globalStep, ApplyAdagradDa.Options... options) { - return ApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, lr, l1, l2, globalStep, options); + public ResourceApplyAdagradDa resourceApplyAdagradDa(Operand var, + Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, + Operand lr, Operand l1, Operand l2, Operand globalStep, + ResourceApplyAdagradDa.Options... options) { + return ResourceApplyAdagradDa.create(scope, var, gradientAccumulator, gradientSquaredAccumulator, grad, lr, l1, l2, globalStep, options); } /** - * Builds an {@link TileGrad} operation + * Builds an {@link SparseApplyMomentum} operation * - * @param input - * @param multiples - * @return a new instance of TileGrad - * @see org.tensorflow.op.train.TileGrad + * @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 momentum Momentum. Must be a scalar. + * @param options carries optional attributes values + * @return a new instance of SparseApplyMomentum + * @see org.tensorflow.op.train.SparseApplyMomentum */ - public TileGrad tileGrad(Operand input, Operand multiples) { - return TileGrad.create(scope, input, multiples); + public SparseApplyMomentum sparseApplyMomentum( + Operand var, Operand accum, Operand lr, Operand grad, Operand indices, + Operand momentum, SparseApplyMomentum.Options... options) { + return SparseApplyMomentum.create(scope, var, accum, lr, grad, indices, momentum, options); } /** - * Builds an {@link ApplyCenteredRmsProp} operation + * Builds an {@link AccumulatorTakeGradient} operation * - * @param var Should be from a Variable(). - * @param mg 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 epsilon Ridge term. Must be a scalar. + * @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 + * @return a new instance of AccumulatorTakeGradient + * @see org.tensorflow.op.train.AccumulatorTakeGradient + */ + public AccumulatorTakeGradient accumulatorTakeGradient( + Operand handle, Operand numRequired, DataType dtype) { + return AccumulatorTakeGradient.create(scope, handle, numRequired, dtype); + } + + /** + * Builds an {@link ResourceSparseApplyAdadelta} operation + * + * @param var + * @param accum Should be from a Variable(). + * @param accumUpdate : Should be from a Variable(). + * @param lr Learning rate. Must be a scalar. + * @param rho Decay factor. Must be a scalar. + * @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 - * @return a new instance of ApplyCenteredRmsProp - * @see org.tensorflow.op.train.ApplyCenteredRmsProp + * @return a new instance of ResourceSparseApplyAdadelta + * @see org.tensorflow.op.train.ResourceSparseApplyAdadelta */ - public ApplyCenteredRmsProp applyCenteredRmsProp(Operand var, Operand mg, - Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, - Operand epsilon, Operand grad, ApplyCenteredRmsProp.Options... options) { - return ApplyCenteredRmsProp.create(scope, var, mg, ms, mom, lr, rho, momentum, epsilon, grad, options); + public ResourceSparseApplyAdadelta resourceSparseApplyAdadelta( + Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, + Operand epsilon, Operand grad, Operand indices, + ResourceSparseApplyAdadelta.Options... options) { + return ResourceSparseApplyAdadelta.create(scope, var, accum, accumUpdate, lr, rho, epsilon, grad, indices, options); + } + + /** + * Builds an {@link ApplyGradientDescent} operation + * + * @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 + * @return a new instance of ApplyGradientDescent + * @see org.tensorflow.op.train.ApplyGradientDescent + */ + public ApplyGradientDescent applyGradientDescent(Operand var, + Operand alpha, Operand delta, ApplyGradientDescent.Options... options) { + return ApplyGradientDescent.create(scope, var, alpha, delta, options); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Compute_func_Pointer_TF_OpKernelContext.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Compute_func_Pointer_TF_OpKernelContext.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Compute_func_Pointer_TF_OpKernelContext.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Compute_func_Pointer_TF_OpKernelContext.java index 00cdd257eee..3cb38cf2581 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Compute_func_Pointer_TF_OpKernelContext.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Compute_func_Pointer_TF_OpKernelContext.java @@ -1,14 +1,14 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class Compute_func_Pointer_TF_OpKernelContext extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Create_func_TF_OpKernelConstruction.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Create_func_TF_OpKernelConstruction.java similarity index 91% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Create_func_TF_OpKernelConstruction.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Create_func_TF_OpKernelConstruction.java index b36f6f488b0..7d9cf68a96e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Create_func_TF_OpKernelConstruction.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Create_func_TF_OpKernelConstruction.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Allocates a new kernel builder and returns a pointer to it. @@ -37,7 +37,7 @@ // TF_RegisterKernelBuilder, which will take ownership of the pointer. If, for // some reason, the kernel builder will not be registered, the caller should // delete it with TF_DeleteKernelBuilder. -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class Create_func_TF_OpKernelConstruction extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Deallocator_Pointer_long_Pointer.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Deallocator_Pointer_long_Pointer.java similarity index 85% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Deallocator_Pointer_long_Pointer.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Deallocator_Pointer_long_Pointer.java index 30f542407da..8ea3a0c7821 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Deallocator_Pointer_long_Pointer.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Deallocator_Pointer_long_Pointer.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Return a new tensor that holds the bytes data[0,len-1]. @@ -19,7 +19,7 @@ // May return NULL (and invoke the deallocator) if the provided data buffer // (data, len) is inconsistent with a tensor of the given TF_DataType // and the shape specified by (dima, num_dims). -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class Deallocator_Pointer_long_Pointer extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Delete_func_Pointer.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Delete_func_Pointer.java similarity index 73% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Delete_func_Pointer.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Delete_func_Pointer.java index e19765c5be1..89a99f2c207 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Delete_func_Pointer.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Delete_func_Pointer.java @@ -1,14 +1,14 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class Delete_func_Pointer extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Listener_BytePointer.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_BytePointer.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Listener_BytePointer.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_BytePointer.java index 126bd63508b..5ae62d2d60a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Listener_BytePointer.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_BytePointer.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Register a listener method that processes printed messages. @@ -14,7 +14,7 @@ // If any listeners are registered, the print operator will call all listeners // with the printed messages and immediately return without writing to the // logs. -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class Listener_BytePointer extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Listener_String.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_String.java similarity index 73% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Listener_String.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_String.java index 5f0924e8a04..853fff48998 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Listener_String.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Listener_String.java @@ -1,14 +1,14 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class Listener_String extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java index dee746680a1..3aa62142056 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Shape_inference_func_TF_ShapeInferenceContext_TF_Status.java @@ -1,16 +1,16 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Sets the shape inference function for the op. -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class Shape_inference_func_TF_ShapeInferenceContext_TF_Status extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_Context.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Context.java similarity index 81% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_Context.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Context.java index f0ec95e0916..98495f38704 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_Context.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Context.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // "Context" under which operations/functions are executed. It encapsulates @@ -16,7 +16,7 @@ // been deleted (with TFE_DeleteTensorHandle). // // TODO(ashankar): Merge with TF_Session? -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TFE_Context extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TFE_Context() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_ContextOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_ContextOptions.java similarity index 71% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_ContextOptions.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_ContextOptions.java index 2d14cb174c9..608920913db 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_ContextOptions.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_ContextOptions.java @@ -1,16 +1,16 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // #endif -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TFE_ContextOptions extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TFE_ContextOptions() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_Op.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Op.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_Op.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Op.java index 71746288ce1..4ae1f8aac15 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_Op.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_Op.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Description of the TensorFlow op to execute. @@ -20,7 +20,7 @@ // (2) TF_ColocateWith, TF_AddControlInput etc. do not make sense. // (3) Implementation detail: Avoid use of NodeBuilder/NodeDefBuilder since // the additional sanity checks there seem unnecessary; -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TFE_Op extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TFE_Op() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_TensorDebugInfo.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorDebugInfo.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_TensorDebugInfo.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorDebugInfo.java index 6d416a2049e..af4423e5017 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_TensorDebugInfo.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorDebugInfo.java @@ -1,19 +1,19 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Debugging/Profiling information for TFE_TensorHandle // // TFE_TensorDebugInfo contains information useful for debugging and // profiling tensors. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TFE_TensorDebugInfo extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TFE_TensorDebugInfo() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_TensorHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorHandle.java similarity index 79% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_TensorHandle.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorHandle.java index eb9f0807d0f..c06f444f784 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TFE_TensorHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFE_TensorHandle.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // A handle to a tensor on a device. @@ -14,7 +14,7 @@ // Like a TF_Tensor, a TFE_TensorHandle refers to a tensor with a value, shape, // type etc. Unlike a TF_Tensor, a TFE_TensorHandle may refer to such tensors // placed in memory of different devices or remote address spaces. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TFE_TensorHandle extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TFE_TensorHandle() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ApiDefMap.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ApiDefMap.java similarity index 82% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ApiDefMap.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ApiDefMap.java index b44d0bcf86a..aa660609bbb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ApiDefMap.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ApiDefMap.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // TF_ApiDefMap encapsulates a collection of API definitions for an operation. @@ -17,7 +17,7 @@ // // The ApiDef messages are typically used to generate convenience wrapper // functions for TensorFlow operations in various language bindings. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_ApiDefMap extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_ApiDefMap() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_AttrMetadata.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AttrMetadata.java similarity index 92% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_AttrMetadata.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AttrMetadata.java index 4a6f9127d6d..ad10acf2fe3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_AttrMetadata.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_AttrMetadata.java @@ -1,16 +1,16 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // TF_AttrMetadata describes the value of an attribute on an operation. -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_AttrMetadata extends Pointer { static { Loader.load(); } /** Default native constructor. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Buffer.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Buffer.java similarity index 88% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Buffer.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Buffer.java index b091dff3712..03c1fd073f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Buffer.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Buffer.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // -------------------------------------------------------------------------- @@ -17,8 +17,8 @@ // By default, TF_Buffer itself does not do any memory management of the // pointed-to block. If need be, users of this struct should specify how to // deallocate the block by setting the `data_deallocator` function pointer. -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) -public class TF_Buffer extends org.tensorflow.c_api.AbstractTF_Buffer { +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_Buffer extends org.tensorflow.internal.c_api.AbstractTF_Buffer { static { Loader.load(); } /** Default native constructor. */ public TF_Buffer() { super((Pointer)null); allocate(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_DeprecatedSession.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeprecatedSession.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_DeprecatedSession.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeprecatedSession.java index 135364f6647..71b93fe248e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_DeprecatedSession.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeprecatedSession.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // -------------------------------------------------------------------------- @@ -14,7 +14,7 @@ // TF_ExtendGraph(). This deprecated API can be removed at any time without // notice. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_DeprecatedSession extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_DeprecatedSession() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_DeviceList.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeviceList.java similarity index 70% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_DeviceList.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeviceList.java index 61a95ccdee9..5ade2133666 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_DeviceList.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DeviceList.java @@ -1,15 +1,15 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_DeviceList extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_DeviceList() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_DimensionHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DimensionHandle.java similarity index 71% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_DimensionHandle.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DimensionHandle.java index 7cb8ff0fcd3..afa0eeef73d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_DimensionHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_DimensionHandle.java @@ -1,16 +1,16 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // #endif -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_DimensionHandle extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_DimensionHandle() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Function.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Function.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Function.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Function.java index 89423c1da31..fac9f020704 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Function.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Function.java @@ -1,18 +1,18 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // TF_Function is a grouping of operations with defined inputs and outputs. // Once created and added to graphs, functions can be invoked by creating an // operation whose operation type matches the function name. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_Function extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Function() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_FunctionOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_FunctionOptions.java similarity index 73% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_FunctionOptions.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_FunctionOptions.java index 4005db8ea6f..0b88b031a12 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_FunctionOptions.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_FunctionOptions.java @@ -1,16 +1,16 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Function definition options. TODO(iga): Define and implement -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_FunctionOptions extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_FunctionOptions() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Graph.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Graph.java similarity index 73% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Graph.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Graph.java index 1ed1bd83735..7cbab9c65a8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Graph.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Graph.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // TODO(jeff,sanjay): @@ -17,8 +17,8 @@ // Represents a computation graph. Graphs may be shared between sessions. // Graphs are thread-safe when used as directed below. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) -public class TF_Graph extends org.tensorflow.c_api.AbstractTF_Graph { +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_Graph extends org.tensorflow.internal.c_api.AbstractTF_Graph { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Graph() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ImportGraphDefOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefOptions.java similarity index 63% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ImportGraphDefOptions.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefOptions.java index 3ced996c971..55a0c0e756b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ImportGraphDefOptions.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefOptions.java @@ -1,18 +1,18 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // TF_ImportGraphDefOptions holds options that can be passed to // TF_GraphImportGraphDef. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) -public class TF_ImportGraphDefOptions extends org.tensorflow.c_api.AbstractTF_ImportGraphDefOptions { +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_ImportGraphDefOptions extends org.tensorflow.internal.c_api.AbstractTF_ImportGraphDefOptions { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_ImportGraphDefOptions() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ImportGraphDefResults.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefResults.java similarity index 75% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ImportGraphDefResults.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefResults.java index 5a64982d866..15554488087 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ImportGraphDefResults.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ImportGraphDefResults.java @@ -1,17 +1,17 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // TF_ImportGraphDefResults holds results that are generated by // TF_GraphImportGraphDefWithResults(). -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_ImportGraphDefResults extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_ImportGraphDefResults() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Input.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Input.java similarity index 85% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Input.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Input.java index 2e1782d7fd6..cc6b37b1659 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Input.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Input.java @@ -1,16 +1,16 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Represents a specific input of an operation. -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_Input extends Pointer { static { Loader.load(); } /** Default native constructor. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_KernelBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_KernelBuilder.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_KernelBuilder.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_KernelBuilder.java index 3932251835a..397fa3a417a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_KernelBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_KernelBuilder.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // -------------------------------------------------------------------------- @@ -22,7 +22,7 @@ // `TF_RegisterKernelBuilder`, which will allow TF to construct user-provided // kernels when necessary. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_KernelBuilder extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_KernelBuilder() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Library.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Library.java similarity index 77% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Library.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Library.java index 48919a8fda1..d367aa20126 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Library.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Library.java @@ -1,19 +1,19 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // -------------------------------------------------------------------------- // Load plugins containing custom ops and kernels // TF_Library holds information about dynamically loaded TensorFlow plugins. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_Library extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Library() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OpDefinitionBuilder.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpDefinitionBuilder.java similarity index 71% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OpDefinitionBuilder.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpDefinitionBuilder.java index 184cd487f26..7f708de3f24 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OpDefinitionBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpDefinitionBuilder.java @@ -1,14 +1,14 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_OpDefinitionBuilder extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_OpDefinitionBuilder() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OpKernelConstruction.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelConstruction.java similarity index 71% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OpKernelConstruction.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelConstruction.java index b9b393859fd..86b1b5f5665 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OpKernelConstruction.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelConstruction.java @@ -1,14 +1,14 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_OpKernelConstruction extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_OpKernelConstruction() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OpKernelContext.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelContext.java similarity index 71% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OpKernelContext.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelContext.java index fbfa2527a67..1aceaf9edce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OpKernelContext.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OpKernelContext.java @@ -1,14 +1,14 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_OpKernelContext extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_OpKernelContext() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Operation.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Operation.java similarity index 76% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Operation.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Operation.java index 4ea255b423d..df5c028da80 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Operation.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Operation.java @@ -1,18 +1,18 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Operation that has been added to the graph. Valid until the graph is // deleted -- in particular adding a new operation to the graph does not // invalidate old TF_Operation* pointers. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_Operation extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Operation() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OperationDescription.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OperationDescription.java similarity index 74% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OperationDescription.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OperationDescription.java index 04f526bab77..8757cf6ee75 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_OperationDescription.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_OperationDescription.java @@ -1,16 +1,16 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Operation being built. The underlying graph must outlive this. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_OperationDescription extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_OperationDescription() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Output.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Output.java similarity index 85% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Output.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Output.java index 3efb91eb7cd..5fb11c29fd1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Output.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Output.java @@ -1,16 +1,16 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // Represents a specific output of an operation. -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_Output extends Pointer { static { Loader.load(); } /** Default native constructor. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Server.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Server.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Server.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Server.java index 00221c91734..84d8725d866 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Server.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Server.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // -------------------------------------------------------------------------- @@ -18,7 +18,7 @@ // cluster. // In-process TensorFlow server. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_Server extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Server() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Session.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Session.java similarity index 68% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Session.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Session.java index a85038a5670..96fd0ba13c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Session.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Session.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // TODO(josh11b): Register OpDef, available to all operations added @@ -15,8 +15,8 @@ // -------------------------------------------------------------------------- // API for driving Graph execution. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) -public class TF_Session extends org.tensorflow.c_api.AbstractTF_Session { +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_Session extends org.tensorflow.internal.c_api.AbstractTF_Session { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Session() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_SessionOptions.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_SessionOptions.java similarity index 66% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_SessionOptions.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_SessionOptions.java index ae7d7d48bf9..3d0eff0c2d2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_SessionOptions.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_SessionOptions.java @@ -1,18 +1,18 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // -------------------------------------------------------------------------- // TF_SessionOptions holds options that can be passed during session creation. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) -public class TF_SessionOptions extends org.tensorflow.c_api.AbstractTF_SessionOptions { +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_SessionOptions extends org.tensorflow.internal.c_api.AbstractTF_SessionOptions { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_SessionOptions() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ShapeHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeHandle.java similarity index 70% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ShapeHandle.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeHandle.java index 5c69f582182..be32e10bfe4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ShapeHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeHandle.java @@ -1,14 +1,14 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_ShapeHandle extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_ShapeHandle() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ShapeInferenceContext.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeInferenceContext.java similarity index 71% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ShapeInferenceContext.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeInferenceContext.java index 89c90706c56..9f5a95fd889 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_ShapeInferenceContext.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_ShapeInferenceContext.java @@ -1,14 +1,14 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_ShapeInferenceContext extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_ShapeInferenceContext() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Status.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Status.java similarity index 60% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Status.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Status.java index cfa727ed7ff..b3fcf5356f3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Status.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Status.java @@ -1,17 +1,17 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // #endif -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) -public class TF_Status extends org.tensorflow.c_api.AbstractTF_Status { +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_Status extends org.tensorflow.internal.c_api.AbstractTF_Status { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Status() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Tensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java similarity index 80% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Tensor.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java index e558ef6967e..31e44123c2c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_Tensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_Tensor.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; // #endif @@ -27,8 +27,8 @@ // is encoded at data[start_offset[i]]]. TF_StringEncode and TF_StringDecode // facilitate this encoding. -@Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) -public class TF_Tensor extends org.tensorflow.c_api.AbstractTF_Tensor { +@Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) +public class TF_Tensor extends org.tensorflow.internal.c_api.AbstractTF_Tensor { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public TF_Tensor() { super((Pointer)null); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_WhileParams.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_WhileParams.java similarity index 88% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_WhileParams.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_WhileParams.java index 8282de2d75e..d531226a7be 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/TF_WhileParams.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TF_WhileParams.java @@ -1,15 +1,15 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class TF_WhileParams extends Pointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Tensor.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Tensor.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Tensor.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Tensor.java index 96c523c9030..84ff8778b02 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/Tensor.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/Tensor.java @@ -1,12 +1,12 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -import static org.tensorflow.c_api.global.tensorflow.*; +import static org.tensorflow.internal.c_api.global.tensorflow.*; /* end extern "C" */ // #endif @@ -16,7 +16,7 @@ // // TODO(ashankar): Figure out an alternative scheme that precludes the need for // these API-boundary breaking methods. -@Namespace("tensorflow") @Opaque @Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Namespace("tensorflow") @Opaque @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public class Tensor extends Pointer { /** Empty constructor. Calls {@code super((Pointer)null)}. */ public Tensor() { super((Pointer)null); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/global/tensorflow.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java similarity index 99% rename from tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/global/tensorflow.java rename to tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java index 1b29fe5f693..402032162c4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/c_api/global/tensorflow.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java @@ -1,14 +1,14 @@ // Targeted by JavaCPP version 1.5.1: DO NOT EDIT THIS FILE -package org.tensorflow.c_api.global; +package org.tensorflow.internal.c_api.global; -import org.tensorflow.c_api.*; +import org.tensorflow.internal.c_api.*; import java.nio.*; import org.bytedeco.javacpp.*; import org.bytedeco.javacpp.annotation.*; -public class tensorflow extends org.tensorflow.c_api.presets.tensorflow { +public class tensorflow extends org.tensorflow.internal.c_api.presets.tensorflow { static { Loader.load(); } // Parsed from tensorflow/c/tf_attrtype.h 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 bf5df8c5108..1dcbdc28da5 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; /** * Produces a visualization of audio data over time. @@ -55,7 +56,7 @@ * resulting spectrogram as a PNG image. */ @Operator(group = "audio") -public final class AudioSpectrogram extends PrimitiveOp implements Operand { +public final class AudioSpectrogram extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.audio.AudioSpectrogram} @@ -88,7 +89,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AudioSpectrogram */ - public static AudioSpectrogram create(Scope scope, Operand input, Long windowSize, Long stride, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -115,16 +116,16 @@ public static Options magnitudeSquared(Boolean magnitudeSquared) { /** * 3D representation of the audio frequencies as an image. */ - public Output spectrogram() { + public Output spectrogram() { return spectrogram; } @Override - public Output asOutput() { + public Output asOutput() { return spectrogram; } - private Output spectrogram; + private Output spectrogram; private AudioSpectrogram(Operation operation) { super(operation); 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 edfa440525f..4202e0f221e 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Decode a 16-bit PCM WAV file to a float tensor. @@ -82,7 +85,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodeWav */ - public static DecodeWav create(Scope scope, Operand contents, Options... options) { + public static DecodeWav create(Scope scope, Operand contents, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeWav", scope.makeOpName("DecodeWav")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -116,19 +119,19 @@ public static Options desiredSamples(Long desiredSamples) { /** * 2-D with shape `[length, channels]`. */ - public Output audio() { + public Output audio() { return audio; } /** * Scalar holding the sample rate found in the WAV header. */ - public Output sampleRate() { + public Output sampleRate() { return sampleRate; } - private Output audio; - private Output sampleRate; + private Output audio; + private Output sampleRate; private DecodeWav(Operation operation) { super(operation); 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 d27962e74b1..5243e7f2539 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Encode audio data using the WAV file format. @@ -37,7 +40,7 @@ * `sample_rate` is a scalar Tensor holding the rate to use (e.g. 44100). */ @Operator(group = "audio") -public final class EncodeWav extends PrimitiveOp implements Operand { +public final class EncodeWav extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new EncodeWav operation. @@ -47,7 +50,7 @@ public final class EncodeWav extends PrimitiveOp implements Operand { * @param sampleRate Scalar containing the sample frequency. * @return a new instance of EncodeWav */ - public static EncodeWav create(Scope scope, Operand audio, Operand sampleRate) { + public static EncodeWav create(Scope scope, Operand audio, Operand sampleRate) { OperationBuilder opBuilder = scope.env().opBuilder("EncodeWav", scope.makeOpName("EncodeWav")); opBuilder.addInput(audio.asOutput()); opBuilder.addInput(sampleRate.asOutput()); @@ -58,16 +61,16 @@ public static EncodeWav create(Scope scope, Operand audio, Operand contents() { + public Output contents() { return contents; } @Override - public Output asOutput() { + public Output asOutput() { return contents; } - private Output contents; + private Output contents; private EncodeWav(Operation operation) { super(operation); 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 46dd8f7de39..a8a3c14c07c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Transforms a spectrogram into a form that's useful for speech recognition. @@ -36,7 +38,7 @@ * is a good resource to learn more. */ @Operator(group = "audio") -public final class Mfcc extends PrimitiveOp implements Operand { +public final class Mfcc extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.audio.Mfcc} @@ -96,7 +98,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Mfcc */ - public static Mfcc create(Scope scope, Operand spectrogram, Operand sampleRate, Options... options) { + 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()); @@ -152,16 +154,16 @@ public static Options dctCoefficientCount(Long dctCoefficientCount) { /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Mfcc(Operation operation) { super(operation); 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 0ce6491da8d..4d10a7d7c1b 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Elementwise computes the bitwise AND of `x` and `y`. @@ -51,7 +53,7 @@ * @param data type for {@code z()} output */ @Operator(group = "bitwise") -public final class BitwiseAnd extends PrimitiveOp implements Operand { +public final class BitwiseAnd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BitwiseAnd operation. @@ -61,7 +63,7 @@ public final class BitwiseAnd extends PrimitiveOp implements O * @param y * @return a new instance of BitwiseAnd */ - public static BitwiseAnd create(Scope scope, Operand x, Operand y) { + 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()); 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 f90a598b69d..140650d91a4 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Elementwise computes the bitwise OR of `x` and `y`. @@ -51,7 +53,7 @@ * @param data type for {@code z()} output */ @Operator(group = "bitwise") -public final class BitwiseOr extends PrimitiveOp implements Operand { +public final class BitwiseOr extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BitwiseOr operation. @@ -61,7 +63,7 @@ public final class BitwiseOr extends PrimitiveOp implements Op * @param y * @return a new instance of BitwiseOr */ - public static BitwiseOr create(Scope scope, Operand x, Operand y) { + 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()); 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 143cf06cd47..8edf129964a 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Elementwise computes the bitwise XOR of `x` and `y`. @@ -51,7 +53,7 @@ * @param data type for {@code z()} output */ @Operator(group = "bitwise") -public final class BitwiseXor extends PrimitiveOp implements Operand { +public final class BitwiseXor extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BitwiseXor operation. @@ -61,7 +63,7 @@ public final class BitwiseXor extends PrimitiveOp implements O * @param y * @return a new instance of BitwiseXor */ - public static BitwiseXor create(Scope scope, Operand x, Operand y) { + 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()); 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 820b767124c..c836c84c62d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Invert (flip) each bit of supported types; for example, type `uint8` value 01010101 becomes 10101010. @@ -72,7 +74,7 @@ * @param data type for {@code y()} output */ @Operator(group = "bitwise") -public final class Invert extends PrimitiveOp implements Operand { +public final class Invert extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Invert operation. @@ -81,7 +83,7 @@ public final class Invert extends PrimitiveOp implements Opera * @param x * @return a new instance of Invert */ - public static Invert create(Scope scope, Operand x) { + public static Invert create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Invert", scope.makeOpName("Invert")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 542d99fa858..f60b9d41990 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Elementwise computes the bitwise left-shift of `x` and `y`. @@ -62,7 +64,7 @@ * @param data type for {@code z()} output */ @Operator(group = "bitwise") -public final class LeftShift extends PrimitiveOp implements Operand { +public final class LeftShift extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LeftShift operation. @@ -72,7 +74,7 @@ public final class LeftShift extends PrimitiveOp implements Op * @param y * @return a new instance of LeftShift */ - public static LeftShift create(Scope scope, Operand x, Operand y) { + 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()); 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 7056bcd0bd7..d88433a7ad4 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Elementwise computes the bitwise right-shift of `x` and `y`. @@ -65,7 +67,7 @@ * @param data type for {@code z()} output */ @Operator(group = "bitwise") -public final class RightShift extends PrimitiveOp implements Operand { +public final class RightShift extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RightShift operation. @@ -75,7 +77,7 @@ public final class RightShift extends PrimitiveOp implements O * @param y * @return a new instance of RightShift */ - public static RightShift create(Scope scope, Operand x, Operand y) { + 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()); 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 4de01a25eb3..ebe55e41e6e 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 @@ -24,13 +24,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Mutually reduces multiple tensors of identical type and shape. * - * @param data type for {@code data()} output + * @param data type for {@code output()} output */ -public final class AllReduce extends PrimitiveOp implements Operand { +public final class AllReduce extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.collective.AllReduce} @@ -65,7 +67,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AllReduce */ - public static AllReduce create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, String mergeOp, String finalOp, List subdivOffsets, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -102,20 +104,20 @@ public static Options waitFor(List waitFor) { /** */ - public Output data() { - return data; + public Output output() { + return output; } @Override public Output asOutput() { - return data; + return output; } - private Output data; + private Output output; private AllReduce(Operation operation) { super(operation); int outputIdx = 0; - data = operation.output(outputIdx++); + output = operation.output(outputIdx++); } } 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 a4139051b33..46d2722a63d 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 @@ -22,16 +22,18 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TNumber; +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 output()} output */ -public final class BroadcastRecv extends PrimitiveOp implements Operand { +public final class BroadcastRecv extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BroadcastRecv operation. @@ -44,10 +46,10 @@ public final class BroadcastRecv extends PrimitiveOp implement * @param shape * @return a new instance of BroadcastRecv */ - public static BroadcastRecv create(Scope scope, Class T, Long groupSize, Long groupKey, Long instanceKey, Shape shape) { + public static BroadcastRecv create(Scope scope, DataType T, Long groupSize, Long groupKey, Long instanceKey, Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveBcastRecv", scope.makeOpName("BroadcastRecv")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("T", DataType.fromClass(T)); + opBuilder.setAttr("T", T); opBuilder.setAttr("group_size", groupSize); opBuilder.setAttr("group_key", groupKey); opBuilder.setAttr("instance_key", instanceKey); @@ -57,20 +59,20 @@ public static BroadcastRecv create(Scope scope, Class T /** */ - public Output data() { - return data; + public Output output() { + return output; } @Override public Output asOutput() { - return data; + return output; } - private Output data; + private Output output; private BroadcastRecv(Operation operation) { super(operation); int outputIdx = 0; - data = operation.output(outputIdx++); + output = operation.output(outputIdx++); } } 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 e841263806c..d16b3b0bba9 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 @@ -21,16 +21,18 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TNumber; +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 output()} output */ -public final class BroadcastSend extends PrimitiveOp implements Operand { +public final class BroadcastSend extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BroadcastSend operation. @@ -43,7 +45,7 @@ public final class BroadcastSend extends PrimitiveOp implement * @param shape * @return a new instance of BroadcastSend */ - public static BroadcastSend create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, Shape shape) { + public static BroadcastSend create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveBcastSend", scope.makeOpName("BroadcastSend")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -56,20 +58,20 @@ public static BroadcastSend create(Scope scope, Operand /** */ - public Output data() { - return data; + public Output output() { + return output; } @Override public Output asOutput() { - return data; + return output; } - private Output data; + private Output output; private BroadcastSend(Operation operation) { super(operation); int outputIdx = 0; - data = operation.output(outputIdx++); + output = operation.output(outputIdx++); } } 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 39e34318b0d..c5511c40bd3 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the "logical and" of elements across dimensions of a tensor. @@ -34,7 +37,7 @@ * retained with length 1. */ @Operator -public final class All extends PrimitiveOp implements Operand { +public final class All extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.All} @@ -65,7 +68,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of All */ - public static All create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); @@ -90,16 +93,16 @@ public static Options keepDims(Boolean keepDims) { /** * The reduced tensor. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private All(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AllToAll.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AllToAll.java index 03a58e54eac..dce3ea4259f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AllToAll.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AllToAll.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * An Op to exchange data across TPU replicas. @@ -46,7 +48,7 @@ * * @param data type for {@code output()} output */ -public final class AllToAll extends PrimitiveOp implements Operand { +public final class AllToAll extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AllToAll operation. @@ -62,7 +64,7 @@ public final class AllToAll extends PrimitiveOp implements Operand { * size(group_assignment.get_shape()[1]) * @return a new instance of AllToAll */ - public static AllToAll create(Scope scope, Operand input, Operand groupAssignment, Long concatDimension, Long splitDimension, Long splitCount) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousIteratorV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousIteratorV2.java index cf6443c0096..860ff7ec002 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousIteratorV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousIteratorV2.java @@ -22,9 +22,9 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; /** * A container for an iterator resource. @@ -39,12 +39,12 @@ public final class AnonymousIteratorV2 extends PrimitiveOp { * @param outputShapes * @return a new instance of AnonymousIteratorV2 */ - public static AnonymousIteratorV2 create(Scope scope, List> outputTypes, List outputShapes) { + public static AnonymousIteratorV2 create(Scope scope, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("AnonymousIteratorV2", scope.makeOpName("AnonymousIteratorV2")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMultiDeviceIterator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMultiDeviceIterator.java index 1928b0a7e5a..aa5f1df880d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMultiDeviceIterator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousMultiDeviceIterator.java @@ -22,9 +22,9 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; /** * A container for a multi device iterator resource. @@ -40,7 +40,7 @@ public final class AnonymousMultiDeviceIterator extends PrimitiveOp { * @param outputShapes * @return a new instance of AnonymousMultiDeviceIterator */ - public static AnonymousMultiDeviceIterator create(Scope scope, List devices, List> outputTypes, List outputShapes) { + public static AnonymousMultiDeviceIterator create(Scope scope, List devices, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("AnonymousMultiDeviceIterator", scope.makeOpName("AnonymousMultiDeviceIterator")); opBuilder = scope.applyControlDependencies(opBuilder); String[] devicesArray = new String[devices.size()]; @@ -50,7 +50,7 @@ public static AnonymousMultiDeviceIterator create(Scope scope, List devi opBuilder.setAttr("devices", devicesArray); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousRandomSeedGenerator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousRandomSeedGenerator.java index 4730df2cfd0..fbc6043a446 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousRandomSeedGenerator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AnonymousRandomSeedGenerator.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; /** */ @@ -36,7 +37,7 @@ public final class AnonymousRandomSeedGenerator extends PrimitiveOp { * @param seed2 * @return a new instance of AnonymousRandomSeedGenerator */ - public static AnonymousRandomSeedGenerator create(Scope scope, Operand seed, Operand seed2) { + 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()); 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 e068c220781..4bcf007fef5 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the "logical or" of elements across dimensions of a tensor. @@ -34,7 +37,7 @@ * retained with length 1. */ @Operator -public final class Any extends PrimitiveOp implements Operand { +public final class Any extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Any} @@ -65,7 +68,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Any */ - public static Any create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); @@ -90,16 +93,16 @@ public static Options keepDims(Boolean keepDims) { /** * The reduced tensor. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Any(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ApplyAdagradV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ApplyAdagradV2.java index 56dea982b75..ac60d1f8be4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ApplyAdagradV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ApplyAdagradV2.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the adagrad scheme. @@ -32,7 +33,7 @@ * * @param data type for {@code out()} output */ -public final class ApplyAdagradV2 extends PrimitiveOp implements Operand { +public final class ApplyAdagradV2 extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ApplyAdagradV2} @@ -76,7 +77,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyAdagradV2 */ - public static ApplyAdagradV2 create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertNextDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertNextDataset.java index 9cb09ac9bda..851bbcae377 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertNextDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AssertNextDataset.java @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class AssertNextDataset extends PrimitiveOp implements Operand { +public final class AssertNextDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AssertNextDataset operation. @@ -41,14 +43,14 @@ public final class AssertNextDataset extends PrimitiveOp implements Operand inputDataset, Operand transformations, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -67,8 +69,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 8b5b9a08602..c2d2d77463f 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; /** * Asserts that the given condition is true. @@ -62,7 +63,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AssertThat */ - public static AssertThat create(Scope scope, Operand condition, Iterable> data, Options... options) { + 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)); 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 b91facf3af9..f98eb5da875 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update 'ref' by assigning 'value' to it. @@ -34,7 +35,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class Assign extends PrimitiveOp implements Operand { +public final class Assign extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Assign} @@ -76,7 +77,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Assign */ - public static Assign create(Scope scope, Operand ref, Operand value, Options... options) { + 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()); 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 38933f52219..680730284c5 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update 'ref' by adding 'value' to it. @@ -34,7 +35,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class AssignAdd extends PrimitiveOp implements Operand { +public final class AssignAdd extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.AssignAdd} @@ -65,7 +66,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AssignAdd */ - public static AssignAdd create(Scope scope, Operand ref, Operand value, Options... options) { + 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()); 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 63fc170c793..e260991a1e1 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Adds a value to the current value of a variable. @@ -41,7 +42,7 @@ public final class AssignAddVariableOp extends PrimitiveOp { * @param value the value by which the variable will be incremented. * @return a new instance of AssignAddVariableOp */ - public static AssignAddVariableOp create(Scope scope, Operand resource, Operand value) { + 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()); 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 8c8b37f34ba..ea9b9b70db9 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update 'ref' by subtracting 'value' from it. @@ -34,7 +35,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class AssignSub extends PrimitiveOp implements Operand { +public final class AssignSub extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.AssignSub} @@ -65,7 +66,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AssignSub */ - public static AssignSub create(Scope scope, Operand ref, Operand value, Options... options) { + 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()); 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 1348c02a966..b6669e19dd7 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Subtracts a value from the current value of a variable. @@ -41,7 +42,7 @@ public final class AssignSubVariableOp extends PrimitiveOp { * @param value the value by which the variable will be incremented. * @return a new instance of AssignSubVariableOp */ - public static AssignSubVariableOp create(Scope scope, Operand resource, Operand value) { + 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()); 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 a3363c6db92..5c1393ea4fa 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Assigns a new value to a variable. @@ -41,7 +42,7 @@ public final class AssignVariableOp extends PrimitiveOp { * @param value the value to set the new tensor to use. * @return a new instance of AssignVariableOp */ - public static AssignVariableOp create(Scope scope, Operand resource, Operand value) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AutoShardDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AutoShardDataset.java index 2a2842ffa70..eb6bdbaf9b6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AutoShardDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/AutoShardDataset.java @@ -23,9 +23,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that shards the input dataset. @@ -38,7 +40,7 @@ * This dataset will throw a NotFound error if we cannot shard the dataset * automatically. */ -public final class AutoShardDataset extends PrimitiveOp implements Operand { +public final class AutoShardDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AutoShardDataset operation. @@ -51,7 +53,7 @@ public final class AutoShardDataset extends PrimitiveOp implements Operand inputDataset, Operand numWorkers, Operand index, List> outputTypes, List outputShapes) { + public static AutoShardDataset create(Scope scope, Operand inputDataset, Operand numWorkers, Operand index, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("AutoShardDataset", scope.makeOpName("AutoShardDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numWorkers.asOutput()); @@ -59,7 +61,7 @@ public static AutoShardDataset create(Scope scope, Operand inputDataset, Oper opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -78,8 +80,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 ddd2d81aa28..853f22d2e50 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 @@ -23,10 +23,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; /** * Defines a barrier that persists across different graph executions. @@ -41,7 +42,7 @@ * and may be updated using BarrierInsertMany. */ @Operator -public final class Barrier extends PrimitiveOp implements Operand { +public final class Barrier extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Barrier} @@ -102,12 +103,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Barrier */ - public static Barrier create(Scope scope, List> componentTypes, Options... options) { + public static Barrier create(Scope scope, List> componentTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Barrier", scope.makeOpName("Barrier")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] componentTypesArray = new DataType[componentTypes.size()]; for (int i = 0; i < componentTypesArray.length; ++i) { - componentTypesArray[i] = DataType.fromClass(componentTypes.get(i)); + componentTypesArray[i] = componentTypes.get(i); } opBuilder.setAttr("component_types", componentTypesArray); if (options != null) { @@ -169,16 +170,16 @@ public static Options sharedName(String sharedName) { /** * The handle to the barrier. */ - public Output handle() { + public Output handle() { return handle; } @Override - public Output asOutput() { + public Output asOutput() { return handle; } - private Output handle; + private Output handle; private Barrier(Operation operation) { super(operation); 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 d0128be4bf5..b73f4127f84 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Closes the given barrier. @@ -66,7 +67,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BarrierClose */ - public static BarrierClose create(Scope scope, Operand handle, Options... options) { + public static BarrierClose create(Scope scope, Operand handle, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BarrierClose", scope.makeOpName("BarrierClose")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 6a7a68f9f17..85830ddcc34 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Computes the number of incomplete elements in the given barrier. */ @Operator -public final class BarrierIncompleteSize extends PrimitiveOp implements Operand { +public final class BarrierIncompleteSize extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BarrierIncompleteSize operation. @@ -38,7 +40,7 @@ public final class BarrierIncompleteSize extends PrimitiveOp implements Operand< * @param handle The handle to a barrier. * @return a new instance of BarrierIncompleteSize */ - public static BarrierIncompleteSize create(Scope scope, Operand handle) { + public static BarrierIncompleteSize create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("BarrierIncompleteSize", scope.makeOpName("BarrierIncompleteSize")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -49,16 +51,16 @@ public static BarrierIncompleteSize create(Scope scope, Operand handle) * The number of incomplete elements (i.e. those with some of their value * components not set) in the barrier. */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private BarrierIncompleteSize(Operation operation) { super(operation); 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 396b099eda3..dd3f42bdb9d 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * For each key, assigns the respective value to the specified component. @@ -46,7 +48,7 @@ public final class BarrierInsertMany extends PrimitiveOp { * @param componentIndex The component of the barrier elements that is being assigned. * @return a new instance of BarrierInsertMany */ - public static BarrierInsertMany create(Scope scope, Operand handle, Operand keys, Operand values, Long componentIndex) { + 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()); 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 224d7c35f62..1218eb85915 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Computes the number of complete elements in the given barrier. */ @Operator -public final class BarrierReadySize extends PrimitiveOp implements Operand { +public final class BarrierReadySize extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BarrierReadySize operation. @@ -38,7 +40,7 @@ public final class BarrierReadySize extends PrimitiveOp implements Operand handle) { + public static BarrierReadySize create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("BarrierReadySize", scope.makeOpName("BarrierReadySize")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -49,16 +51,16 @@ public static BarrierReadySize create(Scope scope, Operand handle) { * The number of complete elements (i.e. those with all of their value * components set) in the barrier. */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private BarrierReadySize(Operation operation) { super(operation); 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 cc665d85999..cc09957acf9 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 @@ -27,6 +27,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Takes the given number of completed elements from a barrier. @@ -93,14 +96,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BarrierTakeMany */ - public static BarrierTakeMany create(Scope scope, Operand handle, Operand numElements, List> componentTypes, Options... options) { + 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()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] componentTypesArray = new DataType[componentTypes.size()]; for (int i = 0; i < componentTypesArray.length; ++i) { - componentTypesArray[i] = DataType.fromClass(componentTypes.get(i)); + componentTypesArray[i] = componentTypes.get(i); } opBuilder.setAttr("component_types", componentTypesArray); if (options != null) { @@ -148,14 +151,14 @@ public static Options timeoutMs(Long timeoutMs) { * These indices refer to the batch in which the values were placed into the * barrier (starting with MIN_LONG and increasing with each BarrierInsertMany). */ - public Output indices() { + public Output indices() { return indices; } /** * A one-dimensional tensor of keys, with length num_elements. */ - public Output keys() { + public Output keys() { return keys; } @@ -167,8 +170,8 @@ public List> values() { return values; } - private Output indices; - private Output keys; + private Output indices; + private Output keys; private List> values; private BarrierTakeMany(Operation operation) { 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 bda8162d846..69c2c8d9e29 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 @@ -27,6 +27,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; /** * Batches all input tensors nondeterministically. @@ -215,19 +216,19 @@ public List> batchedTensors() { /** */ - public Output batchIndex() { + public Output batchIndex() { return batchIndex; } /** */ - public Output id() { + public Output id() { return id; } private List> batchedTensors; - private Output batchIndex; - private Output id; + private Output batchIndex; + private Output id; private Batch(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchMatMulV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchMatMulV2.java index 765d92975c8..e5b3513b717 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchMatMulV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BatchMatMulV2.java @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Multiplies slices of two tensors in batches. @@ -55,7 +56,7 @@ * @param data type for {@code output()} output */ @Operator -public final class BatchMatMulV2 extends PrimitiveOp implements Operand { +public final class BatchMatMulV2 extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.BatchMatMulV2} @@ -94,7 +95,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BatchMatMulV2 */ - public static BatchMatMulV2 create(Scope scope, Operand x, Operand y, Options... options) { + public static BatchMatMulV2 create(Scope scope, Operand x, Operand y, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatMulV2", scope.makeOpName("BatchMatMulV2")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); 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 331b44ff979..64123abb4f8 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * BatchToSpace for 4-D tensors of type T. @@ -39,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator -public final class BatchToSpace extends PrimitiveOp implements Operand { +public final class BatchToSpace extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchToSpace operation. @@ -57,7 +59,7 @@ public final class BatchToSpace extends PrimitiveOp implements Operand { * @param blockSize * @return a new instance of BatchToSpace */ - public static BatchToSpace create(Scope scope, Operand input, Operand crops, Long blockSize) { + 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()); 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 93b8e560911..b1e84532395 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * BatchToSpace for N-D tensors of type T. @@ -38,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator -public final class BatchToSpaceNd extends PrimitiveOp implements Operand { +public final class BatchToSpaceNd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchToSpaceNd operation. @@ -144,7 +146,7 @@ public final class BatchToSpaceNd extends PrimitiveOp implements Operand { * * @return a new instance of BatchToSpaceNd */ - public static BatchToSpaceNd create(Scope scope, Operand input, Operand blockShape, Operand crops) { + 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()); 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 868b3655460..5c7435e6fe4 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Bitcasts a tensor from one type to another without copying data. @@ -81,7 +82,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Bitcast extends PrimitiveOp implements Operand { +public final class Bitcast extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Bitcast operation. @@ -91,11 +92,11 @@ public final class Bitcast extends PrimitiveOp implements Operand { * @param type * @return a new instance of Bitcast */ - public static Bitcast create(Scope scope, Operand input, Class type) { + public static Bitcast create(Scope scope, Operand input, DataType type) { OperationBuilder opBuilder = scope.env().opBuilder("Bitcast", scope.makeOpName("Bitcast")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("type", DataType.fromClass(type)); + opBuilder.setAttr("type", type); return new Bitcast(opBuilder.build()); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BlockLSTM.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BlockLSTM.java index b0397841588..ad29b14a98b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BlockLSTM.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BlockLSTM.java @@ -23,6 +23,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the LSTM cell forward propagation for all the time steps. @@ -47,7 +50,7 @@ * * @param data type for {@code i()} output */ -public final class BlockLSTM extends PrimitiveOp { +public final class BlockLSTM extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.BlockLSTM} @@ -103,7 +106,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BlockLSTM */ - 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) { + 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("BlockLSTM", scope.makeOpName("BlockLSTM")); opBuilder.addInput(seqLenMax.asOutput()); opBuilder.addInput(x.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BlockLSTMGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BlockLSTMGrad.java index 07877ee24fd..bcc08bdde69 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BlockLSTMGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BlockLSTMGrad.java @@ -23,6 +23,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the LSTM cell backward propagation for the entire time sequence. @@ -31,7 +34,7 @@ * * @param data type for {@code xGrad()} output */ -public final class BlockLSTMGrad extends PrimitiveOp { +public final class BlockLSTMGrad extends PrimitiveOp { /** * Factory method to create a class wrapping a new BlockLSTMGrad operation. @@ -59,7 +62,7 @@ public final class BlockLSTMGrad extends PrimitiveOp { * @param usePeephole Whether to use peephole weights. * @return a new instance of BlockLSTMGrad */ - 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) { + 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("BlockLSTMGrad", scope.makeOpName("BlockLSTMGrad")); opBuilder.addInput(seqLenMax.asOutput()); opBuilder.addInput(x.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesAggregateStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesAggregateStats.java index f17db08d961..b55391e142d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesAggregateStats.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesAggregateStats.java @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +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 PrimitiveOp implements Operand { +public final class BoostedTreesAggregateStats extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BoostedTreesAggregateStats operation. @@ -43,7 +45,7 @@ public final class BoostedTreesAggregateStats extends PrimitiveOp implements Ope * @param numBuckets int; equals to the maximum possible value of bucketized feature. * @return a new instance of BoostedTreesAggregateStats */ - public static BoostedTreesAggregateStats create(Scope scope, Operand nodeIds, Operand gradients, Operand hessians, Operand feature, Long maxSplits, Long numBuckets) { + 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,16 +61,16 @@ public static BoostedTreesAggregateStats create(Scope scope, Operand no * output Rank 4 Tensor (shape=[splits, feature_dimension, buckets, logits_dimension + hessian_dimension]) * containing accumulated stats for each node, feature dimension and bucket. */ - public Output statsSummary() { + public Output statsSummary() { return statsSummary; } @Override - public Output asOutput() { + public Output asOutput() { return statsSummary; } - private Output statsSummary; + private Output statsSummary; private BoostedTreesAggregateStats(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesBucketize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesBucketize.java index 8b401786262..1b75c417a7f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesBucketize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesBucketize.java @@ -27,6 +27,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Bucketize each feature based on bucket boundaries. @@ -34,7 +36,7 @@ * 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 PrimitiveOp implements Iterable> { +public final class BoostedTreesBucketize extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new BoostedTreesBucketize operation. @@ -45,7 +47,7 @@ public final class BoostedTreesBucketize extends PrimitiveOp implements Iterable * feature. * @return a new instance of BoostedTreesBucketize */ - public static BoostedTreesBucketize create(Scope scope, Iterable> floatValues, Iterable> bucketBoundaries) { + 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)); @@ -56,24 +58,24 @@ public static BoostedTreesBucketize create(Scope scope, Iterable> /** * int; List of Rank 1 Tensors each containing the bucketized values for a single feature. */ - public List> buckets() { + public List> buckets() { return buckets; } @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) buckets.iterator(); } - private List> buckets; + 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)); + buckets = Arrays.asList((Output[])operation.outputList(outputIdx, bucketsLength)); outputIdx += bucketsLength; } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCalculateBestFeatureSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCalculateBestFeatureSplit.java index 20c180ca72e..3e90fead098 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCalculateBestFeatureSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCalculateBestFeatureSplit.java @@ -23,6 +23,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +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. @@ -71,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BoostedTreesCalculateBestFeatureSplit */ - public static BoostedTreesCalculateBestFeatureSplit create(Scope scope, Operand nodeIdRange, Operand statsSummary, Operand l1, Operand l2, Operand treeComplexity, Operand minNodeWeight, Long logitsDimension, Options... options) { + 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()); @@ -101,59 +104,59 @@ public static Options splitType(String splitType) { /** * 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. */ - public Output nodeIds() { + public Output nodeIds() { return nodeIds; } /** * A Rank 1 tensors indicating the best gains for each feature to split for certain nodes. See above for details like shapes and sizes. */ - public Output gains() { + public Output gains() { return gains; } /** * 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. */ - public Output featureDimensions() { + public Output featureDimensions() { return featureDimensions; } /** * 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. */ - public Output thresholds() { + public Output thresholds() { return thresholds; } /** * 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. */ - public Output leftNodeContribs() { + public Output leftNodeContribs() { return leftNodeContribs; } /** * A Rank 2 tensors, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. */ - public Output rightNodeContribs() { + public Output rightNodeContribs() { return rightNodeContribs; } /** * A Rank 1 tensors indicating the which direction to go if data is missing. See above for details like shapes and sizes. */ - public Output splitWithDefaultDirections() { + public Output splitWithDefaultDirections() { return splitWithDefaultDirections; } - private Output nodeIds; - private Output gains; - private Output featureDimensions; - private Output thresholds; - private Output leftNodeContribs; - private Output rightNodeContribs; - private Output splitWithDefaultDirections; + 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); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCalculateBestGainsPerFeature.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCalculateBestGainsPerFeature.java index 42494896ec2..f0a5032f108 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCalculateBestGainsPerFeature.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCalculateBestGainsPerFeature.java @@ -26,6 +26,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Calculates gains for each feature and returns the best possible split information for the feature. @@ -54,7 +56,7 @@ public final class BoostedTreesCalculateBestGainsPerFeature extends PrimitiveOp * @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 */ - public static BoostedTreesCalculateBestGainsPerFeature create(Scope scope, Operand nodeIdRange, Iterable> statsSummaryList, Operand l1, Operand l2, Operand treeComplexity, Operand minNodeWeight, Long maxSplits) { + 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)); @@ -70,62 +72,62 @@ public static BoostedTreesCalculateBestGainsPerFeature create(Scope scope, Opera /** * 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. */ - public List> nodeIdsList() { + public List> nodeIdsList() { return nodeIdsList; } /** * 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. */ - public List> gainsList() { + public List> gainsList() { return gainsList; } /** * 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. */ - public List> thresholdsList() { + public List> thresholdsList() { return thresholdsList; } /** * 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. */ - public List> leftNodeContribsList() { + public List> leftNodeContribsList() { return leftNodeContribsList; } /** * 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. */ - public List> rightNodeContribsList() { + public List> rightNodeContribsList() { return rightNodeContribsList; } - private List> nodeIdsList; - private List> gainsList; - private List> thresholdsList; - private List> leftNodeContribsList; - private List> rightNodeContribsList; + 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)); + nodeIdsList = Arrays.asList((Output[])operation.outputList(outputIdx, nodeIdsListLength)); outputIdx += nodeIdsListLength; int gainsListLength = operation.outputListLength("gains_list"); - gainsList = Arrays.asList((Output[])operation.outputList(outputIdx, gainsListLength)); + gainsList = Arrays.asList((Output[])operation.outputList(outputIdx, gainsListLength)); outputIdx += gainsListLength; int thresholdsListLength = operation.outputListLength("thresholds_list"); - thresholdsList = Arrays.asList((Output[])operation.outputList(outputIdx, thresholdsListLength)); + 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)); + 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)); + rightNodeContribsList = Arrays.asList((Output[])operation.outputList(outputIdx, rightNodeContribsListLength)); outputIdx += rightNodeContribsListLength; } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCenterBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCenterBias.java index 073c7c08d70..632db799992 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCenterBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCenterBias.java @@ -23,11 +23,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TFloat; /** * 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 PrimitiveOp implements Operand { +public final class BoostedTreesCenterBias extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BoostedTreesCenterBias operation. @@ -40,7 +42,7 @@ public final class BoostedTreesCenterBias extends PrimitiveOp implements Operand * @param l2 l2 regularization factor on leaf weights, per instance based. * @return a new instance of BoostedTreesCenterBias */ - public static BoostedTreesCenterBias create(Scope scope, Operand treeEnsembleHandle, Operand meanGradients, Operand meanHessians, Operand l1, Operand l2) { + 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()); @@ -54,16 +56,16 @@ public static BoostedTreesCenterBias create(Scope scope, Operand treeEnsemble /** * Bool, whether to continue bias centering. */ - public Output continueCentering() { + public Output continueCentering() { return continueCentering; } @Override - public Output asOutput() { + public Output asOutput() { return continueCentering; } - private Output continueCentering; + private Output continueCentering; private BoostedTreesCenterBias(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCreateEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCreateEnsemble.java index e2b119b58db..ed730f33d3b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCreateEnsemble.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCreateEnsemble.java @@ -22,6 +22,8 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Creates a tree ensemble model and returns a handle to it. @@ -37,7 +39,7 @@ public final class BoostedTreesCreateEnsemble extends PrimitiveOp { * @param treeEnsembleSerialized Serialized proto of the tree ensemble. * @return a new instance of BoostedTreesCreateEnsemble */ - public static BoostedTreesCreateEnsemble create(Scope scope, Operand treeEnsembleHandle, Operand stampToken, Operand treeEnsembleSerialized) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCreateQuantileStreamResource.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCreateQuantileStreamResource.java index bb0a22e376b..b83527f70bf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCreateQuantileStreamResource.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesCreateQuantileStreamResource.java @@ -22,6 +22,8 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Create the Resource for Quantile Streams. @@ -57,7 +59,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BoostedTreesCreateQuantileStreamResource */ - public static BoostedTreesCreateQuantileStreamResource create(Scope scope, Operand quantileStreamResourceHandle, Operand epsilon, Operand numStreams, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesDeserializeEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesDeserializeEnsemble.java index 2e92849ccbc..f5f21376a82 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesDeserializeEnsemble.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesDeserializeEnsemble.java @@ -22,6 +22,8 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Deserializes a serialized tree ensemble config and replaces current tree @@ -39,7 +41,7 @@ public final class BoostedTreesDeserializeEnsemble extends PrimitiveOp { * @param treeEnsembleSerialized Serialized proto of the ensemble. * @return a new instance of BoostedTreesDeserializeEnsemble */ - public static BoostedTreesDeserializeEnsemble create(Scope scope, Operand treeEnsembleHandle, Operand stampToken, Operand treeEnsembleSerialized) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesEnsembleResourceHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesEnsembleResourceHandleOp.java index 1e05ca72128..2dae6f7df85 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesEnsembleResourceHandleOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesEnsembleResourceHandleOp.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Creates a handle to a BoostedTreesEnsembleResource */ -public final class BoostedTreesEnsembleResourceHandleOp extends PrimitiveOp implements Operand { +public final class BoostedTreesEnsembleResourceHandleOp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.BoostedTreesEnsembleResourceHandleOp} @@ -102,8 +103,8 @@ public Output resource() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; + public Output asOutput() { + return (Output) resource; } private Output resource; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesExampleDebugOutputs.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesExampleDebugOutputs.java index e52e99387d0..63a6d4a4f0a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesExampleDebugOutputs.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesExampleDebugOutputs.java @@ -24,6 +24,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Debugging/model interpretability outputs for each example. @@ -32,7 +34,7 @@ * 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 PrimitiveOp implements Operand { +public final class BoostedTreesExampleDebugOutputs extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BoostedTreesExampleDebugOutputs operation. @@ -45,7 +47,7 @@ public final class BoostedTreesExampleDebugOutputs extends PrimitiveOp implement * examples_debug_outputs_serialized. * @return a new instance of BoostedTreesExampleDebugOutputs */ - public static BoostedTreesExampleDebugOutputs create(Scope scope, Operand treeEnsembleHandle, Iterable> bucketizedFeatures, Long logitsDimension) { + 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)); @@ -57,16 +59,16 @@ public static BoostedTreesExampleDebugOutputs create(Scope scope, Operand tre /** * Output rank 1 Tensor containing a proto serialized as a string for each example. */ - public Output examplesDebugOutputsSerialized() { + public Output examplesDebugOutputsSerialized() { return examplesDebugOutputsSerialized; } @Override - public Output asOutput() { + public Output asOutput() { return examplesDebugOutputsSerialized; } - private Output examplesDebugOutputsSerialized; + private Output examplesDebugOutputsSerialized; private BoostedTreesExampleDebugOutputs(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesFlushQuantileSummaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesFlushQuantileSummaries.java index 24c2a3398e5..a84b8fec4b2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesFlushQuantileSummaries.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesFlushQuantileSummaries.java @@ -26,6 +26,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Flush the quantile summaries from each quantile stream resource. @@ -34,7 +35,7 @@ * Each summary Tensor is rank 2, containing summaries (value, weight, min_rank, * max_rank) for a single feature. */ -public final class BoostedTreesFlushQuantileSummaries extends PrimitiveOp implements Iterable> { +public final class BoostedTreesFlushQuantileSummaries extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new BoostedTreesFlushQuantileSummaries operation. @@ -54,24 +55,24 @@ public static BoostedTreesFlushQuantileSummaries create(Scope scope, Operand /** */ - public List> summaries() { + public List> summaries() { return summaries; } @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) summaries.iterator(); } - private List> summaries; + 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)); + summaries = Arrays.asList((Output[])operation.outputList(outputIdx, summariesLength)); outputIdx += summariesLength; } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesGetEnsembleStates.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesGetEnsembleStates.java index 1795701419e..d64222c136d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesGetEnsembleStates.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesGetEnsembleStates.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** * Retrieves the tree ensemble resource stamp token, number of trees and growing statistics. @@ -46,28 +48,28 @@ public static BoostedTreesGetEnsembleStates create(Scope scope, Operand treeE /** * Stamp token of the tree ensemble resource. */ - public Output stampToken() { + public Output stampToken() { return stampToken; } /** * The number of trees in the tree ensemble resource. */ - public Output numTrees() { + public Output numTrees() { return numTrees; } /** * The number of trees that were finished successfully. */ - public Output numFinalizedTrees() { + public Output numFinalizedTrees() { return numFinalizedTrees; } /** * The number of layers we attempted to build (but not necessarily succeeded). */ - public Output numAttemptedLayers() { + public Output numAttemptedLayers() { return numAttemptedLayers; } @@ -75,15 +77,15 @@ public Output numAttemptedLayers() { * Rank size 2 tensor that contains start and end ids of the nodes in the latest * layer. */ - public Output lastLayerNodesRange() { + public Output lastLayerNodesRange() { return lastLayerNodesRange; } - private Output stampToken; - private Output numTrees; - private Output numFinalizedTrees; - private Output numAttemptedLayers; - private Output lastLayerNodesRange; + private Output stampToken; + private Output numTrees; + private Output numFinalizedTrees; + private Output numAttemptedLayers; + private Output lastLayerNodesRange; private BoostedTreesGetEnsembleStates(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesMakeQuantileSummaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesMakeQuantileSummaries.java index 8dc77b16bc8..1781b0b9d8e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesMakeQuantileSummaries.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesMakeQuantileSummaries.java @@ -27,6 +27,7 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Makes the summary of quantiles for the batch. @@ -34,7 +35,7 @@ * 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 PrimitiveOp implements Iterable> { +public final class BoostedTreesMakeQuantileSummaries extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new BoostedTreesMakeQuantileSummaries operation. @@ -45,7 +46,7 @@ public final class BoostedTreesMakeQuantileSummaries extends PrimitiveOp impleme * @param epsilon float; The required maximum approximation error. * @return a new instance of BoostedTreesMakeQuantileSummaries */ - public static BoostedTreesMakeQuantileSummaries create(Scope scope, Iterable> floatValues, Operand exampleWeights, Operand epsilon) { + 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()); @@ -58,24 +59,24 @@ public static BoostedTreesMakeQuantileSummaries create(Scope scope, Iterable> summaries() { + public List> summaries() { return summaries; } @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) summaries.iterator(); } - private List> summaries; + 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)); + summaries = Arrays.asList((Output[])operation.outputList(outputIdx, summariesLength)); outputIdx += summariesLength; } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesMakeStatsSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesMakeStatsSummary.java index b6275455cfc..21e4904f177 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesMakeStatsSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesMakeStatsSummary.java @@ -24,13 +24,15 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +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 PrimitiveOp implements Operand { +public final class BoostedTreesMakeStatsSummary extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BoostedTreesMakeStatsSummary operation. @@ -44,7 +46,7 @@ public final class BoostedTreesMakeStatsSummary extends PrimitiveOp implements O * @param numBuckets int; equals to the maximum possible value of bucketized feature. * @return a new instance of BoostedTreesMakeStatsSummary */ - public static BoostedTreesMakeStatsSummary create(Scope scope, Operand nodeIds, Operand gradients, Operand hessians, Iterable> bucketizedFeaturesList, Long maxSplits, Long numBuckets) { + 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()); @@ -59,16 +61,16 @@ public static BoostedTreesMakeStatsSummary create(Scope scope, Operand /** * 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. */ - public Output statsSummary() { + public Output statsSummary() { return statsSummary; } @Override - public Output asOutput() { + public Output asOutput() { return statsSummary; } - private Output statsSummary; + private Output statsSummary; private BoostedTreesMakeStatsSummary(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesPredict.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesPredict.java index 2c23019ed58..c8e607bed1e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesPredict.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesPredict.java @@ -24,6 +24,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Runs multiple additive regression ensemble predictors on input instances and @@ -31,7 +33,7 @@ * 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 PrimitiveOp implements Operand { +public final class BoostedTreesPredict extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BoostedTreesPredict operation. @@ -44,7 +46,7 @@ public final class BoostedTreesPredict extends PrimitiveOp implements Operand treeEnsembleHandle, Iterable> bucketizedFeatures, Long logitsDimension) { + 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)); @@ -56,16 +58,16 @@ public static BoostedTreesPredict create(Scope scope, Operand treeEnsembleHan /** * Output rank 2 Tensor containing logits for each example. */ - public Output logits() { + public Output logits() { return logits; } @Override - public Output asOutput() { + public Output asOutput() { return logits; } - private Output logits; + private Output logits; private BoostedTreesPredict(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceAddSummaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceAddSummaries.java index e53d3020267..182866fd6e6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceAddSummaries.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceAddSummaries.java @@ -23,6 +23,7 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Add the quantile summaries to each quantile stream resource. @@ -41,7 +42,7 @@ public final class BoostedTreesQuantileStreamResourceAddSummaries extends Primit * @param summaries string; List of Rank 2 Tensor each containing the summaries for a single feature. * @return a new instance of BoostedTreesQuantileStreamResourceAddSummaries */ - public static BoostedTreesQuantileStreamResourceAddSummaries create(Scope scope, Operand quantileStreamResourceHandle, Iterable> summaries) { + 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)); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceDeserialize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceDeserialize.java index 35541661a6c..388dbebbbb2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceDeserialize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceDeserialize.java @@ -23,6 +23,7 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Deserialize bucket boundaries and ready flag into current QuantileAccumulator. @@ -39,7 +40,7 @@ public final class BoostedTreesQuantileStreamResourceDeserialize extends Primiti * @param bucketBoundaries float; List of Rank 1 Tensors each containing the bucket boundaries for a feature. * @return a new instance of BoostedTreesQuantileStreamResourceDeserialize */ - public static BoostedTreesQuantileStreamResourceDeserialize create(Scope scope, Operand quantileStreamResourceHandle, Iterable> bucketBoundaries) { + 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)); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceFlush.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceFlush.java index 0420c6b2842..eab27aeb708 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceFlush.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceFlush.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; /** * Flush the summaries for a quantile stream resource. @@ -63,7 +64,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BoostedTreesQuantileStreamResourceFlush */ - public static BoostedTreesQuantileStreamResourceFlush create(Scope scope, Operand quantileStreamResourceHandle, Operand numBuckets, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java index 2226f9c8084..93ce9b96285 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceGetBucketBoundaries.java @@ -26,6 +26,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Generate the bucket boundaries for each feature based on accumulated summaries. @@ -33,7 +34,7 @@ * 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 PrimitiveOp implements Iterable> { +public final class BoostedTreesQuantileStreamResourceGetBucketBoundaries extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new BoostedTreesQuantileStreamResourceGetBucketBoundaries operation. @@ -54,24 +55,24 @@ public static BoostedTreesQuantileStreamResourceGetBucketBoundaries create(Scope /** * float; List of Rank 1 Tensors each containing the bucket boundaries for a feature. */ - public List> bucketBoundaries() { + public List> bucketBoundaries() { return bucketBoundaries; } @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) bucketBoundaries.iterator(); } - private List> bucketBoundaries; + 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)); + bucketBoundaries = Arrays.asList((Output[])operation.outputList(outputIdx, bucketBoundariesLength)); outputIdx += bucketBoundariesLength; } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceHandleOp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceHandleOp.java index c7740b142ea..043f422c7f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceHandleOp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesQuantileStreamResourceHandleOp.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Creates a handle to a BoostedTreesQuantileStreamResource. */ -public final class BoostedTreesQuantileStreamResourceHandleOp extends PrimitiveOp implements Operand { +public final class BoostedTreesQuantileStreamResourceHandleOp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.BoostedTreesQuantileStreamResourceHandleOp} @@ -102,8 +103,8 @@ public Output resource() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; + public Output asOutput() { + return (Output) resource; } private Output resource; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSerializeEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSerializeEnsemble.java index fc5f528d3e3..268541ad6f8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSerializeEnsemble.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSerializeEnsemble.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Serializes the tree ensemble to a proto. @@ -46,19 +48,19 @@ public static BoostedTreesSerializeEnsemble create(Scope scope, Operand treeE /** * Stamp token of the tree ensemble resource. */ - public Output stampToken() { + public Output stampToken() { return stampToken; } /** * Serialized proto of the ensemble. */ - public Output treeEnsembleSerialized() { + public Output treeEnsembleSerialized() { return treeEnsembleSerialized; } - private Output stampToken; - private Output treeEnsembleSerialized; + private Output stampToken; + private Output treeEnsembleSerialized; private BoostedTreesSerializeEnsemble(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSparseAggregateStats.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSparseAggregateStats.java index 5c73e14a295..cd2f5d33289 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSparseAggregateStats.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSparseAggregateStats.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Aggregates the summary of accumulated stats for the batch. @@ -51,7 +53,7 @@ public final class BoostedTreesSparseAggregateStats extends PrimitiveOp { * @param numBuckets int; equals to the maximum possible value of bucketized feature + 1. * @return a new instance of BoostedTreesSparseAggregateStats */ - public static BoostedTreesSparseAggregateStats create(Scope scope, Operand nodeIds, Operand gradients, Operand hessians, Operand featureIndices, Operand featureValues, Operand featureShape, Long maxSplits, Long numBuckets) { + 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()); @@ -70,14 +72,14 @@ public static BoostedTreesSparseAggregateStats create(Scope scope, Operand statsSummaryIndices() { + public Output statsSummaryIndices() { return statsSummaryIndices; } /** * output Rank 1 Tensor (shape=[number of non zero statistics]) */ - public Output statsSummaryValues() { + public Output statsSummaryValues() { return statsSummaryValues; } @@ -89,13 +91,13 @@ public Output statsSummaryValues() { * as logits dimension when diagonal hessian is used, or label_dimension^2 when full * hessian is used. */ - public Output statsSummaryShape() { + public Output statsSummaryShape() { return statsSummaryShape; } - private Output statsSummaryIndices; - private Output statsSummaryValues; - private Output statsSummaryShape; + private Output statsSummaryIndices; + private Output statsSummaryValues; + private Output statsSummaryShape; private BoostedTreesSparseAggregateStats(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSparseCalculateBestFeatureSplit.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSparseCalculateBestFeatureSplit.java index 4818a57985b..48f193ac74d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSparseCalculateBestFeatureSplit.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesSparseCalculateBestFeatureSplit.java @@ -23,6 +23,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +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. @@ -73,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BoostedTreesSparseCalculateBestFeatureSplit */ - 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) { + 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()); @@ -105,28 +108,28 @@ public static Options splitType(String splitType) { /** * A Rank 1 tensor indicating possible node ids that can be split. */ - public Output nodeIds() { + public Output nodeIds() { return nodeIds; } /** * A Rank 1 tensor indicating the best gains to split each node. */ - public Output gains() { + public Output gains() { return gains; } /** * A Rank 1 tensor indicating the best feature dimension for each feature to split for each node. */ - public Output featureDimensions() { + public Output featureDimensions() { return featureDimensions; } /** * A Rank 1 tensor indicating the bucket id to compare with (as a threshold) for split in each node. */ - public Output thresholds() { + public Output thresholds() { return thresholds; } @@ -134,31 +137,31 @@ public Output thresholds() { * 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. */ - public Output leftNodeContribs() { + public Output leftNodeContribs() { return leftNodeContribs; } /** * A Rank 2 tensor, with the same shape/conditions as left_node_contribs_list, but just that the value is for the right node. */ - public Output rightNodeContribs() { + public Output rightNodeContribs() { return rightNodeContribs; } /** * A Rank 1 tensor indicating which direction to go if data is missing. */ - public Output splitWithDefaultDirections() { + public Output splitWithDefaultDirections() { return splitWithDefaultDirections; } - private Output nodeIds; - private Output gains; - private Output featureDimensions; - private Output thresholds; - private Output leftNodeContribs; - private Output rightNodeContribs; - private Output splitWithDefaultDirections; + 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); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesTrainingPredict.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesTrainingPredict.java index 44c950bb510..d7cb2a7f3d6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesTrainingPredict.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesTrainingPredict.java @@ -24,6 +24,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Runs multiple additive regression ensemble predictors on input instances and @@ -49,7 +51,7 @@ public final class BoostedTreesTrainingPredict extends PrimitiveOp { * shape. * @return a new instance of BoostedTreesTrainingPredict */ - public static BoostedTreesTrainingPredict create(Scope scope, Operand treeEnsembleHandle, Operand cachedTreeIds, Operand cachedNodeIds, Iterable> bucketizedFeatures, Long logitsDimension) { + 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,27 +66,27 @@ public static BoostedTreesTrainingPredict create(Scope scope, Operand treeEns * Rank 2 Tensor containing logits update (with respect to cached * values stored) for each example. */ - public Output partialLogits() { + public Output partialLogits() { return partialLogits; } /** * Rank 1 Tensor containing new tree ids for each example. */ - public Output treeIds() { + public Output treeIds() { return treeIds; } /** * Rank 1 Tensor containing new node ids in the new tree_ids. */ - public Output nodeIds() { + public Output nodeIds() { return nodeIds; } - private Output partialLogits; - private Output treeIds; - private Output nodeIds; + private Output partialLogits; + private Output treeIds; + private Output nodeIds; private BoostedTreesTrainingPredict(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesUpdateEnsemble.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesUpdateEnsemble.java index 982e6d2a751..46399d6bb9e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesUpdateEnsemble.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/BoostedTreesUpdateEnsemble.java @@ -23,6 +23,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Updates the tree ensemble by either adding a layer to the last tree being grown @@ -55,7 +57,7 @@ public final class BoostedTreesUpdateEnsemble extends PrimitiveOp { * @param pruningMode 0-No pruning, 1-Pre-pruning, 2-Post-pruning. * @return a new instance of BoostedTreesUpdateEnsemble */ - 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) { + 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()); 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 cccaa287ae4..002fd93e4bd 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Return the shape of s0 op s1 with broadcast. @@ -34,7 +36,7 @@ * @param data type for {@code r0()} output */ @Operator -public final class BroadcastDynamicShape extends PrimitiveOp implements Operand { +public final class BroadcastDynamicShape extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BroadcastDynamicShape operation. @@ -44,7 +46,7 @@ public final class BroadcastDynamicShape extends PrimitiveOp i * @param s1 * @return a new instance of BroadcastDynamicShape */ - public static BroadcastDynamicShape create(Scope scope, Operand s0, Operand s1) { + 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()); 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 4669ffd6ec7..6efe36d0a58 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 @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Return the reduction indices for computing gradients of s0 op s1 with broadcast. @@ -31,7 +33,7 @@ * * @param data type for {@code r0()} output */ -public final class BroadcastGradientArgs extends PrimitiveOp { +public final class BroadcastGradientArgs extends PrimitiveOp { /** * Factory method to create a class wrapping a new BroadcastGradientArgs operation. @@ -41,7 +43,7 @@ public final class BroadcastGradientArgs extends PrimitiveOp { * @param s1 * @return a new instance of BroadcastGradientArgs */ - public static BroadcastGradientArgs create(Scope scope, Operand s0, Operand s1) { + 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()); 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 85b41994abc..db39581fb42 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Broadcast an array for a compatible shape. @@ -49,7 +51,7 @@ * @param data type for {@code output()} output */ @Operator -public final class BroadcastTo extends PrimitiveOp implements Operand { +public final class BroadcastTo extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BroadcastTo operation. @@ -59,7 +61,7 @@ public final class BroadcastTo extends PrimitiveOp implements Operand { * @param shape An 1-D `int` Tensor. The shape of the desired output. * @return a new instance of BroadcastTo */ - public static BroadcastTo create(Scope scope, Operand input, Operand shape) { + 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()); 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 b0c7c71e1f6..de5f9b92eea 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Bucketizes 'input' based on 'boundaries'. @@ -41,7 +44,7 @@ * [1, 3]] */ @Operator -public final class Bucketize extends PrimitiveOp implements Operand { +public final class Bucketize extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Bucketize operation. @@ -51,7 +54,7 @@ public final class Bucketize extends PrimitiveOp implements Operand { * @param boundaries A sorted list of floats gives the boundary of the buckets. * @return a new instance of Bucketize */ - public static Bucketize create(Scope scope, Operand input, List boundaries) { + 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.applyControlDependencies(opBuilder); @@ -70,16 +73,16 @@ public static Bucketize create(Scope scope, Operand input, * Equivalent to np.digitize. * @end_compatibility */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Bucketize(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CSVDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CSVDataset.java index 715c9c48d16..875af208d77 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CSVDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CSVDataset.java @@ -22,14 +22,18 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class CSVDataset extends PrimitiveOp implements Operand { +public final class CSVDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CSVDataset operation. @@ -47,7 +51,7 @@ public final class CSVDataset extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of CSVDataset */ - 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) { + 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()); @@ -75,8 +79,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CacheDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CacheDatasetV2.java index 622e8984f2d..eedc1e3cfa6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CacheDatasetV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CacheDatasetV2.java @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class CacheDatasetV2 extends PrimitiveOp implements Operand { +public final class CacheDatasetV2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CacheDatasetV2 operation. @@ -42,7 +44,7 @@ public final class CacheDatasetV2 extends PrimitiveOp implements Operand * @param outputShapes * @return a new instance of CacheDatasetV2 */ - public static CacheDatasetV2 create(Scope scope, Operand inputDataset, Operand filename, Operand cache, List> outputTypes, List outputShapes) { + 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()); @@ -50,7 +52,7 @@ public static CacheDatasetV2 create(Scope scope, Operand inputDataset, Operan opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -69,8 +71,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ChooseFastestDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ChooseFastestDataset.java index a6f8594b793..cea1724cea0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ChooseFastestDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ChooseFastestDataset.java @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** */ -public final class ChooseFastestDataset extends PrimitiveOp implements Operand { +public final class ChooseFastestDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ChooseFastestDataset operation. @@ -42,14 +43,14 @@ public final class ChooseFastestDataset extends PrimitiveOp implements Operand> inputDatasets, Long numExperiments, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); opBuilder.setAttr("num_experiments", numExperiments); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +69,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 a6c33cde3f3..7d921f6c272 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Clips tensor values to a specified min and max. @@ -36,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ClipByValue extends PrimitiveOp implements Operand { +public final class ClipByValue extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ClipByValue operation. @@ -49,7 +50,7 @@ public final class ClipByValue extends PrimitiveOp implements Operand { * as `t`. The maximum value to clip by. * @return a new instance of ClipByValue */ - public static ClipByValue create(Scope scope, Operand t, Operand clipValueMin, Operand clipValueMax) { + 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()); 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 cde655cedc0..781d9e33956 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 @@ -21,16 +21,18 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Mutually accumulates multiple tensors of identical type and shape. * - * @param data type for {@code data()} output + * @param data type for {@code output()} output */ -public final class CollectiveGather extends PrimitiveOp implements Operand { +public final class CollectiveGather extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CollectiveGather operation. @@ -43,7 +45,7 @@ public final class CollectiveGather extends PrimitiveOp implem * @param shape * @return a new instance of CollectiveGather */ - public static CollectiveGather create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, Shape shape) { + public static CollectiveGather create(Scope scope, Operand input, Long groupSize, Long groupKey, Long instanceKey, Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("CollectiveGather", scope.makeOpName("CollectiveGather")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -56,20 +58,20 @@ public static CollectiveGather create(Scope scope, Operand /** */ - public Output data() { - return data; + public Output output() { + return output; } @Override public Output asOutput() { - return data; + return output; } - private Output data; + private Output output; private CollectiveGather(Operation operation) { super(operation); int outputIdx = 0; - data = operation.output(outputIdx++); + output = operation.output(outputIdx++); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectivePermute.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectivePermute.java index c27139b06d9..4391ebbefb9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectivePermute.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CollectivePermute.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * An Op to permute tensors across replicated TPU instances. @@ -35,7 +37,7 @@ * * @param data type for {@code output()} output */ -public final class CollectivePermute extends PrimitiveOp implements Operand { +public final class CollectivePermute extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CollectivePermute operation. @@ -46,7 +48,7 @@ public final class CollectivePermute extends PrimitiveOp implements Operand CollectivePermute create(Scope scope, Operand input, Operand sourceTargetPairs) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CombinedNonMaxSuppression.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CombinedNonMaxSuppression.java index f24124aa0fd..fa1079b0800 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CombinedNonMaxSuppression.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CombinedNonMaxSuppression.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Greedily selects a subset of bounding boxes in descending order of score, @@ -98,7 +100,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CombinedNonMaxSuppression */ - public static CombinedNonMaxSuppression create(Scope scope, Operand boxes, Operand scores, Operand maxOutputSizePerClass, Operand maxTotalSize, Operand iouThreshold, Operand scoreThreshold, Options... options) { + 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()); @@ -144,7 +146,7 @@ public static Options clipBoxes(Boolean clipBoxes) { * A [batch_size, max_detections, 4] float32 tensor * containing the non-max suppressed boxes. */ - public Output nmsedBoxes() { + public Output nmsedBoxes() { return nmsedBoxes; } @@ -152,7 +154,7 @@ public Output nmsedBoxes() { * A [batch_size, max_detections] float32 tensor * containing the scores for the boxes. */ - public Output nmsedScores() { + public Output nmsedScores() { return nmsedScores; } @@ -160,7 +162,7 @@ public Output nmsedScores() { * A [batch_size, max_detections] float32 tensor * containing the classes for the boxes. */ - public Output nmsedClasses() { + public Output nmsedClasses() { return nmsedClasses; } @@ -170,14 +172,14 @@ public Output nmsedClasses() { * nms_boxes[i], nms_scores[i] and nms_class[i] are valid. The rest of the * entries are zero paddings. */ - public Output validDetections() { + public Output validDetections() { return validDetections; } - private Output nmsedBoxes; - private Output nmsedScores; - private Output nmsedClasses; - private Output validDetections; + private Output nmsedBoxes; + private Output nmsedScores; + private Output nmsedClasses; + private Output validDetections; private CombinedNonMaxSuppression(Operation operation) { super(operation); 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 b14f6c04f42..5c022eb5d72 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Concatenates tensors along one dimension. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Concat extends PrimitiveOp implements Operand { +public final class Concat extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Concat operation. @@ -44,7 +46,7 @@ public final class Concat extends PrimitiveOp implements Operand { * range [-rank(values), rank(values)). * @return a new instance of Concat */ - public static Concat create(Scope scope, Iterable> values, Operand axis) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConfigureDistributedTPU.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConfigureDistributedTPU.java index c1e9a06e03f..a582e58049d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConfigureDistributedTPU.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ConfigureDistributedTPU.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Sets up the centralized structures for a distributed TPU system. */ -public final class ConfigureDistributedTPU extends PrimitiveOp implements Operand { +public final class ConfigureDistributedTPU extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ConfigureDistributedTPU} @@ -119,16 +120,16 @@ public static Options isGlobalInit(Boolean isGlobalInit) { * A serialized tensorflow.tpu.TopologyProto that describes the TPU * topology. */ - public Output topology() { + public Output topology() { return topology; } @Override - public Output asOutput() { + public Output asOutput() { return topology; } - private Output topology; + private Output topology; private ConfigureDistributedTPU(Operation operation) { super(operation); 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 a3bedbfa400..4a5a93a96f2 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Increments 'ref' until it reaches 'limit'. @@ -31,7 +33,7 @@ * @param data type for {@code output()} output */ @Operator -public final class CountUpTo extends PrimitiveOp implements Operand { +public final class CountUpTo extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CountUpTo operation. @@ -42,7 +44,7 @@ public final class CountUpTo extends PrimitiveOp implements Op * 'OutOfRange' error. * @return a new instance of CountUpTo */ - public static CountUpTo create(Scope scope, Operand ref, Long limit) { + 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.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CrossReplicaSum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CrossReplicaSum.java index 0fd6d9177b6..e993992ea95 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CrossReplicaSum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CrossReplicaSum.java @@ -23,6 +23,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An Op to sum inputs across replicated TPU instances. @@ -36,7 +39,7 @@ * * @param data type for {@code output()} output */ -public final class CrossReplicaSum extends PrimitiveOp implements Operand { +public final class CrossReplicaSum extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CrossReplicaSum operation. @@ -48,7 +51,7 @@ public final class CrossReplicaSum extends PrimitiveOp impleme * replica ids in the ith subgroup. * @return a new instance of CrossReplicaSum */ - public static CrossReplicaSum create(Scope scope, Operand input, Operand groupAssignment) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNBackpropV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNBackpropV3.java index 2be49c97997..a6b749c5f85 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNBackpropV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNBackpropV3.java @@ -23,6 +23,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Backprop step of CudnnRNNV3. @@ -77,7 +80,7 @@ * * @param data type for {@code inputBackprop()} output */ -public final class CudnnRNNBackpropV3 extends PrimitiveOp { +public final class CudnnRNNBackpropV3 extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.CudnnRNNBackpropV3} @@ -181,7 +184,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CudnnRNNBackpropV3 */ - public static CudnnRNNBackpropV3 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) { + public static CudnnRNNBackpropV3 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("CudnnRNNBackpropV3")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputH.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNCanonicalToParamsV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNCanonicalToParamsV2.java index acc0913384a..e7186f5260c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNCanonicalToParamsV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNCanonicalToParamsV2.java @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Converts CudnnRNN params from canonical form to usable form. It supports the projection in LSTM. @@ -63,7 +66,7 @@ * @param data type for {@code params()} output */ @Operator -public final class CudnnRNNCanonicalToParamsV2 extends PrimitiveOp implements Operand { +public final class CudnnRNNCanonicalToParamsV2 extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.CudnnRNNCanonicalToParamsV2} @@ -150,7 +153,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CudnnRNNCanonicalToParamsV2 */ - public static CudnnRNNCanonicalToParamsV2 create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Iterable> weights, Iterable> biases, Options... options) { + public static CudnnRNNCanonicalToParamsV2 create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Iterable> weights, Iterable> biases, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNCanonicalToParamsV2", scope.makeOpName("CudnnRNNCanonicalToParamsV2")); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNParamsToCanonicalV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNParamsToCanonicalV2.java index e1386573c3a..378c2c47ed9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNParamsToCanonicalV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNParamsToCanonicalV2.java @@ -26,6 +26,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Retrieves CudnnRNN params in canonical form. It supports the projection in LSTM. @@ -64,7 +67,7 @@ * @param data type for {@code weights()} output */ @Operator -public final class CudnnRNNParamsToCanonicalV2 extends PrimitiveOp { +public final class CudnnRNNParamsToCanonicalV2 extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.CudnnRNNParamsToCanonicalV2} @@ -152,7 +155,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CudnnRNNParamsToCanonicalV2 */ - public static CudnnRNNParamsToCanonicalV2 create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Operand params, Long numParamsWeights, Long numParamsBiases, Options... options) { + public static CudnnRNNParamsToCanonicalV2 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("CudnnRNNParamsToCanonicalV2")); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNV3.java index 2786a410b16..6074100ede5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CudnnRNNV3.java @@ -23,6 +23,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * A RNN backed by cuDNN. @@ -67,7 +70,7 @@ * * @param data type for {@code output()} output */ -public final class CudnnRNNV3 extends PrimitiveOp { +public final class CudnnRNNV3 extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.CudnnRNNV3} @@ -172,7 +175,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CudnnRNNV3 */ - public static CudnnRNNV3 create(Scope scope, Operand input, Operand inputH, Operand inputC, Operand params, Operand sequenceLengths, Options... options) { + public static CudnnRNNV3 create(Scope scope, Operand input, Operand inputH, Operand inputC, Operand params, Operand sequenceLengths, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNV3", scope.makeOpName("CudnnRNNV3")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputH.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CumulativeLogsumexp.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CumulativeLogsumexp.java index 4ac0ae657c0..10572542b74 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CumulativeLogsumexp.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/CumulativeLogsumexp.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Compute the cumulative product of the tensor `x` along `axis`. @@ -47,7 +49,7 @@ * * @param data type for {@code out()} output */ -public final class CumulativeLogsumexp extends PrimitiveOp implements Operand { +public final class CumulativeLogsumexp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.CumulativeLogsumexp} @@ -87,7 +89,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CumulativeLogsumexp */ - public static CumulativeLogsumexp create(Scope scope, Operand x, Operand axis, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DatasetCardinality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DatasetCardinality.java index 26cc47eef2a..1a6094d5a92 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DatasetCardinality.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DatasetCardinality.java @@ -23,13 +23,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; /** * Returns the cardinality of `input_dataset`. *

* Returns the cardinality of `input_dataset`. */ -public final class DatasetCardinality extends PrimitiveOp implements Operand { +public final class DatasetCardinality extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DatasetCardinality operation. @@ -49,16 +50,16 @@ public static DatasetCardinality create(Scope scope, Operand inputDataset) { * The cardinality of `input_dataset`. Named constants are used to represent * infinite and unknown cardinality. */ - public Output cardinality() { + public Output cardinality() { return cardinality; } @Override - public Output asOutput() { + public Output asOutput() { return cardinality; } - private Output cardinality; + private Output cardinality; private DatasetCardinality(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DatasetFromGraph.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DatasetFromGraph.java index 100706ba1a8..d534c8431a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DatasetFromGraph.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DatasetFromGraph.java @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +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`. */ -public final class DatasetFromGraph extends PrimitiveOp implements Operand { +public final class DatasetFromGraph extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DatasetFromGraph operation. @@ -38,7 +40,7 @@ public final class DatasetFromGraph extends PrimitiveOp implements Operand graphDef) { + public static DatasetFromGraph create(Scope scope, Operand graphDef) { OperationBuilder opBuilder = scope.env().opBuilder("DatasetFromGraph", scope.makeOpName("DatasetFromGraph")); opBuilder.addInput(graphDef.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -54,8 +56,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DebugGradientIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DebugGradientIdentity.java index 28fc1adbfbb..3d438dba3cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DebugGradientIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DebugGradientIdentity.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Identity op for gradient debugging. @@ -33,7 +34,7 @@ * * @param data type for {@code output()} output */ -public final class DebugGradientIdentity extends PrimitiveOp implements Operand { +public final class DebugGradientIdentity extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DebugGradientIdentity operation. @@ -42,7 +43,7 @@ public final class DebugGradientIdentity extends PrimitiveOp implements Opera * @param input * @return a new instance of DebugGradientIdentity */ - public static DebugGradientIdentity create(Scope scope, Operand input) { + public static DebugGradientIdentity create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("DebugGradientIdentity", scope.makeOpName("DebugGradientIdentity")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DebugGradientRefIdentity.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DebugGradientRefIdentity.java index 2db65501cbf..69dd0110df1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DebugGradientRefIdentity.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DebugGradientRefIdentity.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Identity op for gradient debugging. @@ -33,7 +34,7 @@ * * @param data type for {@code output()} output */ -public final class DebugGradientRefIdentity extends PrimitiveOp implements Operand { +public final class DebugGradientRefIdentity extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DebugGradientRefIdentity operation. @@ -42,7 +43,7 @@ public final class DebugGradientRefIdentity extends PrimitiveOp implements Op * @param input * @return a new instance of DebugGradientRefIdentity */ - public static DebugGradientRefIdentity create(Scope scope, Operand input) { + public static DebugGradientRefIdentity create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("DebugGradientRefIdentity", scope.makeOpName("DebugGradientRefIdentity")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodePaddedRaw.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodePaddedRaw.java index eb71ab6e692..a1f5430c61c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodePaddedRaw.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DecodePaddedRaw.java @@ -25,6 +25,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reinterpret the bytes of a string as a vector of numbers. @@ -32,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator -public final class DecodePaddedRaw extends PrimitiveOp implements Operand { +public final class DecodePaddedRaw extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.DecodePaddedRaw} @@ -65,12 +69,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodePaddedRaw */ - public static DecodePaddedRaw create(Scope scope, Operand inputBytes, Operand fixedLength, Class outType, Options... options) { + public static DecodePaddedRaw create(Scope scope, Operand inputBytes, Operand fixedLength, DataType outType, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodePaddedRaw", scope.makeOpName("DecodePaddedRaw")); opBuilder.addInput(inputBytes.asOutput()); opBuilder.addInput(fixedLength.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); if (options != null) { for (Options opts : options) { if (opts.littleEndian != null) { 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 9f188ce008c..705511a0386 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 @@ -26,6 +26,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * The op extracts fields from a serialized protocol buffers message into tensors. @@ -130,7 +132,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodeProto */ - public static DecodeProto create(Scope scope, Operand bytes, String messageType, List fieldNames, List> outputTypes, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -142,7 +144,7 @@ public static DecodeProto create(Scope scope, Operand bytes, String mess opBuilder.setAttr("field_names", fieldNamesArray); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); if (options != null) { @@ -188,7 +190,7 @@ public static Options sanitize(Boolean sanitize) { * Each entry is the number of values found for the corresponding field. * Optional fields may have 0 or 1 values. */ - public Output sizes() { + public Output sizes() { return sizes; } @@ -201,7 +203,7 @@ public List> values() { return values; } - private Output sizes; + private Output sizes; private List> values; private DecodeProto(Operation operation) { 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 d63c9d0c797..5e2c8120d03 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Makes a copy of `x`. @@ -31,7 +32,7 @@ * @param data type for {@code y()} output */ @Operator -public final class DeepCopy extends PrimitiveOp implements Operand { +public final class DeepCopy extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DeepCopy operation. @@ -40,7 +41,7 @@ public final class DeepCopy extends PrimitiveOp implements Operand { * @param x The source tensor of type `T`. * @return a new instance of DeepCopy */ - public static DeepCopy create(Scope scope, Operand x) { + public static DeepCopy create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("DeepCopy", scope.makeOpName("DeepCopy")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 7024c12928e..4da393ce1af 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Delete the tensor specified by its handle in the session. @@ -37,7 +38,7 @@ public final class DeleteSessionTensor extends PrimitiveOp { * @param handle The handle for a tensor stored in the session state. * @return a new instance of DeleteSessionTensor */ - public static DeleteSessionTensor create(Scope scope, Operand handle) { + public static DeleteSessionTensor create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("DeleteSessionTensor", scope.makeOpName("DeleteSessionTensor")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 90d19979114..b077366e669 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Destroys the temporary variable and returns its final value. @@ -39,7 +40,7 @@ * @param data type for {@code value()} output */ @Operator -public final class DestroyTemporaryVariable extends PrimitiveOp implements Operand { +public final class DestroyTemporaryVariable extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DestroyTemporaryVariable operation. @@ -50,7 +51,7 @@ public final class DestroyTemporaryVariable extends PrimitiveOp implements Op * 'TemporaryVariable' op. * @return a new instance of DestroyTemporaryVariable */ - public static DestroyTemporaryVariable create(Scope scope, Operand ref, String varName) { + 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.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DirectedInterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DirectedInterleaveDataset.java index 7d15d488267..e8e685f6919 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DirectedInterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DirectedInterleaveDataset.java @@ -23,15 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A substitute for `InterleaveDataset` on a fixed list of `N` datasets. */ -public final class DirectedInterleaveDataset extends PrimitiveOp implements Operand { +public final class DirectedInterleaveDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DirectedInterleaveDataset operation. @@ -45,14 +46,14 @@ public final class DirectedInterleaveDataset extends PrimitiveOp implements Oper * @param outputShapes * @return a new instance of DirectedInterleaveDataset */ - public static DirectedInterleaveDataset create(Scope scope, Operand selectorInputDataset, Iterable> dataInputDatasets, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -71,8 +72,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DrawBoundingBoxesV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DrawBoundingBoxesV2.java index dc344bcadf5..815c84bfb7f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DrawBoundingBoxesV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/DrawBoundingBoxesV2.java @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Draw bounding boxes on a batch of images. @@ -43,7 +46,7 @@ * @param data type for {@code output()} output */ @Operator -public final class DrawBoundingBoxesV2 extends PrimitiveOp implements Operand { +public final class DrawBoundingBoxesV2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DrawBoundingBoxesV2 operation. @@ -55,7 +58,7 @@ public final class DrawBoundingBoxesV2 extends PrimitiveOp imp * @param colors 2-D. A list of RGBA colors to cycle through for the boxes. * @return a new instance of DrawBoundingBoxesV2 */ - public static DrawBoundingBoxesV2 create(Scope scope, Operand images, Operand boxes, Operand colors) { + public static DrawBoundingBoxesV2 create(Scope scope, Operand images, Operand boxes, Operand colors) { OperationBuilder opBuilder = scope.env().opBuilder("DrawBoundingBoxesV2", scope.makeOpName("DrawBoundingBoxesV2")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(boxes.asOutput()); 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 c06b8b156dd..c7149fb36cd 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 @@ -27,6 +27,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Partitions `data` into `num_partitions` tensors using indices from `partitions`. @@ -68,7 +70,7 @@ * @param data type for {@code outputs()} output */ @Operator -public final class DynamicPartition extends PrimitiveOp implements Iterable> { +public final class DynamicPartition extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new DynamicPartition operation. @@ -79,7 +81,7 @@ public final class DynamicPartition extends PrimitiveOp implements Iterable DynamicPartition create(Scope scope, Operand data, Operand partitions, Long numPartitions) { + 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()); 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 864bc9631b0..9b18cc05f52 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Interleave the values from the `data` tensors into a single tensor. @@ -87,7 +89,7 @@ * @param data type for {@code merged()} output */ @Operator -public final class DynamicStitch extends PrimitiveOp implements Operand { +public final class DynamicStitch extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DynamicStitch operation. @@ -97,7 +99,7 @@ public final class DynamicStitch extends PrimitiveOp implements Operand { * @param data * @return a new instance of DynamicStitch */ - public static DynamicStitch create(Scope scope, Iterable> indices, Iterable> data) { + 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)); 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 6cd854fcc3a..5d6517c22ff 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Computes the (possibly normalized) Levenshtein Edit Distance. @@ -36,7 +39,7 @@ * The inputs are: */ @Operator -public final class EditDistance extends PrimitiveOp implements Operand { +public final class EditDistance extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.EditDistance} @@ -77,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of EditDistance */ - public static EditDistance create(Scope scope, Operand hypothesisIndices, Operand hypothesisValues, Operand hypothesisShape, Operand truthIndices, Operand truthValues, Operand truthShape, Options... options) { + 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()); @@ -137,16 +140,16 @@ public static Options normalize(Boolean normalize) { * output = [[inf, 1.0], // (0,0): no truth, (0,1): no hypothesis * [0.5, 1.0]] // (1,0): addition, (1,1): no hypothesis */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private EditDistance(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Einsum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Einsum.java index 7b1d8568389..90c3bbaa331 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Einsum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Einsum.java @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Tensor contraction according to Einstein summation convention. @@ -109,7 +110,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Einsum extends PrimitiveOp implements Operand { +public final class Einsum extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Einsum operation. @@ -119,7 +120,7 @@ public final class Einsum extends PrimitiveOp implements Operand { * @param equation String describing the Einstein Summation operation; in the format of np.einsum. * @return a new instance of Einsum */ - public static Einsum create(Scope scope, Iterable> inputs, String equation) { + 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.applyControlDependencies(opBuilder); 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 1d15b16bb04..e1fe1f3c360 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Creates a tensor with the given shape. @@ -34,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Empty extends PrimitiveOp implements Operand { +public final class Empty extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Empty} @@ -64,11 +66,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Empty */ - public static Empty create(Scope scope, Operand shape, Class dtype, Options... options) { + public static Empty create(Scope scope, Operand shape, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Empty", scope.makeOpName("Empty")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.init != null) { 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 f933e1d3c34..eb2c3e83ff7 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Creates and returns an empty tensor list. @@ -37,7 +40,7 @@ * element_shape: a shape compatible with that of elements in the list. */ @Operator -public final class EmptyTensorList extends PrimitiveOp implements Operand { +public final class EmptyTensorList extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new EmptyTensorList operation. @@ -48,12 +51,12 @@ public final class EmptyTensorList extends PrimitiveOp implements Operand EmptyTensorList create(Scope scope, Operand elementShape, Operand maxNumElements, Class elementDtype) { + public static EmptyTensorList create(Scope scope, Operand elementShape, Operand maxNumElements, DataType elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("EmptyTensorList", scope.makeOpName("EmptyTensorList")); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(maxNumElements.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("element_dtype", DataType.fromClass(elementDtype)); + opBuilder.setAttr("element_dtype", elementDtype); return new EmptyTensorList(opBuilder.build()); } @@ -65,8 +68,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 2bcaec9aa45..c3a9c16a2dc 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * The op serializes protobuf messages provided in the input tensors. @@ -70,7 +72,7 @@ * - A "bytes://", in which protocol descriptors are created from ``, * which is expected to be a `FileDescriptorSet` serialized as a string. */ -public final class EncodeProto extends PrimitiveOp implements Operand { +public final class EncodeProto extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.EncodeProto} @@ -102,7 +104,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of EncodeProto */ - public static EncodeProto create(Scope scope, Operand sizes, Iterable> values, List fieldNames, String messageType, Options... options) { + 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)); @@ -133,16 +135,16 @@ public static Options descriptorSource(String descriptorSource) { /** * Tensor of serialized protos with shape `batch_shape`. */ - public Output bytes() { + public Output bytes() { return bytes; } @Override - public Output asOutput() { + public Output asOutput() { return bytes; } - private Output bytes; + private Output bytes; private EncodeProto(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingIntegerBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingIntegerBatch.java index d17275aebb0..eafd8f76a5c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingIntegerBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingIntegerBatch.java @@ -23,6 +23,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * An op that enqueues a list of input batch tensors to TPUEmbedding. @@ -62,7 +64,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of EnqueueTPUEmbeddingIntegerBatch */ - public static EnqueueTPUEmbeddingIntegerBatch create(Scope scope, Iterable> batch, Operand modeOverride, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingSparseBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingSparseBatch.java index 489907b3137..b656d0eab37 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingSparseBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingSparseBatch.java @@ -24,6 +24,9 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An op that enqueues TPUEmbedding input indices from a SparseTensor. @@ -93,7 +96,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of EnqueueTPUEmbeddingSparseBatch */ - public static EnqueueTPUEmbeddingSparseBatch create(Scope scope, Iterable> sampleIndices, Iterable> embeddingIndices, Iterable> aggregationWeights, Operand modeOverride, Options... options) { + 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)); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingSparseTensorBatch.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingSparseTensorBatch.java index 74418c46616..29ae548be48 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingSparseTensorBatch.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EnqueueTPUEmbeddingSparseTensorBatch.java @@ -24,6 +24,9 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Eases the porting of code that uses tf.nn.embedding_lookup_sparse(). @@ -106,7 +109,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of EnqueueTPUEmbeddingSparseTensorBatch */ - public static EnqueueTPUEmbeddingSparseTensorBatch create(Scope scope, Iterable> sampleIndices, Iterable> embeddingIndices, Iterable> aggregationWeights, Operand modeOverride, List tableIds, Options... options) { + 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)); 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 8d808e65730..8d538b4f57d 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 @@ -21,10 +21,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Ensures that the tensor's shape matches the expected shape. @@ -35,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator -public final class EnsureShape extends PrimitiveOp implements Operand { +public final class EnsureShape extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new EnsureShape operation. @@ -45,7 +46,7 @@ public final class EnsureShape extends PrimitiveOp implements Operand { * @param shape The expected (possibly partially specified) shape of the input tensor. * @return a new instance of EnsureShape */ - public static EnsureShape create(Scope scope, Operand input, Shape shape) { + 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.applyControlDependencies(opBuilder); 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 da98b0b6cf4..4f26e43f7d4 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Creates or finds a child frame, and makes `data` available to the child frame. @@ -35,7 +36,7 @@ * * @param data type for {@code output()} output */ -public final class Enter extends PrimitiveOp implements Operand { +public final class Enter extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Enter} @@ -74,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Enter */ - public static Enter create(Scope scope, Operand data, String frameName, Options... options) { + 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.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EuclideanNorm.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EuclideanNorm.java index d1fa6d0bd5c..6bf81fb54a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EuclideanNorm.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/EuclideanNorm.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the euclidean norm of elements across dimensions of a tensor. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class EuclideanNorm extends PrimitiveOp implements Operand { +public final class EuclideanNorm extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.EuclideanNorm} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of EuclideanNorm */ - public static EuclideanNorm create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); 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 be052db219a..52046d4e00d 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Exits the current frame to its parent frame. @@ -31,7 +32,7 @@ * * @param data type for {@code output()} output */ -public final class Exit extends PrimitiveOp implements Operand { +public final class Exit extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Exit operation. @@ -40,7 +41,7 @@ public final class Exit extends PrimitiveOp implements Operand { * @param data The tensor to be made available to the parent frame. * @return a new instance of Exit */ - public static Exit create(Scope scope, Operand data) { + public static Exit create(Scope scope, Operand data) { OperationBuilder opBuilder = scope.env().opBuilder("Exit", scope.makeOpName("Exit")); opBuilder.addInput(data.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 192a86a4cbf..f9982c8e4f7 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Inserts a dimension of 1 into a tensor's shape. @@ -60,7 +62,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ExpandDims extends PrimitiveOp implements Operand { +public final class ExpandDims extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExpandDims operation. @@ -72,7 +74,7 @@ public final class ExpandDims extends PrimitiveOp implements Operand { * `[-rank(input) - 1, rank(input)]`. * @return a new instance of ExpandDims */ - public static ExpandDims create(Scope scope, Operand input, Operand axis) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalAutoShardDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalAutoShardDataset.java index 9f8a0a3b8c1..6f939e5bab6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalAutoShardDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalAutoShardDataset.java @@ -23,9 +23,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that shards the input dataset. @@ -38,7 +40,7 @@ * This dataset will throw a NotFound error if we cannot shard the dataset * automatically. */ -public final class ExperimentalAutoShardDataset extends PrimitiveOp implements Operand { +public final class ExperimentalAutoShardDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalAutoShardDataset operation. @@ -51,7 +53,7 @@ public final class ExperimentalAutoShardDataset extends PrimitiveOp implements O * @param outputShapes * @return a new instance of ExperimentalAutoShardDataset */ - public static ExperimentalAutoShardDataset create(Scope scope, Operand inputDataset, Operand numWorkers, Operand index, List> outputTypes, List outputShapes) { + public static ExperimentalAutoShardDataset create(Scope scope, Operand inputDataset, Operand numWorkers, Operand index, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalAutoShardDataset", scope.makeOpName("ExperimentalAutoShardDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numWorkers.asOutput()); @@ -59,7 +61,7 @@ public static ExperimentalAutoShardDataset create(Scope scope, Operand inputD opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -78,8 +80,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalBytesProducedStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalBytesProducedStatsDataset.java index 667105314ae..afb711a7013 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalBytesProducedStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalBytesProducedStatsDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Records the bytes size of each element of `input_dataset` in a StatsAggregator. */ -public final class ExperimentalBytesProducedStatsDataset extends PrimitiveOp implements Operand { +public final class ExperimentalBytesProducedStatsDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalBytesProducedStatsDataset operation. @@ -42,14 +44,14 @@ public final class ExperimentalBytesProducedStatsDataset extends PrimitiveOp imp * @param outputShapes * @return a new instance of ExperimentalBytesProducedStatsDataset */ - public static ExperimentalBytesProducedStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { + public static ExperimentalBytesProducedStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalBytesProducedStatsDataset", scope.makeOpName("ExperimentalBytesProducedStatsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +70,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalChooseFastestDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalChooseFastestDataset.java index 402b1096985..24144b287f7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalChooseFastestDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalChooseFastestDataset.java @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** */ -public final class ExperimentalChooseFastestDataset extends PrimitiveOp implements Operand { +public final class ExperimentalChooseFastestDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalChooseFastestDataset operation. @@ -42,14 +43,14 @@ public final class ExperimentalChooseFastestDataset extends PrimitiveOp implemen * @param outputShapes * @return a new instance of ExperimentalChooseFastestDataset */ - public static ExperimentalChooseFastestDataset create(Scope scope, Iterable> inputDatasets, Long numExperiments, List> outputTypes, List outputShapes) { + public static ExperimentalChooseFastestDataset create(Scope scope, Iterable> inputDatasets, Long numExperiments, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalChooseFastestDataset", scope.makeOpName("ExperimentalChooseFastestDataset")); opBuilder.addInputList(Operands.asOutputs(inputDatasets)); opBuilder = scope.applyControlDependencies(opBuilder); opBuilder.setAttr("num_experiments", numExperiments); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +69,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDatasetCardinality.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDatasetCardinality.java index 4a81173ed9a..91f62690849 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDatasetCardinality.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDatasetCardinality.java @@ -23,13 +23,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; /** * Returns the cardinality of `input_dataset`. *

* Returns the cardinality of `input_dataset`. */ -public final class ExperimentalDatasetCardinality extends PrimitiveOp implements Operand { +public final class ExperimentalDatasetCardinality extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalDatasetCardinality operation. @@ -49,16 +50,16 @@ public static ExperimentalDatasetCardinality create(Scope scope, Operand inpu * The cardinality of `input_dataset`. Named constants are used to represent * infinite and unknown cardinality. */ - public Output cardinality() { + public Output cardinality() { return cardinality; } @Override - public Output asOutput() { + public Output asOutput() { return cardinality; } - private Output cardinality; + private Output cardinality; private ExperimentalDatasetCardinality(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDatasetToTFRecord.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDatasetToTFRecord.java index 77f0a40e7fd..2243a662b33 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDatasetToTFRecord.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDatasetToTFRecord.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Writes the given dataset to the given file using the TFRecord format. @@ -38,7 +39,7 @@ public final class ExperimentalDatasetToTFRecord extends PrimitiveOp { * compression), (ii) "ZLIB", or (iii) "GZIP". * @return a new instance of ExperimentalDatasetToTFRecord */ - public static ExperimentalDatasetToTFRecord create(Scope scope, Operand inputDataset, Operand filename, Operand compressionType) { + public static ExperimentalDatasetToTFRecord create(Scope scope, Operand inputDataset, Operand filename, Operand compressionType) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDatasetToTFRecord", scope.makeOpName("ExperimentalDatasetToTFRecord")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(filename.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDenseToSparseBatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDenseToSparseBatchDataset.java index 7a0095b0a05..d089d936d63 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDenseToSparseBatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalDenseToSparseBatchDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that batches input elements into a SparseTensor. */ -public final class ExperimentalDenseToSparseBatchDataset extends PrimitiveOp implements Operand { +public final class ExperimentalDenseToSparseBatchDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalDenseToSparseBatchDataset operation. @@ -46,7 +48,7 @@ public final class ExperimentalDenseToSparseBatchDataset extends PrimitiveOp imp * @param outputShapes * @return a new instance of ExperimentalDenseToSparseBatchDataset */ - public static ExperimentalDenseToSparseBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand rowShape, List> outputTypes, List outputShapes) { + public static ExperimentalDenseToSparseBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand rowShape, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDenseToSparseBatchDataset", scope.makeOpName("ExperimentalDenseToSparseBatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(batchSize.asOutput()); @@ -54,7 +56,7 @@ public static ExperimentalDenseToSparseBatchDataset create(Scope scope, Operand< opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -73,8 +75,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalLatencyStatsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalLatencyStatsDataset.java index 787c91bb9e2..96f83407deb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalLatencyStatsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalLatencyStatsDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Records the latency of producing `input_dataset` elements in a StatsAggregator. */ -public final class ExperimentalLatencyStatsDataset extends PrimitiveOp implements Operand { +public final class ExperimentalLatencyStatsDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalLatencyStatsDataset operation. @@ -42,14 +44,14 @@ public final class ExperimentalLatencyStatsDataset extends PrimitiveOp implement * @param outputShapes * @return a new instance of ExperimentalLatencyStatsDataset */ - public static ExperimentalLatencyStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { + public static ExperimentalLatencyStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalLatencyStatsDataset", scope.makeOpName("ExperimentalLatencyStatsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(tag.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +70,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalMatchingFilesDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalMatchingFilesDataset.java index 0508f121e7b..0bf96e5b682 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalMatchingFilesDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalMatchingFilesDataset.java @@ -23,10 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class ExperimentalMatchingFilesDataset extends PrimitiveOp implements Operand { +public final class ExperimentalMatchingFilesDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalMatchingFilesDataset operation. @@ -35,7 +37,7 @@ public final class ExperimentalMatchingFilesDataset extends PrimitiveOp implemen * @param patterns * @return a new instance of ExperimentalMatchingFilesDataset */ - public static ExperimentalMatchingFilesDataset create(Scope scope, Operand patterns) { + public static ExperimentalMatchingFilesDataset create(Scope scope, Operand patterns) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalMatchingFilesDataset", scope.makeOpName("ExperimentalMatchingFilesDataset")); opBuilder.addInput(patterns.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -50,8 +52,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalMaxIntraOpParallelismDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalMaxIntraOpParallelismDataset.java index 57c5b91add8..9f117d20523 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalMaxIntraOpParallelismDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalMaxIntraOpParallelismDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that overrides the maximum intra-op parallelism. */ -public final class ExperimentalMaxIntraOpParallelismDataset extends PrimitiveOp implements Operand { +public final class ExperimentalMaxIntraOpParallelismDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalMaxIntraOpParallelismDataset operation. @@ -42,14 +44,14 @@ public final class ExperimentalMaxIntraOpParallelismDataset extends PrimitiveOp * @param outputShapes * @return a new instance of ExperimentalMaxIntraOpParallelismDataset */ - public static ExperimentalMaxIntraOpParallelismDataset create(Scope scope, Operand inputDataset, Operand maxIntraOpParallelism, List> outputTypes, List outputShapes) { + public static ExperimentalMaxIntraOpParallelismDataset create(Scope scope, Operand inputDataset, Operand maxIntraOpParallelism, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalMaxIntraOpParallelismDataset", scope.makeOpName("ExperimentalMaxIntraOpParallelismDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(maxIntraOpParallelism.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +70,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalParseExampleDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalParseExampleDataset.java index eae72a12ee0..d2ae44a1833 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalParseExampleDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalParseExampleDataset.java @@ -23,15 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +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. */ -public final class ExperimentalParseExampleDataset extends PrimitiveOp implements Operand { +public final class ExperimentalParseExampleDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ExperimentalParseExampleDataset} @@ -81,7 +83,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ExperimentalParseExampleDataset */ - public static ExperimentalParseExampleDataset create(Scope scope, Operand inputDataset, Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, List denseKeys, List> sparseTypes, List denseShapes, List> outputTypes, List outputShapes, Options... options) { + public static ExperimentalParseExampleDataset create(Scope scope, Operand inputDataset, Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, List denseKeys, List> sparseTypes, List denseShapes, List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalParseExampleDataset", scope.makeOpName("ExperimentalParseExampleDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numParallelCalls.asOutput()); @@ -99,7 +101,7 @@ public static ExperimentalParseExampleDataset create(Scope scope, Operand inp opBuilder.setAttr("dense_keys", denseKeysArray); DataType[] sparseTypesArray = new DataType[sparseTypes.size()]; for (int i = 0; i < sparseTypesArray.length; ++i) { - sparseTypesArray[i] = DataType.fromClass(sparseTypes.get(i)); + sparseTypesArray[i] = sparseTypes.get(i); } opBuilder.setAttr("sparse_types", sparseTypesArray); Shape[] denseShapesArray = new Shape[denseShapes.size()]; @@ -109,7 +111,7 @@ public static ExperimentalParseExampleDataset create(Scope scope, Operand inp opBuilder.setAttr("dense_shapes", denseShapesArray); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -142,8 +144,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalPrivateThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalPrivateThreadPoolDataset.java index cea1ae5081e..1394f251374 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalPrivateThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalPrivateThreadPoolDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute `input_dataset`. */ -public final class ExperimentalPrivateThreadPoolDataset extends PrimitiveOp implements Operand { +public final class ExperimentalPrivateThreadPoolDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalPrivateThreadPoolDataset operation. @@ -42,14 +44,14 @@ public final class ExperimentalPrivateThreadPoolDataset extends PrimitiveOp impl * @param outputShapes * @return a new instance of ExperimentalPrivateThreadPoolDataset */ - public static ExperimentalPrivateThreadPoolDataset create(Scope scope, Operand inputDataset, Operand numThreads, List> outputTypes, List outputShapes) { + public static ExperimentalPrivateThreadPoolDataset create(Scope scope, Operand inputDataset, Operand numThreads, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalPrivateThreadPoolDataset", scope.makeOpName("ExperimentalPrivateThreadPoolDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numThreads.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +70,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalRandomDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalRandomDataset.java index 7a524b3f46f..b159d09dd06 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalRandomDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalRandomDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a Dataset that returns pseudorandom numbers. */ -public final class ExperimentalRandomDataset extends PrimitiveOp implements Operand { +public final class ExperimentalRandomDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalRandomDataset operation. @@ -44,14 +46,14 @@ public final class ExperimentalRandomDataset extends PrimitiveOp implements Oper * @param outputShapes * @return a new instance of ExperimentalRandomDataset */ - public static ExperimentalRandomDataset create(Scope scope, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { + public static ExperimentalRandomDataset create(Scope scope, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalRandomDataset", scope.makeOpName("ExperimentalRandomDataset")); opBuilder.addInput(seed.asOutput()); opBuilder.addInput(seed2.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -70,8 +72,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalRebatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalRebatchDataset.java index 1165d155e34..12358651c5c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalRebatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalRebatchDataset.java @@ -23,9 +23,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that changes the batch size. @@ -33,7 +35,7 @@ * Creates a dataset that changes the batch size of the dataset to current batch * size // num_replicas. */ -public final class ExperimentalRebatchDataset extends PrimitiveOp implements Operand { +public final class ExperimentalRebatchDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ExperimentalRebatchDataset} @@ -67,14 +69,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ExperimentalRebatchDataset */ - public static ExperimentalRebatchDataset create(Scope scope, Operand inputDataset, Operand numReplicas, List> outputTypes, List outputShapes, Options... options) { + public static ExperimentalRebatchDataset create(Scope scope, Operand inputDataset, Operand numReplicas, List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalRebatchDataset", scope.makeOpName("ExperimentalRebatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numReplicas.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -107,8 +109,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSetStatsAggregatorDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSetStatsAggregatorDataset.java index d29f82a6ee9..cb9f3f14bf4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSetStatsAggregatorDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSetStatsAggregatorDataset.java @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class ExperimentalSetStatsAggregatorDataset extends PrimitiveOp implements Operand { +public final class ExperimentalSetStatsAggregatorDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalSetStatsAggregatorDataset operation. @@ -43,7 +45,7 @@ public final class ExperimentalSetStatsAggregatorDataset extends PrimitiveOp imp * @param outputShapes * @return a new instance of ExperimentalSetStatsAggregatorDataset */ - public static ExperimentalSetStatsAggregatorDataset create(Scope scope, Operand inputDataset, Operand statsAggregator, Operand tag, Operand counterPrefix, List> outputTypes, List outputShapes) { + public static ExperimentalSetStatsAggregatorDataset create(Scope scope, Operand inputDataset, Operand statsAggregator, Operand tag, Operand counterPrefix, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSetStatsAggregatorDataset", scope.makeOpName("ExperimentalSetStatsAggregatorDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(statsAggregator.asOutput()); @@ -52,7 +54,7 @@ public static ExperimentalSetStatsAggregatorDataset create(Scope scope, Operand< opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -71,8 +73,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSlidingWindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSlidingWindowDataset.java index 77b38724316..182b4d2b950 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSlidingWindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSlidingWindowDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that passes a sliding window over `input_dataset`. */ -public final class ExperimentalSlidingWindowDataset extends PrimitiveOp implements Operand { +public final class ExperimentalSlidingWindowDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalSlidingWindowDataset operation. @@ -47,7 +49,7 @@ public final class ExperimentalSlidingWindowDataset extends PrimitiveOp implemen * @param outputShapes * @return a new instance of ExperimentalSlidingWindowDataset */ - public static ExperimentalSlidingWindowDataset create(Scope scope, Operand inputDataset, Operand windowSize, Operand windowShift, Operand windowStride, List> outputTypes, List outputShapes) { + public static ExperimentalSlidingWindowDataset create(Scope scope, Operand inputDataset, Operand windowSize, Operand windowShift, Operand windowStride, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSlidingWindowDataset", scope.makeOpName("ExperimentalSlidingWindowDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(windowSize.asOutput()); @@ -56,7 +58,7 @@ public static ExperimentalSlidingWindowDataset create(Scope scope, Operand in opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -75,8 +77,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSqlDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSqlDataset.java index d576d457738..0802a01c588 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSqlDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalSqlDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Creates a dataset that executes a SQL query and emits rows of the result set. */ -public final class ExperimentalSqlDataset extends PrimitiveOp implements Operand { +public final class ExperimentalSqlDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalSqlDataset operation. @@ -43,7 +45,7 @@ public final class ExperimentalSqlDataset extends PrimitiveOp implements Operand * @param outputShapes * @return a new instance of ExperimentalSqlDataset */ - public static ExperimentalSqlDataset create(Scope scope, Operand driverName, Operand dataSourceName, Operand query, List> outputTypes, List outputShapes) { + public static ExperimentalSqlDataset create(Scope scope, Operand driverName, Operand dataSourceName, Operand query, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSqlDataset", scope.makeOpName("ExperimentalSqlDataset")); opBuilder.addInput(driverName.asOutput()); opBuilder.addInput(dataSourceName.asOutput()); @@ -51,7 +53,7 @@ public static ExperimentalSqlDataset create(Scope scope, Operand driverN opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -70,8 +72,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalStatsAggregatorHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalStatsAggregatorHandle.java index cf00b6039b6..43dd972195b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalStatsAggregatorHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalStatsAggregatorHandle.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Creates a statistics manager resource. */ -public final class ExperimentalStatsAggregatorHandle extends PrimitiveOp implements Operand { +public final class ExperimentalStatsAggregatorHandle extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ExperimentalStatsAggregatorHandle} @@ -102,8 +103,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalStatsAggregatorSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalStatsAggregatorSummary.java index 39aedb8a8c2..623b0f834b5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalStatsAggregatorSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalStatsAggregatorSummary.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Produces a summary of any statistics recorded by the given statistics manager. */ -public final class ExperimentalStatsAggregatorSummary extends PrimitiveOp implements Operand { +public final class ExperimentalStatsAggregatorSummary extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalStatsAggregatorSummary operation. @@ -45,16 +46,16 @@ public static ExperimentalStatsAggregatorSummary create(Scope scope, Operand /** */ - public Output summary() { + public Output summary() { return summary; } @Override - public Output asOutput() { + public Output asOutput() { return summary; } - private Output summary; + private Output summary; private ExperimentalStatsAggregatorSummary(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalUnbatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalUnbatchDataset.java index 060cb11ccc0..8d413f145f9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalUnbatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ExperimentalUnbatchDataset.java @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A dataset that splits the elements of its input into multiple elements. */ -public final class ExperimentalUnbatchDataset extends PrimitiveOp implements Operand { +public final class ExperimentalUnbatchDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalUnbatchDataset operation. @@ -41,13 +42,13 @@ public final class ExperimentalUnbatchDataset extends PrimitiveOp implements Ope * @param outputShapes * @return a new instance of ExperimentalUnbatchDataset */ - public static ExperimentalUnbatchDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + public static ExperimentalUnbatchDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalUnbatchDataset", scope.makeOpName("ExperimentalUnbatchDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -66,8 +67,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 526b749e8f2..0c66ed84060 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Extract `patches` from `input` and put them in the "depth" output dimension. 3D extension of `extract_image_patches`. @@ -32,7 +34,7 @@ * @param data type for {@code patches()} output */ @Operator -public final class ExtractVolumePatches extends PrimitiveOp implements Operand { +public final class ExtractVolumePatches extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExtractVolumePatches operation. @@ -52,7 +54,7 @@ public final class ExtractVolumePatches extends PrimitiveOp im * * @return a new instance of ExtractVolumePatches */ - public static ExtractVolumePatches create(Scope scope, Operand input, List ksizes, List strides, String padding) { + 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.applyControlDependencies(opBuilder); 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 4bd71e2aa29..b24f80f5f9e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Creates a tensor filled with a scalar value. @@ -54,7 +56,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Fill extends PrimitiveOp implements Operand { +public final class Fill extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Fill operation. @@ -68,7 +70,7 @@ public final class Fill extends PrimitiveOp implements Operand { * @end_compatibility * @return a new instance of Fill */ - public static Fill create(Scope scope, Operand dims, Operand value) { + 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()); 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 70fe53cb11b..848c1c4e422 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 @@ -24,7 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; +import org.tensorflow.types.family.TType; /** * Generates fingerprint values. @@ -59,7 +61,7 @@ * Fingerprint(ReduceJoin(data))` in general. */ @Operator -public final class Fingerprint extends PrimitiveOp implements Operand { +public final class Fingerprint extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Fingerprint operation. @@ -70,7 +72,7 @@ public final class Fingerprint extends PrimitiveOp implements Operand { * `farmhash::fingerprint64`. * @return a new instance of Fingerprint */ - public static Fingerprint create(Scope scope, Operand data, Operand method) { + 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()); @@ -83,16 +85,16 @@ public static Fingerprint create(Scope scope, Operand data, Operand fingerprint() { + public Output fingerprint() { return fingerprint; } @Override - public Output asOutput() { + public Output asOutput() { return fingerprint; } - private Output fingerprint; + private Output fingerprint; private Fingerprint(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FusedBatchNormGradV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FusedBatchNormGradV3.java index 9e9ab0f9b5d..d7b4c1a9406 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FusedBatchNormGradV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FusedBatchNormGradV3.java @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Gradient for batch normalization. @@ -35,7 +38,7 @@ * @param data type for {@code scaleBackprop()} output */ @Operator -public final class FusedBatchNormGradV3 extends PrimitiveOp { +public final class FusedBatchNormGradV3 extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.FusedBatchNormGradV3} @@ -98,7 +101,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FusedBatchNormGradV3 */ - public static FusedBatchNormGradV3 create(Scope scope, Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, Operand reserveSpace2, Operand reserveSpace3, Options... options) { + public static FusedBatchNormGradV3 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("FusedBatchNormGradV3")); opBuilder.addInput(yBackprop.asOutput()); opBuilder.addInput(x.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FusedBatchNormV3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FusedBatchNormV3.java index 1c3240c2e2a..4e852f947ff 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FusedBatchNormV3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/FusedBatchNormV3.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Batch normalization. @@ -35,7 +37,7 @@ * @param data type for {@code batchMean()} output */ @Operator -public final class FusedBatchNormV3 extends PrimitiveOp { +public final class FusedBatchNormV3 extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.FusedBatchNormV3} @@ -89,7 +91,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FusedBatchNormV3 */ - public static FusedBatchNormV3 create(Scope scope, Operand x, Operand scale, Operand offset, Operand mean, Operand variance, Options... options) { + public static FusedBatchNormV3 create(Scope scope, Operand x, Operand scale, Operand offset, Operand mean, Operand variance, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FusedBatchNormV3", scope.makeOpName("FusedBatchNormV3")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(scale.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GRUBlockCell.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GRUBlockCell.java index c7c83573a0f..2beaa55f281 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GRUBlockCell.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GRUBlockCell.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the GRU cell forward propagation for 1 time step. @@ -74,7 +76,7 @@ * * @param data type for {@code r()} output */ -public final class GRUBlockCell extends PrimitiveOp { +public final class GRUBlockCell extends PrimitiveOp { /** * Factory method to create a class wrapping a new GRUBlockCell operation. @@ -88,7 +90,7 @@ public final class GRUBlockCell extends PrimitiveOp { * @param bC * @return a new instance of GRUBlockCell */ - public static GRUBlockCell create(Scope scope, Operand x, Operand hPrev, Operand wRu, Operand wC, Operand bRu, Operand bC) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GRUBlockCellGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GRUBlockCellGrad.java index 23b4a6cd51b..4181e84d33a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GRUBlockCellGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/GRUBlockCellGrad.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the GRU cell back-propagation for 1 time step. @@ -110,7 +112,7 @@ * * @param data type for {@code dX()} output */ -public final class GRUBlockCellGrad extends PrimitiveOp { +public final class GRUBlockCellGrad extends PrimitiveOp { /** * Factory method to create a class wrapping a new GRUBlockCellGrad operation. @@ -128,7 +130,7 @@ public final class GRUBlockCellGrad extends PrimitiveOp { * @param dH * @return a new instance of GRUBlockCellGrad */ - 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) { + 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()); 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 991c94ae988..20d23c517e4 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Gather slices from `params` axis `axis` according to `indices`. @@ -57,7 +59,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Gather extends PrimitiveOp implements Operand { +public final class Gather extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Gather} @@ -90,7 +92,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Gather */ - public static Gather create(Scope scope, Operand params, Operand indices, Operand axis, Options... options) { + 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()); 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 ea44591dc45..516601b512f 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Gather slices from `params` into a Tensor with shape specified by `indices`. @@ -124,7 +126,7 @@ * @param data type for {@code output()} output */ @Operator -public final class GatherNd extends PrimitiveOp implements Operand { +public final class GatherNd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new GatherNd operation. @@ -134,7 +136,7 @@ public final class GatherNd extends PrimitiveOp implements Operand { * @param indices Index tensor. * @return a new instance of GatherNd */ - public static GatherNd create(Scope scope, Operand params, Operand indices) { + 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()); 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 1e2978c813f..3f98233a91c 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Store the input tensor in the state of the current session. */ @Operator -public final class GetSessionHandle extends PrimitiveOp implements Operand { +public final class GetSessionHandle extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new GetSessionHandle operation. @@ -38,7 +39,7 @@ public final class GetSessionHandle extends PrimitiveOp implements Operand GetSessionHandle create(Scope scope, Operand value) { + public static GetSessionHandle create(Scope scope, Operand value) { OperationBuilder opBuilder = scope.env().opBuilder("GetSessionHandleV2", scope.makeOpName("GetSessionHandle")); opBuilder.addInput(value.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -55,8 +56,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 c4cb100757d..c84eb490c84 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Get the value of the tensor specified by its handle. @@ -32,7 +34,7 @@ * @param data type for {@code value()} output */ @Operator -public final class GetSessionTensor extends PrimitiveOp implements Operand { +public final class GetSessionTensor extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new GetSessionTensor operation. @@ -42,11 +44,11 @@ public final class GetSessionTensor extends PrimitiveOp implements Operand * @param dtype The type of the output value. * @return a new instance of GetSessionTensor */ - public static GetSessionTensor create(Scope scope, Operand handle, Class dtype) { + public static GetSessionTensor create(Scope scope, Operand handle, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("GetSessionTensor", scope.makeOpName("GetSessionTensor")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new GetSessionTensor(opBuilder.build()); } 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 43d73d08810..53da78569dd 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Gives a guarantee to the TF runtime that the input tensor is a constant. @@ -38,7 +39,7 @@ * @param data type for {@code output()} output */ @Operator -public final class GuaranteeConst extends PrimitiveOp implements Operand { +public final class GuaranteeConst extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new GuaranteeConst operation. @@ -47,7 +48,7 @@ public final class GuaranteeConst extends PrimitiveOp implements Operand { * @param input * @return a new instance of GuaranteeConst */ - public static GuaranteeConst create(Scope scope, Operand input) { + public static GuaranteeConst create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("GuaranteeConst", scope.makeOpName("GuaranteeConst")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 cc9fae9b021..d3558db2e94 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Creates a non-initialized hash table. @@ -34,7 +35,7 @@ * table will be immutable. */ @Operator -public final class HashTable extends PrimitiveOp implements Operand { +public final class HashTable extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.HashTable} @@ -85,11 +86,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of HashTable */ - public static HashTable create(Scope scope, Class keyDtype, Class valueDtype, Options... options) { + public static HashTable create(Scope scope, DataType keyDtype, DataType valueDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("HashTableV2", scope.makeOpName("HashTable")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("key_dtype", DataType.fromClass(keyDtype)); - opBuilder.setAttr("value_dtype", DataType.fromClass(valueDtype)); + opBuilder.setAttr("key_dtype", keyDtype); + opBuilder.setAttr("value_dtype", valueDtype); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -139,8 +140,8 @@ public Output tableHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) tableHandle; + public Output asOutput() { + return (Output) tableHandle; } private Output tableHandle; 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 2d87208ea3d..f154d26aa7b 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Return histogram of values. @@ -48,7 +51,7 @@ * @param data type for {@code out()} output */ @Operator -public final class HistogramFixedWidth extends PrimitiveOp implements Operand { +public final class HistogramFixedWidth extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new HistogramFixedWidth operation. @@ -62,13 +65,13 @@ public final class HistogramFixedWidth extends PrimitiveOp imp * @param dtype * @return a new instance of HistogramFixedWidth */ - public static HistogramFixedWidth create(Scope scope, Operand values, Operand valueRange, Operand nbins, Class dtype) { + public static HistogramFixedWidth create(Scope scope, Operand values, Operand valueRange, Operand nbins, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("HistogramFixedWidth", scope.makeOpName("HistogramFixedWidth")); opBuilder.addInput(values.asOutput()); opBuilder.addInput(valueRange.asOutput()); opBuilder.addInput(nbins.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new HistogramFixedWidth(opBuilder.build()); } @@ -83,8 +86,8 @@ public static HistogramFixedWidth create * @param nbins Scalar `int32 Tensor`. Number of histogram bins. * @return a new instance of HistogramFixedWidth */ - public static HistogramFixedWidth create(Scope scope, Operand values, Operand valueRange, Operand nbins) { - return create(scope, values, valueRange, nbins, Integer.class); + public static HistogramFixedWidth create(Scope scope, Operand values, Operand valueRange, Operand nbins) { + return create(scope, values, valueRange, nbins, TInt32.DTYPE); } /** 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 efda54a91fb..64616238fe3 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Return a tensor with the same shape and contents as the input tensor or value. @@ -31,7 +32,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Identity extends PrimitiveOp implements Operand { +public final class Identity extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Identity operation. @@ -40,7 +41,7 @@ public final class Identity extends PrimitiveOp implements Operand { * @param input * @return a new instance of Identity */ - public static Identity create(Scope scope, Operand input) { + public static Identity create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Identity", scope.makeOpName("Identity")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 0dc057878e9..3c40fef21b7 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 @@ -28,6 +28,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns a list of tensors with the same shapes and contents as the input @@ -49,7 +50,7 @@ * */ @Operator -public final class IdentityN extends PrimitiveOp implements Iterable> { +public final class IdentityN extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new IdentityN operation. @@ -73,7 +74,7 @@ public List> output() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) output.iterator(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IgnoreErrorsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IgnoreErrorsDataset.java index 0af926e3717..737b4078d7e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IgnoreErrorsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IgnoreErrorsDataset.java @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that contains the elements of `input_dataset` ignoring errors. */ -public final class IgnoreErrorsDataset extends PrimitiveOp implements Operand { +public final class IgnoreErrorsDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IgnoreErrorsDataset operation. @@ -41,13 +42,13 @@ public final class IgnoreErrorsDataset extends PrimitiveOp implements Operand inputDataset, List> outputTypes, List outputShapes) { + public static IgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("IgnoreErrorsDataset", scope.makeOpName("IgnoreErrorsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -66,8 +67,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 aa8e8b3e664..d8ac8fee7a1 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 @@ -22,10 +22,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Returns immutable tensor from memory region. @@ -35,7 +36,7 @@ * @param data type for {@code tensor()} output */ @Operator -public final class ImmutableConst extends PrimitiveOp implements Operand { +public final class ImmutableConst extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ImmutableConst operation. @@ -47,10 +48,10 @@ public final class ImmutableConst extends PrimitiveOp implements Operand { * NewReadOnlyMemoryRegionFromFile in tensorflow::Env. * @return a new instance of ImmutableConst */ - public static ImmutableConst create(Scope scope, Class dtype, Shape shape, String memoryRegionName) { + public static ImmutableConst create(Scope scope, DataType dtype, Shape shape, String memoryRegionName) { OperationBuilder opBuilder = scope.env().opBuilder("ImmutableConst", scope.makeOpName("ImmutableConst")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); opBuilder.setAttr("shape", shape); opBuilder.setAttr("memory_region_name", memoryRegionName); return new ImmutableConst(opBuilder.build()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedDequeue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedDequeue.java index 1e8474c966e..c981f2d4d79 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedDequeue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedDequeue.java @@ -22,16 +22,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +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 */ -public final class InfeedDequeue extends PrimitiveOp implements Operand { +public final class InfeedDequeue extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new InfeedDequeue operation. @@ -41,10 +42,10 @@ public final class InfeedDequeue extends PrimitiveOp implements Operand { * @param shape The shape of the tensor. * @return a new instance of InfeedDequeue */ - public static InfeedDequeue create(Scope scope, Class dtype, Shape shape) { + public static InfeedDequeue create(Scope scope, DataType dtype, Shape shape) { OperationBuilder opBuilder = scope.env().opBuilder("InfeedDequeue", scope.makeOpName("InfeedDequeue")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); opBuilder.setAttr("shape", shape); return new InfeedDequeue(opBuilder.build()); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedDequeueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedDequeueTuple.java index 207bd126831..ca70b58ce3a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedDequeueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedDequeueTuple.java @@ -25,14 +25,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Fetches multiple values from infeed as an XLA tuple. */ -public final class InfeedDequeueTuple extends PrimitiveOp implements Iterable> { +public final class InfeedDequeueTuple extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new InfeedDequeueTuple operation. @@ -42,12 +43,12 @@ public final class InfeedDequeueTuple extends PrimitiveOp implements Iterable> dtypes, List shapes) { + public static InfeedDequeueTuple create(Scope scope, List> dtypes, List shapes) { OperationBuilder opBuilder = scope.env().opBuilder("InfeedDequeueTuple", scope.makeOpName("InfeedDequeueTuple")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); Shape[] shapesArray = new Shape[shapes.size()]; @@ -67,7 +68,7 @@ public List> outputs() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) outputs.iterator(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedEnqueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedEnqueue.java index 74251f1d1d6..e0a0fe0fbe6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedEnqueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedEnqueue.java @@ -21,9 +21,10 @@ import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * An op which feeds a single Tensor value into the computation. @@ -79,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of InfeedEnqueue */ - public static InfeedEnqueue create(Scope scope, Operand input, Options... options) { + 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.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedEnqueueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedEnqueueTuple.java index 1dec27d3a40..5580c60433b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedEnqueueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InfeedEnqueueTuple.java @@ -21,10 +21,10 @@ import org.tensorflow.Operand; import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; /** * Feeds multiple Tensor values into the computation as an XLA tuple. 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 5878ce2ec89..b3a382902ef 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Table initializer that takes two tensors for keys and values respectively. @@ -39,7 +40,7 @@ public final class InitializeTable extends PrimitiveOp { * @param values Values of type Tval. * @return a new instance of InitializeTable */ - public static InitializeTable create(Scope scope, Operand tableHandle, Operand keys, Operand values) { + 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()); 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 f28b98709c2..db2ca0cb283 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Initializes a table from a text file. @@ -81,7 +82,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of InitializeTableFromTextFile */ - public static InitializeTableFromTextFile create(Scope scope, Operand tableHandle, Operand filename, Long keyIndex, Long valueIndex, Options... options) { + 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()); 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 5bc86ea6a6c..eed30e18eff 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Adds v into specified rows of x. @@ -33,7 +35,7 @@ * @param data type for {@code y()} output */ @Operator -public final class InplaceAdd extends PrimitiveOp implements Operand { +public final class InplaceAdd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new InplaceAdd operation. @@ -44,7 +46,7 @@ public final class InplaceAdd extends PrimitiveOp implements Operand { * @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. * @return a new instance of InplaceAdd */ - public static InplaceAdd create(Scope scope, Operand x, Operand i, Operand v) { + 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()); 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 81e027b52a8..1436913a1d6 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Subtracts `v` into specified rows of `x`. @@ -33,7 +35,7 @@ * @param data type for {@code y()} output */ @Operator -public final class InplaceSub extends PrimitiveOp implements Operand { +public final class InplaceSub extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new InplaceSub operation. @@ -44,7 +46,7 @@ public final class InplaceSub extends PrimitiveOp implements Operand { * @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. * @return a new instance of InplaceSub */ - public static InplaceSub create(Scope scope, Operand x, Operand i, Operand v) { + 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()); 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 3ba6530eed3..b317bb12936 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Updates specified rows with values in `v`. @@ -33,7 +35,7 @@ * @param data type for {@code y()} output */ @Operator -public final class InplaceUpdate extends PrimitiveOp implements Operand { +public final class InplaceUpdate extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new InplaceUpdate operation. @@ -44,7 +46,7 @@ public final class InplaceUpdate extends PrimitiveOp implements Operand { * @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. * @return a new instance of InplaceUpdate */ - public static InplaceUpdate create(Scope scope, Operand x, Operand i, Operand v) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsBoostedTreesEnsembleInitialized.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsBoostedTreesEnsembleInitialized.java index cbe3b016340..6b764d2475c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsBoostedTreesEnsembleInitialized.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsBoostedTreesEnsembleInitialized.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TBool; /** * Checks whether a tree ensemble has been initialized. */ -public final class IsBoostedTreesEnsembleInitialized extends PrimitiveOp implements Operand { +public final class IsBoostedTreesEnsembleInitialized extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IsBoostedTreesEnsembleInitialized operation. @@ -46,16 +47,16 @@ public static IsBoostedTreesEnsembleInitialized create(Scope scope, Operand t /** * output boolean on whether it is initialized or not. */ - public Output isInitialized() { + public Output isInitialized() { return isInitialized; } @Override - public Output asOutput() { + public Output asOutput() { return isInitialized; } - private Output isInitialized; + private Output isInitialized; private IsBoostedTreesEnsembleInitialized(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsBoostedTreesQuantileStreamResourceInitialized.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsBoostedTreesQuantileStreamResourceInitialized.java index 26855e129fb..5b287ae41eb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsBoostedTreesQuantileStreamResourceInitialized.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IsBoostedTreesQuantileStreamResourceInitialized.java @@ -23,13 +23,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TBool; /** * Checks whether a quantile stream has been initialized. *

* An Op that checks if quantile stream resource is initialized. */ -public final class IsBoostedTreesQuantileStreamResourceInitialized extends PrimitiveOp implements Operand { +public final class IsBoostedTreesQuantileStreamResourceInitialized extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IsBoostedTreesQuantileStreamResourceInitialized operation. @@ -48,16 +49,16 @@ public static IsBoostedTreesQuantileStreamResourceInitialized create(Scope scope /** * bool; True if the resource is initialized, False otherwise. */ - public Output isInitialized() { + public Output isInitialized() { return isInitialized; } @Override - public Output asOutput() { + public Output asOutput() { return isInitialized; } - private Output isInitialized; + private Output isInitialized; private IsBoostedTreesQuantileStreamResourceInitialized(Operation operation) { super(operation); 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 6c4b9a691b7..6ca11650f57 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Checks whether a tensor has been initialized. @@ -31,7 +33,7 @@ * Outputs boolean scalar indicating whether the tensor has been initialized. */ @Operator -public final class IsVariableInitialized extends PrimitiveOp implements Operand { +public final class IsVariableInitialized extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IsVariableInitialized operation. @@ -40,7 +42,7 @@ public final class IsVariableInitialized extends PrimitiveOp implements Operand< * @param ref Should be from a `Variable` node. May be uninitialized. * @return a new instance of IsVariableInitialized */ - public static IsVariableInitialized create(Scope scope, Operand ref) { + public static IsVariableInitialized create(Scope scope, Operand ref) { OperationBuilder opBuilder = scope.env().opBuilder("IsVariableInitialized", scope.makeOpName("IsVariableInitialized")); opBuilder.addInput(ref.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -49,16 +51,16 @@ public static IsVariableInitialized create(Scope scope, Operand ref) { /** */ - public Output isInitialized() { + public Output isInitialized() { return isInitialized; } @Override - public Output asOutput() { + public Output asOutput() { return isInitialized; } - private Output isInitialized; + private Output isInitialized; private IsVariableInitialized(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IteratorGetDevice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IteratorGetDevice.java index 73fd7065fbc..7ec76ed7e37 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IteratorGetDevice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/IteratorGetDevice.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Returns the name of the device on which `resource` has been placed. */ -public final class IteratorGetDevice extends PrimitiveOp implements Operand { +public final class IteratorGetDevice extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IteratorGetDevice operation. @@ -45,16 +46,16 @@ public static IteratorGetDevice create(Scope scope, Operand resource) { /** */ - public Output device() { + public Output device() { return device; } @Override - public Output asOutput() { + public Output asOutput() { return device; } - private Output device; + private Output device; private IteratorGetDevice(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KMC2ChainInitialization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KMC2ChainInitialization.java index 288c9c82caf..27882ba4b2f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KMC2ChainInitialization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KMC2ChainInitialization.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Returns the index of a data point that should be added to the seed set. @@ -32,7 +34,7 @@ * 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 PrimitiveOp implements Operand { +public final class KMC2ChainInitialization extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new KMC2ChainInitialization operation. @@ -43,7 +45,7 @@ public final class KMC2ChainInitialization extends PrimitiveOp implements Operan * @param seed Scalar. Seed for initializing the random number generator. * @return a new instance of KMC2ChainInitialization */ - public static KMC2ChainInitialization create(Scope scope, Operand distances, Operand seed) { + 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()); @@ -54,16 +56,16 @@ public static KMC2ChainInitialization create(Scope scope, Operand distanc /** * Scalar with the index of the sampled point. */ - public Output index() { + public Output index() { return index; } @Override - public Output asOutput() { + public Output asOutput() { return index; } - private Output index; + private Output index; private KMC2ChainInitialization(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KmeansPlusPlusInitialization.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KmeansPlusPlusInitialization.java index 6e85daf6fef..23fde1a4b99 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KmeansPlusPlusInitialization.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/KmeansPlusPlusInitialization.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Selects num_to_sample rows of input using the KMeans++ criterion. @@ -32,7 +34,7 @@ * distance from the nearest row selected thus far till num_to_sample rows have * been sampled. */ -public final class KmeansPlusPlusInitialization extends PrimitiveOp implements Operand { +public final class KmeansPlusPlusInitialization extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new KmeansPlusPlusInitialization operation. @@ -47,7 +49,7 @@ public final class KmeansPlusPlusInitialization extends PrimitiveOp implements O * heuristic is used to sample O(log(num_to_sample)) additional points. * @return a new instance of KmeansPlusPlusInitialization */ - public static KmeansPlusPlusInitialization create(Scope scope, Operand points, Operand numToSample, Operand seed, Operand numRetriesPerSample) { + 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()); @@ -60,16 +62,16 @@ public static KmeansPlusPlusInitialization create(Scope scope, Operand po /** * Matrix of shape (num_to_sample, d). The sampled rows. */ - public Output samples() { + public Output samples() { return samples; } @Override - public Output asOutput() { + public Output asOutput() { return samples; } - private Output samples; + private Output samples; private KmeansPlusPlusInitialization(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LMDBDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LMDBDataset.java index 4c709d74aeb..60586148324 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LMDBDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LMDBDataset.java @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class LMDBDataset extends PrimitiveOp implements Operand { +public final class LMDBDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LMDBDataset operation. @@ -40,13 +42,13 @@ public final class LMDBDataset extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of LMDBDataset */ - public static LMDBDataset create(Scope scope, Operand filenames, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -65,8 +67,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LSTMBlockCell.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LSTMBlockCell.java index ef7ef171c14..d58d0774842 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LSTMBlockCell.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LSTMBlockCell.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the LSTM cell forward propagation for 1 time step. @@ -54,7 +56,7 @@ * * @param data type for {@code i()} output */ -public final class LSTMBlockCell extends PrimitiveOp { +public final class LSTMBlockCell extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.LSTMBlockCell} @@ -108,7 +110,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LSTMBlockCell */ - public static LSTMBlockCell create(Scope scope, Operand x, Operand csPrev, Operand hPrev, Operand w, Operand wci, Operand wcf, Operand wco, Operand b, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LSTMBlockCellGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LSTMBlockCellGrad.java index 25da21a31e9..4a08ea46136 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LSTMBlockCellGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LSTMBlockCellGrad.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the LSTM cell backward propagation for 1 timestep. @@ -31,7 +33,7 @@ * * @param data type for {@code csPrevGrad()} output */ -public final class LSTMBlockCellGrad extends PrimitiveOp { +public final class LSTMBlockCellGrad extends PrimitiveOp { /** * Factory method to create a class wrapping a new LSTMBlockCellGrad operation. @@ -56,7 +58,7 @@ public final class LSTMBlockCellGrad extends PrimitiveOp { * @param usePeephole Whether the cell uses peephole connections. * @return a new instance of LSTMBlockCellGrad */ - 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) { + 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()); 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 faae8c19de3..5cc880af2b9 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,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Generates values in an interval. @@ -41,7 +43,7 @@ * @param data type for {@code output()} output */ @Operator -public final class LinSpace extends PrimitiveOp implements Operand { +public final class LinSpace extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LinSpace operation. @@ -52,7 +54,7 @@ public final class LinSpace extends PrimitiveOp implements Ope * @param num 0-D tensor. Number of values to generate. * @return a new instance of LinSpace */ - public static LinSpace create(Scope scope, Operand start, Operand stop, Operand num) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingADAMParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingADAMParameters.java index a0953b8c570..b6e4fd0fcac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingADAMParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingADAMParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load ADAM embedding parameters. @@ -74,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingADAMParameters */ - public static LoadTPUEmbeddingADAMParameters create(Scope scope, Operand parameters, Operand momenta, Operand velocities, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingADAMParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingADAMParametersGradAccumDebug.java index d6f48806bb9..5bfa7517eac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingADAMParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingADAMParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load ADAM embedding parameters with debug support. @@ -75,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingADAMParametersGradAccumDebug */ - public static LoadTPUEmbeddingADAMParametersGradAccumDebug create(Scope scope, Operand parameters, Operand momenta, Operand velocities, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdadeltaParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdadeltaParameters.java index 231e74b0b4f..8651c2e7039 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdadeltaParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdadeltaParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load Adadelta embedding parameters. @@ -74,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingAdadeltaParameters */ - public static LoadTPUEmbeddingAdadeltaParameters create(Scope scope, Operand parameters, Operand accumulators, Operand updates, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.java index f77aaa25199..edb262f7ab6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdadeltaParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load Adadelta parameters with debug support. @@ -75,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingAdadeltaParametersGradAccumDebug */ - public static LoadTPUEmbeddingAdadeltaParametersGradAccumDebug create(Scope scope, Operand parameters, Operand accumulators, Operand updates, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdagradParameters.java index c88e1ae8aef..925d12cd38b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdagradParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load Adagrad embedding parameters. @@ -73,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingAdagradParameters */ - public static LoadTPUEmbeddingAdagradParameters create(Scope scope, Operand parameters, Operand accumulators, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdagradParametersGradAccumDebug.java index 3964656c45c..f0f5beb2c54 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdagradParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingAdagradParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load Adagrad embedding parameters with debug support. @@ -74,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingAdagradParametersGradAccumDebug */ - public static LoadTPUEmbeddingAdagradParametersGradAccumDebug create(Scope scope, Operand parameters, Operand accumulators, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingCenteredRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingCenteredRMSPropParameters.java index f975ebb4b39..daa6bf81f6b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingCenteredRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingCenteredRMSPropParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load centered RMSProp embedding parameters. @@ -75,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingCenteredRMSPropParameters */ - public static LoadTPUEmbeddingCenteredRMSPropParameters create(Scope scope, Operand parameters, Operand ms, Operand mom, Operand mg, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingFTRLParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingFTRLParameters.java index f8d95d7a950..97e6ad050f6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingFTRLParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingFTRLParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load FTRL embedding parameters. @@ -74,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingFTRLParameters */ - public static LoadTPUEmbeddingFTRLParameters create(Scope scope, Operand parameters, Operand accumulators, Operand linears, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingFTRLParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingFTRLParametersGradAccumDebug.java index 9d3768d0b80..4f336388828 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingFTRLParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingFTRLParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load FTRL embedding parameters with debug support. @@ -75,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingFTRLParametersGradAccumDebug */ - public static LoadTPUEmbeddingFTRLParametersGradAccumDebug create(Scope scope, Operand parameters, Operand accumulators, Operand linears, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMDLAdagradLightParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMDLAdagradLightParameters.java index 7cc48270b2f..1749e34446f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMDLAdagradLightParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMDLAdagradLightParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load MDL Adagrad Light embedding parameters. @@ -75,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingMDLAdagradLightParameters */ - public static LoadTPUEmbeddingMDLAdagradLightParameters create(Scope scope, Operand parameters, Operand accumulators, Operand weights, Operand benefits, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMomentumParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMomentumParameters.java index 88db883b9e1..bb43b57a0c9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMomentumParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMomentumParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load Momentum embedding parameters. @@ -73,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingMomentumParameters */ - public static LoadTPUEmbeddingMomentumParameters create(Scope scope, Operand parameters, Operand momenta, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMomentumParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMomentumParametersGradAccumDebug.java index 5dfedf47805..4ac4933de50 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMomentumParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingMomentumParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load Momentum embedding parameters with debug support. @@ -74,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingMomentumParametersGradAccumDebug */ - public static LoadTPUEmbeddingMomentumParametersGradAccumDebug create(Scope scope, Operand parameters, Operand momenta, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingProximalAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingProximalAdagradParameters.java index c60005b7095..5c1208b863e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingProximalAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingProximalAdagradParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load proximal Adagrad embedding parameters. @@ -73,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingProximalAdagradParameters */ - public static LoadTPUEmbeddingProximalAdagradParameters create(Scope scope, Operand parameters, Operand accumulators, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java index 10f10fdb7df..732623f5944 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load proximal Adagrad embedding parameters with debug support. @@ -74,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug */ - public static LoadTPUEmbeddingProximalAdagradParametersGradAccumDebug create(Scope scope, Operand parameters, Operand accumulators, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingRMSPropParameters.java index 9ec503b9234..cf62e37c0be 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingRMSPropParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load RMSProp embedding parameters. @@ -74,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingRMSPropParameters */ - public static LoadTPUEmbeddingRMSPropParameters create(Scope scope, Operand parameters, Operand ms, Operand mom, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingRMSPropParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingRMSPropParametersGradAccumDebug.java index ba1e8b49334..b7e77d2468e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingRMSPropParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingRMSPropParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load RMSProp embedding parameters with debug support. @@ -75,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingRMSPropParametersGradAccumDebug */ - public static LoadTPUEmbeddingRMSPropParametersGradAccumDebug create(Scope scope, Operand parameters, Operand ms, Operand mom, Operand gradientAccumulators, Long numShards, Long shardId, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingStochasticGradientDescentParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingStochasticGradientDescentParameters.java index cf9c2d8c503..9015494b7ae 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingStochasticGradientDescentParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/LoadTPUEmbeddingStochasticGradientDescentParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Load SGD embedding parameters. @@ -72,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadTPUEmbeddingStochasticGradientDescentParameters */ - public static LoadTPUEmbeddingStochasticGradientDescentParameters create(Scope scope, Operand parameters, Long numShards, Long shardId, Options... options) { + 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.applyControlDependencies(opBuilder); 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 b3c82d2778e..9a3c7f0e6ea 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Outputs all keys and values in the table. @@ -33,7 +34,7 @@ * @param data type for {@code values()} output */ @Operator -public final class LookupTableExport extends PrimitiveOp { +public final class LookupTableExport extends PrimitiveOp { /** * Factory method to create a class wrapping a new LookupTableExport operation. @@ -44,12 +45,12 @@ public final class LookupTableExport extends PrimitiveOp { * @param Tvalues * @return a new instance of LookupTableExport */ - public static LookupTableExport create(Scope scope, Operand tableHandle, Class Tkeys, Class Tvalues) { + public static LookupTableExport create(Scope scope, Operand tableHandle, DataType Tkeys, DataType Tvalues) { OperationBuilder opBuilder = scope.env().opBuilder("LookupTableExportV2", scope.makeOpName("LookupTableExport")); opBuilder.addInput(tableHandle.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Tkeys", DataType.fromClass(Tkeys)); - opBuilder.setAttr("Tvalues", DataType.fromClass(Tvalues)); + opBuilder.setAttr("Tkeys", Tkeys); + opBuilder.setAttr("Tvalues", Tvalues); return new LookupTableExport(opBuilder.build()); } 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 63b836bb2c5..1cab15dd12f 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Looks up keys in a table, outputs the corresponding values. @@ -37,7 +38,7 @@ * @param data type for {@code values()} output */ @Operator -public final class LookupTableFind extends PrimitiveOp implements Operand { +public final class LookupTableFind extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LookupTableFind operation. @@ -48,7 +49,7 @@ public final class LookupTableFind extends PrimitiveOp implements Operand * @param defaultValue * @return a new instance of LookupTableFind */ - public static LookupTableFind create(Scope scope, Operand tableHandle, Operand keys, Operand defaultValue) { + 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()); 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 2204682eddf..3407640cd53 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Replaces the contents of the table with the specified keys and values. @@ -42,7 +43,7 @@ public final class LookupTableImport extends PrimitiveOp { * @param values Values to associate with keys. * @return a new instance of LookupTableImport */ - public static LookupTableImport create(Scope scope, Operand tableHandle, Operand keys, Operand values) { + 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()); 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 6882211528e..191501bdd0d 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Updates the table to associates keys with values. @@ -42,7 +43,7 @@ public final class LookupTableInsert extends PrimitiveOp { * @param values Values to associate with keys. * @return a new instance of LookupTableInsert */ - public static LookupTableInsert create(Scope scope, Operand tableHandle, Operand keys, Operand values) { + 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()); 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 4c911c471f9..63347f02411 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 @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Removes keys and its associated values from a table. @@ -39,7 +40,7 @@ public final class LookupTableRemove extends PrimitiveOp { * @param keys Any shape. Keys of the elements to remove. * @return a new instance of LookupTableRemove */ - public static LookupTableRemove create(Scope scope, Operand tableHandle, Operand keys) { + 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()); 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 70c26a789fb..9516edfbfd6 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; /** * Computes the number of elements in the given table. */ @Operator -public final class LookupTableSize extends PrimitiveOp implements Operand { +public final class LookupTableSize extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LookupTableSize operation. @@ -48,16 +49,16 @@ public static LookupTableSize create(Scope scope, Operand tableHandle) { /** * Scalar that contains number of elements in the table. */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private LookupTableSize(Operation operation) { super(operation); 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 e92f4d96123..7a18737817b 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; /** * Forwards the input to the output. @@ -32,7 +33,7 @@ * "pivot" switches of a loop. */ @Operator -public final class LoopCond extends PrimitiveOp implements Operand { +public final class LoopCond extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LoopCond operation. @@ -41,7 +42,7 @@ public final class LoopCond extends PrimitiveOp implements Operand { * @param input A boolean scalar, representing the branch predicate of the Switch op. * @return a new instance of LoopCond */ - public static LoopCond create(Scope scope, Operand input) { + public static LoopCond create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("LoopCond", scope.makeOpName("LoopCond")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -51,16 +52,16 @@ public static LoopCond create(Scope scope, Operand input) { /** * The same tensor as `input`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private LoopCond(Operation operation) { super(operation); 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 e53704e3fa1..43c7177dc54 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 @@ -24,6 +24,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +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. @@ -48,7 +51,7 @@ * * @param data type for {@code output()} output */ -public final class LowerBound extends PrimitiveOp implements Operand { +public final class LowerBound extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LowerBound operation. @@ -60,12 +63,12 @@ public final class LowerBound extends PrimitiveOp implements O * @param outType * @return a new instance of LowerBound */ - public static LowerBound create(Scope scope, Operand sortedInputs, Operand values, Class outType) { + public static LowerBound create(Scope scope, Operand sortedInputs, Operand values, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("LowerBound", scope.makeOpName("LowerBound")); opBuilder.addInput(sortedInputs.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new LowerBound(opBuilder.build()); } @@ -78,8 +81,8 @@ public static LowerBound create(Scope scope, Operand * the values that will be searched for in `sorted_search_values`. * @return a new instance of LowerBound */ - public static LowerBound create(Scope scope, Operand sortedInputs, Operand values) { - return create(scope, sortedInputs, values, Integer.class); + public static LowerBound create(Scope scope, Operand sortedInputs, Operand values) { + return create(scope, sortedInputs, values, TInt32.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Lu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Lu.java index d26a2ee3d5e..d62605e5667 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Lu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Lu.java @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the LU decomposition of one or more square matrices. @@ -51,7 +54,7 @@ * @param data type for {@code p()} output */ @Operator -public final class Lu extends PrimitiveOp { +public final class Lu extends PrimitiveOp { /** * Factory method to create a class wrapping a new Lu operation. @@ -62,11 +65,11 @@ public final class Lu extends PrimitiveOp { * @param outputIdxType * @return a new instance of Lu */ - public static Lu create(Scope scope, Operand input, Class outputIdxType) { + public static Lu create(Scope scope, Operand input, DataType outputIdxType) { OperationBuilder opBuilder = scope.env().opBuilder("Lu", scope.makeOpName("Lu")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("output_idx_type", DataType.fromClass(outputIdxType)); + opBuilder.setAttr("output_idx_type", outputIdxType); return new Lu(opBuilder.build()); } @@ -78,8 +81,8 @@ public static Lu create(Scope scope, Operand inpu * size `[M, M]`. * @return a new instance of Lu */ - public static Lu create(Scope scope, Operand input) { - return create(scope, input, Integer.class); + public static Lu create(Scope scope, Operand input) { + return create(scope, input, TInt32.DTYPE); } /** 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 88bddc291ea..df9044b1fa9 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 @@ -85,12 +85,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MapClear */ - public static MapClear create(Scope scope, List> dtypes, Options... options) { + public static MapClear create(Scope scope, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapClear", scope.makeOpName("MapClear")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { 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 16f0173e649..07f086fbd68 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 @@ -26,12 +26,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; /** * Op returns the number of incomplete elements in the underlying container. */ @Operator -public final class MapIncompleteSize extends PrimitiveOp implements Operand { +public final class MapIncompleteSize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.MapIncompleteSize} @@ -87,12 +88,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MapIncompleteSize */ - public static MapIncompleteSize create(Scope scope, List> dtypes, Options... options) { + public static MapIncompleteSize create(Scope scope, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapIncompleteSize", scope.makeOpName("MapIncompleteSize")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -144,16 +145,16 @@ public static Options sharedName(String sharedName) { /** */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private MapIncompleteSize(Operation operation) { super(operation); 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 64ce0f02e53..96b7a8c52b6 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 @@ -28,6 +28,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Op peeks at the values at the specified key. If the @@ -36,7 +39,7 @@ * this op will block until it does. */ @Operator -public final class MapPeek extends PrimitiveOp implements Iterable> { +public final class MapPeek extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.core.MapPeek} @@ -94,14 +97,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MapPeek */ - public static MapPeek create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { + 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()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -159,7 +162,7 @@ public List> values() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) values.iterator(); } 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 3e9be2a9586..44b4aacdba4 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 @@ -26,12 +26,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; /** * Op returns the number of elements in the underlying container. */ @Operator -public final class MapSize extends PrimitiveOp implements Operand { +public final class MapSize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.MapSize} @@ -87,12 +88,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MapSize */ - public static MapSize create(Scope scope, List> dtypes, Options... options) { + public static MapSize create(Scope scope, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MapSize", scope.makeOpName("MapSize")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -144,16 +145,16 @@ public static Options sharedName(String sharedName) { /** */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private MapSize(Operation operation) { super(operation); 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 5ef7f865654..6b51660063c 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 @@ -26,6 +26,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** * Stage (key, values) in the underlying container which behaves like a hashtable. @@ -93,7 +95,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MapStage */ - public static MapStage create(Scope scope, Operand key, Operand indices, Iterable> values, List> dtypes, Options... options) { + 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()); @@ -101,7 +103,7 @@ public static MapStage create(Scope scope, Operand key, Operand i opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { 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 ddca39c3c20..8659a5a63c1 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 @@ -28,6 +28,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Op removes and returns the values associated with the key @@ -36,7 +39,7 @@ * does not contain this key, the op will block until it does. */ @Operator -public final class MapUnstage extends PrimitiveOp implements Iterable> { +public final class MapUnstage extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.core.MapUnstage} @@ -94,14 +97,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MapUnstage */ - public static MapUnstage create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { + 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()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -159,7 +162,7 @@ public List> values() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) values.iterator(); } 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 eeca07c036b..9e95fd7a736 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 @@ -27,6 +27,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** * Op removes and returns a random (key, value) @@ -92,13 +94,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MapUnstageNoKey */ - public static MapUnstageNoKey create(Scope scope, Operand indices, List> dtypes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -150,7 +152,7 @@ public static Options sharedName(String sharedName) { /** */ - public Output key() { + public Output key() { return key; } @@ -160,7 +162,7 @@ public List> values() { return values; } - private Output key; + private Output key; private List> values; private MapUnstageNoKey(Operation operation) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixDiagPartV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixDiagPartV2.java index b1c87b73d25..d54ecc0b782 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixDiagPartV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixDiagPartV2.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Returns the batched diagonal part of a batched tensor. @@ -98,7 +100,7 @@ * @param data type for {@code diagonal()} output */ @Operator -public final class MatrixDiagPartV2 extends PrimitiveOp implements Operand { +public final class MatrixDiagPartV2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MatrixDiagPartV2 operation. @@ -113,7 +115,7 @@ public final class MatrixDiagPartV2 extends PrimitiveOp implements Operand * Default is 0. * @return a new instance of MatrixDiagPartV2 */ - public static MatrixDiagPartV2 create(Scope scope, Operand input, Operand k, Operand paddingValue) { + public static MatrixDiagPartV2 create(Scope scope, Operand input, Operand k, Operand paddingValue) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagPartV2", scope.makeOpName("MatrixDiagPartV2")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(k.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixDiagV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixDiagV2.java index 2e2c0f93385..fcf022950c3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixDiagV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixDiagV2.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Returns a batched diagonal tensor with given batched diagonal values. @@ -116,7 +118,7 @@ * @param data type for {@code output()} output */ @Operator -public final class MatrixDiagV2 extends PrimitiveOp implements Operand { +public final class MatrixDiagV2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MatrixDiagV2 operation. @@ -137,7 +139,7 @@ public final class MatrixDiagV2 extends PrimitiveOp implements Operand { * Default is 0. * @return a new instance of MatrixDiagV2 */ - public static MatrixDiagV2 create(Scope scope, Operand diagonal, Operand k, Operand numRows, Operand numCols, Operand paddingValue) { + public static MatrixDiagV2 create(Scope scope, Operand diagonal, Operand k, Operand numRows, Operand numCols, Operand paddingValue) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagV2", scope.makeOpName("MatrixDiagV2")); opBuilder.addInput(diagonal.asOutput()); opBuilder.addInput(k.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixSetDiagV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixSetDiagV2.java index 74f5edadc7c..be4f49924b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixSetDiagV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MatrixSetDiagV2.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Returns a batched matrix tensor with new batched diagonal values. @@ -100,7 +102,7 @@ * @param data type for {@code output()} output */ @Operator -public final class MatrixSetDiagV2 extends PrimitiveOp implements Operand { +public final class MatrixSetDiagV2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MatrixSetDiagV2 operation. @@ -115,7 +117,7 @@ public final class MatrixSetDiagV2 extends PrimitiveOp implements Operand * of a matrix band. `k[0]` must not be larger than `k[1]`. * @return a new instance of MatrixSetDiagV2 */ - public static MatrixSetDiagV2 create(Scope scope, Operand input, Operand diagonal, Operand k) { + public static MatrixSetDiagV2 create(Scope scope, Operand input, Operand diagonal, Operand k) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixSetDiagV2", scope.makeOpName("MatrixSetDiagV2")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(diagonal.asOutput()); 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 972e8e142e1..d1e723e30a8 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Max extends PrimitiveOp implements Operand { +public final class Max extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Max} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Max */ - public static Max create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MaxIntraOpParallelismDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MaxIntraOpParallelismDataset.java index e442fbf7f4a..0acc24c91e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MaxIntraOpParallelismDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MaxIntraOpParallelismDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that overrides the maximum intra-op parallelism. */ -public final class MaxIntraOpParallelismDataset extends PrimitiveOp implements Operand { +public final class MaxIntraOpParallelismDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MaxIntraOpParallelismDataset operation. @@ -42,14 +44,14 @@ public final class MaxIntraOpParallelismDataset extends PrimitiveOp implements O * @param outputShapes * @return a new instance of MaxIntraOpParallelismDataset */ - public static MaxIntraOpParallelismDataset create(Scope scope, Operand inputDataset, Operand maxIntraOpParallelism, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +70,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 2961b1cfcd5..7c9f7248cfc 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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`. @@ -38,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Merge extends PrimitiveOp { +public final class Merge extends PrimitiveOp { /** * Factory method to create a class wrapping a new Merge operation. @@ -47,7 +49,7 @@ public final class Merge extends PrimitiveOp { * @param inputs The input tensors, exactly one of which will become available. * @return a new instance of Merge */ - public static Merge create(Scope scope, Iterable> inputs) { + public static Merge create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("Merge", scope.makeOpName("Merge")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.applyControlDependencies(opBuilder); @@ -64,12 +66,12 @@ public Output output() { /** * The index of the chosen input tensor in `inputs`. */ - public Output valueIndex() { + public Output valueIndex() { return valueIndex; } private Output output; - private Output valueIndex; + private Output valueIndex; private Merge(Operation operation) { super(operation); 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 cb8f427ac36..3b37c6ca1c9 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Min extends PrimitiveOp implements Operand { +public final class Min extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Min} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Min */ - public static Min create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); 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 99953ee05c4..8787017151c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Pads a tensor with mirrored values. @@ -57,7 +59,7 @@ * @param data type for {@code output()} output */ @Operator -public final class MirrorPad extends PrimitiveOp implements Operand { +public final class MirrorPad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MirrorPad operation. @@ -73,7 +75,7 @@ public final class MirrorPad extends PrimitiveOp implements Operand { * it is `[1, 2, 3, 3, 2]` in symmetric mode. * @return a new instance of MirrorPad */ - public static MirrorPad create(Scope scope, Operand input, Operand paddings, String mode) { + 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()); 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 fcf5d332647..733d183e0a9 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 @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Gradient op for `MirrorPad` op. This op folds a mirror-padded tensor. @@ -48,7 +50,7 @@ * * @param data type for {@code output()} output */ -public final class MirrorPadGrad extends PrimitiveOp implements Operand { +public final class MirrorPadGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MirrorPadGrad operation. @@ -60,7 +62,7 @@ public final class MirrorPadGrad extends PrimitiveOp implements Operand { * @param mode The mode used in the `MirrorPad` op. * @return a new instance of MirrorPadGrad */ - public static MirrorPadGrad create(Scope scope, Operand input, Operand paddings, String mode) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MulNoNan.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MulNoNan.java index 6d547179c44..eb876691c4f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MulNoNan.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/MulNoNan.java @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns x * y element-wise. Returns zero if y is zero, even if x if infinite or NaN. @@ -34,7 +35,7 @@ * @param data type for {@code z()} output */ @Operator -public final class MulNoNan extends PrimitiveOp implements Operand { +public final class MulNoNan extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MulNoNan operation. @@ -44,7 +45,7 @@ public final class MulNoNan extends PrimitiveOp implements Operand { * @param y * @return a new instance of MulNoNan */ - public static MulNoNan create(Scope scope, Operand x, Operand y) { + 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()); 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 68e1d135043..beb6d42ae0b 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 @@ -22,10 +22,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates an empty hash table that uses tensors as the backing store. @@ -38,7 +39,7 @@ * the insert operations. It does not support the initialization operation. */ @Operator -public final class MutableDenseHashTable extends PrimitiveOp implements Operand { +public final class MutableDenseHashTable extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.MutableDenseHashTable} @@ -119,12 +120,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MutableDenseHashTable */ - public static MutableDenseHashTable create(Scope scope, Operand emptyKey, Operand deletedKey, Class valueDtype, Options... options) { + public static MutableDenseHashTable create(Scope scope, Operand emptyKey, Operand deletedKey, DataType valueDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MutableDenseHashTableV2", scope.makeOpName("MutableDenseHashTable")); opBuilder.addInput(emptyKey.asOutput()); opBuilder.addInput(deletedKey.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("value_dtype", DataType.fromClass(valueDtype)); + opBuilder.setAttr("value_dtype", valueDtype); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -205,8 +206,8 @@ public Output tableHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) tableHandle; + public Output asOutput() { + return (Output) tableHandle; } private Output tableHandle; 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 cba8c552089..a40049d7479 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Creates an empty hash table. @@ -34,7 +35,7 @@ * the insert operations. It does not support the initialization operation. */ @Operator -public final class MutableHashTable extends PrimitiveOp implements Operand { +public final class MutableHashTable extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.MutableHashTable} @@ -85,11 +86,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MutableHashTable */ - public static MutableHashTable create(Scope scope, Class keyDtype, Class valueDtype, Options... options) { + public static MutableHashTable create(Scope scope, DataType keyDtype, DataType valueDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MutableHashTableV2", scope.makeOpName("MutableHashTable")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("key_dtype", DataType.fromClass(keyDtype)); - opBuilder.setAttr("value_dtype", DataType.fromClass(valueDtype)); + opBuilder.setAttr("key_dtype", keyDtype); + opBuilder.setAttr("value_dtype", valueDtype); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -139,8 +140,8 @@ public Output tableHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) tableHandle; + public Output asOutput() { + return (Output) tableHandle; } private Output tableHandle; 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 8c8ee00ad51..24fe42d2a6f 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 @@ -22,10 +22,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates an empty hash table. @@ -35,7 +36,7 @@ * the insert operations. It does not support the initialization operation. */ @Operator -public final class MutableHashTableOfTensors extends PrimitiveOp implements Operand { +public final class MutableHashTableOfTensors extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.MutableHashTableOfTensors} @@ -94,11 +95,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MutableHashTableOfTensors */ - public static MutableHashTableOfTensors create(Scope scope, Class keyDtype, Class valueDtype, Options... options) { + public static MutableHashTableOfTensors create(Scope scope, DataType keyDtype, DataType valueDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MutableHashTableOfTensorsV2", scope.makeOpName("MutableHashTableOfTensors")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("key_dtype", DataType.fromClass(keyDtype)); - opBuilder.setAttr("value_dtype", DataType.fromClass(valueDtype)); + opBuilder.setAttr("key_dtype", keyDtype); + opBuilder.setAttr("value_dtype", valueDtype); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -157,8 +158,8 @@ public Output tableHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) tableHandle; + public Output asOutput() { + return (Output) tableHandle; } private Output tableHandle; 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 9a16ae81c56..6a8a772963c 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Creates a Mutex resource that can be locked by `MutexLock`. */ @Operator -public final class Mutex extends PrimitiveOp implements Operand { +public final class Mutex extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Mutex} @@ -109,8 +110,8 @@ public Output resource() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; + public Output asOutput() { + return (Output) resource; } private Output resource; 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 191ca0e0580..4e3ade48b8d 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Locks a mutex resource. The output is the lock. So long as the lock tensor @@ -65,7 +66,7 @@ * wish to ensure the usage is exclusive. */ @Operator -public final class MutexLock extends PrimitiveOp implements Operand { +public final class MutexLock extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MutexLock operation. @@ -92,8 +93,8 @@ public Output mutexLock() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) mutexLock; + public Output asOutput() { + return (Output) mutexLock; } private Output mutexLock; 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 5e4b0906308..a40b45db628 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 @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs a tensor containing the reduction across all input tensors. @@ -40,9 +42,9 @@ * 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 output()} output */ -public final class NcclAllReduce extends PrimitiveOp implements Operand { +public final class NcclAllReduce extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new NcclAllReduce operation. @@ -54,7 +56,7 @@ public final class NcclAllReduce extends PrimitiveOp implement * @param sharedName * @return a new instance of NcclAllReduce */ - public static NcclAllReduce create(Scope scope, Operand input, String reduction, Long numDevices, String sharedName) { + 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.applyControlDependencies(opBuilder); @@ -66,20 +68,20 @@ public static NcclAllReduce create(Scope scope, Operand /** */ - public Output data() { - return data; + public Output output() { + return output; } @Override public Output asOutput() { - return data; + return output; } - private Output data; + private Output output; private NcclAllReduce(Operation operation) { super(operation); int outputIdx = 0; - data = operation.output(outputIdx++); + output = 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 0432ae7ae02..a470a1f3e12 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 @@ -21,9 +21,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Sends `input` to all devices that are connected to the output. @@ -40,7 +42,7 @@ * * @param data type for {@code output()} output */ -public final class NcclBroadcast extends PrimitiveOp implements Operand { +public final class NcclBroadcast extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new NcclBroadcast operation. @@ -50,7 +52,7 @@ public final class NcclBroadcast extends PrimitiveOp implement * @param shape * @return a new instance of NcclBroadcast */ - public static NcclBroadcast create(Scope scope, Operand input, Shape shape) { + 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.applyControlDependencies(opBuilder); 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 b8049a21dc1..feb7bb9f470 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reduces `input` from `num_devices` using `reduction` to a single device. @@ -37,9 +39,9 @@ * data: the value of the reduction across all `num_devices` devices. * reduction: the reduction operation to perform. * - * @param data type for {@code data()} output + * @param data type for {@code output()} output */ -public final class NcclReduce extends PrimitiveOp implements Operand { +public final class NcclReduce extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new NcclReduce operation. @@ -49,7 +51,7 @@ public final class NcclReduce extends PrimitiveOp implements O * @param reduction * @return a new instance of NcclReduce */ - public static NcclReduce create(Scope scope, Iterable> input, String reduction) { + 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.applyControlDependencies(opBuilder); @@ -59,20 +61,20 @@ public static NcclReduce create(Scope scope, Iterable data() { - return data; + public Output output() { + return output; } @Override public Output asOutput() { - return data; + return output; } - private Output data; + private Output output; private NcclReduce(Operation operation) { super(operation); int outputIdx = 0; - data = operation.output(outputIdx++); + output = operation.output(outputIdx++); } } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NearestNeighbors.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NearestNeighbors.java index b6ed3c1721c..c3b2b0615f4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NearestNeighbors.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NearestNeighbors.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Selects the k nearest centers for each point. @@ -43,7 +45,7 @@ public final class NearestNeighbors extends PrimitiveOp { * only m centers are returned. * @return a new instance of NearestNeighbors */ - public static NearestNeighbors create(Scope scope, Operand points, Operand centers, Operand k) { + 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,7 +58,7 @@ public static NearestNeighbors create(Scope scope, Operand points, Operan * Matrix of shape (n, min(m, k)). Each row contains the indices of the centers * closest to the corresponding point, ordered by increasing distance. */ - public Output nearestCenterIndices() { + public Output nearestCenterIndices() { return nearestCenterIndices; } @@ -64,12 +66,12 @@ public Output nearestCenterIndices() { * Matrix of shape (n, min(m, k)). Each row contains the squared L2 distance to the * corresponding center in nearest_center_indices. */ - public Output nearestCenterDistances() { + public Output nearestCenterDistances() { return nearestCenterDistances; } - private Output nearestCenterIndices; - private Output nearestCenterDistances; + private Output nearestCenterIndices; + private Output nearestCenterDistances; private NearestNeighbors(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextAfter.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextAfter.java index a4b8b296274..1434ca77136 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextAfter.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NextAfter.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the next representable value of `x1` in the direction of `x2`, element-wise. @@ -39,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator -public final class NextAfter extends PrimitiveOp implements Operand { +public final class NextAfter extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new NextAfter operation. @@ -49,7 +51,7 @@ public final class NextAfter extends PrimitiveOp implements Op * @param x2 * @return a new instance of NextAfter */ - public static NextAfter create(Scope scope, Operand x1, Operand x2) { + 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()); 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 0b598a3b374..d650516d8ea 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Makes its input available to the next iteration. @@ -31,7 +32,7 @@ * @param data type for {@code output()} output */ @Operator -public final class NextIteration extends PrimitiveOp implements Operand { +public final class NextIteration extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new NextIteration operation. @@ -40,7 +41,7 @@ public final class NextIteration extends PrimitiveOp implements Operand { * @param data The tensor to be made available to the next iteration. * @return a new instance of NextIteration */ - public static NextIteration create(Scope scope, Operand data) { + public static NextIteration create(Scope scope, Operand data) { OperationBuilder opBuilder = scope.env().opBuilder("NextIteration", scope.makeOpName("NextIteration")); opBuilder.addInput(data.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonDeterministicInts.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonDeterministicInts.java index 5879a315640..16a08a25fe0 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonDeterministicInts.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonDeterministicInts.java @@ -24,6 +24,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Non-deterministically generates some integers. @@ -32,7 +34,7 @@ * * @param data type for {@code output()} output */ -public final class NonDeterministicInts extends PrimitiveOp implements Operand { +public final class NonDeterministicInts extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new NonDeterministicInts operation. @@ -42,11 +44,11 @@ public final class NonDeterministicInts extends PrimitiveOp implements Operan * @param dtype The type of the output. * @return a new instance of NonDeterministicInts */ - public static NonDeterministicInts create(Scope scope, Operand shape, Class dtype) { + public static NonDeterministicInts create(Scope scope, Operand shape, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("NonDeterministicInts", scope.makeOpName("NonDeterministicInts")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new NonDeterministicInts(opBuilder.build()); } @@ -57,8 +59,8 @@ public static NonDeterministicInts create(Scope scope, Operand shap * @param shape The shape of the output tensor. * @return a new instance of NonDeterministicInts */ - public static NonDeterministicInts create(Scope scope, Operand shape) { - return create(scope, shape, Long.class); + public static NonDeterministicInts create(Scope scope, Operand shape) { + return create(scope, shape, TInt64.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonMaxSuppressionV5.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonMaxSuppressionV5.java index 11dbb4bc35c..00f4ba9582f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonMaxSuppressionV5.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonMaxSuppressionV5.java @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Greedily selects a subset of bounding boxes in descending order of score, @@ -54,7 +57,7 @@ * @param data type for {@code selectedScores()} output */ @Operator -public final class NonMaxSuppressionV5 extends PrimitiveOp { +public final class NonMaxSuppressionV5 extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.NonMaxSuppressionV5} @@ -95,7 +98,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of NonMaxSuppressionV5 */ - public static NonMaxSuppressionV5 create(Scope scope, Operand boxes, Operand scores, Operand maxOutputSize, Operand iouThreshold, Operand scoreThreshold, Operand softNmsSigma, Options... options) { + public static NonMaxSuppressionV5 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("NonMaxSuppressionV5")); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(scores.asOutput()); @@ -126,7 +129,7 @@ public static Options padToMaxOutputSize(Boolean padToMaxOutputSize) { * A 1-D integer tensor of shape `[M]` representing the selected * indices from the boxes tensor, where `M <= max_output_size`. */ - public Output selectedIndices() { + public Output selectedIndices() { return selectedIndices; } @@ -144,13 +147,13 @@ public Output selectedScores() { * A 0-D integer tensor representing the number of valid elements in * `selected_indices`, with the valid elements appearing first. */ - public Output validOutputs() { + public Output validOutputs() { return validOutputs; } - private Output selectedIndices; + private Output selectedIndices; private Output selectedScores; - private Output validOutputs; + private Output validOutputs; private NonMaxSuppressionV5(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonSerializableDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonSerializableDataset.java index 957f9117696..544d3b7d792 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonSerializableDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/NonSerializableDataset.java @@ -23,13 +23,14 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** */ -public final class NonSerializableDataset extends PrimitiveOp implements Operand { +public final class NonSerializableDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new NonSerializableDataset operation. @@ -40,13 +41,13 @@ public final class NonSerializableDataset extends PrimitiveOp implements Operand * @param outputShapes * @return a new instance of NonSerializableDataset */ - public static NonSerializableDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -65,8 +66,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 52699a4e758..f441d2427d4 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns a one-hot tensor. @@ -112,7 +115,7 @@ * @param data type for {@code output()} output */ @Operator -public final class OneHot extends PrimitiveOp implements Operand { +public final class OneHot extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.OneHot} @@ -144,7 +147,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OneHot */ - public static OneHot create(Scope scope, Operand indices, Operand depth, Operand onValue, Operand offValue, Options... options) { + 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()); 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 aacad8b4fb5..7f40b39c9de 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns a tensor of ones with the same shape and type as x. @@ -31,7 +32,7 @@ * @param data type for {@code y()} output */ @Operator -public final class OnesLike extends PrimitiveOp implements Operand { +public final class OnesLike extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new OnesLike operation. @@ -40,7 +41,7 @@ public final class OnesLike extends PrimitiveOp implements Operand { * @param x a tensor of type T. * @return a new instance of OnesLike */ - public static OnesLike create(Scope scope, Operand x) { + public static OnesLike create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("OnesLike", scope.makeOpName("OnesLike")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 dff8119bfec..6053386e175 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 @@ -85,12 +85,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OrderedMapClear */ - public static OrderedMapClear create(Scope scope, List> dtypes, Options... options) { + public static OrderedMapClear create(Scope scope, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapClear", scope.makeOpName("OrderedMapClear")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { 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 63cca530ab3..8993afee755 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 @@ -26,12 +26,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; /** * Op returns the number of incomplete elements in the underlying container. */ @Operator -public final class OrderedMapIncompleteSize extends PrimitiveOp implements Operand { +public final class OrderedMapIncompleteSize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.OrderedMapIncompleteSize} @@ -87,12 +88,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OrderedMapIncompleteSize */ - public static OrderedMapIncompleteSize create(Scope scope, List> dtypes, Options... options) { + public static OrderedMapIncompleteSize create(Scope scope, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapIncompleteSize", scope.makeOpName("OrderedMapIncompleteSize")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -144,16 +145,16 @@ public static Options sharedName(String sharedName) { /** */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private OrderedMapIncompleteSize(Operation operation) { super(operation); 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 6c6a80c7663..d282cf03243 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 @@ -28,6 +28,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Op peeks at the values at the specified key. If the @@ -37,7 +40,7 @@ * performance. */ @Operator -public final class OrderedMapPeek extends PrimitiveOp implements Iterable> { +public final class OrderedMapPeek extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.core.OrderedMapPeek} @@ -95,14 +98,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OrderedMapPeek */ - public static OrderedMapPeek create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { + 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()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -160,7 +163,7 @@ public List> values() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) values.iterator(); } 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 ffbaf307d8d..ada4ac290aa 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 @@ -26,12 +26,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; /** * Op returns the number of elements in the underlying container. */ @Operator -public final class OrderedMapSize extends PrimitiveOp implements Operand { +public final class OrderedMapSize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.OrderedMapSize} @@ -87,12 +88,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OrderedMapSize */ - public static OrderedMapSize create(Scope scope, List> dtypes, Options... options) { + public static OrderedMapSize create(Scope scope, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OrderedMapSize", scope.makeOpName("OrderedMapSize")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -144,16 +145,16 @@ public static Options sharedName(String sharedName) { /** */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private OrderedMapSize(Operation operation) { super(operation); 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 0c34ed4f0ce..c136bdd0aba 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 @@ -26,6 +26,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** * Stage (key, values) in the underlying container which behaves like a ordered @@ -95,7 +97,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OrderedMapStage */ - public static OrderedMapStage create(Scope scope, Operand key, Operand indices, Iterable> values, List> dtypes, Options... options) { + 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()); @@ -103,7 +105,7 @@ public static OrderedMapStage create(Scope scope, Operand key, Operand> { +public final class OrderedMapUnstage extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.core.OrderedMapUnstage} @@ -94,14 +97,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OrderedMapUnstage */ - public static OrderedMapUnstage create(Scope scope, Operand key, Operand indices, List> dtypes, Options... options) { + 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()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -159,7 +162,7 @@ public List> values() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) values.iterator(); } 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 d63d6fe1d7c..ecff3c7435f 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 @@ -27,6 +27,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** * Op removes and returns the (key, value) element with the smallest @@ -92,13 +94,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OrderedMapUnstageNoKey */ - public static OrderedMapUnstageNoKey create(Scope scope, Operand indices, List> dtypes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -150,7 +152,7 @@ public static Options sharedName(String sharedName) { /** */ - public Output key() { + public Output key() { return key; } @@ -160,7 +162,7 @@ public List> values() { return values; } - private Output key; + private Output key; private List> values; private OrderedMapUnstageNoKey(Operation operation) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedDequeue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedDequeue.java index ac446dc9ee2..12f18169064 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedDequeue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedDequeue.java @@ -22,9 +22,10 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Retrieves a single tensor from the computation outfeed. @@ -33,7 +34,7 @@ * * @param data type for {@code output()} output */ -public final class OutfeedDequeue extends PrimitiveOp implements Operand { +public final class OutfeedDequeue extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.OutfeedDequeue} @@ -65,10 +66,10 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OutfeedDequeue */ - public static OutfeedDequeue create(Scope scope, Class dtype, Shape shape, Options... options) { + public static OutfeedDequeue create(Scope scope, DataType dtype, Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeue", scope.makeOpName("OutfeedDequeue")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); opBuilder.setAttr("shape", shape); if (options != null) { for (Options opts : options) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedDequeueTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedDequeueTuple.java index 72d7f3b5ca1..d3eaf4078d3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedDequeueTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedDequeueTuple.java @@ -25,9 +25,10 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Retrieve multiple values from the computation outfeed. @@ -35,7 +36,7 @@ * This operation will block indefinitely until data is available. Output `i` * corresponds to XLA tuple element `i`. */ -public final class OutfeedDequeueTuple extends PrimitiveOp implements Iterable> { +public final class OutfeedDequeueTuple extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.core.OutfeedDequeueTuple} @@ -67,12 +68,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OutfeedDequeueTuple */ - public static OutfeedDequeueTuple create(Scope scope, List> dtypes, List shapes, Options... options) { + public static OutfeedDequeueTuple create(Scope scope, List> dtypes, List shapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("OutfeedDequeueTuple", scope.makeOpName("OutfeedDequeueTuple")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); Shape[] shapesArray = new Shape[shapes.size()]; @@ -108,7 +109,7 @@ public List> outputs() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) outputs.iterator(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedEnqueue.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedEnqueue.java index 1641c3a65e4..5442b4c4be4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedEnqueue.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/OutfeedEnqueue.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Enqueue a Tensor on the computation outfeed. @@ -35,7 +36,7 @@ public final class OutfeedEnqueue extends PrimitiveOp { * @param input A tensor that will be inserted into the outfeed queue. * @return a new instance of OutfeedEnqueue */ - public static OutfeedEnqueue create(Scope scope, Operand input) { + public static OutfeedEnqueue create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("OutfeedEnqueue", scope.makeOpName("OutfeedEnqueue")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 60352327c31..c24c4ee95f6 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Pads a tensor. @@ -56,7 +58,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Pad extends PrimitiveOp implements Operand { +public final class Pad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Pad operation. @@ -67,7 +69,7 @@ public final class Pad extends PrimitiveOp implements Operand { * @param constantValues * @return a new instance of Pad */ - public static Pad create(Scope scope, Operand input, Operand paddings, Operand constantValues) { + 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()); 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 8928b8b2748..31eb16ce5db 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 @@ -21,11 +21,12 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Concatenates a list of `N` tensors along the first dimension. @@ -48,7 +49,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ParallelConcat extends PrimitiveOp implements Operand { +public final class ParallelConcat extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ParallelConcat operation. @@ -60,7 +61,7 @@ public final class ParallelConcat extends PrimitiveOp implements Operand { * but with the number of input values in the first dimension. * @return a new instance of ParallelConcat */ - public static ParallelConcat create(Scope scope, Iterable> values, Shape shape) { + 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.applyControlDependencies(opBuilder); 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 020810e0544..d9bfda85a9b 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Interleave the values from the `data` tensors into a single tensor. @@ -86,7 +88,7 @@ * @param data type for {@code merged()} output */ @Operator -public final class ParallelDynamicStitch extends PrimitiveOp implements Operand { +public final class ParallelDynamicStitch extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ParallelDynamicStitch operation. @@ -96,7 +98,7 @@ public final class ParallelDynamicStitch extends PrimitiveOp implements Opera * @param data * @return a new instance of ParallelDynamicStitch */ - public static ParallelDynamicStitch create(Scope scope, Iterable> indices, Iterable> data) { + 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)); 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 153670ce63c..0176f9cc862 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 @@ -22,10 +22,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A placeholder op for a value that will be fed into the computation. @@ -37,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Placeholder extends PrimitiveOp implements Operand { +public final class Placeholder extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Placeholder} @@ -67,10 +68,10 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Placeholder */ - public static Placeholder create(Scope scope, Class dtype, Options... options) { + public static Placeholder create(Scope scope, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Placeholder", scope.makeOpName("Placeholder")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.shape != null) { 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 9790ec20136..b75a0a7e8e7 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 @@ -21,10 +21,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A placeholder op that passes through `input` when its output is not fed. @@ -32,7 +33,7 @@ * @param data type for {@code output()} output */ @Operator -public final class PlaceholderWithDefault extends PrimitiveOp implements Operand { +public final class PlaceholderWithDefault extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new PlaceholderWithDefault operation. @@ -42,7 +43,7 @@ public final class PlaceholderWithDefault extends PrimitiveOp implements Oper * @param shape The (possibly partial) shape of the tensor. * @return a new instance of PlaceholderWithDefault */ - public static PlaceholderWithDefault create(Scope scope, Operand input, Shape shape) { + 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.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prelinearize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prelinearize.java index 6c641999b5b..736a24fa23b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prelinearize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Prelinearize.java @@ -22,14 +22,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * An op which linearizes one Tensor value to an opaque variant tensor. */ -public final class Prelinearize extends PrimitiveOp implements Operand { +public final class Prelinearize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Prelinearize} @@ -69,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Prelinearize */ - public static Prelinearize create(Scope scope, Operand input, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -114,8 +115,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PrelinearizeTuple.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PrelinearizeTuple.java index bf99fa5f7f7..345f098d469 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PrelinearizeTuple.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PrelinearizeTuple.java @@ -22,15 +22,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * An op which linearizes multiple Tensor values to an opaque variant tensor. */ -public final class PrelinearizeTuple extends PrimitiveOp implements Operand { +public final class PrelinearizeTuple extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.PrelinearizeTuple} @@ -104,8 +105,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 50fb5aae36c..e1fe600afe7 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Prints a string scalar. @@ -68,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Print */ - public static Print create(Scope scope, Operand input, Options... options) { + public static Print create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PrintV2", scope.makeOpName("Print")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PrivateThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PrivateThreadPoolDataset.java index fce679d83e1..44c7214fed3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PrivateThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/PrivateThreadPoolDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute `input_dataset`. */ -public final class PrivateThreadPoolDataset extends PrimitiveOp implements Operand { +public final class PrivateThreadPoolDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new PrivateThreadPoolDataset operation. @@ -42,14 +44,14 @@ public final class PrivateThreadPoolDataset extends PrimitiveOp implements Opera * @param outputShapes * @return a new instance of PrivateThreadPoolDataset */ - public static PrivateThreadPoolDataset create(Scope scope, Operand inputDataset, Operand numThreads, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +70,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 e3051043a2c..81167c9fa73 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the product of elements across dimensions of a tensor. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Prod extends PrimitiveOp implements Operand { +public final class Prod extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Prod} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Prod */ - public static Prod create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConcat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConcat.java index 1b3b2217dfb..a1c34b2d57f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConcat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConcat.java @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Concatenates quantized tensors along one dimension. @@ -32,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator -public final class QuantizedConcat extends PrimitiveOp { +public final class QuantizedConcat extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedConcat operation. @@ -46,7 +49,7 @@ public final class QuantizedConcat extends PrimitiveOp { * @param inputMaxes The maximum scalar values for each of the input tensors. * @return a new instance of QuantizedConcat */ - public static QuantizedConcat create(Scope scope, Operand concatDim, Iterable> values, Iterable> inputMins, Iterable> inputMaxes) { + 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)); @@ -68,20 +71,20 @@ public Output output() { /** * The float value that the minimum quantized output value represents. */ - public Output outputMin() { + public Output outputMin() { return outputMin; } /** * The float value that the maximum quantized output value represents. */ - public Output outputMax() { + public Output outputMax() { return outputMax; } private Output output; - private Output outputMin; - private Output outputMax; + private Output outputMin; + private Output outputMax; private QuantizedConcat(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConcatV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConcatV2.java index f96ca92943e..c97509bd314 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConcatV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConcatV2.java @@ -25,12 +25,15 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator -public final class QuantizedConcatV2 extends PrimitiveOp { +public final class QuantizedConcatV2 extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedConcatV2 operation. @@ -42,7 +45,7 @@ public final class QuantizedConcatV2 extends PrimitiveOp { * @param inputMaxes * @return a new instance of QuantizedConcatV2 */ - public static QuantizedConcatV2 create(Scope scope, Iterable> values, Operand axis, Iterable> inputMins, Iterable> inputMaxes) { + public static QuantizedConcatV2 create(Scope scope, Iterable> values, Operand axis, Iterable> inputMins, Iterable> inputMaxes) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConcatV2", scope.makeOpName("QuantizedConcatV2")); opBuilder.addInputList(Operands.asOutputs(values)); opBuilder.addInput(axis.asOutput()); @@ -60,19 +63,19 @@ public Output output() { /** */ - public Output outputMin() { + public Output outputMin() { return outputMin; } /** */ - public Output outputMax() { + public Output outputMax() { return outputMax; } private Output output; - private Output outputMin; - private Output outputMax; + private Output outputMin; + private Output outputMax; private QuantizedConcatV2(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndRelu.java index 9edd60a2ea4..a9da308cc7a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndRelu.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DAndRelu extends PrimitiveOp { +public final class QuantizedConv2DAndRelu extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DAndRelu} @@ -75,7 +77,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DAndRelu */ - 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) { + public static QuantizedConv2DAndRelu create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DAndRelu", scope.makeOpName("QuantizedConv2DAndRelu")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -84,7 +86,7 @@ public static QuantizedConv2DAndRelu create(Scope scope, Operand opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -134,19 +136,19 @@ public Output output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DAndRelu(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndReluAndRequantize.java index 7fc5911a5b4..4c1aa980e93 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndReluAndRequantize.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DAndReluAndRequantize extends PrimitiveOp { +public final class QuantizedConv2DAndReluAndRequantize extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DAndReluAndRequantize} @@ -77,7 +79,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DAndReluAndRequantize */ - 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) { + public static QuantizedConv2DAndReluAndRequantize create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DAndReluAndRequantize", scope.makeOpName("QuantizedConv2DAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -88,7 +90,7 @@ public static QuantizedConv2DAndReluAndRequantize create(Scope scop opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -138,19 +140,19 @@ public Output output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DAndReluAndRequantize(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndRequantize.java index 2cc2367cfb2..bb7024f5f1f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DAndRequantize.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DAndRequantize extends PrimitiveOp { +public final class QuantizedConv2DAndRequantize extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DAndRequantize} @@ -77,7 +79,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DAndRequantize */ - 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) { + public static QuantizedConv2DAndRequantize create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DAndRequantize", scope.makeOpName("QuantizedConv2DAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -88,7 +90,7 @@ public static QuantizedConv2DAndRequantize create(Scope scope, Oper opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -138,19 +140,19 @@ public Output output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DAndRequantize(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DPerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DPerChannel.java index 476a1edc0ac..09afb1c4201 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DPerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DPerChannel.java @@ -25,13 +25,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes QuantizedConv2D per channel. * * @param data type for {@code output()} output */ -public final class QuantizedConv2DPerChannel extends PrimitiveOp { +public final class QuantizedConv2DPerChannel extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DPerChannel} @@ -68,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DPerChannel */ - 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) { + public static QuantizedConv2DPerChannel create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DPerChannel", scope.makeOpName("QuantizedConv2DPerChannel")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -77,7 +79,7 @@ public static QuantizedConv2DPerChannel create(Scope scope, Operand opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -115,20 +117,20 @@ public Output output() { /** * The minimum value of the final output tensor. */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** * The maximum value of the final output tensor. */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DPerChannel(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBias.java index 1f668d2ee70..90f5085052c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBias.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DWithBias extends PrimitiveOp { +public final class QuantizedConv2DWithBias extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DWithBias} @@ -76,7 +78,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DWithBias */ - 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) { + public static QuantizedConv2DWithBias create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBias", scope.makeOpName("QuantizedConv2DWithBias")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -86,7 +88,7 @@ public static QuantizedConv2DWithBias create(Scope scope, Operand output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DWithBias(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndRelu.java index 10b1f56fdfa..abe58d0278a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndRelu.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DWithBiasAndRelu extends PrimitiveOp { +public final class QuantizedConv2DWithBiasAndRelu extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DWithBiasAndRelu} @@ -76,7 +78,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DWithBiasAndRelu */ - 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) { + public static QuantizedConv2DWithBiasAndRelu create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasAndRelu", scope.makeOpName("QuantizedConv2DWithBiasAndRelu")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -86,7 +88,7 @@ public static QuantizedConv2DWithBiasAndRelu create(Scope scope, Op opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -136,19 +138,19 @@ public Output output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DWithBiasAndRelu(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndReluAndRequantize.java index c8bbdc3ecb1..883b714a5fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndReluAndRequantize.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DWithBiasAndReluAndRequantize extends PrimitiveOp { +public final class QuantizedConv2DWithBiasAndReluAndRequantize extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DWithBiasAndReluAndRequantize} @@ -78,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DWithBiasAndReluAndRequantize */ - 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) { + public static QuantizedConv2DWithBiasAndReluAndRequantize create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasAndReluAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -90,7 +92,7 @@ public static QuantizedConv2DWithBiasAndReluAndRequantize create opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -140,19 +142,19 @@ public Output output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DWithBiasAndReluAndRequantize(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndRequantize.java index 17c11264934..ae9e5793888 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasAndRequantize.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DWithBiasAndRequantize extends PrimitiveOp { +public final class QuantizedConv2DWithBiasAndRequantize extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DWithBiasAndRequantize} @@ -78,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DWithBiasAndRequantize */ - 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) { + public static QuantizedConv2DWithBiasAndRequantize create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -90,7 +92,7 @@ public static QuantizedConv2DWithBiasAndRequantize create(Scope opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -140,19 +142,19 @@ public Output output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DWithBiasAndRequantize(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java index 818d6f539b0..d2e5862d5b2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSignedSumAndReluAndRequantize.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DWithBiasSignedSumAndReluAndRequantize extends PrimitiveOp { +public final class QuantizedConv2DWithBiasSignedSumAndReluAndRequantize extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DWithBiasSignedSumAndReluAndRequantize} @@ -81,7 +83,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DWithBiasSignedSumAndReluAndRequantize */ - 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) { + 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, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasSignedSumAndReluAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasSignedSumAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -96,7 +98,7 @@ public static QuantizedConv2DWithBiasSignedSumAndReluAndRequanti opBuilder.addInput(minSummand.asOutput()); opBuilder.addInput(maxSummand.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -146,19 +148,19 @@ public Output output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DWithBiasSignedSumAndReluAndRequantize(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSumAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSumAndRelu.java index f9434882938..cdb2683baef 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSumAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSumAndRelu.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DWithBiasSumAndRelu extends PrimitiveOp { +public final class QuantizedConv2DWithBiasSumAndRelu extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DWithBiasSumAndRelu} @@ -77,7 +79,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DWithBiasSumAndRelu */ - 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) { + public static QuantizedConv2DWithBiasSumAndRelu create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand summand, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasSumAndRelu", scope.makeOpName("QuantizedConv2DWithBiasSumAndRelu")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -88,7 +90,7 @@ public static QuantizedConv2DWithBiasSumAndRelu create(Scope scope, opBuilder.addInput(maxFilter.asOutput()); opBuilder.addInput(summand.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -138,19 +140,19 @@ public Output output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DWithBiasSumAndRelu(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSumAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSumAndReluAndRequantize.java index abbd0f2742d..b7ded5433bd 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSumAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedConv2DWithBiasSumAndReluAndRequantize.java @@ -25,11 +25,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class QuantizedConv2DWithBiasSumAndReluAndRequantize extends PrimitiveOp { +public final class QuantizedConv2DWithBiasSumAndReluAndRequantize extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedConv2DWithBiasSumAndReluAndRequantize} @@ -81,7 +83,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2DWithBiasSumAndReluAndRequantize */ - 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) { + 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, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2DWithBiasSumAndReluAndRequantize", scope.makeOpName("QuantizedConv2DWithBiasSumAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -96,7 +98,7 @@ public static QuantizedConv2DWithBiasSumAndReluAndRequantize opBuilder.addInput(minSummand.asOutput()); opBuilder.addInput(maxSummand.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -146,19 +148,19 @@ public Output output() { /** */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2DWithBiasSumAndReluAndRequantize(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2D.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2D.java index f578ea30f5a..44e80a06c45 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2D.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2D.java @@ -25,13 +25,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes quantized depthwise Conv2D. * * @param data type for {@code output()} output */ -public final class QuantizedDepthwiseConv2D extends PrimitiveOp { +public final class QuantizedDepthwiseConv2D extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedDepthwiseConv2D} @@ -68,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedDepthwiseConv2D */ - 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) { + public static QuantizedDepthwiseConv2D create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2D", scope.makeOpName("QuantizedDepthwiseConv2D")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -77,7 +79,7 @@ public static QuantizedDepthwiseConv2D create(Scope scope, Operand< opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -115,20 +117,20 @@ public Output output() { /** * The float value that the minimum quantized output value represents. */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** * The float value that the maximum quantized output value represents. */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedDepthwiseConv2D(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBias.java index 7ef96750fbd..dbaf14883f8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBias.java @@ -25,13 +25,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes quantized depthwise Conv2D with Bias. * * @param data type for {@code output()} output */ -public final class QuantizedDepthwiseConv2DWithBias extends PrimitiveOp { +public final class QuantizedDepthwiseConv2DWithBias extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedDepthwiseConv2DWithBias} @@ -69,7 +71,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedDepthwiseConv2DWithBias */ - 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) { + public static QuantizedDepthwiseConv2DWithBias create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2DWithBias", scope.makeOpName("QuantizedDepthwiseConv2DWithBias")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -79,7 +81,7 @@ public static QuantizedDepthwiseConv2DWithBias create(Scope scope, opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -117,20 +119,20 @@ public Output output() { /** * The float value that the minimum quantized output value represents. */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** * The float value that the maximum quantized output value represents. */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedDepthwiseConv2DWithBias(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBiasAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBiasAndRelu.java index 8609f9b0a6c..bfed3d13b65 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBiasAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBiasAndRelu.java @@ -25,13 +25,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes quantized depthwise Conv2D with Bias and Relu. * * @param data type for {@code output()} output */ -public final class QuantizedDepthwiseConv2DWithBiasAndRelu extends PrimitiveOp { +public final class QuantizedDepthwiseConv2DWithBiasAndRelu extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedDepthwiseConv2DWithBiasAndRelu} @@ -69,7 +71,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedDepthwiseConv2DWithBiasAndRelu */ - 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) { + public static QuantizedDepthwiseConv2DWithBiasAndRelu create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2DWithBiasAndRelu", scope.makeOpName("QuantizedDepthwiseConv2DWithBiasAndRelu")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -79,7 +81,7 @@ public static QuantizedDepthwiseConv2DWithBiasAndRelu create(Scope opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -117,20 +119,20 @@ public Output output() { /** * The float value that the minimum quantized output value represents. */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** * The float value that the maximum quantized output value represents. */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedDepthwiseConv2DWithBiasAndRelu(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java index ac46d0f12f1..514de1229a9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize.java @@ -25,13 +25,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes quantized depthwise Conv2D with Bias, Relu and Requantize. * * @param data type for {@code output()} output */ -public final class QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize extends PrimitiveOp { +public final class QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize} @@ -71,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize */ - 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) { + public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize create(Scope scope, Operand input, Operand filter, Operand bias, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, Operand minFreezedOutput, Operand maxFreezedOutput, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize", scope.makeOpName("QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -83,7 +85,7 @@ public static QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize< opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -121,20 +123,20 @@ public Output output() { /** * The float value that the minimum quantized output value represents. */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** * The float value that the maximum quantized output value represents. */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedDepthwiseConv2DWithBiasAndReluAndRequantize(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBias.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBias.java index ab2a5e9f58d..66e10dd23ac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBias.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBias.java @@ -24,6 +24,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Performs a quantized matrix multiplication of `a` by the matrix `b` with bias @@ -37,7 +39,7 @@ * * @param data type for {@code out()} output */ -public final class QuantizedMatMulWithBias extends PrimitiveOp { +public final class QuantizedMatMulWithBias extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedMatMulWithBias} @@ -92,7 +94,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedMatMulWithBias */ - public static QuantizedMatMulWithBias create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Options... options) { + public static QuantizedMatMulWithBias create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, DataType Toutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBias", scope.makeOpName("QuantizedMatMulWithBias")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -102,7 +104,7 @@ public static QuantizedMatMulWithBias create(Scope scope, Operan opBuilder.addInput(minB.asOutput()); opBuilder.addInput(maxB.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Toutput", DataType.fromClass(Toutput)); + opBuilder.setAttr("Toutput", Toutput); if (options != null) { for (Options opts : options) { if (opts.transposeA != null) { @@ -149,20 +151,20 @@ public Output out() { /** * The float value that the lowest quantized output value represents. */ - public Output minOut() { + public Output minOut() { return minOut; } /** * The float value that the highest quantized output value represents. */ - public Output maxOut() { + public Output maxOut() { return maxOut; } private Output out; - private Output minOut; - private Output maxOut; + private Output minOut; + private Output maxOut; private QuantizedMatMulWithBias(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBiasAndRelu.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBiasAndRelu.java index ae3c8fc7782..e42e0ee6a24 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBiasAndRelu.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBiasAndRelu.java @@ -24,6 +24,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Perform a quantized matrix multiplication of `a` by the matrix `b` with bias @@ -38,7 +40,7 @@ * * @param data type for {@code out()} output */ -public final class QuantizedMatMulWithBiasAndRelu extends PrimitiveOp { +public final class QuantizedMatMulWithBiasAndRelu extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedMatMulWithBiasAndRelu} @@ -93,7 +95,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedMatMulWithBiasAndRelu */ - public static QuantizedMatMulWithBiasAndRelu create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Options... options) { + public static QuantizedMatMulWithBiasAndRelu create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, DataType Toutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndRelu", scope.makeOpName("QuantizedMatMulWithBiasAndRelu")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -103,7 +105,7 @@ public static QuantizedMatMulWithBiasAndRelu create(Scope scope, Op opBuilder.addInput(minB.asOutput()); opBuilder.addInput(maxB.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Toutput", DataType.fromClass(Toutput)); + opBuilder.setAttr("Toutput", Toutput); if (options != null) { for (Options opts : options) { if (opts.transposeA != null) { @@ -150,20 +152,20 @@ public Output out() { /** * The float value that the lowest quantized output value represents. */ - public Output minOut() { + public Output minOut() { return minOut; } /** * The float value that the highest quantized output value represents. */ - public Output maxOut() { + public Output maxOut() { return maxOut; } private Output out; - private Output minOut; - private Output maxOut; + private Output minOut; + private Output maxOut; private QuantizedMatMulWithBiasAndRelu(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBiasAndReluAndRequantize.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBiasAndReluAndRequantize.java index b279bf5212b..3ffe5b4720f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBiasAndReluAndRequantize.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/QuantizedMatMulWithBiasAndReluAndRequantize.java @@ -24,6 +24,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Perform a quantized matrix multiplication of `a` by the matrix `b` with bias @@ -39,7 +41,7 @@ * * @param data type for {@code out()} output */ -public final class QuantizedMatMulWithBiasAndReluAndRequantize extends PrimitiveOp { +public final class QuantizedMatMulWithBiasAndReluAndRequantize extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.QuantizedMatMulWithBiasAndReluAndRequantize} @@ -96,7 +98,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedMatMulWithBiasAndReluAndRequantize */ - 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) { + public static QuantizedMatMulWithBiasAndReluAndRequantize create(Scope scope, Operand a, Operand b, Operand bias, Operand minA, Operand maxA, Operand minB, Operand maxB, Operand minFreezedOutput, Operand maxFreezedOutput, DataType Toutput, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMulWithBiasAndReluAndRequantize", scope.makeOpName("QuantizedMatMulWithBiasAndReluAndRequantize")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -108,7 +110,7 @@ public static QuantizedMatMulWithBiasAndReluAndRequantize create opBuilder.addInput(minFreezedOutput.asOutput()); opBuilder.addInput(maxFreezedOutput.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Toutput", DataType.fromClass(Toutput)); + opBuilder.setAttr("Toutput", Toutput); if (options != null) { for (Options opts : options) { if (opts.transposeA != null) { @@ -155,20 +157,20 @@ public Output out() { /** * The float value that the lowest quantized output value represents. */ - public Output minOut() { + public Output minOut() { return minOut; } /** * The float value that the highest quantized output value represents. */ - public Output maxOut() { + public Output maxOut() { return maxOut; } private Output out; - private Output minOut; - private Output maxOut; + private Output minOut; + private Output maxOut; private QuantizedMatMulWithBiasAndReluAndRequantize(Operation operation) { super(operation); 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 30690c85754..e01dd849f40 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reshapes a quantized tensor as per the Reshape op. @@ -33,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator -public final class QuantizedReshape extends PrimitiveOp { +public final class QuantizedReshape extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedReshape operation. @@ -45,7 +48,7 @@ public final class QuantizedReshape extends PrimitiveOp { * @param inputMax The maximum value of the input. * @return a new instance of QuantizedReshape */ - public static QuantizedReshape create(Scope scope, Operand tensor, Operand shape, Operand inputMin, Operand inputMax) { + 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()); @@ -64,20 +67,20 @@ public Output output() { /** * This value is copied from input_min. */ - public Output outputMin() { + public Output outputMin() { return outputMin; } /** * This value is copied from input_max. */ - public Output outputMax() { + public Output outputMax() { return outputMax; } private Output output; - private Output outputMin; - private Output outputMax; + private Output outputMin; + private Output outputMax; private QuantizedReshape(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedGather.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedGather.java index 67f9a822f07..67a052d7a14 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedGather.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedGather.java @@ -26,6 +26,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Gather ragged slices from `params` axis `0` according to `indices`. @@ -61,7 +63,7 @@ * @param data type for {@code outputNestedSplits()} output * @param data type for {@code outputDenseValues()} output */ -public final class RaggedGather extends PrimitiveOp { +public final class RaggedGather extends PrimitiveOp { /** * Factory method to create a class wrapping a new RaggedGather operation. @@ -79,7 +81,7 @@ public final class RaggedGather extends PrimitiveOp { * `indices.shape.ndims + params.ragged_rank - 1`. * @return a new instance of RaggedGather */ - public static RaggedGather create(Scope scope, Iterable> paramsNestedSplits, Operand paramsDenseValues, Operand indices, Long OUTPUTRAGGEDRANK) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedRange.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedRange.java index dc892365e41..a4ed6c0ae92 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedRange.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedRange.java @@ -24,6 +24,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns a `RaggedTensor` containing the specified sequences of numbers. @@ -48,7 +51,7 @@ * @param data type for {@code rtNestedSplits()} output * @param data type for {@code rtDenseValues()} output */ -public final class RaggedRange extends PrimitiveOp { +public final class RaggedRange extends PrimitiveOp { /** * Factory method to create a class wrapping a new RaggedRange operation. @@ -60,13 +63,13 @@ public final class RaggedRange extends Primi * @param Tsplits * @return a new instance of RaggedRange */ - public static RaggedRange create(Scope scope, Operand starts, Operand limits, Operand deltas, Class Tsplits) { + public static RaggedRange create(Scope scope, Operand starts, Operand limits, Operand deltas, DataType Tsplits) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedRange", scope.makeOpName("RaggedRange")); opBuilder.addInput(starts.asOutput()); opBuilder.addInput(limits.asOutput()); opBuilder.addInput(deltas.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Tsplits", DataType.fromClass(Tsplits)); + opBuilder.setAttr("Tsplits", Tsplits); return new RaggedRange(opBuilder.build()); } @@ -79,8 +82,8 @@ public static RaggedRange create(Scop * @param deltas The deltas of each range. * @return a new instance of RaggedRange */ - public static RaggedRange create(Scope scope, Operand starts, Operand limits, Operand deltas) { - return create(scope, starts, limits, deltas, Long.class); + public static RaggedRange create(Scope scope, Operand starts, Operand limits, Operand deltas) { + return create(scope, starts, limits, deltas, TInt64.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorFromVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorFromVariant.java index 11872cfec53..0d81dee81b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorFromVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorFromVariant.java @@ -26,6 +26,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Decodes a `variant` Tensor into a `RaggedTensor`. @@ -46,7 +48,7 @@ * @param data type for {@code outputNestedSplits()} output * @param data type for {@code outputDenseValues()} output */ -public final class RaggedTensorFromVariant extends PrimitiveOp { +public final class RaggedTensorFromVariant extends PrimitiveOp { /** * Factory method to create a class wrapping a new RaggedTensorFromVariant operation. @@ -61,14 +63,14 @@ public final class RaggedTensorFromVariant extends Primitiv * @param Tsplits * @return a new instance of RaggedTensorFromVariant */ - public static RaggedTensorFromVariant create(Scope scope, Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, Class Tvalues, Class Tsplits) { + public static RaggedTensorFromVariant create(Scope scope, Operand encodedRagged, Long inputRaggedRank, Long outputRaggedRank, DataType Tvalues, DataType Tsplits) { OperationBuilder opBuilder = scope.env().opBuilder("RaggedTensorFromVariant", scope.makeOpName("RaggedTensorFromVariant")); opBuilder.addInput(encodedRagged.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); opBuilder.setAttr("input_ragged_rank", inputRaggedRank); opBuilder.setAttr("output_ragged_rank", outputRaggedRank); - opBuilder.setAttr("Tvalues", DataType.fromClass(Tvalues)); - opBuilder.setAttr("Tsplits", DataType.fromClass(Tsplits)); + opBuilder.setAttr("Tvalues", Tvalues); + opBuilder.setAttr("Tsplits", Tsplits); return new RaggedTensorFromVariant(opBuilder.build()); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorToSparse.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorToSparse.java index d537d03c812..996928c9061 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorToSparse.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorToSparse.java @@ -24,6 +24,9 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +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. @@ -34,7 +37,7 @@ * * @param data type for {@code sparseValues()} output */ -public final class RaggedTensorToSparse extends PrimitiveOp { +public final class RaggedTensorToSparse extends PrimitiveOp { /** * Factory method to create a class wrapping a new RaggedTensorToSparse operation. @@ -44,7 +47,7 @@ public final class RaggedTensorToSparse extends PrimitiveOp { * @param rtDenseValues The `flat_values` for the `RaggedTensor`. * @return a new instance of RaggedTensorToSparse */ - public static RaggedTensorToSparse create(Scope scope, Iterable> rtNestedSplits, Operand rtDenseValues) { + 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()); @@ -55,7 +58,7 @@ public static RaggedTensorToSparse create(Scope scope, /** * The indices for the `SparseTensor`. */ - public Output sparseIndices() { + public Output sparseIndices() { return sparseIndices; } @@ -69,13 +72,13 @@ public Output sparseValues() { /** * `sparse_dense_shape` is a tight bounding box of the input `RaggedTensor`. */ - public Output sparseDenseShape() { + public Output sparseDenseShape() { return sparseDenseShape; } - private Output sparseIndices; + private Output sparseIndices; private Output sparseValues; - private Output sparseDenseShape; + private Output sparseDenseShape; private RaggedTensorToSparse(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorToVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorToVariant.java index 2abde17cfb8..e04a2ec6f22 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorToVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RaggedTensorToVariant.java @@ -24,6 +24,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Encodes a `RaggedTensor` into a `variant` Tensor. @@ -41,7 +43,7 @@ * corresponding decoding logic. * */ -public final class RaggedTensorToVariant extends PrimitiveOp implements Operand { +public final class RaggedTensorToVariant extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RaggedTensorToVariant operation. @@ -53,7 +55,7 @@ public final class RaggedTensorToVariant extends PrimitiveOp implements Operand< * @param batchedInput A `bool` denoting whether the input is a batched `RaggedTensor`. * @return a new instance of RaggedTensorToVariant */ - public static RaggedTensorToVariant create(Scope scope, Iterable> rtNestedSplits, Operand rtDenseValues, Boolean batchedInput) { + 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()); @@ -71,8 +73,8 @@ public Output encodedRagged() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) encodedRagged; + public Output asOutput() { + return (Output) encodedRagged; } private Output encodedRagged; 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 2c30b5449c3..a78a308f769 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Creates a sequence of numbers. @@ -43,7 +45,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Range extends PrimitiveOp implements Operand { +public final class Range extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Range operation. @@ -54,7 +56,7 @@ public final class Range extends PrimitiveOp implements Operan * @param delta 0-D (scalar). Optional. Default is 1. Number that increments `start`. * @return a new instance of Range */ - public static Range create(Scope scope, Operand start, Operand limit, Operand delta) { + 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()); 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 49d3ebc13fc..e1e7041387a 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Returns the rank of a tensor. @@ -41,7 +43,7 @@ * of the tensor. Rank is also known as "order", "degree", or "ndims." */ @Operator -public final class Rank extends PrimitiveOp implements Operand { +public final class Rank extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Rank operation. @@ -50,7 +52,7 @@ public final class Rank extends PrimitiveOp implements Operand { * @param input * @return a new instance of Rank */ - public static Rank create(Scope scope, Operand input) { + public static Rank create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Rank", scope.makeOpName("Rank")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -59,16 +61,16 @@ public static Rank create(Scope scope, Operand input) { /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Rank(Operation operation) { super(operation); 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 1a3370eda14..3db1f095837 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Reads the value of a variable. @@ -39,7 +40,7 @@ * @param data type for {@code value()} output */ @Operator -public final class ReadVariableOp extends PrimitiveOp implements Operand { +public final class ReadVariableOp extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ReadVariableOp operation. @@ -49,11 +50,11 @@ public final class ReadVariableOp extends PrimitiveOp implements Operand { * @param dtype the dtype of the value. * @return a new instance of ReadVariableOp */ - public static ReadVariableOp create(Scope scope, Operand resource, Class dtype) { + public static ReadVariableOp create(Scope scope, Operand resource, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("ReadVariableOp", scope.makeOpName("ReadVariableOp")); opBuilder.addInput(resource.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new ReadVariableOp(opBuilder.build()); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RebatchDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RebatchDataset.java index afd9cdd3008..6fd78fe8555 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RebatchDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RebatchDataset.java @@ -23,9 +23,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that changes the batch size. @@ -33,7 +35,7 @@ * Creates a dataset that changes the batch size of the dataset to current batch * size // num_workers. */ -public final class RebatchDataset extends PrimitiveOp implements Operand { +public final class RebatchDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.RebatchDataset} @@ -67,14 +69,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RebatchDataset */ - public static RebatchDataset create(Scope scope, Operand inputDataset, Operand numReplicas, List> outputTypes, List outputShapes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -107,8 +109,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RecvTPUEmbeddingActivations.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RecvTPUEmbeddingActivations.java index 88ca08f3eca..2a67a9700cf 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RecvTPUEmbeddingActivations.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RecvTPUEmbeddingActivations.java @@ -26,6 +26,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * An op that receives embedding activations on the TPU. @@ -37,7 +38,7 @@ * one Tensor of activations per table specified in the model. There can be at * most one RecvTPUEmbeddingActivations op in the TPU graph. */ -public final class RecvTPUEmbeddingActivations extends PrimitiveOp implements Iterable> { +public final class RecvTPUEmbeddingActivations extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new RecvTPUEmbeddingActivations operation. @@ -60,24 +61,24 @@ public static RecvTPUEmbeddingActivations create(Scope scope, Long numOutputs, S * A TensorList of embedding activations containing one Tensor per * embedding table in the model. */ - public List> outputs() { + public List> outputs() { return outputs; } @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) outputs.iterator(); } - private List> outputs; + 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)); + 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/ReduceAll.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ReduceAll.java index d4a76da4258..b7bbecb4f57 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the "logical and" of elements across dimensions of a tensor. @@ -34,7 +37,7 @@ * retained with length 1. */ @Operator -public final class ReduceAll extends PrimitiveOp implements Operand { +public final class ReduceAll extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ReduceAll} @@ -65,7 +68,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ReduceAll */ - public static ReduceAll create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); @@ -90,16 +93,16 @@ public static Options keepDims(Boolean keepDims) { /** * The reduced tensor. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private ReduceAll(Operation operation) { super(operation); 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 4157226c067..5f4d94ab5c1 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the "logical or" of elements across dimensions of a tensor. @@ -34,7 +37,7 @@ * retained with length 1. */ @Operator -public final class ReduceAny extends PrimitiveOp implements Operand { +public final class ReduceAny extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ReduceAny} @@ -65,7 +68,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ReduceAny */ - public static ReduceAny create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); @@ -90,16 +93,16 @@ public static Options keepDims(Boolean keepDims) { /** * The reduced tensor. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private ReduceAny(Operation operation) { super(operation); 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 95f3672a434..a674ad4be28 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ReduceMax extends PrimitiveOp implements Operand { +public final class ReduceMax extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ReduceMax} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ReduceMax */ - public static ReduceMax create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); 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 81d2a4d913e..29e2ad78252 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ReduceMin extends PrimitiveOp implements Operand { +public final class ReduceMin extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ReduceMin} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ReduceMin */ - public static ReduceMin create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); 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 981758183be..3de9a7ca094 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the product of elements across dimensions of a tensor. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ReduceProd extends PrimitiveOp implements Operand { +public final class ReduceProd extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ReduceProd} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ReduceProd */ - public static ReduceProd create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); 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 013432ca778..6dfc4313728 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the sum of elements across dimensions of a tensor. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ReduceSum extends PrimitiveOp implements Operand { +public final class ReduceSum extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ReduceSum} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ReduceSum */ - public static ReduceSum create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); 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 3c293640791..763acedfb18 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Creates or finds a child frame, and makes `data` available to the child frame. @@ -34,7 +35,7 @@ * * @param data type for {@code output()} output */ -public final class RefEnter extends PrimitiveOp implements Operand { +public final class RefEnter extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.RefEnter} @@ -73,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RefEnter */ - public static RefEnter create(Scope scope, Operand data, String frameName, Options... options) { + 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.applyControlDependencies(opBuilder); 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 754a9aeab37..fe8dfa6cc1d 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Exits the current frame to its parent frame. @@ -31,7 +32,7 @@ * * @param data type for {@code output()} output */ -public final class RefExit extends PrimitiveOp implements Operand { +public final class RefExit extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RefExit operation. @@ -40,7 +41,7 @@ public final class RefExit extends PrimitiveOp implements Operand { * @param data The tensor to be made available to the parent frame. * @return a new instance of RefExit */ - public static RefExit create(Scope scope, Operand data) { + public static RefExit create(Scope scope, Operand data) { OperationBuilder opBuilder = scope.env().opBuilder("RefExit", scope.makeOpName("RefExit")); opBuilder.addInput(data.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 dd139e39101..f3c23f64625 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 @@ -23,13 +23,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Return the same ref tensor as the input ref tensor. * * @param data type for {@code output()} output */ -public final class RefIdentity extends PrimitiveOp implements Operand { +public final class RefIdentity extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RefIdentity operation. @@ -38,7 +39,7 @@ public final class RefIdentity extends PrimitiveOp implements Operand { * @param input * @return a new instance of RefIdentity */ - public static RefIdentity create(Scope scope, Operand input) { + public static RefIdentity create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("RefIdentity", scope.makeOpName("RefIdentity")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 5a30ee939c1..d0ba1c93ca3 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Forwards the value of an available tensor from `inputs` to `output`. @@ -36,7 +38,7 @@ * * @param data type for {@code output()} output */ -public final class RefMerge extends PrimitiveOp { +public final class RefMerge extends PrimitiveOp { /** * Factory method to create a class wrapping a new RefMerge operation. @@ -45,7 +47,7 @@ public final class RefMerge extends PrimitiveOp { * @param inputs The input tensors, exactly one of which will become available. * @return a new instance of RefMerge */ - public static RefMerge create(Scope scope, Iterable> inputs) { + public static RefMerge create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("RefMerge", scope.makeOpName("RefMerge")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.applyControlDependencies(opBuilder); @@ -62,12 +64,12 @@ public Output output() { /** * The index of the chosen input tensor in `inputs`. */ - public Output valueIndex() { + public Output valueIndex() { return valueIndex; } private Output output; - private Output valueIndex; + private Output valueIndex; private RefMerge(Operation operation) { super(operation); 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 0cd46893693..d49390c218d 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Makes its input available to the next iteration. @@ -31,7 +32,7 @@ * @param data type for {@code output()} output */ @Operator -public final class RefNextIteration extends PrimitiveOp implements Operand { +public final class RefNextIteration extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RefNextIteration operation. @@ -40,7 +41,7 @@ public final class RefNextIteration extends PrimitiveOp implements Operand * @param data The tensor to be made available to the next iteration. * @return a new instance of RefNextIteration */ - public static RefNextIteration create(Scope scope, Operand data) { + public static RefNextIteration create(Scope scope, Operand data) { OperationBuilder opBuilder = scope.env().opBuilder("RefNextIteration", scope.makeOpName("RefNextIteration")); opBuilder.addInput(data.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 712b82fa40d..61a48903dcd 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Forwards the `index`th element of `inputs` to `output`. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator -public final class RefSelect extends PrimitiveOp implements Operand { +public final class RefSelect extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RefSelect operation. @@ -42,7 +44,7 @@ public final class RefSelect extends PrimitiveOp implements Operand { * @param inputs A list of ref tensors, one of which will be forwarded to `output`. * @return a new instance of RefSelect */ - public static RefSelect create(Scope scope, Operand index, Iterable> inputs) { + 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)); 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 3017e9de59a..0c24c9a55bd 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Forwards the ref tensor `data` to the output port determined by `pred`. @@ -36,7 +38,7 @@ * @param data type for {@code outputFalse()} output */ @Operator -public final class RefSwitch extends PrimitiveOp { +public final class RefSwitch extends PrimitiveOp { /** * Factory method to create a class wrapping a new RefSwitch operation. @@ -46,7 +48,7 @@ public final class RefSwitch extends PrimitiveOp { * @param pred A scalar that specifies which output port will receive data. * @return a new instance of RefSwitch */ - public static RefSwitch create(Scope scope, Operand data, Operand pred) { + 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()); 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 a9593b1272a..86af7d79e7b 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 @@ -29,6 +29,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Execute a sub graph on a remote processor. @@ -42,7 +43,7 @@ * will be passed to consumer nodes as outputs of this node. */ @Operator -public final class RemoteFusedGraphExecute extends PrimitiveOp implements Iterable> { +public final class RemoteFusedGraphExecute extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new RemoteFusedGraphExecute operation. @@ -54,13 +55,13 @@ public final class RemoteFusedGraphExecute extends PrimitiveOp implements Iterab * of RemoteFusedGraphExecuteInfo which contains graph specifications. * @return a new instance of RemoteFusedGraphExecute */ - public static RemoteFusedGraphExecute create(Scope scope, Iterable> inputs, List> Toutputs, String serializedRemoteFusedGraphExecuteInfo) { + 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.applyControlDependencies(opBuilder); DataType[] ToutputsArray = new DataType[Toutputs.size()]; for (int i = 0; i < ToutputsArray.length; ++i) { - ToutputsArray[i] = DataType.fromClass(Toutputs.get(i)); + ToutputsArray[i] = Toutputs.get(i); } opBuilder.setAttr("Toutputs", ToutputsArray); opBuilder.setAttr("serialized_remote_fused_graph_execute_info", serializedRemoteFusedGraphExecuteInfo); @@ -76,7 +77,7 @@ public List> outputs() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) outputs.iterator(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RequantizationRangePerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RequantizationRangePerChannel.java index e2d507496de..c7c336b26d3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RequantizationRangePerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RequantizationRangePerChannel.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes requantization range per channel. @@ -40,7 +42,7 @@ public final class RequantizationRangePerChannel extends PrimitiveOp { * Example: set this to 6 for Relu6. * @return a new instance of RequantizationRangePerChannel */ - public static RequantizationRangePerChannel create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Float clipValueMax) { + 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()); @@ -53,19 +55,19 @@ public static RequantizationRangePerChannel create(Scope scope, Operand i /** * The minimum value of the final output tensor */ - public Output outputMin() { + public Output outputMin() { return outputMin; } /** * The maximum value of the final output tensor. */ - public Output outputMax() { + public Output outputMax() { return outputMax; } - private Output outputMin; - private Output outputMax; + private Output outputMin; + private Output outputMax; private RequantizationRangePerChannel(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RequantizePerChannel.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RequantizePerChannel.java index 67aed0b4cfb..34941f3b84a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RequantizePerChannel.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RequantizePerChannel.java @@ -24,13 +24,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Requantizes input with min and max values known per channel. * * @param data type for {@code output()} output */ -public final class RequantizePerChannel extends PrimitiveOp { +public final class RequantizePerChannel extends PrimitiveOp { /** * Factory method to create a class wrapping a new RequantizePerChannel operation. @@ -44,7 +46,7 @@ public final class RequantizePerChannel extends PrimitiveOp { * @param outType The quantized type of output tensor that needs to be converted. * @return a new instance of RequantizePerChannel */ - public static RequantizePerChannel create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, Class outType) { + public static RequantizePerChannel create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("RequantizePerChannel", scope.makeOpName("RequantizePerChannel")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); @@ -52,7 +54,7 @@ public static RequantizePerChannel create(Scope scope, Operand inpu opBuilder.addInput(requestedOutputMin.asOutput()); opBuilder.addInput(requestedOutputMax.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new RequantizePerChannel(opBuilder.build()); } @@ -66,20 +68,20 @@ public Output output() { /** * The minimum value of the final output tensor */ - public Output outputMin() { + public Output outputMin() { return outputMin; } /** * The maximum value of the final output tensor. */ - public Output outputMax() { + public Output outputMax() { return outputMax; } private Output output; - private Output outputMin; - private Output outputMax; + private Output outputMin; + private Output outputMax; private RequantizePerChannel(Operation operation) { super(operation); 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 0fa6e78cdb0..5146030a1b0 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reshapes a tensor. @@ -88,7 +90,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Reshape extends PrimitiveOp implements Operand { +public final class Reshape extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Reshape operation. @@ -98,7 +100,7 @@ public final class Reshape extends PrimitiveOp implements Operand { * @param shape Defines the shape of the output tensor. * @return a new instance of Reshape */ - public static Reshape create(Scope scope, Operand tensor, Operand shape) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorApplyGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorApplyGradient.java index ef5e8796149..5a9556cea3b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorApplyGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorApplyGradient.java @@ -22,6 +22,8 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Applies a gradient to a given accumulator. @@ -39,7 +41,7 @@ public final class ResourceAccumulatorApplyGradient extends PrimitiveOp { * @param gradient A tensor of the gradient to be accumulated. * @return a new instance of ResourceAccumulatorApplyGradient */ - public static ResourceAccumulatorApplyGradient create(Scope scope, Operand handle, Operand localStep, Operand gradient) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorNumAccumulated.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorNumAccumulated.java index da40320c80b..947a7545b0f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorNumAccumulated.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorNumAccumulated.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; /** * Returns the number of gradients aggregated in the given accumulators. */ -public final class ResourceAccumulatorNumAccumulated extends PrimitiveOp implements Operand { +public final class ResourceAccumulatorNumAccumulated extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ResourceAccumulatorNumAccumulated operation. @@ -46,16 +47,16 @@ public static ResourceAccumulatorNumAccumulated create(Scope scope, Operand h /** * The number of gradients aggregated in the given accumulator. */ - public Output numAccumulated() { + public Output numAccumulated() { return numAccumulated; } @Override - public Output asOutput() { + public Output asOutput() { return numAccumulated; } - private Output numAccumulated; + private Output numAccumulated; private ResourceAccumulatorNumAccumulated(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorSetGlobalStep.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorSetGlobalStep.java index 1ff57263c61..c4e6240a192 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorSetGlobalStep.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorSetGlobalStep.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; /** * Updates the accumulator with a new value for global_step. @@ -39,7 +40,7 @@ public final class ResourceAccumulatorSetGlobalStep extends PrimitiveOp { * @param newGlobalStep The new global_step value to set. * @return a new instance of ResourceAccumulatorSetGlobalStep */ - public static ResourceAccumulatorSetGlobalStep create(Scope scope, Operand handle, Operand newGlobalStep) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorTakeGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorTakeGradient.java index 9d5b66ceb24..396ac2a07e3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorTakeGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceAccumulatorTakeGradient.java @@ -24,6 +24,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Extracts the average gradient in the given ConditionalAccumulator. @@ -36,7 +38,7 @@ * * @param data type for {@code average()} output */ -public final class ResourceAccumulatorTakeGradient extends PrimitiveOp implements Operand { +public final class ResourceAccumulatorTakeGradient extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ResourceAccumulatorTakeGradient operation. @@ -48,12 +50,12 @@ public final class ResourceAccumulatorTakeGradient extends PrimitiveOp implem * of the accumulator. * @return a new instance of ResourceAccumulatorTakeGradient */ - public static ResourceAccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, Class dtype) { + public static ResourceAccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceAccumulatorTakeGradient", scope.makeOpName("ResourceAccumulatorTakeGradient")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numRequired.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new ResourceAccumulatorTakeGradient(opBuilder.build()); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyAdagradV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyAdagradV2.java index 195a5af8ecd..51ca6876e45 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyAdagradV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyAdagradV2.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the adagrad scheme. @@ -73,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyAdagradV2 */ - public static ResourceApplyAdagradV2 create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Options... options) { + public static ResourceApplyAdagradV2 create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdagradV2", scope.makeOpName("ResourceApplyAdagradV2")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyAdamWithAmsgrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyAdamWithAmsgrad.java index db354f7ae94..ab574a98386 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyAdamWithAmsgrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyAdamWithAmsgrad.java @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the Adam algorithm. @@ -75,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyAdamWithAmsgrad */ - 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) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyKerasMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyKerasMomentum.java index 5e49211289b..d7bc8f845ae 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyKerasMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceApplyKerasMomentum.java @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the momentum scheme. Set use_nesterov = True if you @@ -79,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyKerasMomentum */ - public static ResourceApplyKerasMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceConditionalAccumulator.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceConditionalAccumulator.java index de60fa0a487..f8a1db1f93b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceConditionalAccumulator.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceConditionalAccumulator.java @@ -22,9 +22,10 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A conditional accumulator for aggregating gradients. @@ -38,7 +39,7 @@ * This is a resource version of ConditionalAccumulator that will work in TF2.0 * with tf.cond version 2. */ -public final class ResourceConditionalAccumulator extends PrimitiveOp implements Operand { +public final class ResourceConditionalAccumulator extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ResourceConditionalAccumulator} @@ -88,10 +89,10 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceConditionalAccumulator */ - public static ResourceConditionalAccumulator create(Scope scope, Class dtype, Shape shape, Options... options) { + public static ResourceConditionalAccumulator create(Scope scope, DataType dtype, Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceConditionalAccumulator", scope.makeOpName("ResourceConditionalAccumulator")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); opBuilder.setAttr("shape", shape); if (options != null) { for (Options opts : options) { @@ -141,8 +142,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 fe7c6337e4b..342c761b54b 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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'. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ResourceCountUpTo extends PrimitiveOp implements Operand { +public final class ResourceCountUpTo extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ResourceCountUpTo operation. @@ -44,12 +46,12 @@ public final class ResourceCountUpTo extends PrimitiveOp imple * @param T * @return a new instance of ResourceCountUpTo */ - public static ResourceCountUpTo create(Scope scope, Operand resource, Long limit, Class T) { + public static ResourceCountUpTo create(Scope scope, Operand resource, Long limit, DataType T) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceCountUpTo", scope.makeOpName("ResourceCountUpTo")); opBuilder.addInput(resource.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); opBuilder.setAttr("limit", limit); - opBuilder.setAttr("T", DataType.fromClass(T)); + opBuilder.setAttr("T", T); return new ResourceCountUpTo(opBuilder.build()); } 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 a3a2f7a2288..a0b093e9f7b 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Gather slices from the variable pointed to by `resource` according to `indices`. @@ -46,7 +48,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ResourceGather extends PrimitiveOp implements Operand { +public final class ResourceGather extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ResourceGather} @@ -86,12 +88,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceGather */ - public static ResourceGather create(Scope scope, Operand resource, Operand indices, Class dtype, Options... options) { + public static ResourceGather create(Scope scope, Operand resource, Operand indices, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceGather", scope.makeOpName("ResourceGather")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.batchDims != null) { 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 8adcf5c55c5..b71d677f989 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 @@ -25,12 +25,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator -public final class ResourceGatherNd extends PrimitiveOp implements Operand { +public final class ResourceGatherNd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ResourceGatherNd operation. @@ -41,12 +43,12 @@ public final class ResourceGatherNd extends PrimitiveOp implements Operand * @param dtype * @return a new instance of ResourceGatherNd */ - public static ResourceGatherNd create(Scope scope, Operand resource, Operand indices, Class dtype) { + public static ResourceGatherNd create(Scope scope, Operand resource, Operand indices, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceGatherNd", scope.makeOpName("ResourceGatherNd")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new ResourceGatherNd(opBuilder.build()); } 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 6613f3138d3..29354a7aec9 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Adds sparse updates to the variable referenced by `resource`. @@ -59,7 +61,7 @@ public final class ResourceScatterAdd extends PrimitiveOp { * @param updates A tensor of updated values to add to `ref`. * @return a new instance of ResourceScatterAdd */ - public static ResourceScatterAdd create(Scope scope, Operand resource, Operand indices, Operand updates) { + 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()); 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 1f70e2a874b..52fce6ffc67 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Divides sparse updates into the variable referenced by `resource`. @@ -59,7 +61,7 @@ public final class ResourceScatterDiv extends PrimitiveOp { * @param updates A tensor of updated values to add to `ref`. * @return a new instance of ResourceScatterDiv */ - public static ResourceScatterDiv create(Scope scope, Operand resource, Operand indices, Operand updates) { + 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()); 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 69e9850cb37..b7d3d7dd5da 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reduces sparse updates into the variable referenced by `resource` using the `max` operation. @@ -59,7 +61,7 @@ public final class ResourceScatterMax extends PrimitiveOp { * @param updates A tensor of updated values to add to `ref`. * @return a new instance of ResourceScatterMax */ - public static ResourceScatterMax create(Scope scope, Operand resource, Operand indices, Operand updates) { + 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()); 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 c472a12b382..343dd1988a5 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reduces sparse updates into the variable referenced by `resource` using the `min` operation. @@ -59,7 +61,7 @@ public final class ResourceScatterMin extends PrimitiveOp { * @param updates A tensor of updated values to add to `ref`. * @return a new instance of ResourceScatterMin */ - public static ResourceScatterMin create(Scope scope, Operand resource, Operand indices, Operand updates) { + 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()); 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 46d7fd5bfe1..4c46348f8c7 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Multiplies sparse updates into the variable referenced by `resource`. @@ -59,7 +61,7 @@ public final class ResourceScatterMul extends PrimitiveOp { * @param updates A tensor of updated values to add to `ref`. * @return a new instance of ResourceScatterMul */ - public static ResourceScatterMul create(Scope scope, Operand resource, Operand indices, Operand updates) { + 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()); 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 ec2462b03ad..76b3f31df6f 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Applies sparse addition to individual values or slices in a Variable. @@ -93,7 +95,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceScatterNdAdd */ - public static ResourceScatterNdAdd create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdSub.java index 2c0ba2ac5b5..960eb8b1d20 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdSub.java @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Applies sparse subtraction to individual values or slices in a Variable. @@ -93,7 +95,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceScatterNdSub */ - public static ResourceScatterNdSub create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdUpdate.java index 167fa47d22d..fa1614ce3f9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceScatterNdUpdate.java @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Applies sparse `updates` to individual values or slices within a given @@ -95,7 +97,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceScatterNdUpdate */ - public static ResourceScatterNdUpdate create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 ec8ab22718a..0d3248f25ce 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Subtracts sparse updates from the variable referenced by `resource`. @@ -59,7 +61,7 @@ public final class ResourceScatterSub extends PrimitiveOp { * @param updates A tensor of updated values to add to `ref`. * @return a new instance of ResourceScatterSub */ - public static ResourceScatterSub create(Scope scope, Operand resource, Operand indices, Operand updates) { + 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()); 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 e97d9551725..c2af6f4da5c 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Assigns sparse updates to the variable referenced by `resource`. @@ -50,7 +52,7 @@ public final class ResourceScatterUpdate extends PrimitiveOp { * @param updates A tensor of updated values to add to `ref`. * @return a new instance of ResourceScatterUpdate */ - public static ResourceScatterUpdate create(Scope scope, Operand resource, Operand indices, Operand updates) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceSparseApplyAdagradV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceSparseApplyAdagradV2.java index b794f208966..78986ed19b2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceSparseApplyAdagradV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceSparseApplyAdagradV2.java @@ -22,6 +22,8 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update relevant entries in '*var' and '*accum' according to the adagrad scheme. @@ -75,7 +77,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyAdagradV2 */ - public static ResourceSparseApplyAdagradV2 create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Operand indices, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceSparseApplyKerasMomentum.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceSparseApplyKerasMomentum.java index 6c70febbb1f..8e51c1ab179 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceSparseApplyKerasMomentum.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ResourceSparseApplyKerasMomentum.java @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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 momentum scheme. @@ -82,7 +84,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyKerasMomentum */ - public static ResourceSparseApplyKerasMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, Options... options) { + 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()); 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 020b03db452..aa14e070bf0 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Assign `value` to the sliced l-value reference of `ref`. @@ -104,7 +106,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceStridedSliceAssign */ - public static ResourceStridedSliceAssign create(Scope scope, Operand ref, Operand begin, Operand end, Operand strides, Operand value, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingADAMParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingADAMParameters.java index 1a60282c2c1..a6d5f856026 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingADAMParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingADAMParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve ADAM embedding parameters. @@ -105,27 +106,27 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the ADAM optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter momenta updated by the ADAM optimization algorithm. */ - public Output momenta() { + public Output momenta() { return momenta; } /** * Parameter velocities updated by the ADAM optimization algorithm. */ - public Output velocities() { + public Output velocities() { return velocities; } - private Output parameters; - private Output momenta; - private Output velocities; + private Output parameters; + private Output momenta; + private Output velocities; private RetrieveTPUEmbeddingADAMParameters(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java index f88660ce979..040adf32ee7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingADAMParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve ADAM embedding parameters with debug support. @@ -105,35 +106,35 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the ADAM optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter momenta updated by the ADAM optimization algorithm. */ - public Output momenta() { + public Output momenta() { return momenta; } /** * Parameter velocities updated by the ADAM optimization algorithm. */ - public Output velocities() { + public Output velocities() { return velocities; } /** * Parameter gradient_accumulators updated by the ADAM optimization algorithm. */ - public Output gradientAccumulators() { + public Output gradientAccumulators() { return gradientAccumulators; } - private Output parameters; - private Output momenta; - private Output velocities; - private Output gradientAccumulators; + private Output parameters; + private Output momenta; + private Output velocities; + private Output gradientAccumulators; private RetrieveTPUEmbeddingADAMParametersGradAccumDebug(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdadeltaParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdadeltaParameters.java index 9a8eabbf2d8..74dbebd1a67 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdadeltaParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdadeltaParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve Adadelta embedding parameters. @@ -105,27 +106,27 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the Adadelta optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter accumulators updated by the Adadelta optimization algorithm. */ - public Output accumulators() { + public Output accumulators() { return accumulators; } /** * Parameter updates updated by the Adadelta optimization algorithm. */ - public Output updates() { + public Output updates() { return updates; } - private Output parameters; - private Output accumulators; - private Output updates; + private Output parameters; + private Output accumulators; + private Output updates; private RetrieveTPUEmbeddingAdadeltaParameters(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java index ab5776d7159..e0c20e01f3f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve Adadelta embedding parameters with debug support. @@ -105,35 +106,35 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the Adadelta optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter accumulators updated by the Adadelta optimization algorithm. */ - public Output accumulators() { + public Output accumulators() { return accumulators; } /** * Parameter updates updated by the Adadelta optimization algorithm. */ - public Output updates() { + public Output updates() { return updates; } /** * Parameter gradient_accumulators updated by the Adadelta optimization algorithm. */ - public Output gradientAccumulators() { + public Output gradientAccumulators() { return gradientAccumulators; } - private Output parameters; - private Output accumulators; - private Output updates; - private Output gradientAccumulators; + private Output parameters; + private Output accumulators; + private Output updates; + private Output gradientAccumulators; private RetrieveTPUEmbeddingAdadeltaParametersGradAccumDebug(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdagradParameters.java index 8e2e3bb6ab6..4731b432cab 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdagradParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve Adagrad embedding parameters. @@ -105,19 +106,19 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the Adagrad optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter accumulators updated by the Adagrad optimization algorithm. */ - public Output accumulators() { + public Output accumulators() { return accumulators; } - private Output parameters; - private Output accumulators; + private Output parameters; + private Output accumulators; private RetrieveTPUEmbeddingAdagradParameters(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java index 16f10db96fe..8dddf6e9d6d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingAdagradParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve Adagrad embedding parameters with debug support. @@ -105,27 +106,27 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the Adagrad optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter accumulators updated by the Adagrad optimization algorithm. */ - public Output accumulators() { + public Output accumulators() { return accumulators; } /** * Parameter gradient_accumulators updated by the Adagrad optimization algorithm. */ - public Output gradientAccumulators() { + public Output gradientAccumulators() { return gradientAccumulators; } - private Output parameters; - private Output accumulators; - private Output gradientAccumulators; + private Output parameters; + private Output accumulators; + private Output gradientAccumulators; private RetrieveTPUEmbeddingAdagradParametersGradAccumDebug(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingCenteredRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingCenteredRMSPropParameters.java index 079c968978d..ed3b32a7d59 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingCenteredRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingCenteredRMSPropParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve centered RMSProp embedding parameters. @@ -105,35 +106,35 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the centered RMSProp optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter ms updated by the centered RMSProp optimization algorithm. */ - public Output ms() { + public Output ms() { return ms; } /** * Parameter mom updated by the centered RMSProp optimization algorithm. */ - public Output mom() { + public Output mom() { return mom; } /** * Parameter mg updated by the centered RMSProp optimization algorithm. */ - public Output mg() { + public Output mg() { return mg; } - private Output parameters; - private Output ms; - private Output mom; - private Output mg; + private Output parameters; + private Output ms; + private Output mom; + private Output mg; private RetrieveTPUEmbeddingCenteredRMSPropParameters(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingFTRLParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingFTRLParameters.java index 0de5292c378..54c5241a0a1 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingFTRLParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingFTRLParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve FTRL embedding parameters. @@ -105,27 +106,27 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the FTRL optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter accumulators updated by the FTRL optimization algorithm. */ - public Output accumulators() { + public Output accumulators() { return accumulators; } /** * Parameter linears updated by the FTRL optimization algorithm. */ - public Output linears() { + public Output linears() { return linears; } - private Output parameters; - private Output accumulators; - private Output linears; + private Output parameters; + private Output accumulators; + private Output linears; private RetrieveTPUEmbeddingFTRLParameters(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java index 32c61428018..f7264fcf8e3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingFTRLParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve FTRL embedding parameters with debug support. @@ -105,35 +106,35 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the FTRL optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter accumulators updated by the FTRL optimization algorithm. */ - public Output accumulators() { + public Output accumulators() { return accumulators; } /** * Parameter linears updated by the FTRL optimization algorithm. */ - public Output linears() { + public Output linears() { return linears; } /** * Parameter gradient_accumulators updated by the FTRL optimization algorithm. */ - public Output gradientAccumulators() { + public Output gradientAccumulators() { return gradientAccumulators; } - private Output parameters; - private Output accumulators; - private Output linears; - private Output gradientAccumulators; + private Output parameters; + private Output accumulators; + private Output linears; + private Output gradientAccumulators; private RetrieveTPUEmbeddingFTRLParametersGradAccumDebug(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMDLAdagradLightParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMDLAdagradLightParameters.java index 5436bcfcedf..796171a08e6 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMDLAdagradLightParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMDLAdagradLightParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve MDL Adagrad Light embedding parameters. @@ -105,35 +106,35 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the MDL Adagrad Light optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter accumulators updated by the MDL Adagrad Light optimization algorithm. */ - public Output accumulators() { + public Output accumulators() { return accumulators; } /** * Parameter weights updated by the MDL Adagrad Light optimization algorithm. */ - public Output weights() { + public Output weights() { return weights; } /** * Parameter benefits updated by the MDL Adagrad Light optimization algorithm. */ - public Output benefits() { + public Output benefits() { return benefits; } - private Output parameters; - private Output accumulators; - private Output weights; - private Output benefits; + private Output parameters; + private Output accumulators; + private Output weights; + private Output benefits; private RetrieveTPUEmbeddingMDLAdagradLightParameters(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMomentumParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMomentumParameters.java index d086985a7a1..4b5bb17bd4a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMomentumParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMomentumParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve Momentum embedding parameters. @@ -105,19 +106,19 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the Momentum optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter momenta updated by the Momentum optimization algorithm. */ - public Output momenta() { + public Output momenta() { return momenta; } - private Output parameters; - private Output momenta; + private Output parameters; + private Output momenta; private RetrieveTPUEmbeddingMomentumParameters(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java index ed7cde14464..c9017b8c1ce 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingMomentumParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve Momentum embedding parameters with debug support. @@ -105,27 +106,27 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the Momentum optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter momenta updated by the Momentum optimization algorithm. */ - public Output momenta() { + public Output momenta() { return momenta; } /** * Parameter gradient_accumulators updated by the Momentum optimization algorithm. */ - public Output gradientAccumulators() { + public Output gradientAccumulators() { return gradientAccumulators; } - private Output parameters; - private Output momenta; - private Output gradientAccumulators; + private Output parameters; + private Output momenta; + private Output gradientAccumulators; private RetrieveTPUEmbeddingMomentumParametersGradAccumDebug(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingProximalAdagradParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingProximalAdagradParameters.java index 16332f64e84..a4c0d307590 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingProximalAdagradParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingProximalAdagradParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve proximal Adagrad embedding parameters. @@ -105,19 +106,19 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the proximal Adagrad optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter accumulators updated by the proximal Adagrad optimization algorithm. */ - public Output accumulators() { + public Output accumulators() { return accumulators; } - private Output parameters; - private Output accumulators; + private Output parameters; + private Output accumulators; private RetrieveTPUEmbeddingProximalAdagradParameters(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java index e02ecc04d40..7af385f0145 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve proximal Adagrad embedding parameters with debug support. @@ -105,27 +106,27 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the proximal Adagrad optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter accumulators updated by the proximal Adagrad optimization algorithm. */ - public Output accumulators() { + public Output accumulators() { return accumulators; } /** * Parameter gradient_accumulators updated by the proximal Adagrad optimization algorithm. */ - public Output gradientAccumulators() { + public Output gradientAccumulators() { return gradientAccumulators; } - private Output parameters; - private Output accumulators; - private Output gradientAccumulators; + private Output parameters; + private Output accumulators; + private Output gradientAccumulators; private RetrieveTPUEmbeddingProximalAdagradParametersGradAccumDebug(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingRMSPropParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingRMSPropParameters.java index ae84f309a9c..33551f49b5c 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingRMSPropParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingRMSPropParameters.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve RMSProp embedding parameters. @@ -105,27 +106,27 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the RMSProp optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter ms updated by the RMSProp optimization algorithm. */ - public Output ms() { + public Output ms() { return ms; } /** * Parameter mom updated by the RMSProp optimization algorithm. */ - public Output mom() { + public Output mom() { return mom; } - private Output parameters; - private Output ms; - private Output mom; + private Output parameters; + private Output ms; + private Output mom; private RetrieveTPUEmbeddingRMSPropParameters(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java index 606e5724937..ee4454c29af 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug.java @@ -22,6 +22,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve RMSProp embedding parameters with debug support. @@ -105,35 +106,35 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the RMSProp optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } /** * Parameter ms updated by the RMSProp optimization algorithm. */ - public Output ms() { + public Output ms() { return ms; } /** * Parameter mom updated by the RMSProp optimization algorithm. */ - public Output mom() { + public Output mom() { return mom; } /** * Parameter gradient_accumulators updated by the RMSProp optimization algorithm. */ - public Output gradientAccumulators() { + public Output gradientAccumulators() { return gradientAccumulators; } - private Output parameters; - private Output ms; - private Output mom; - private Output gradientAccumulators; + private Output parameters; + private Output ms; + private Output mom; + private Output gradientAccumulators; private RetrieveTPUEmbeddingRMSPropParametersGradAccumDebug(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java index 6d6fdb253eb..834caa3bc3b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RetrieveTPUEmbeddingStochasticGradientDescentParameters.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Retrieve SGD embedding parameters. @@ -32,7 +33,7 @@ * the correct embedding table configuration. For example, this op is * used to retrieve updated parameters before saving a checkpoint. */ -public final class RetrieveTPUEmbeddingStochasticGradientDescentParameters extends PrimitiveOp implements Operand { +public final class RetrieveTPUEmbeddingStochasticGradientDescentParameters extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.RetrieveTPUEmbeddingStochasticGradientDescentParameters} @@ -106,16 +107,16 @@ public static Options tableName(String tableName) { /** * Parameter parameters updated by the stochastic gradient descent optimization algorithm. */ - public Output parameters() { + public Output parameters() { return parameters; } @Override - public Output asOutput() { + public Output asOutput() { return parameters; } - private Output parameters; + private Output parameters; private RetrieveTPUEmbeddingStochasticGradientDescentParameters(Operation operation) { super(operation); 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 750ba20f0b6..de9d3f0e21e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reverses specific dimensions of a tensor. @@ -78,7 +80,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Reverse extends PrimitiveOp implements Operand { +public final class Reverse extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Reverse operation. @@ -89,7 +91,7 @@ public final class Reverse extends PrimitiveOp implements Operand { * `[-rank(tensor), rank(tensor))`. * @return a new instance of Reverse */ - public static Reverse create(Scope scope, Operand tensor, Operand axis) { + 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()); 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 27e60dd41fe..2ef13ca136b 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reverses variable length slices. @@ -84,7 +86,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ReverseSequence extends PrimitiveOp implements Operand { +public final class ReverseSequence extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ReverseSequence} @@ -116,7 +118,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ReverseSequence */ - public static ReverseSequence create(Scope scope, Operand input, Operand seqLengths, Long seqDim, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RngSkip.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RngSkip.java index 048deecbc7e..df092de6c8e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RngSkip.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RngSkip.java @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; /** * Advance the counter of a counter-based RNG. @@ -42,7 +43,7 @@ public final class RngSkip extends PrimitiveOp { * @param delta The amount of advancement. * @return a new instance of RngSkip */ - public static RngSkip create(Scope scope, Operand resource, Operand algorithm, Operand delta) { + 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()); 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 25b0c1582ca..f9a1b3e9fac 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Rolls the elements of a tensor along an axis. @@ -52,7 +54,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Roll extends PrimitiveOp implements Operand { +public final class Roll extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Roll operation. @@ -69,7 +71,7 @@ public final class Roll extends PrimitiveOp implements Operand { * axis. * @return a new instance of Roll */ - public static Roll create(Scope scope, Operand input, Operand shift, Operand axis) { + 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()); 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 1d5552c4728..441553da5f4 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Perform batches of RPC requests. @@ -73,7 +74,7 @@ * See the `TryRpc` op if you prefer to handle RPC failures manually in the graph. */ @Operator -public final class Rpc extends PrimitiveOp implements Operand { +public final class Rpc extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Rpc} @@ -133,7 +134,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Rpc */ - public static Rpc create(Scope scope, Operand address, Operand method, Operand request, Options... options) { + 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()); @@ -184,16 +185,16 @@ public static Options timeoutInMs(Long timeoutInMs) { /** * Same shape as `request`. Serialized proto strings: the rpc responses. */ - public Output response() { + public Output response() { return response; } @Override - public Output asOutput() { + public Output asOutput() { return response; } - private Output response; + private Output response; private Rpc(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SamplingDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SamplingDataset.java index 86db550e242..b1af2df5130 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SamplingDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SamplingDataset.java @@ -23,14 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that contains `rate` elements from the `input_dataset`. */ -public final class SamplingDataset extends PrimitiveOp implements Operand { +public final class SamplingDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SamplingDataset operation. @@ -45,7 +48,7 @@ public final class SamplingDataset extends PrimitiveOp implements Operand inputDataset, Operand rate, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { + 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()); @@ -54,7 +57,7 @@ public static SamplingDataset create(Scope scope, Operand inputDataset, Opera opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -73,8 +76,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScaleAndTranslate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScaleAndTranslate.java index e5012bbb32d..8434089d91e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScaleAndTranslate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScaleAndTranslate.java @@ -24,11 +24,15 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** */ @Operator -public final class ScaleAndTranslate extends PrimitiveOp implements Operand { +public final class ScaleAndTranslate extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScaleAndTranslate} @@ -69,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScaleAndTranslate */ - public static ScaleAndTranslate create(Scope scope, Operand images, Operand size, Operand scale, Operand translation, Options... options) { + public static ScaleAndTranslate create(Scope scope, Operand images, Operand size, Operand scale, Operand translation, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ScaleAndTranslate", scope.makeOpName("ScaleAndTranslate")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(size.asOutput()); @@ -105,16 +109,16 @@ public static Options antialias(Boolean antialias) { /** */ - public Output resizedImages() { + public Output resizedImages() { return resizedImages; } @Override - public Output asOutput() { + public Output asOutput() { return resizedImages; } - private Output resizedImages; + private Output resizedImages; private ScaleAndTranslate(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScaleAndTranslateGrad.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScaleAndTranslateGrad.java index f61d3e7d91c..adcf3f11318 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScaleAndTranslateGrad.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ScaleAndTranslateGrad.java @@ -23,11 +23,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ -public final class ScaleAndTranslateGrad extends PrimitiveOp implements Operand { +public final class ScaleAndTranslateGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScaleAndTranslateGrad} @@ -68,7 +71,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScaleAndTranslateGrad */ - public static ScaleAndTranslateGrad create(Scope scope, Operand grads, Operand originalImage, Operand scale, Operand translation, Options... options) { + 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()); 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 5ef403ff99b..41ee92a33be 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Adds sparse updates to a variable reference. @@ -54,7 +56,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterAdd extends PrimitiveOp implements Operand { +public final class ScatterAdd extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterAdd} @@ -86,7 +88,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterAdd */ - public static ScatterAdd create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 f11f7d27bf9..a1713d52593 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Divides a variable reference by sparse updates. @@ -50,7 +52,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterDiv extends PrimitiveOp implements Operand { +public final class ScatterDiv extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterDiv} @@ -82,7 +84,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterDiv */ - public static ScatterDiv create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 6e9e717f0dd..1f7cbe8c513 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reduces sparse updates into a variable reference using the `max` operation. @@ -54,7 +56,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterMax extends PrimitiveOp implements Operand { +public final class ScatterMax extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterMax} @@ -86,7 +88,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterMax */ - public static ScatterMax create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 ac026b21ceb..fee972dca37 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Reduces sparse updates into a variable reference using the `min` operation. @@ -54,7 +56,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterMin extends PrimitiveOp implements Operand { +public final class ScatterMin extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterMin} @@ -86,7 +88,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterMin */ - public static ScatterMin create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 19a49ba8d69..b55aa0f5aff 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Multiplies sparse updates into a variable reference. @@ -50,7 +52,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterMul extends PrimitiveOp implements Operand { +public final class ScatterMul extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterMul} @@ -82,7 +84,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterMul */ - public static ScatterMul create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 ddba3889939..d7d1de93937 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Scatter `updates` into a new tensor according to `indices`. @@ -110,7 +112,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ScatterNd extends PrimitiveOp implements Operand { +public final class ScatterNd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ScatterNd operation. @@ -121,7 +123,7 @@ public final class ScatterNd extends PrimitiveOp implements Operand { * @param shape 1-D. The shape of the resulting tensor. * @return a new instance of ScatterNd */ - public static ScatterNd create(Scope scope, Operand indices, Operand updates, Operand shape) { + 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()); 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 ad997e2b67a..6825eda3789 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Applies sparse addition to individual values or slices in a Variable. @@ -61,7 +63,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterNdAdd extends PrimitiveOp implements Operand { +public final class ScatterNdAdd extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterNdAdd} @@ -96,7 +98,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterNdAdd */ - public static ScatterNdAdd create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 c2466d58877..83ed3e2811e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Applies sparse addition to `input` using individual values or slices @@ -65,7 +67,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ScatterNdNonAliasingAdd extends PrimitiveOp implements Operand { +public final class ScatterNdNonAliasingAdd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ScatterNdNonAliasingAdd operation. @@ -78,7 +80,7 @@ public final class ScatterNdNonAliasingAdd extends PrimitiveOp implements Ope * to add to `input`. * @return a new instance of ScatterNdNonAliasingAdd */ - public static ScatterNdNonAliasingAdd create(Scope scope, Operand input, Operand indices, Operand updates) { + 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()); 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 989d2085ad9..e2875e8af3c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Applies sparse subtraction to individual values or slices in a Variable. @@ -63,7 +65,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterNdSub extends PrimitiveOp implements Operand { +public final class ScatterNdSub extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterNdSub} @@ -98,7 +100,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterNdSub */ - public static ScatterNdSub create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 e9465e76800..c1ca318bc0b 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Applies sparse `updates` to individual values or slices within a given @@ -65,7 +67,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterNdUpdate extends PrimitiveOp implements Operand { +public final class ScatterNdUpdate extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterNdUpdate} @@ -100,7 +102,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterNdUpdate */ - public static ScatterNdUpdate create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 80086275101..aadb6f5af22 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Subtracts sparse updates to a variable reference. @@ -53,7 +55,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterSub extends PrimitiveOp implements Operand { +public final class ScatterSub extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterSub} @@ -85,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterSub */ - public static ScatterSub create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); 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 d9b272a03dd..8898e370382 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Applies sparse updates to a variable reference. @@ -57,7 +59,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class ScatterUpdate extends PrimitiveOp implements Operand { +public final class ScatterUpdate extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ScatterUpdate} @@ -89,7 +91,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ScatterUpdate */ - public static ScatterUpdate create(Scope scope, Operand ref, Operand indices, Operand updates, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SelectV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SelectV2.java index a3241878b9b..a1f14881901 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SelectV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SelectV2.java @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator -public final class SelectV2 extends PrimitiveOp implements Operand { +public final class SelectV2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SelectV2 operation. @@ -40,7 +42,7 @@ public final class SelectV2 extends PrimitiveOp implements Operand { * @param e * @return a new instance of SelectV2 */ - public static SelectV2 create(Scope scope, Operand condition, Operand t, Operand e) { + public static SelectV2 create(Scope scope, Operand condition, Operand t, Operand e) { OperationBuilder opBuilder = scope.env().opBuilder("SelectV2", scope.makeOpName("SelectV2")); opBuilder.addInput(condition.asOutput()); opBuilder.addInput(t.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SendTPUEmbeddingGradients.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SendTPUEmbeddingGradients.java index 4c575124a88..d103ecb1164 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SendTPUEmbeddingGradients.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SendTPUEmbeddingGradients.java @@ -23,6 +23,7 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Performs gradient updates of embedding tables. @@ -48,7 +49,7 @@ public final class SendTPUEmbeddingGradients extends PrimitiveOp { * @param config Serialized TPUEmbeddingConfiguration proto. * @return a new instance of SendTPUEmbeddingGradients */ - public static SendTPUEmbeddingGradients create(Scope scope, Iterable> inputs, Iterable> learningRates, String config) { + public static SendTPUEmbeddingGradients create(Scope scope, Iterable> inputs, Iterable> learningRates, String config) { OperationBuilder opBuilder = scope.env().opBuilder("SendTPUEmbeddingGradients", scope.makeOpName("SendTPUEmbeddingGradients")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder.addInputList(Operands.asOutputs(learningRates)); 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 f7de18583d1..5d914620f1b 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the difference between two lists of numbers or strings. @@ -53,7 +56,7 @@ * @param data type for {@code idx()} output */ @Operator -public final class SetDiff1d extends PrimitiveOp { +public final class SetDiff1d extends PrimitiveOp { /** * Factory method to create a class wrapping a new SetDiff1d operation. @@ -64,12 +67,12 @@ public final class SetDiff1d extends PrimitiveOp { * @param outIdx * @return a new instance of SetDiff1d */ - public static SetDiff1d create(Scope scope, Operand x, Operand y, Class outIdx) { + public static SetDiff1d create(Scope scope, Operand x, Operand y, DataType outIdx) { OperationBuilder opBuilder = scope.env().opBuilder("ListDiff", scope.makeOpName("SetDiff1d")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_idx", DataType.fromClass(outIdx)); + opBuilder.setAttr("out_idx", outIdx); return new SetDiff1d(opBuilder.build()); } @@ -81,8 +84,8 @@ public static SetDiff1d create(Scope scope, Operand< * @param y 1-D. Values to remove. * @return a new instance of SetDiff1d */ - public static SetDiff1d create(Scope scope, Operand x, Operand y) { - return create(scope, x, y, Integer.class); + public static SetDiff1d create(Scope scope, Operand x, Operand y) { + return create(scope, x, y, TInt32.DTYPE); } /** 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 02a1241ec23..ff3343c7fec 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Number of unique elements along last dimension of input `set`. @@ -36,7 +39,7 @@ * indices. */ @Operator -public final class SetSize extends PrimitiveOp implements Operand { +public final class SetSize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.SetSize} @@ -67,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SetSize */ - public static SetSize create(Scope scope, Operand setIndices, Operand setValues, Operand setShape, Options... options) { + 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()); @@ -95,16 +98,16 @@ public static Options validateIndices(Boolean validateIndices) { * `n-1` dimensions as `set`. Each value is the number of unique elements in * the corresponding `[0...n-1]` dimension of `set`. */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private SetSize(Operation operation) { super(operation); 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 84c85161ebb..8cbef665fe2 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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 a tensor. @@ -41,7 +44,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Shape extends PrimitiveOp implements Operand { +public final class Shape extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Shape operation. @@ -51,11 +54,11 @@ public final class Shape extends PrimitiveOp implements Operan * @param outType * @return a new instance of Shape */ - public static Shape create(Scope scope, Operand input, Class outType) { + public static Shape create(Scope scope, Operand input, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("Shape", scope.makeOpName("Shape")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new Shape(opBuilder.build()); } @@ -66,8 +69,8 @@ public static Shape create(Scope scope, Operand inpu * @param input * @return a new instance of Shape */ - public static Shape create(Scope scope, Operand input) { - return create(scope, input, Integer.class); + public static Shape create(Scope scope, Operand input) { + return create(scope, input, TInt32.DTYPE); } /** 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 686f6c9884f..2324f89e69c 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 @@ -29,6 +29,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns shape of tensors. @@ -38,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator -public final class ShapeN extends PrimitiveOp implements Iterable> { +public final class ShapeN extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new ShapeN operation. @@ -48,11 +51,11 @@ public final class ShapeN extends PrimitiveOp implements Itera * @param outType * @return a new instance of ShapeN */ - public static ShapeN create(Scope scope, Iterable> input, Class outType) { + public static ShapeN create(Scope scope, Iterable> input, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("ShapeN", scope.makeOpName("ShapeN")); opBuilder.addInputList(Operands.asOutputs(input)); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new ShapeN(opBuilder.build()); } @@ -63,8 +66,8 @@ public static ShapeN create(Scope scope, Iterable ShapeN create(Scope scope, Iterable> input) { - return create(scope, input, Integer.class); + public static ShapeN create(Scope scope, Iterable> input) { + return create(scope, input, TInt32.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShardDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShardDataset.java index ba5acf442ee..c066b5a808a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShardDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShardDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a `Dataset` that includes only 1/`num_shards` of this dataset. */ -public final class ShardDataset extends PrimitiveOp implements Operand { +public final class ShardDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ShardDataset} @@ -63,7 +65,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ShardDataset */ - public static ShardDataset create(Scope scope, Operand inputDataset, Operand numShards, Operand index, List> outputTypes, List outputShapes, Options... options) { + 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()); @@ -71,7 +73,7 @@ public static ShardDataset create(Scope scope, Operand inputDataset, Operand< opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -104,8 +106,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShuffleDatasetV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShuffleDatasetV2.java index 2c494712878..bfa87cf6560 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShuffleDatasetV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ShuffleDatasetV2.java @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** */ -public final class ShuffleDatasetV2 extends PrimitiveOp implements Operand { +public final class ShuffleDatasetV2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ShuffleDatasetV2 operation. @@ -42,7 +44,7 @@ public final class ShuffleDatasetV2 extends PrimitiveOp implements Operand inputDataset, Operand bufferSize, Operand seedGenerator, List> outputTypes, List outputShapes) { + public static ShuffleDatasetV2 create(Scope scope, Operand inputDataset, Operand bufferSize, Operand seedGenerator, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ShuffleDatasetV2", scope.makeOpName("ShuffleDatasetV2")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(bufferSize.asOutput()); @@ -50,7 +52,7 @@ public static ShuffleDatasetV2 create(Scope scope, Operand inputDataset, Oper opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -69,8 +71,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 2b3c84e4ac0..0b6725052ab 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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 size of a tensor. @@ -42,7 +45,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Size extends PrimitiveOp implements Operand { +public final class Size extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Size operation. @@ -52,11 +55,11 @@ public final class Size extends PrimitiveOp implements Operand * @param outType * @return a new instance of Size */ - public static Size create(Scope scope, Operand input, Class outType) { + public static Size create(Scope scope, Operand input, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("Size", scope.makeOpName("Size")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new Size(opBuilder.build()); } @@ -67,8 +70,8 @@ public static Size create(Scope scope, Operand input * @param input * @return a new instance of Size */ - public static Size create(Scope scope, Operand input) { - return create(scope, input, Integer.class); + public static Size create(Scope scope, Operand input) { + return create(scope, input, TInt32.DTYPE); } /** 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 612f394d615..d305126af82 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 @@ -23,6 +23,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Parses a text file and creates a batch of examples. @@ -125,59 +128,59 @@ public static Options subsample(Float subsample) { /** * A vector of words in the corpus. */ - public Output vocabWord() { + public Output vocabWord() { return vocabWord; } /** * Frequencies of words. Sorted in the non-ascending order. */ - public Output vocabFreq() { + public Output vocabFreq() { return vocabFreq; } /** * Number of words per epoch in the data file. */ - public Output wordsPerEpoch() { + public Output wordsPerEpoch() { return wordsPerEpoch; } /** * The current epoch number. */ - public Output currentEpoch() { + public Output currentEpoch() { return currentEpoch; } /** * The total number of words processed so far. */ - public Output totalWordsProcessed() { + public Output totalWordsProcessed() { return totalWordsProcessed; } /** * A vector of word ids. */ - public Output examples() { + public Output examples() { return examples; } /** * A vector of word ids. */ - public Output labels() { + public Output labels() { return labels; } - private Output vocabWord; - private Output vocabFreq; - private Output wordsPerEpoch; - private Output currentEpoch; - private Output totalWordsProcessed; - private Output examples; - private Output labels; + 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); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SleepDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SleepDataset.java index 70b419697be..1702a1b762f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SleepDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SleepDataset.java @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** */ -public final class SleepDataset extends PrimitiveOp implements Operand { +public final class SleepDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SleepDataset operation. @@ -41,14 +43,14 @@ public final class SleepDataset extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of SleepDataset */ - public static SleepDataset create(Scope scope, Operand inputDataset, Operand sleepMicroseconds, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -67,8 +69,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 fe591d2c7f3..4bf53db2892 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Return a slice from 'input'. @@ -38,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Slice extends PrimitiveOp implements Operand { +public final class Slice extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Slice operation. @@ -53,7 +55,7 @@ public final class Slice extends PrimitiveOp implements Operand { * size[i] = input.dim_size(i) - begin[i]). * @return a new instance of Slice */ - public static Slice create(Scope scope, Operand input, Operand begin, Operand size) { + public static Slice create(Scope scope, Operand input, Operand begin, Operand size) { OperationBuilder opBuilder = scope.env().opBuilder("Slice", scope.makeOpName("Slice")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(begin.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SlidingWindowDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SlidingWindowDataset.java index 117a4738579..cb85a150867 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SlidingWindowDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SlidingWindowDataset.java @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that passes a sliding window over `input_dataset`. */ -public final class SlidingWindowDataset extends PrimitiveOp implements Operand { +public final class SlidingWindowDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SlidingWindowDataset operation. @@ -47,7 +49,7 @@ public final class SlidingWindowDataset extends PrimitiveOp implements Operand inputDataset, Operand windowSize, Operand windowShift, Operand windowStride, List> outputTypes, List outputShapes) { + 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()); @@ -56,7 +58,7 @@ public static SlidingWindowDataset create(Scope scope, Operand inputDataset, opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -75,8 +77,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 748418da94f..f4601c464bd 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns a copy of the input tensor. @@ -31,7 +32,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Snapshot extends PrimitiveOp implements Operand { +public final class Snapshot extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Snapshot operation. @@ -40,7 +41,7 @@ public final class Snapshot extends PrimitiveOp implements Operand { * @param input * @return a new instance of Snapshot */ - public static Snapshot create(Scope scope, Operand input) { + public static Snapshot create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Snapshot", scope.makeOpName("Snapshot")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SnapshotDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SnapshotDataset.java index 24ba2438bbf..52271041996 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SnapshotDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SnapshotDataset.java @@ -23,9 +23,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Creates a dataset that will write to / read from a snapshot. @@ -35,7 +37,7 @@ * If not, it will run the preprocessing pipeline as usual, and write out a * snapshot of the data processed for future use. */ -public final class SnapshotDataset extends PrimitiveOp implements Operand { +public final class SnapshotDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.SnapshotDataset} @@ -139,14 +141,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SnapshotDataset */ - public static SnapshotDataset create(Scope scope, Operand inputDataset, Operand path, List> outputTypes, List outputShapes, Options... options) { + public static SnapshotDataset create(Scope scope, Operand inputDataset, Operand path, List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SnapshotDataset", scope.makeOpName("SnapshotDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(path.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -259,8 +261,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 986a0477372..3f79d58f976 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * SpaceToBatch for N-D tensors of type T. @@ -40,7 +42,7 @@ * @param data type for {@code output()} output */ @Operator -public final class SpaceToBatchNd extends PrimitiveOp implements Operand { +public final class SpaceToBatchNd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SpaceToBatchNd operation. @@ -143,7 +145,7 @@ public final class SpaceToBatchNd extends PrimitiveOp implements Operand { * regular convolution. * @return a new instance of SpaceToBatchNd */ - public static SpaceToBatchNd create(Scope scope, Operand input, Operand blockShape, Operand paddings) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SparseApplyAdagradV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SparseApplyAdagradV2.java index bb5d24d6dba..2621a29569a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SparseApplyAdagradV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/SparseApplyAdagradV2.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update relevant entries in '*var' and '*accum' according to the adagrad scheme. @@ -33,7 +35,7 @@ * * @param data type for {@code out()} output */ -public final class SparseApplyAdagradV2 extends PrimitiveOp implements Operand { +public final class SparseApplyAdagradV2 extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.SparseApplyAdagradV2} @@ -78,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyAdagradV2 */ - public static SparseApplyAdagradV2 create(Scope scope, Operand var, Operand accum, Operand lr, Operand epsilon, Operand grad, Operand indices, Options... options) { + public static SparseApplyAdagradV2 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("SparseApplyAdagradV2")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); 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 f07b4ef8898..6d1b3b0dc9e 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 @@ -27,6 +27,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Splits a tensor into `num_split` tensors along one dimension. @@ -34,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Split extends PrimitiveOp implements Iterable> { +public final class Split extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new Split operation. @@ -47,7 +49,7 @@ public final class Split extends PrimitiveOp implements Iterable> * `value.shape[split_dim]`. * @return a new instance of Split */ - public static Split create(Scope scope, Operand axis, Operand value, Long numSplit) { + 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()); 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 bc2ca20f0a8..e46801bea9f 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 @@ -27,6 +27,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Splits a tensor into `num_split` tensors along one dimension. @@ -34,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator -public final class SplitV extends PrimitiveOp implements Iterable> { +public final class SplitV extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new SplitV operation. @@ -49,7 +52,7 @@ public final class SplitV extends PrimitiveOp implements Iterable> * @param numSplit * @return a new instance of SplitV */ - public static SplitV create(Scope scope, Operand value, Operand sizeSplits, Operand axis, Long numSplit) { + 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()); 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 fd78ecc7438..e4c021aea9c 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Removes dimensions of size 1 from the shape of a tensor. @@ -49,7 +50,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Squeeze extends PrimitiveOp implements Operand { +public final class Squeeze extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Squeeze} @@ -80,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Squeeze */ - public static Squeeze create(Scope scope, Operand input, Options... options) { + 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.applyControlDependencies(opBuilder); 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 8b49699ec2b..d695eb1922f 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Packs a list of `N` rank-`R` tensors into one rank-`(R+1)` tensor. @@ -50,7 +51,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Stack extends PrimitiveOp implements Operand { +public final class Stack extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Stack} @@ -80,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Stack */ - public static Stack create(Scope scope, Iterable> values, Options... options) { + 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.applyControlDependencies(opBuilder); 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 a8232f541ff..9fcebb07647 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 @@ -85,12 +85,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StageClear */ - public static StageClear create(Scope scope, List> dtypes, Options... options) { + public static StageClear create(Scope scope, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StageClear", scope.makeOpName("StageClear")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { 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 c2b76b92ec0..50f82773b71 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 @@ -28,6 +28,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Op peeks at the values at the specified index. If the @@ -37,7 +39,7 @@ * performance. */ @Operator -public final class StagePeek extends PrimitiveOp implements Iterable> { +public final class StagePeek extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.core.StagePeek} @@ -94,13 +96,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StagePeek */ - public static StagePeek create(Scope scope, Operand index, List> dtypes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -158,7 +160,7 @@ public List> values() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) values.iterator(); } 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 1822f34ed99..c2998294caa 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 @@ -26,12 +26,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; /** * Op returns the number of elements in the underlying container. */ @Operator -public final class StageSize extends PrimitiveOp implements Operand { +public final class StageSize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.StageSize} @@ -87,12 +88,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StageSize */ - public static StageSize create(Scope scope, List> dtypes, Options... options) { + public static StageSize create(Scope scope, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StageSize", scope.makeOpName("StageSize")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -144,16 +145,16 @@ public static Options sharedName(String sharedName) { /** */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private StageSize(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulRandomBinomial.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulRandomBinomial.java index 10f78abfbd8..44d4001f707 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulRandomBinomial.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulRandomBinomial.java @@ -25,12 +25,15 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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 */ @Operator -public final class StatefulRandomBinomial extends PrimitiveOp implements Operand { +public final class StatefulRandomBinomial extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatefulRandomBinomial operation. @@ -44,7 +47,7 @@ public final class StatefulRandomBinomial extends PrimitiveOp * @param dtype * @return a new instance of StatefulRandomBinomial */ - public static StatefulRandomBinomial create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand counts, Operand probs, Class dtype) { + public static StatefulRandomBinomial create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand counts, Operand probs, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulRandomBinomial", scope.makeOpName("StatefulRandomBinomial")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); @@ -52,7 +55,7 @@ public static StatefulRan opBuilder.addInput(counts.asOutput()); opBuilder.addInput(probs.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new StatefulRandomBinomial(opBuilder.build()); } @@ -67,8 +70,8 @@ public static StatefulRan * @param probs * @return a new instance of StatefulRandomBinomial */ - public static StatefulRandomBinomial create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand counts, Operand probs) { - return create(scope, resource, algorithm, shape, counts, probs, Long.class); + 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.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulStandardNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulStandardNormal.java index f0f61c60ec8..8911b7d8914 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulStandardNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulStandardNormal.java @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Outputs random values from a normal distribution. This op is deprecated in favor of op 'StatefulStandardNormalV2' @@ -34,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator -public final class StatefulStandardNormal extends PrimitiveOp implements Operand { +public final class StatefulStandardNormal extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatefulStandardNormal operation. @@ -45,12 +47,12 @@ public final class StatefulStandardNormal extends PrimitiveOp implements Oper * @param dtype The type of the output. * @return a new instance of StatefulStandardNormal */ - public static StatefulStandardNormal create(Scope scope, Operand resource, Operand shape, Class dtype) { + public static StatefulStandardNormal create(Scope scope, Operand resource, Operand shape, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulStandardNormal", scope.makeOpName("StatefulStandardNormal")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new StatefulStandardNormal(opBuilder.build()); } @@ -62,8 +64,8 @@ public static StatefulStandardNormal create(Scope scope, Operand re * @param shape The shape of the output tensor. * @return a new instance of StatefulStandardNormal */ - public static StatefulStandardNormal create(Scope scope, Operand resource, Operand shape) { - return create(scope, resource, shape, Float.class); + public static StatefulStandardNormal create(Scope scope, Operand resource, Operand shape) { + return create(scope, resource, shape, TFloat.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulStandardNormalV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulStandardNormalV2.java index 0e12656238d..3464ecc2aac 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulStandardNormalV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulStandardNormalV2.java @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Outputs random values from a normal distribution. @@ -34,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator -public final class StatefulStandardNormalV2 extends PrimitiveOp implements Operand { +public final class StatefulStandardNormalV2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatefulStandardNormalV2 operation. @@ -46,13 +49,13 @@ public final class StatefulStandardNormalV2 extends PrimitiveOp implements Op * @param dtype The type of the output. * @return a new instance of StatefulStandardNormalV2 */ - public static StatefulStandardNormalV2 create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { + public static StatefulStandardNormalV2 create(Scope scope, Operand resource, Operand algorithm, Operand shape, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulStandardNormalV2", scope.makeOpName("StatefulStandardNormalV2")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new StatefulStandardNormalV2(opBuilder.build()); } @@ -65,8 +68,8 @@ public static StatefulStandardNormalV2 create(Scope scope, Operand * @param shape The shape of the output tensor. * @return a new instance of StatefulStandardNormalV2 */ - public static StatefulStandardNormalV2 create(Scope scope, Operand resource, Operand algorithm, Operand shape) { - return create(scope, resource, algorithm, shape, Float.class); + public static StatefulStandardNormalV2 create(Scope scope, Operand resource, Operand algorithm, Operand shape) { + return create(scope, resource, algorithm, shape, TFloat.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulTruncatedNormal.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulTruncatedNormal.java index fd190a04c0d..665216f421f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulTruncatedNormal.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulTruncatedNormal.java @@ -24,6 +24,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Outputs random values from a truncated normal distribution. @@ -34,7 +37,7 @@ * * @param data type for {@code output()} output */ -public final class StatefulTruncatedNormal extends PrimitiveOp implements Operand { +public final class StatefulTruncatedNormal extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatefulTruncatedNormal operation. @@ -46,13 +49,13 @@ public final class StatefulTruncatedNormal extends PrimitiveOp implements Ope * @param dtype The type of the output. * @return a new instance of StatefulTruncatedNormal */ - public static StatefulTruncatedNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { + public static StatefulTruncatedNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulTruncatedNormal", scope.makeOpName("StatefulTruncatedNormal")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new StatefulTruncatedNormal(opBuilder.build()); } @@ -65,8 +68,8 @@ public static StatefulTruncatedNormal create(Scope scope, Operand r * @param shape The shape of the output tensor. * @return a new instance of StatefulTruncatedNormal */ - public static StatefulTruncatedNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape) { - return create(scope, resource, algorithm, shape, Float.class); + public static StatefulTruncatedNormal create(Scope scope, Operand resource, Operand algorithm, Operand shape) { + return create(scope, resource, algorithm, shape, TFloat.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniform.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniform.java index e38edeff019..60c4afff561 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniform.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniform.java @@ -24,6 +24,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Outputs random values from a uniform distribution. @@ -33,7 +36,7 @@ * * @param data type for {@code output()} output */ -public final class StatefulUniform extends PrimitiveOp implements Operand { +public final class StatefulUniform extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatefulUniform operation. @@ -45,13 +48,13 @@ public final class StatefulUniform extends PrimitiveOp implements Operand * @param dtype The type of the output. * @return a new instance of StatefulUniform */ - public static StatefulUniform create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { + public static StatefulUniform create(Scope scope, Operand resource, Operand algorithm, Operand shape, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulUniform", scope.makeOpName("StatefulUniform")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new StatefulUniform(opBuilder.build()); } @@ -64,8 +67,8 @@ public static StatefulUniform create(Scope scope, Operand resource, * @param shape The shape of the output tensor. * @return a new instance of StatefulUniform */ - public static StatefulUniform create(Scope scope, Operand resource, Operand algorithm, Operand shape) { - return create(scope, resource, algorithm, shape, Float.class); + public static StatefulUniform create(Scope scope, Operand resource, Operand algorithm, Operand shape) { + return create(scope, resource, algorithm, shape, TFloat.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniformFullInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniformFullInt.java index 03d3a5c7c8a..f5e5273182b 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniformFullInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniformFullInt.java @@ -24,6 +24,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Outputs random integers from a uniform distribution. @@ -32,7 +34,7 @@ * * @param data type for {@code output()} output */ -public final class StatefulUniformFullInt extends PrimitiveOp implements Operand { +public final class StatefulUniformFullInt extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatefulUniformFullInt operation. @@ -44,13 +46,13 @@ public final class StatefulUniformFullInt extends PrimitiveOp implements Oper * @param dtype The type of the output. * @return a new instance of StatefulUniformFullInt */ - public static StatefulUniformFullInt create(Scope scope, Operand resource, Operand algorithm, Operand shape, Class dtype) { + public static StatefulUniformFullInt create(Scope scope, Operand resource, Operand algorithm, Operand shape, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatefulUniformFullInt", scope.makeOpName("StatefulUniformFullInt")); opBuilder.addInput(resource.asOutput()); opBuilder.addInput(algorithm.asOutput()); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new StatefulUniformFullInt(opBuilder.build()); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniformInt.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniformInt.java index c68cdf33f00..8027129575d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniformInt.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatefulUniformInt.java @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Outputs random integers from a uniform distribution. @@ -37,7 +39,7 @@ * * @param data type for {@code output()} output */ -public final class StatefulUniformInt extends PrimitiveOp implements Operand { +public final class StatefulUniformInt extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatefulUniformInt operation. @@ -50,7 +52,7 @@ public final class StatefulUniformInt extends PrimitiveOp implements Operand< * @param maxval Maximum value (exclusive, scalar). * @return a new instance of StatefulUniformInt */ - public static StatefulUniformInt create(Scope scope, Operand resource, Operand algorithm, Operand shape, Operand minval, Operand maxval) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatsAggregatorHandleV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatsAggregatorHandleV2.java index 9e1e930862d..4e3af269068 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatsAggregatorHandleV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StatsAggregatorHandleV2.java @@ -23,10 +23,11 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** */ -public final class StatsAggregatorHandleV2 extends PrimitiveOp implements Operand { +public final class StatsAggregatorHandleV2 extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.StatsAggregatorHandleV2} @@ -101,8 +102,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 8911bb9c9f8..a09ab63ec79 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Stops gradient computation. @@ -56,7 +57,7 @@ * @param data type for {@code output()} output */ @Operator -public final class StopGradient extends PrimitiveOp implements Operand { +public final class StopGradient extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StopGradient operation. @@ -65,7 +66,7 @@ public final class StopGradient extends PrimitiveOp implements Operand { * @param input * @return a new instance of StopGradient */ - public static StopGradient create(Scope scope, Operand input) { + public static StopGradient create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("StopGradient", scope.makeOpName("StopGradient")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 0e8361c5688..15330ccc851 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Return a strided slice from `input`. @@ -118,7 +120,7 @@ * @param data type for {@code output()} output */ @Operator -public final class StridedSlice extends PrimitiveOp implements Operand { +public final class StridedSlice extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.StridedSlice} @@ -210,7 +212,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StridedSlice */ - public static StridedSlice create(Scope scope, Operand input, Operand begin, Operand end, Operand strides, Options... options) { + 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()); 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 a08e68bcf52..43440bf0847 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Assign `value` to the sliced l-value reference of `ref`. @@ -38,7 +40,7 @@ * @param data type for {@code outputRef()} output */ @Operator -public final class StridedSliceAssign extends PrimitiveOp implements Operand { +public final class StridedSliceAssign extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.StridedSliceAssign} @@ -107,7 +109,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StridedSliceAssign */ - public static StridedSliceAssign create(Scope scope, Operand ref, Operand begin, Operand end, Operand strides, Operand value, Options... options) { + 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()); 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 d2db9ddf8b9..b49c538c0d3 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the gradient of `StridedSlice`. @@ -40,7 +42,7 @@ * @param data type for {@code output()} output */ @Operator -public final class StridedSliceGrad extends PrimitiveOp implements Operand { +public final class StridedSliceGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.StridedSliceGrad} @@ -109,7 +111,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StridedSliceGrad */ - public static StridedSliceGrad create(Scope scope, Operand shape, Operand begin, Operand end, Operand strides, Operand dy, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringLower.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringLower.java index d9552ccee37..39d8f789254 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringLower.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringLower.java @@ -24,11 +24,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** */ @Operator -public final class StringLower extends PrimitiveOp implements Operand { +public final class StringLower extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.StringLower} @@ -57,7 +58,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StringLower */ - public static StringLower create(Scope scope, Operand input, Options... options) { + public static StringLower create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringLower", scope.makeOpName("StringLower")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -80,16 +81,16 @@ public static Options encoding(String encoding) { /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private StringLower(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringNGrams.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringNGrams.java index 82818eaad6b..2f4144f795f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringNGrams.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringNGrams.java @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Creates ngrams from ragged string data. @@ -36,7 +39,7 @@ * @param data type for {@code ngramsSplits()} output */ @Operator -public final class StringNGrams extends PrimitiveOp { +public final class StringNGrams extends PrimitiveOp { /** * Factory method to create a class wrapping a new StringNGrams operation. @@ -58,7 +61,7 @@ public final class StringNGrams extends PrimitiveOp { * @param preserveShortSequences * @return a new instance of StringNGrams */ - public static StringNGrams create(Scope scope, Operand data, Operand dataSplits, String separator, List ngramWidths, String leftPad, String rightPad, Long padWidth, Boolean preserveShortSequences) { + 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()); @@ -79,7 +82,7 @@ public static StringNGrams create(Scope scope, Operand ngrams() { + public Output ngrams() { return ngrams; } @@ -90,7 +93,7 @@ public Output ngramsSplits() { return ngramsSplits; } - private Output ngrams; + private Output ngrams; private Output ngramsSplits; private StringNGrams(Operation operation) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringUpper.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringUpper.java index 5a6792f855c..2453bb9e33d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringUpper.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/StringUpper.java @@ -24,11 +24,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** */ @Operator -public final class StringUpper extends PrimitiveOp implements Operand { +public final class StringUpper extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.StringUpper} @@ -57,7 +58,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StringUpper */ - public static StringUpper create(Scope scope, Operand input, Options... options) { + public static StringUpper create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringUpper", scope.makeOpName("StringUpper")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -80,16 +81,16 @@ public static Options encoding(String encoding) { /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private StringUpper(Operation operation) { super(operation); 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 71f003c2a3b..1393228ac08 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the sum of elements across dimensions of a tensor. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Sum extends PrimitiveOp implements Operand { +public final class Sum extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Sum} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Sum */ - public static Sum create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); 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 111d0d3fd21..ebb95e4659d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Forwards `data` to the output port determined by `pred`. @@ -36,7 +38,7 @@ * @param data type for {@code outputFalse()} output */ @Operator -public final class SwitchCond extends PrimitiveOp { +public final class SwitchCond extends PrimitiveOp { /** * Factory method to create a class wrapping a new SwitchCond operation. @@ -46,7 +48,7 @@ public final class SwitchCond extends PrimitiveOp { * @param pred A scalar that specifies which output port will receive data. * @return a new instance of SwitchCond */ - public static SwitchCond create(Scope scope, Operand data, Operand pred) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUCompilationResult.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUCompilationResult.java index 2504c60fa08..468a2d9d539 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUCompilationResult.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUCompilationResult.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * CompilationResultProto indicating the status of the TPU compilation. */ -public final class TPUCompilationResult extends PrimitiveOp implements Operand { +public final class TPUCompilationResult extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TPUCompilationResult operation. @@ -43,16 +44,16 @@ public static TPUCompilationResult create(Scope scope) { /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private TPUCompilationResult(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUEmbeddingActivations.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUEmbeddingActivations.java index 04769e14ff1..af55d307d7d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUEmbeddingActivations.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUEmbeddingActivations.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * An op enabling differentiation of TPU Embeddings. @@ -33,7 +34,7 @@ * differentiation of graphs containing embeddings via the TPU Embedding Python * libraries. */ -public final class TPUEmbeddingActivations extends PrimitiveOp implements Operand { +public final class TPUEmbeddingActivations extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TPUEmbeddingActivations operation. @@ -47,7 +48,7 @@ public final class TPUEmbeddingActivations extends PrimitiveOp implements Operan * activations. * @return a new instance of TPUEmbeddingActivations */ - public static TPUEmbeddingActivations create(Scope scope, Operand embeddingVariable, Operand slicedActivations, Long tableId, Long lookupId) { + 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()); @@ -59,16 +60,16 @@ public static TPUEmbeddingActivations create(Scope scope, Operand embeddi /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private TPUEmbeddingActivations(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUOrdinalSelector.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUOrdinalSelector.java index 3c1cf19fa90..a1e008b340f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUOrdinalSelector.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUOrdinalSelector.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; /** * A TPU core selector Op. @@ -31,7 +32,7 @@ * (for regular inference) to execute the TPU program on. The output is * consumed by TPUPartitionedCall. */ -public final class TPUOrdinalSelector extends PrimitiveOp implements Operand { +public final class TPUOrdinalSelector extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TPUOrdinalSelector operation. @@ -48,16 +49,16 @@ public static TPUOrdinalSelector create(Scope scope) { /** * A vector 1 or more TPU cores. */ - public Output deviceOrdinals() { + public Output deviceOrdinals() { return deviceOrdinals; } @Override - public Output asOutput() { + public Output asOutput() { return deviceOrdinals; } - private Output deviceOrdinals; + private Output deviceOrdinals; private TPUOrdinalSelector(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUReplicatedInput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUReplicatedInput.java index 10acf326651..313da21af53 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUReplicatedInput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUReplicatedInput.java @@ -24,13 +24,14 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Connects N inputs to an N-way replicated TPU computation. * * @param data type for {@code output()} output */ -public final class TPUReplicatedInput extends PrimitiveOp implements Operand { +public final class TPUReplicatedInput extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TPUReplicatedInput operation. @@ -39,7 +40,7 @@ public final class TPUReplicatedInput extends PrimitiveOp implements Operand< * @param inputs * @return a new instance of TPUReplicatedInput */ - public static TPUReplicatedInput create(Scope scope, Iterable> inputs) { + public static TPUReplicatedInput create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("TPUReplicatedInput", scope.makeOpName("TPUReplicatedInput")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUReplicatedOutput.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUReplicatedOutput.java index 07569410f8a..6b80ab2f594 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUReplicatedOutput.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TPUReplicatedOutput.java @@ -26,13 +26,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Connects outputs of an N-way replicated computation to N outputs. * * @param data type for {@code outputs()} output */ -public final class TPUReplicatedOutput extends PrimitiveOp implements Iterable> { +public final class TPUReplicatedOutput extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new TPUReplicatedOutput operation. @@ -42,7 +43,7 @@ public final class TPUReplicatedOutput extends PrimitiveOp implements Iterabl * @param numReplicas * @return a new instance of TPUReplicatedOutput */ - public static TPUReplicatedOutput create(Scope scope, Operand input, Long numReplicas) { + 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.applyControlDependencies(opBuilder); 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 cf6fd881f25..51fb37717ee 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 @@ -22,10 +22,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Returns a tensor that may be mutated, but only persists within a single step. @@ -48,7 +49,7 @@ * @param data type for {@code ref()} output */ @Operator -public final class TemporaryVariable extends PrimitiveOp implements Operand { +public final class TemporaryVariable extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.TemporaryVariable} @@ -79,11 +80,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TemporaryVariable */ - public static TemporaryVariable create(Scope scope, Shape shape, Class dtype, Options... options) { + public static TemporaryVariable create(Scope scope, Shape shape, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TemporaryVariable", scope.makeOpName("TemporaryVariable")); opBuilder = scope.applyControlDependencies(opBuilder); opBuilder.setAttr("shape", shape); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.varName != null) { 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 ff6879c5973..5b89424aab0 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 @@ -22,10 +22,13 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * An array of Tensors of given size. @@ -111,11 +114,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TensorArray */ - public static TensorArray create(Scope scope, Operand size, Class dtype, Options... options) { + public static TensorArray create(Scope scope, Operand size, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayV3", scope.makeOpName("TensorArray")); opBuilder.addInput(size.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.elementShape != null) { @@ -195,12 +198,12 @@ public Output handle() { /** * A scalar used to control gradient flow. */ - public Output flow() { + public Output flow() { return flow; } private Output handle; - private Output flow; + private Output flow; private TensorArray(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 a1ebefdb5d3..cc7f23d413a 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 @@ -22,10 +22,13 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Concat the elements from the TensorArray into value `value`. @@ -44,7 +47,7 @@ * @param data type for {@code value()} output */ @Operator -public final class TensorArrayConcat extends PrimitiveOp { +public final class TensorArrayConcat extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.TensorArrayConcat} @@ -78,12 +81,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TensorArrayConcat */ - public static TensorArrayConcat create(Scope scope, Operand handle, Operand flowIn, Class dtype, Options... options) { + public static TensorArrayConcat create(Scope scope, Operand handle, Operand flowIn, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayConcatV3", scope.makeOpName("TensorArrayConcat")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.elementShapeExcept0 != null) { @@ -117,12 +120,12 @@ public Output value() { * value output. In the example above, this would be the values: * `(n1, n2, ..., n(T-1))`. */ - public Output lengths() { + public Output lengths() { return lengths; } private Output value; - private Output lengths; + private Output lengths; private TensorArrayConcat(Operation operation) { super(operation); 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 b278852627a..b5977647002 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 @@ -22,10 +22,13 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Gather specific elements from the TensorArray into output `value`. @@ -35,7 +38,7 @@ * @param data type for {@code value()} output */ @Operator -public final class TensorArrayGather extends PrimitiveOp implements Operand { +public final class TensorArrayGather extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.TensorArrayGather} @@ -69,13 +72,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TensorArrayGather */ - public static TensorArrayGather create(Scope scope, Operand handle, Operand indices, Operand flowIn, Class dtype, Options... options) { + public static TensorArrayGather create(Scope scope, Operand handle, Operand indices, Operand flowIn, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayGatherV3", scope.makeOpName("TensorArrayGather")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(flowIn.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.elementShape != null) { 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 d16394fcf2d..634e8008a1e 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; /** * Creates a TensorArray for storing the gradients of values in the given handle. @@ -78,7 +79,7 @@ public final class TensorArrayGrad extends PrimitiveOp { * to return. * @return a new instance of TensorArrayGrad */ - public static TensorArrayGrad create(Scope scope, Operand handle, Operand flowIn, String source) { + 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()); @@ -95,12 +96,12 @@ public Output gradHandle() { /** */ - public Output flowOut() { + public Output flowOut() { return flowOut; } private Output gradHandle; - private Output flowOut; + private Output flowOut; private TensorArrayGrad(Operation operation) { super(operation); 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 26fb985b1b4..7abf799834b 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Creates a TensorArray for storing multiple gradients of values in the given handle. @@ -49,7 +51,7 @@ public final class TensorArrayGradWithShape extends PrimitiveOp { * to return. * @return a new instance of TensorArrayGradWithShape */ - public static TensorArrayGradWithShape create(Scope scope, Operand handle, Operand flowIn, Operand shapeToPrepend, String source) { + 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()); @@ -67,12 +69,12 @@ public Output gradHandle() { /** */ - public Output flowOut() { + public Output flowOut() { return flowOut; } private Output gradHandle; - private Output flowOut; + private Output flowOut; private TensorArrayGradWithShape(Operation operation) { super(operation); 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 d7d12c53177..007dfa720db 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 @@ -22,16 +22,19 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * @param data type for {@code value()} output */ @Operator -public final class TensorArrayPack extends PrimitiveOp implements Operand { +public final class TensorArrayPack extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.TensorArrayPack} @@ -62,12 +65,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TensorArrayPack */ - public static TensorArrayPack create(Scope scope, Operand handle, Operand flowIn, Class dtype, Options... options) { + public static TensorArrayPack create(Scope scope, Operand handle, Operand flowIn, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayPack", scope.makeOpName("TensorArrayPack")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(flowIn.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.elementShape != null) { 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 73c7e2046f6..5d1e5d8d5fd 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Read an element from the TensorArray into output `value`. @@ -32,7 +35,7 @@ * @param data type for {@code value()} output */ @Operator -public final class TensorArrayRead extends PrimitiveOp implements Operand { +public final class TensorArrayRead extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorArrayRead operation. @@ -44,13 +47,13 @@ public final class TensorArrayRead extends PrimitiveOp implements Operand * @param dtype The type of the elem that is returned. * @return a new instance of TensorArrayRead */ - public static TensorArrayRead create(Scope scope, Operand handle, Operand index, Operand flowIn, Class dtype) { + public static TensorArrayRead create(Scope scope, Operand handle, Operand index, Operand flowIn, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorArrayReadV3", scope.makeOpName("TensorArrayRead")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(index.asOutput()); opBuilder.addInput(flowIn.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new TensorArrayRead(opBuilder.build()); } 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 f67302ef00b..cca05c5a71f 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Scatter the data from the input value into specific TensorArray elements. @@ -31,7 +34,7 @@ * `indices` must be a vector, its length must match the first dim of `value`. */ @Operator -public final class TensorArrayScatter extends PrimitiveOp implements Operand { +public final class TensorArrayScatter extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorArrayScatter operation. @@ -43,7 +46,7 @@ public final class TensorArrayScatter extends PrimitiveOp implements Operand TensorArrayScatter create(Scope scope, Operand handle, Operand indices, Operand value, Operand flowIn) { + 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()); @@ -56,16 +59,16 @@ public static TensorArrayScatter create(Scope scope, Operand handle, Oper /** * A float scalar that enforces proper chaining of operations. */ - public Output flowOut() { + public Output flowOut() { return flowOut; } @Override - public Output asOutput() { + public Output asOutput() { return flowOut; } - private Output flowOut; + private Output flowOut; private TensorArrayScatter(Operation operation) { super(operation); 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 1ff64e8d978..f6e5036eaab 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Get the current size of the TensorArray. */ @Operator -public final class TensorArraySize extends PrimitiveOp implements Operand { +public final class TensorArraySize extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorArraySize operation. @@ -39,7 +41,7 @@ public final class TensorArraySize extends PrimitiveOp implements Operand handle, Operand flowIn) { + 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()); @@ -50,16 +52,16 @@ public static TensorArraySize create(Scope scope, Operand handle, Operand size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private TensorArraySize(Operation operation) { super(operation); 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 92d1998daff..d4a9911f8a0 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Split the data from the input value into TensorArray elements. @@ -51,7 +54,7 @@ * */ @Operator -public final class TensorArraySplit extends PrimitiveOp implements Operand { +public final class TensorArraySplit extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorArraySplit operation. @@ -64,7 +67,7 @@ public final class TensorArraySplit extends PrimitiveOp implements Operand TensorArraySplit create(Scope scope, Operand handle, Operand value, Operand lengths, Operand flowIn) { + 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()); @@ -77,16 +80,16 @@ public static TensorArraySplit create(Scope scope, Operand handle, Operan /** * A float scalar that enforces proper chaining of operations. */ - public Output flowOut() { + public Output flowOut() { return flowOut; } @Override - public Output asOutput() { + public Output asOutput() { return flowOut; } - private Output flowOut; + private Output flowOut; private TensorArraySplit(Operation operation) { super(operation); 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 7123f91ca2f..92d73345394 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 @@ -24,11 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ @Operator -public final class TensorArrayUnpack extends PrimitiveOp implements Operand { +public final class TensorArrayUnpack extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorArrayUnpack operation. @@ -39,7 +42,7 @@ public final class TensorArrayUnpack extends PrimitiveOp implements Operand TensorArrayUnpack create(Scope scope, Operand handle, Operand value, Operand flowIn) { + 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()); @@ -50,16 +53,16 @@ public static TensorArrayUnpack create(Scope scope, Operand handle, /** */ - public Output flowOut() { + public Output flowOut() { return flowOut; } @Override - public Output asOutput() { + public Output asOutput() { return flowOut; } - private Output flowOut; + private Output flowOut; private TensorArrayUnpack(Operation operation) { super(operation); 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 ba7b307491d..4bae2f128ff 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 @@ -24,12 +24,15 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Push an element onto the tensor_array. */ @Operator -public final class TensorArrayWrite extends PrimitiveOp implements Operand { +public final class TensorArrayWrite extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorArrayWrite operation. @@ -41,7 +44,7 @@ public final class TensorArrayWrite extends PrimitiveOp implements Operand TensorArrayWrite create(Scope scope, Operand handle, Operand index, Operand value, Operand flowIn) { + 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()); @@ -54,16 +57,16 @@ public static TensorArrayWrite create(Scope scope, Operand handle, Operan /** * A float scalar that enforces proper chaining of operations. */ - public Output flowOut() { + public Output flowOut() { return flowOut; } @Override - public Output asOutput() { + public Output asOutput() { return flowOut; } - private Output flowOut; + private Output flowOut; private TensorArrayWrite(Operation operation) { super(operation); 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 5e77b4929ad..7d376f8b2eb 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 @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Creates a tree resource and returns a handle to it. @@ -36,7 +37,7 @@ public final class TensorForestCreateTreeVariable extends PrimitiveOp { * @param treeConfig Serialized proto string of the boosted_trees.Tree. * @return a new instance of TensorForestCreateTreeVariable */ - public static TensorForestCreateTreeVariable create(Scope scope, Operand treeHandle, Operand treeConfig) { + 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()); 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 1587f244af8..81dc608b273 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 @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Deserializes a proto into the tree handle @@ -36,7 +37,7 @@ public final class TensorForestTreeDeserialize extends PrimitiveOp { * @param treeConfig Serialied proto string of the boosted_trees.Tree proto. * @return a new instance of TensorForestTreeDeserialize */ - public static TensorForestTreeDeserialize create(Scope scope, Operand treeHandle, Operand treeConfig) { + 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()); 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 154d6368488..1fd3f1c29c0 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 @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TBool; /** * Checks whether a tree has been initialized. */ -public final class TensorForestTreeIsInitializedOp extends PrimitiveOp implements Operand { +public final class TensorForestTreeIsInitializedOp extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorForestTreeIsInitializedOp operation. @@ -46,16 +47,16 @@ public static TensorForestTreeIsInitializedOp create(Scope scope, Operand tre /** * Whether the tree is initialized. */ - public Output isInitialized() { + public Output isInitialized() { return isInitialized; } @Override - public Output asOutput() { + public Output asOutput() { return isInitialized; } - private Output isInitialized; + private Output isInitialized; private TensorForestTreeIsInitializedOp(Operation operation) { super(operation); 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 dcbd95d11ed..f6589857f6d 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 @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; /** * Output the logits for the given input data */ -public final class TensorForestTreePredict extends PrimitiveOp implements Operand { +public final class TensorForestTreePredict extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorForestTreePredict operation. @@ -38,7 +39,7 @@ public final class TensorForestTreePredict extends PrimitiveOp implements Operan * @param logitsDimension Scalar, dimension of the logits. * @return a new instance of TensorForestTreePredict */ - public static TensorForestTreePredict create(Scope scope, Operand treeHandle, Operand denseFeatures, Long logitsDimension) { + 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,16 +51,16 @@ public static TensorForestTreePredict create(Scope scope, Operand treeHandle, /** * The logits predictions from the tree for each instance in the batch. */ - public Output logits() { + public Output logits() { return logits; } @Override - public Output asOutput() { + public Output asOutput() { return logits; } - private Output logits; + private Output logits; private TensorForestTreePredict(Operation operation) { super(operation); 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 7e2beb37827..2c0fc923353 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 @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Creates a handle to a TensorForestTreeResource */ -public final class TensorForestTreeResourceHandleOp extends PrimitiveOp implements Operand { +public final class TensorForestTreeResourceHandleOp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.TensorForestTreeResourceHandleOp} @@ -102,8 +103,8 @@ public Output resource() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; + public Output asOutput() { + return (Output) resource; } private Output resource; 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 2f2f9d65770..86f0cb9715b 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 @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Serializes the tree handle to a proto */ -public final class TensorForestTreeSerialize extends PrimitiveOp implements Operand { +public final class TensorForestTreeSerialize extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorForestTreeSerialize operation. @@ -46,16 +47,16 @@ public static TensorForestTreeSerialize create(Scope scope, Operand treeHandl /** * Serialied proto string of the tree resource. */ - public Output treeConfig() { + public Output treeConfig() { return treeConfig; } @Override - public Output asOutput() { + public Output asOutput() { return treeConfig; } - private Output treeConfig; + private Output treeConfig; private TensorForestTreeSerialize(Operation operation) { super(operation); 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 754be16d3a8..23a4b12f856 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 @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; /** * Get the number of nodes in a tree */ -public final class TensorForestTreeSize extends PrimitiveOp implements Operand { +public final class TensorForestTreeSize extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorForestTreeSize operation. @@ -46,16 +47,16 @@ public static TensorForestTreeSize create(Scope scope, Operand treeHandle) { /** * The size of the tree. */ - public Output treeSize() { + public Output treeSize() { return treeSize; } @Override - public Output asOutput() { + public Output asOutput() { return treeSize; } - private Output treeSize; + private Output treeSize; private TensorForestTreeSize(Operation operation) { super(operation); 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 7e4cbb155ca..53f42b43138 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 @@ -22,10 +22,12 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Concats all tensors in the list along the 0th dimension. @@ -40,7 +42,7 @@ * @param data type for {@code tensor()} output */ @Operator -public final class TensorListConcat extends PrimitiveOp { +public final class TensorListConcat extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.TensorListConcat} @@ -70,11 +72,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TensorListConcat */ - public static TensorListConcat create(Scope scope, Operand inputHandle, Class elementDtype, Options... options) { + public static TensorListConcat create(Scope scope, Operand inputHandle, DataType elementDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListConcat", scope.makeOpName("TensorListConcat")); opBuilder.addInput(inputHandle.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("element_dtype", DataType.fromClass(elementDtype)); + opBuilder.setAttr("element_dtype", elementDtype); if (options != null) { for (Options opts : options) { if (opts.elementShape != null) { @@ -100,12 +102,12 @@ public Output tensor() { /** */ - public Output lengths() { + public Output lengths() { return lengths; } private Output tensor; - private Output lengths; + private Output lengths; private TensorListConcat(Operation operation) { super(operation); 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 0fb9e873943..bcd89b65021 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 @@ -25,11 +25,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** */ @Operator -public final class TensorListConcatLists extends PrimitiveOp implements Operand { +public final class TensorListConcatLists extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListConcatLists operation. @@ -40,12 +41,12 @@ public final class TensorListConcatLists extends PrimitiveOp implements Operand< * @param elementDtype * @return a new instance of TensorListConcatLists */ - public static TensorListConcatLists create(Scope scope, Operand inputA, Operand inputB, Class elementDtype) { + public static TensorListConcatLists create(Scope scope, Operand inputA, Operand inputB, DataType elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListConcatLists", scope.makeOpName("TensorListConcatLists")); opBuilder.addInput(inputA.asOutput()); opBuilder.addInput(inputB.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("element_dtype", DataType.fromClass(elementDtype)); + opBuilder.setAttr("element_dtype", elementDtype); return new TensorListConcatLists(opBuilder.build()); } @@ -57,8 +58,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatV2.java index 9cfadcd50ba..19dc4ed9206 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListConcatV2.java @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Concats all tensors in the list along the 0th dimension. @@ -45,7 +48,7 @@ * @param data type for {@code tensor()} output */ @Operator -public final class TensorListConcatV2 extends PrimitiveOp { +public final class TensorListConcatV2 extends PrimitiveOp { /** * Factory method to create a class wrapping a new TensorListConcatV2 operation. @@ -57,13 +60,13 @@ public final class TensorListConcatV2 extends PrimitiveOp { * @param elementDtype * @return a new instance of TensorListConcatV2 */ - public static TensorListConcatV2 create(Scope scope, Operand inputHandle, Operand elementShape, Operand leadingDims, Class elementDtype) { + public static TensorListConcatV2 create(Scope scope, Operand inputHandle, Operand elementShape, Operand leadingDims, DataType elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListConcatV2", scope.makeOpName("TensorListConcatV2")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(leadingDims.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("element_dtype", DataType.fromClass(elementDtype)); + opBuilder.setAttr("element_dtype", elementDtype); return new TensorListConcatV2(opBuilder.build()); } @@ -75,12 +78,12 @@ public Output tensor() { /** */ - public Output lengths() { + public Output lengths() { return lengths; } private Output tensor; - private Output lengths; + private Output lengths; private TensorListConcatV2(Operation operation) { super(operation); 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 2a2fc172c2b..b021a3c616e 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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. @@ -35,7 +37,7 @@ * @param data type for {@code elementShape()} output */ @Operator -public final class TensorListElementShape extends PrimitiveOp implements Operand { +public final class TensorListElementShape extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListElementShape operation. @@ -45,11 +47,11 @@ public final class TensorListElementShape extends PrimitiveOp * @param shapeType * @return a new instance of TensorListElementShape */ - public static TensorListElementShape create(Scope scope, Operand inputHandle, Class shapeType) { + public static TensorListElementShape create(Scope scope, Operand inputHandle, DataType shapeType) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListElementShape", scope.makeOpName("TensorListElementShape")); opBuilder.addInput(inputHandle.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("shape_type", DataType.fromClass(shapeType)); + opBuilder.setAttr("shape_type", shapeType); return new TensorListElementShape(opBuilder.build()); } 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 4d68d970eb8..ad54bd8eb6c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Creates a TensorList which, when stacked, has the value of `tensor`. @@ -34,7 +36,7 @@ * output_handle: The list. */ @Operator -public final class TensorListFromTensor extends PrimitiveOp implements Operand { +public final class TensorListFromTensor extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListFromTensor operation. @@ -44,7 +46,7 @@ public final class TensorListFromTensor extends PrimitiveOp implements Operand TensorListFromTensor create(Scope scope, Operand tensor, Operand elementShape) { + 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()); @@ -60,8 +62,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; 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 6f54e07d340..e8e11695421 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Creates a Tensor by indexing into the TensorList. @@ -39,7 +41,7 @@ * @param data type for {@code values()} output */ @Operator -public final class TensorListGather extends PrimitiveOp implements Operand { +public final class TensorListGather extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListGather operation. @@ -51,13 +53,13 @@ public final class TensorListGather extends PrimitiveOp implements Operand * @param elementDtype * @return a new instance of TensorListGather */ - public static TensorListGather create(Scope scope, Operand inputHandle, Operand indices, Operand elementShape, Class elementDtype) { + public static TensorListGather create(Scope scope, Operand inputHandle, Operand indices, Operand elementShape, DataType elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListGather", scope.makeOpName("TensorListGather")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("element_dtype", DataType.fromClass(elementDtype)); + opBuilder.setAttr("element_dtype", elementDtype); return new TensorListGather(opBuilder.build()); } 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 7accbc95616..113aec72352 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 @@ -25,12 +25,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * @param data type for {@code item()} output */ @Operator -public final class TensorListGetItem extends PrimitiveOp implements Operand { +public final class TensorListGetItem extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListGetItem operation. @@ -42,13 +44,13 @@ public final class TensorListGetItem extends PrimitiveOp implements Operand TensorListGetItem create(Scope scope, Operand inputHandle, Operand index, Operand elementShape, Class elementDtype) { + public static TensorListGetItem create(Scope scope, Operand inputHandle, Operand index, Operand elementShape, DataType elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListGetItem", scope.makeOpName("TensorListGetItem")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(index.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("element_dtype", DataType.fromClass(elementDtype)); + opBuilder.setAttr("element_dtype", elementDtype); return new TensorListGetItem(opBuilder.build()); } 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 68a2a09c424..f0a5747633a 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; /** * Returns the number of tensors in the input tensor list. @@ -32,7 +33,7 @@ * length: the number of tensors in the list */ @Operator -public final class TensorListLength extends PrimitiveOp implements Operand { +public final class TensorListLength extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListLength operation. @@ -50,16 +51,16 @@ public static TensorListLength create(Scope scope, Operand inputHandle) { /** */ - public Output length() { + public Output length() { return length; } @Override - public Output asOutput() { + public Output asOutput() { return length; } - private Output length; + private Output length; private TensorListLength(Operation operation) { super(operation); 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 57c0528f747..ab004bc71e0 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Returns the last element of the input list as well as a list with all but that element. @@ -39,7 +41,7 @@ * @param data type for {@code tensor()} output */ @Operator -public final class TensorListPopBack extends PrimitiveOp { +public final class TensorListPopBack extends PrimitiveOp { /** * Factory method to create a class wrapping a new TensorListPopBack operation. @@ -50,12 +52,12 @@ public final class TensorListPopBack extends PrimitiveOp { * @param elementDtype * @return a new instance of TensorListPopBack */ - public static TensorListPopBack create(Scope scope, Operand inputHandle, Operand elementShape, Class elementDtype) { + public static TensorListPopBack create(Scope scope, Operand inputHandle, Operand elementShape, DataType elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListPopBack", scope.makeOpName("TensorListPopBack")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("element_dtype", DataType.fromClass(elementDtype)); + opBuilder.setAttr("element_dtype", elementDtype); return new TensorListPopBack(opBuilder.build()); } 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 dbe77e4f128..33739c9d0e0 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +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`. @@ -35,7 +36,7 @@ * element_shape: a shape compatible with that of elements in the list. */ @Operator -public final class TensorListPushBack extends PrimitiveOp implements Operand { +public final class TensorListPushBack extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListPushBack operation. @@ -45,7 +46,7 @@ public final class TensorListPushBack extends PrimitiveOp implements Operand TensorListPushBack create(Scope scope, Operand inputHandle, Operand tensor) { + 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()); @@ -61,8 +62,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; 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 763c60dcfcf..029e362c85b 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 @@ -24,11 +24,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** */ @Operator -public final class TensorListPushBackBatch extends PrimitiveOp implements Operand { +public final class TensorListPushBackBatch extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListPushBackBatch operation. @@ -38,7 +39,7 @@ public final class TensorListPushBackBatch extends PrimitiveOp implements Operan * @param tensor * @return a new instance of TensorListPushBackBatch */ - public static TensorListPushBackBatch create(Scope scope, Operand inputHandles, Operand tensor) { + 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()); @@ -54,8 +55,8 @@ public Output outputHandles() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandles; + public Output asOutput() { + return (Output) outputHandles; } private Output outputHandles; 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 e6cbc6172cc..2fe38d964fb 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * List of the given size with empty elements. @@ -35,7 +38,7 @@ * element_dtype: the desired type of elements in the list. */ @Operator -public final class TensorListReserve extends PrimitiveOp implements Operand { +public final class TensorListReserve extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListReserve operation. @@ -46,12 +49,12 @@ public final class TensorListReserve extends PrimitiveOp implements Operand TensorListReserve create(Scope scope, Operand elementShape, Operand numElements, Class elementDtype) { + public static TensorListReserve create(Scope scope, Operand elementShape, Operand numElements, DataType elementDtype) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListReserve", scope.makeOpName("TensorListReserve")); opBuilder.addInput(elementShape.asOutput()); opBuilder.addInput(numElements.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("element_dtype", DataType.fromClass(elementDtype)); + opBuilder.setAttr("element_dtype", elementDtype); return new TensorListReserve(opBuilder.build()); } @@ -63,8 +66,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 5b7721a8584..4ada0ecc87e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Resizes the list. @@ -34,7 +36,7 @@ * */ @Operator -public final class TensorListResize extends PrimitiveOp implements Operand { +public final class TensorListResize extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListResize operation. @@ -44,7 +46,7 @@ public final class TensorListResize extends PrimitiveOp implements Operand inputHandle, Operand size) { + public static TensorListResize create(Scope scope, Operand inputHandle, Operand size) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListResize", scope.makeOpName("TensorListResize")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(size.asOutput()); @@ -60,8 +62,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; 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 2c852c7f612..ce0f7447d32 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Creates a TensorList by indexing into a Tensor. @@ -38,7 +41,7 @@ * output_handle: The TensorList. */ @Operator -public final class TensorListScatter extends PrimitiveOp implements Operand { +public final class TensorListScatter extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListScatter operation. @@ -49,7 +52,7 @@ public final class TensorListScatter extends PrimitiveOp implements Operand TensorListScatter create(Scope scope, Operand tensor, Operand indices, Operand elementShape) { + public static TensorListScatter create(Scope scope, Operand tensor, Operand indices, Operand elementShape) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListScatter", scope.makeOpName("TensorListScatter")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -66,8 +69,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; 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 8b174850855..254bdd83878 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Scatters tensor at indices in an input list. @@ -37,7 +39,7 @@ * output_handle: The TensorList. */ @Operator -public final class TensorListScatterIntoExistingList extends PrimitiveOp implements Operand { +public final class TensorListScatterIntoExistingList extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListScatterIntoExistingList operation. @@ -48,7 +50,7 @@ public final class TensorListScatterIntoExistingList extends PrimitiveOp impleme * @param indices * @return a new instance of TensorListScatterIntoExistingList */ - public static TensorListScatterIntoExistingList create(Scope scope, Operand inputHandle, Operand tensor, Operand indices) { + 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()); @@ -65,8 +67,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterV2.java index 26037b18856..5bf86107ed8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterV2.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorListScatterV2.java @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Creates a TensorList by indexing into a Tensor. @@ -41,7 +44,7 @@ * output_handle: The TensorList. */ @Operator -public final class TensorListScatterV2 extends PrimitiveOp implements Operand { +public final class TensorListScatterV2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListScatterV2 operation. @@ -53,7 +56,7 @@ public final class TensorListScatterV2 extends PrimitiveOp implements Operand TensorListScatterV2 create(Scope scope, Operand tensor, Operand indices, Operand elementShape, Operand numElements) { + public static TensorListScatterV2 create(Scope scope, Operand tensor, Operand indices, Operand elementShape, Operand numElements) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListScatterV2", scope.makeOpName("TensorListScatterV2")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); @@ -71,8 +74,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; 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 b2c6887ea52..780fe704826 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 @@ -24,11 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** */ @Operator -public final class TensorListSetItem extends PrimitiveOp implements Operand { +public final class TensorListSetItem extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListSetItem operation. @@ -39,7 +41,7 @@ public final class TensorListSetItem extends PrimitiveOp implements Operand TensorListSetItem create(Scope scope, Operand inputHandle, Operand index, Operand item) { + 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()); @@ -56,8 +58,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; 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 1aabadcea15..914b6a3fd29 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Splits a tensor into a list. @@ -37,7 +40,7 @@ * output_handle: The list. */ @Operator -public final class TensorListSplit extends PrimitiveOp implements Operand { +public final class TensorListSplit extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorListSplit operation. @@ -48,7 +51,7 @@ public final class TensorListSplit extends PrimitiveOp implements Operand TensorListSplit create(Scope scope, Operand tensor, Operand elementShape, Operand lengths) { + 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()); @@ -65,8 +68,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; 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 0e7c18a51fc..cd725da36eb 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Stacks all tensors in the list. @@ -39,7 +41,7 @@ * @param data type for {@code tensor()} output */ @Operator -public final class TensorListStack extends PrimitiveOp implements Operand { +public final class TensorListStack extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.TensorListStack} @@ -70,12 +72,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TensorListStack */ - public static TensorListStack create(Scope scope, Operand inputHandle, Operand elementShape, Class elementDtype, Options... options) { + public static TensorListStack create(Scope scope, Operand inputHandle, Operand elementShape, DataType elementDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TensorListStack", scope.makeOpName("TensorListStack")); opBuilder.addInput(inputHandle.asOutput()); opBuilder.addInput(elementShape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("element_dtype", DataType.fromClass(elementDtype)); + opBuilder.setAttr("element_dtype", elementDtype); if (options != null) { for (Options opts : options) { if (opts.numElements != null) { diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterAdd.java index 2254d8cc222..af1878b0a52 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterAdd.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterAdd.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Adds sparse `updates` to an existing tensor according to `indices`. @@ -92,7 +94,7 @@ * @param data type for {@code output()} output */ @Operator -public final class TensorScatterAdd extends PrimitiveOp implements Operand { +public final class TensorScatterAdd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorScatterAdd operation. @@ -103,7 +105,7 @@ public final class TensorScatterAdd extends PrimitiveOp implements Operand * @param updates Updates to scatter into output. * @return a new instance of TensorScatterAdd */ - public static TensorScatterAdd create(Scope scope, Operand tensor, Operand indices, Operand updates) { + public static TensorScatterAdd create(Scope scope, Operand tensor, Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterAdd", scope.makeOpName("TensorScatterAdd")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterSub.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterSub.java index 5c721652041..3781aa720de 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterSub.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterSub.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Subtracts sparse `updates` from an existing tensor according to `indices`. @@ -92,7 +94,7 @@ * @param data type for {@code output()} output */ @Operator -public final class TensorScatterSub extends PrimitiveOp implements Operand { +public final class TensorScatterSub extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorScatterSub operation. @@ -103,7 +105,7 @@ public final class TensorScatterSub extends PrimitiveOp implements Operand * @param updates Updates to scatter into output. * @return a new instance of TensorScatterSub */ - public static TensorScatterSub create(Scope scope, Operand tensor, Operand indices, Operand updates) { + public static TensorScatterSub create(Scope scope, Operand tensor, Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterSub", scope.makeOpName("TensorScatterSub")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterUpdate.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterUpdate.java index f8337f3d3d8..7dcb38fd312 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterUpdate.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TensorScatterUpdate.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Scatter `updates` into an existing tensor according to `indices`. @@ -103,7 +105,7 @@ * @param data type for {@code output()} output */ @Operator -public final class TensorScatterUpdate extends PrimitiveOp implements Operand { +public final class TensorScatterUpdate extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorScatterUpdate operation. @@ -114,7 +116,7 @@ public final class TensorScatterUpdate extends PrimitiveOp implements Operand * @param updates Updates to scatter into output. * @return a new instance of TensorScatterUpdate */ - public static TensorScatterUpdate create(Scope scope, Operand tensor, Operand indices, Operand updates) { + public static TensorScatterUpdate create(Scope scope, Operand tensor, Operand indices, Operand updates) { OperationBuilder opBuilder = scope.env().opBuilder("TensorScatterUpdate", scope.makeOpName("TensorScatterUpdate")); opBuilder.addInput(tensor.asOutput()); opBuilder.addInput(indices.asOutput()); 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 8d55b509994..545439804cb 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Assign `value` to the sliced l-value reference of `input`. @@ -38,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator -public final class TensorStridedSliceUpdate extends PrimitiveOp implements Operand { +public final class TensorStridedSliceUpdate extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.TensorStridedSliceUpdate} @@ -107,7 +109,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TensorStridedSliceUpdate */ - public static TensorStridedSliceUpdate create(Scope scope, Operand input, Operand begin, Operand end, Operand strides, Operand value, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ThreadPoolDataset.java index fa1ac884355..6243eadc3a9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ThreadPoolDataset.java @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute `input_dataset`. */ -public final class ThreadPoolDataset extends PrimitiveOp implements Operand { +public final class ThreadPoolDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ThreadPoolDataset operation. @@ -42,14 +43,14 @@ public final class ThreadPoolDataset extends PrimitiveOp implements Operand inputDataset, Operand threadPool, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +69,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ThreadPoolHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ThreadPoolHandle.java index 74958fc21ec..38d440dfb2a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ThreadPoolHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/ThreadPoolHandle.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute `input_dataset`. */ -public final class ThreadPoolHandle extends PrimitiveOp implements Operand { +public final class ThreadPoolHandle extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.ThreadPoolHandle} @@ -131,8 +132,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 f1d174cce9a..9c2d771df73 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Constructs a tensor by tiling a given tensor. @@ -37,7 +39,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Tile extends PrimitiveOp implements Operand { +public final class Tile extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Tile operation. @@ -47,7 +49,7 @@ public final class Tile extends PrimitiveOp implements Operand { * @param multiples 1-D. Length must be the same as the number of dimensions in `input` * @return a new instance of Tile */ - public static Tile create(Scope scope, Operand input, Operand multiples) { + 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()); 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 4db9d22f4b2..8966533ef97 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TDouble; /** * Provides the time since epoch in seconds. @@ -34,7 +35,7 @@ * to the graph. */ @Operator -public final class Timestamp extends PrimitiveOp implements Operand { +public final class Timestamp extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Timestamp operation. @@ -50,16 +51,16 @@ public static Timestamp create(Scope scope) { /** */ - public Output ts() { + public Output ts() { return ts; } @Override - public Output asOutput() { + public Output asOutput() { return ts; } - private Output ts; + private Output ts; private Timestamp(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TridiagonalMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TridiagonalMatMul.java index 425287073ca..50ecdd91de9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TridiagonalMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TridiagonalMatMul.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Calculate product with tridiagonal matrix. @@ -31,7 +32,7 @@ * * @param data type for {@code output()} output */ -public final class TridiagonalMatMul extends PrimitiveOp implements Operand { +public final class TridiagonalMatMul extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TridiagonalMatMul operation. @@ -47,7 +48,7 @@ public final class TridiagonalMatMul extends PrimitiveOp implements Operand TridiagonalMatMul create(Scope scope, Operand superdiag, Operand maindiag, Operand subdiag, Operand rhs) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TridiagonalSolve.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TridiagonalSolve.java index 2a7f9f09ee8..8babc7cc5b2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TridiagonalSolve.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/TridiagonalSolve.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Solves tridiagonal systems of equations. @@ -36,7 +37,7 @@ * * @param data type for {@code output()} output */ -public final class TridiagonalSolve extends PrimitiveOp implements Operand { +public final class TridiagonalSolve extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.TridiagonalSolve} @@ -71,7 +72,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TridiagonalSolve */ - public static TridiagonalSolve create(Scope scope, Operand diagonals, Operand rhs, Options... options) { + 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()); 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 b0b8a5b7d60..95f429d8bac 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Perform batches of RPC requests. @@ -135,7 +137,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TryRpc */ - public static TryRpc create(Scope scope, Operand address, Operand method, Operand request, Options... options) { + 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()); @@ -186,14 +188,14 @@ public static Options timeoutInMs(Long timeoutInMs) { /** * Same shape as `request`. Serialized proto strings: the rpc responses. */ - public Output response() { + public Output response() { return response; } /** * Same shape as `request`. Values correspond to tensorflow Status enum codes. */ - public Output statusCode() { + public Output statusCode() { return statusCode; } @@ -201,13 +203,13 @@ public Output statusCode() { * Same shape as `request`. Values correspond to Status messages * returned from the RPC calls. */ - public Output statusMessage() { + public Output statusMessage() { return statusMessage; } - private Output response; - private Output statusCode; - private Output statusMessage; + private Output response; + private Output statusCode; + private Output statusMessage; private TryRpc(Operation operation) { super(operation); 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 6250f31703d..d3984595c0e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Reverses the operation of Batch for a single output Tensor. @@ -50,7 +52,7 @@ * @param data type for {@code unbatchedTensor()} output */ @Operator -public final class Unbatch extends PrimitiveOp implements Operand { +public final class Unbatch extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Unbatch} @@ -91,7 +93,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Unbatch */ - public static Unbatch create(Scope scope, Operand batchedTensor, Operand batchIndex, Operand id, Long timeoutMicros, Options... options) { + 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()); 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 801444645cb..48c1cdb017f 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Gradient of Unbatch. @@ -46,7 +48,7 @@ * @param data type for {@code batchedGrad()} output */ @Operator -public final class UnbatchGrad extends PrimitiveOp implements Operand { +public final class UnbatchGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.UnbatchGrad} @@ -87,7 +89,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of UnbatchGrad */ - public static UnbatchGrad create(Scope scope, Operand originalInput, Operand batchIndex, Operand grad, Operand id, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnicodeDecode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnicodeDecode.java index 36c46dd3a06..56dfd29683d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnicodeDecode.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnicodeDecode.java @@ -24,6 +24,11 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Decodes each string in `input` into a sequence of Unicode code points. @@ -47,7 +52,7 @@ * * @param data type for {@code rowSplits()} output */ -public final class UnicodeDecode extends PrimitiveOp { +public final class UnicodeDecode extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.core.UnicodeDecode} @@ -108,12 +113,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of UnicodeDecode */ - public static UnicodeDecode create(Scope scope, Operand input, String inputEncoding, Class Tsplits, Options... options) { + public static UnicodeDecode create(Scope scope, Operand input, String inputEncoding, DataType Tsplits, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("UnicodeDecode", scope.makeOpName("UnicodeDecode")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); opBuilder.setAttr("input_encoding", inputEncoding); - opBuilder.setAttr("Tsplits", DataType.fromClass(Tsplits)); + opBuilder.setAttr("Tsplits", Tsplits); if (options != null) { for (Options opts : options) { if (opts.errors != null) { @@ -141,8 +146,8 @@ public static UnicodeDecode create(Scope scope, Operand create(Scope scope, Operand input, String inputEncoding, Options... options) { - return create(scope, input, inputEncoding, Long.class, options); + public static UnicodeDecode create(Scope scope, Operand input, String inputEncoding, Options... options) { + return create(scope, input, inputEncoding, TInt64.DTYPE, options); } /** @@ -186,12 +191,12 @@ public Output rowSplits() { /** * A 1D int32 Tensor containing the decoded codepoints. */ - public Output charValues() { + public Output charValues() { return charValues; } private Output rowSplits; - private Output charValues; + private Output charValues; private UnicodeDecode(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnicodeEncode.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnicodeEncode.java index 93304921ef3..7678e7ca2f2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnicodeEncode.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnicodeEncode.java @@ -23,6 +23,10 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Encode a tensor of ints into unicode strings. @@ -43,7 +47,7 @@ * } * */ -public final class UnicodeEncode extends PrimitiveOp implements Operand { +public final class UnicodeEncode extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.UnicodeEncode} @@ -95,7 +99,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of UnicodeEncode */ - public static UnicodeEncode create(Scope scope, Operand inputValues, Operand inputSplits, String outputEncoding, Options... options) { + 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()); @@ -140,16 +144,16 @@ public static Options replacementChar(Long replacementChar) { /** * The 1-D Tensor of strings encoded from the provided unicode codepoints. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private UnicodeEncode(Operation operation) { super(operation); 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 ae743e96409..d9ff850b8a6 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Finds unique elements along an axis of a tensor. @@ -73,7 +76,7 @@ * @param data type for {@code idx()} output */ @Operator -public final class Unique extends PrimitiveOp { +public final class Unique extends PrimitiveOp { /** * Factory method to create a class wrapping a new Unique operation. @@ -85,12 +88,12 @@ public final class Unique extends PrimitiveOp { * @param outIdx * @return a new instance of Unique */ - public static Unique create(Scope scope, Operand x, Operand axis, Class outIdx) { + public static Unique create(Scope scope, Operand x, Operand axis, DataType outIdx) { OperationBuilder opBuilder = scope.env().opBuilder("UniqueV2", scope.makeOpName("Unique")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_idx", DataType.fromClass(outIdx)); + opBuilder.setAttr("out_idx", outIdx); return new Unique(opBuilder.build()); } @@ -103,8 +106,8 @@ public static Unique create(Scope * find the unique elements. * @return a new instance of Unique */ - public static Unique create(Scope scope, Operand x, Operand axis) { - return create(scope, x, axis, Integer.class); + public static Unique create(Scope scope, Operand x, Operand axis) { + return create(scope, x, axis, TInt32.DTYPE); } /** diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueDataset.java index f07590cdf22..a21b27f8b4e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UniqueDataset.java @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that contains the unique elements of `input_dataset`. */ -public final class UniqueDataset extends PrimitiveOp implements Operand { +public final class UniqueDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UniqueDataset operation. @@ -41,13 +42,13 @@ public final class UniqueDataset extends PrimitiveOp implements Operand * @param outputShapes * @return a new instance of UniqueDataset */ - public static UniqueDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -66,8 +67,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 63e7435ec8b..47edb438fe6 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Finds unique elements along an axis of a tensor. @@ -77,7 +80,7 @@ * @param data type for {@code idx()} output */ @Operator -public final class UniqueWithCounts extends PrimitiveOp { +public final class UniqueWithCounts extends PrimitiveOp { /** * Factory method to create a class wrapping a new UniqueWithCounts operation. @@ -89,12 +92,12 @@ public final class UniqueWithCounts extends PrimitiveOp { * @param outIdx * @return a new instance of UniqueWithCounts */ - public static UniqueWithCounts create(Scope scope, Operand x, Operand axis, Class outIdx) { + public static UniqueWithCounts create(Scope scope, Operand x, Operand axis, DataType outIdx) { OperationBuilder opBuilder = scope.env().opBuilder("UniqueWithCountsV2", scope.makeOpName("UniqueWithCounts")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(axis.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_idx", DataType.fromClass(outIdx)); + opBuilder.setAttr("out_idx", outIdx); return new UniqueWithCounts(opBuilder.build()); } @@ -107,8 +110,8 @@ public static UniqueWithCounts cre * find the unique elements. * @return a new instance of UniqueWithCounts */ - public static UniqueWithCounts create(Scope scope, Operand x, Operand axis) { - return create(scope, x, axis, Integer.class); + public static UniqueWithCounts create(Scope scope, Operand x, Operand axis) { + return create(scope, x, axis, TInt32.DTYPE); } /** 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 b73ecb4699c..bda64f7789e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Converts a flat index or array of flat indices into a tuple of @@ -37,7 +39,7 @@ * @param data type for {@code output()} output */ @Operator -public final class UnravelIndex extends PrimitiveOp implements Operand { +public final class UnravelIndex extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UnravelIndex operation. @@ -49,7 +51,7 @@ public final class UnravelIndex extends PrimitiveOp implements * indices. * @return a new instance of UnravelIndex */ - public static UnravelIndex create(Scope scope, Operand indices, Operand dims) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnsortedSegmentJoin.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnsortedSegmentJoin.java index c25175c3a02..11343172a3f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnsortedSegmentJoin.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnsortedSegmentJoin.java @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Joins the elements of `inputs` based on `segment_ids`. @@ -56,7 +59,7 @@ * */ @Operator -public final class UnsortedSegmentJoin extends PrimitiveOp implements Operand { +public final class UnsortedSegmentJoin extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.UnsortedSegmentJoin} @@ -88,7 +91,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of UnsortedSegmentJoin */ - public static UnsortedSegmentJoin create(Scope scope, Operand inputs, Operand segmentIds, Operand numSegments, Options... options) { + 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()); @@ -113,16 +116,16 @@ public static Options separator(String separator) { /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private UnsortedSegmentJoin(Operation operation) { super(operation); 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 5db08f57536..f60f8749e09 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 @@ -27,6 +27,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Unpacks a given dimension of a rank-`R` tensor into `num` rank-`(R-1)` tensors. @@ -47,7 +48,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Unstack extends PrimitiveOp implements Iterable> { +public final class Unstack extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.core.Unstack} @@ -78,7 +79,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Unstack */ - public static Unstack create(Scope scope, Operand value, Long num, Options... options) { + 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.applyControlDependencies(opBuilder); 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 1655c06b038..d80aa8134ad 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 @@ -28,6 +28,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Op is similar to a lightweight Dequeue. @@ -36,7 +37,7 @@ * capabilities and options. This Op is optimized for performance. */ @Operator -public final class Unstage extends PrimitiveOp implements Iterable> { +public final class Unstage extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.core.Unstage} @@ -92,12 +93,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Unstage */ - public static Unstage create(Scope scope, List> dtypes, Options... options) { + public static Unstage create(Scope scope, List> dtypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Unstage", scope.makeOpName("Unstage")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] dtypesArray = new DataType[dtypes.size()]; for (int i = 0; i < dtypesArray.length; ++i) { - dtypesArray[i] = DataType.fromClass(dtypes.get(i)); + dtypesArray[i] = dtypes.get(i); } opBuilder.setAttr("dtypes", dtypesArray); if (options != null) { @@ -155,7 +156,7 @@ public List> values() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) values.iterator(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnwrapDatasetVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnwrapDatasetVariant.java index c73e8a948f9..f98bb1a9a4d 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnwrapDatasetVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/UnwrapDatasetVariant.java @@ -23,10 +23,11 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** */ -public final class UnwrapDatasetVariant extends PrimitiveOp implements Operand { +public final class UnwrapDatasetVariant extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UnwrapDatasetVariant operation. @@ -50,8 +51,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; 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 70c8e8769dd..3caa8789e30 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 @@ -24,6 +24,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +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. @@ -48,7 +51,7 @@ * * @param data type for {@code output()} output */ -public final class UpperBound extends PrimitiveOp implements Operand { +public final class UpperBound extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UpperBound operation. @@ -60,12 +63,12 @@ public final class UpperBound extends PrimitiveOp implements O * @param outType * @return a new instance of UpperBound */ - public static UpperBound create(Scope scope, Operand sortedInputs, Operand values, Class outType) { + public static UpperBound create(Scope scope, Operand sortedInputs, Operand values, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("UpperBound", scope.makeOpName("UpperBound")); opBuilder.addInput(sortedInputs.asOutput()); opBuilder.addInput(values.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new UpperBound(opBuilder.build()); } @@ -78,8 +81,8 @@ public static UpperBound create(Scope scope, Operand * the values that will be searched for in `sorted_search_values`. * @return a new instance of UpperBound */ - public static UpperBound create(Scope scope, Operand sortedInputs, Operand values) { - return create(scope, sortedInputs, values, Integer.class); + public static UpperBound create(Scope scope, Operand sortedInputs, Operand values) { + return create(scope, sortedInputs, values, TInt32.DTYPE); } /** 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 86ac34af81c..6dc6685352a 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 @@ -22,16 +22,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a handle to a Variable resource. */ @Operator -public final class VarHandleOp extends PrimitiveOp implements Operand { +public final class VarHandleOp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.VarHandleOp} @@ -71,10 +72,10 @@ private Options() { * @param options carries optional attributes values * @return a new instance of VarHandleOp */ - public static VarHandleOp create(Scope scope, Class dtype, Shape shape, Options... options) { + public static VarHandleOp create(Scope scope, DataType dtype, Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("VarHandleOp", scope.makeOpName("VarHandleOp")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); opBuilder.setAttr("shape", shape); if (options != null) { for (Options opts : options) { @@ -111,8 +112,8 @@ public Output resource() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resource; + public Output asOutput() { + return (Output) resource; } private Output resource; 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 bae968632b6..3a3cdd0dd50 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; /** * Checks whether a resource handle-based variable has been initialized. */ @Operator -public final class VarIsInitializedOp extends PrimitiveOp implements Operand { +public final class VarIsInitializedOp extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new VarIsInitializedOp operation. @@ -49,16 +50,16 @@ public static VarIsInitializedOp create(Scope scope, Operand resource) { * a scalar boolean which is true if the variable has been * initialized. */ - public Output isInitialized() { + public Output isInitialized() { return isInitialized; } @Override - public Output asOutput() { + public Output asOutput() { return isInitialized; } - private Output isInitialized; + private Output isInitialized; private VarIsInitializedOp(Operation operation) { super(operation); 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 8c017bf8682..72ca6fb0140 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 @@ -22,10 +22,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Holds state in the form of a tensor that persists across steps. @@ -37,7 +38,7 @@ * @param data type for {@code ref()} output */ @Operator -public final class Variable extends PrimitiveOp implements Operand { +public final class Variable extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.core.Variable} @@ -78,11 +79,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Variable */ - public static Variable create(Scope scope, Shape shape, Class dtype, Options... options) { + public static Variable create(Scope scope, Shape shape, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("VariableV2", scope.makeOpName("Variable")); opBuilder = scope.applyControlDependencies(opBuilder); opBuilder.setAttr("shape", shape); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.container != null) { 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 6e3d1e0a65d..38160e01a51 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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`. @@ -41,7 +44,7 @@ * @param data type for {@code output()} output */ @Operator -public final class VariableShape extends PrimitiveOp implements Operand { +public final class VariableShape extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new VariableShape operation. @@ -51,11 +54,11 @@ public final class VariableShape extends PrimitiveOp implement * @param outType * @return a new instance of VariableShape */ - public static VariableShape create(Scope scope, Operand input, Class outType) { + public static VariableShape create(Scope scope, Operand input, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("VariableShape", scope.makeOpName("VariableShape")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new VariableShape(opBuilder.build()); } @@ -66,8 +69,8 @@ public static VariableShape create(Scope scope, Operand * @param input * @return a new instance of VariableShape */ - public static VariableShape create(Scope scope, Operand input) { - return create(scope, input, Integer.class); + public static VariableShape create(Scope scope, Operand input) { + return create(scope, input, TInt32.DTYPE); } /** 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 cb344ae0e1d..edd7d132ab9 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Returns locations of nonzero / true values in a tensor. @@ -89,7 +91,7 @@ * */ @Operator -public final class Where extends PrimitiveOp implements Operand { +public final class Where extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Where operation. @@ -98,7 +100,7 @@ public final class Where extends PrimitiveOp implements Operand { * @param condition * @return a new instance of Where */ - public static Where create(Scope scope, Operand condition) { + public static Where create(Scope scope, Operand condition) { OperationBuilder opBuilder = scope.env().opBuilder("Where", scope.makeOpName("Where")); opBuilder.addInput(condition.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -107,16 +109,16 @@ public static Where create(Scope scope, Operand condition) { /** */ - public Output index() { + public Output index() { return index; } @Override - public Output asOutput() { + public Output asOutput() { return index; } - private Output index; + private Output index; private Where(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where3.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where3.java index 3450e63be8d..38b38a90254 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where3.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/Where3.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Selects elements from `x` or `y`, depending on `condition`. @@ -70,7 +72,7 @@ * @param data type for {@code output()} output */ @Operator -public final class Where3 extends PrimitiveOp implements Operand { +public final class Where3 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Where3 operation. @@ -83,7 +85,7 @@ public final class Where3 extends PrimitiveOp implements Operand { * @param y = A `Tensor` with the same type and shape as `x`. * @return a new instance of Where3 */ - public static Where3 create(Scope scope, Operand condition, Operand x, Operand y) { + public static Where3 create(Scope scope, Operand condition, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Select", scope.makeOpName("Where3")); opBuilder.addInput(condition.asOutput()); opBuilder.addInput(x.asOutput()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WorkerHeartbeat.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WorkerHeartbeat.java index fb2a52de7a0..26e30ce69db 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WorkerHeartbeat.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WorkerHeartbeat.java @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Worker heartbeat op. @@ -30,7 +31,7 @@ * 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 PrimitiveOp implements Operand { +public final class WorkerHeartbeat extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new WorkerHeartbeat operation. @@ -39,7 +40,7 @@ public final class WorkerHeartbeat extends PrimitiveOp implements Operand request) { + public static WorkerHeartbeat create(Scope scope, Operand request) { OperationBuilder opBuilder = scope.env().opBuilder("WorkerHeartbeat", scope.makeOpName("WorkerHeartbeat")); opBuilder.addInput(request.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -49,16 +50,16 @@ public static WorkerHeartbeat create(Scope scope, Operand request) { /** * A string tensor containing a serialized WorkerHeartbeatResponse */ - public Output response() { + public Output response() { return response; } @Override - public Output asOutput() { + public Output asOutput() { return response; } - private Output response; + private Output response; private WorkerHeartbeat(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WrapDatasetVariant.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WrapDatasetVariant.java index 8e5cbf4561b..0ca70afc3be 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WrapDatasetVariant.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WrapDatasetVariant.java @@ -23,10 +23,11 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** */ -public final class WrapDatasetVariant extends PrimitiveOp implements Operand { +public final class WrapDatasetVariant extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new WrapDatasetVariant operation. @@ -50,8 +51,8 @@ public Output outputHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) outputHandle; + public Output asOutput() { + return (Output) outputHandle; } private Output outputHandle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WriteKafka.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WriteKafka.java new file mode 100644 index 00000000000..7b3016dd7b4 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WriteKafka.java @@ -0,0 +1,70 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.core; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.PrimitiveOp; +import org.tensorflow.op.Scope; +import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; + +/** + */ +@Operator +public final class WriteKafka extends PrimitiveOp implements Operand { + + /** + * Factory method to create a class wrapping a new WriteKafka operation. + * + * @param scope current scope + * @param message + * @param topic + * @param servers + * @return a new instance of WriteKafka + */ + public static WriteKafka create(Scope scope, Operand message, Operand topic, Operand servers) { + OperationBuilder opBuilder = scope.env().opBuilder("WriteKafka", scope.makeOpName("WriteKafka")); + opBuilder.addInput(message.asOutput()); + opBuilder.addInput(topic.asOutput()); + opBuilder.addInput(servers.asOutput()); + opBuilder = scope.applyControlDependencies(opBuilder); + return new WriteKafka(opBuilder.build()); + } + + /** + */ + public Output content() { + return content; + } + + @Override + public Output asOutput() { + return content; + } + + private Output content; + + private WriteKafka(Operation operation) { + super(operation); + int outputIdx = 0; + content = operation.output(outputIdx++); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WriteRawProtoSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WriteRawProtoSummary.java index bf6df0f2f75..7d2a16905c2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WriteRawProtoSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/WriteRawProtoSummary.java @@ -22,6 +22,8 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** */ @@ -36,7 +38,7 @@ public final class WriteRawProtoSummary extends PrimitiveOp { * @param tensor * @return a new instance of WriteRawProtoSummary */ - public static WriteRawProtoSummary create(Scope scope, Operand writer, Operand step, Operand tensor) { + 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()); 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 1e6c43a5475..103ed6c54ba 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns a tensor of zeros with the same shape and type as x. @@ -31,7 +32,7 @@ * @param data type for {@code y()} output */ @Operator -public final class ZerosLike extends PrimitiveOp implements Operand { +public final class ZerosLike extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ZerosLike operation. @@ -40,7 +41,7 @@ public final class ZerosLike extends PrimitiveOp implements Operand { * @param x a tensor of type T. * @return a new instance of ZerosLike */ - public static ZerosLike create(Scope scope, Operand x) { + public static ZerosLike create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("ZerosLike", scope.makeOpName("ZerosLike")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 8c32480c5d0..1121b8a2df5 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 @@ -23,16 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A container for an iterator resource. */ @Operator(group = "data") -public final class AnonymousIterator extends PrimitiveOp implements Operand { +public final class AnonymousIterator extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AnonymousIterator operation. @@ -42,12 +43,12 @@ public final class AnonymousIterator extends PrimitiveOp implements Operand> outputTypes, List outputShapes) { + public static AnonymousIterator create(Scope scope, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("AnonymousIterator", scope.makeOpName("AnonymousIterator")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -70,8 +71,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 c594bd3bac9..c4beafcb630 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 @@ -23,14 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that batches `batch_size` elements from `input_dataset`. */ -public final class BatchDataset extends PrimitiveOp implements Operand { +public final class BatchDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.BatchDataset} @@ -64,7 +67,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BatchDataset */ - public static BatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand dropRemainder, List> outputTypes, List outputShapes, Options... options) { + 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()); @@ -72,7 +75,7 @@ public static BatchDataset create(Scope scope, Operand inputDataset, Operand< opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -105,8 +108,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 700e1946b4e..5c525a2541e 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Records the bytes size of each element of `input_dataset` in a StatsAggregator. */ -public final class BytesProducedStatsDataset extends PrimitiveOp implements Operand { +public final class BytesProducedStatsDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BytesProducedStatsDataset operation. @@ -42,14 +44,14 @@ public final class BytesProducedStatsDataset extends PrimitiveOp implements Oper * @param outputShapes * @return a new instance of BytesProducedStatsDataset */ - public static BytesProducedStatsDataset create(Scope scope, Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +70,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 4d101f3b01d..44f72c22271 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 @@ -23,9 +23,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Creates a dataset that caches elements from `input_dataset`. @@ -35,7 +37,7 @@ * (e.g. cannot be opened, contains tensors of the wrong shape / size), an error * will the returned when used. */ -public final class CacheDataset extends PrimitiveOp implements Operand { +public final class CacheDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CacheDataset operation. @@ -48,14 +50,14 @@ public final class CacheDataset extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of CacheDataset */ - public static CacheDataset create(Scope scope, Operand inputDataset, Operand filename, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -74,8 +76,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 792b569027b..d95e8998b7e 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 @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that concatenates `input_dataset` with `another_dataset`. */ -public final class ConcatenateDataset extends PrimitiveOp implements Operand { +public final class ConcatenateDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ConcatenateDataset operation. @@ -42,14 +43,14 @@ public final class ConcatenateDataset extends PrimitiveOp implements Operand inputDataset, Operand anotherDataset, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +69,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 28518414f5b..56df2ca0ac0 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 @@ -23,13 +23,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Returns a serialized GraphDef representing `input_dataset`. *

* Returns a graph representation for `input_dataset`. */ -public final class DatasetToGraph extends PrimitiveOp implements Operand { +public final class DatasetToGraph extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DatasetToGraph operation. @@ -48,16 +49,16 @@ public static DatasetToGraph create(Scope scope, Operand inputDataset) { /** * The graph representation of the dataset (as serialized GraphDef). */ - public Output graph() { + public Output graph() { return graph; } @Override - public Output asOutput() { + public Output asOutput() { return graph; } - private Output graph; + private Output graph; private DatasetToGraph(Operation operation) { super(operation); 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 bd9843a560e..34c76cd33a5 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 @@ -25,14 +25,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Outputs the single element from the given dataset. */ -public final class DatasetToSingleElement extends PrimitiveOp implements Iterable> { +public final class DatasetToSingleElement extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new DatasetToSingleElement operation. @@ -43,13 +44,13 @@ public final class DatasetToSingleElement extends PrimitiveOp implements Iterabl * @param outputShapes * @return a new instance of DatasetToSingleElement */ - public static DatasetToSingleElement create(Scope scope, Operand dataset, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -69,7 +70,7 @@ public List> components() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) components.iterator(); } 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 18e3cb86616..4836127810b 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 @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Writes the given dataset to the given file using the TFRecord format. @@ -38,7 +39,7 @@ public final class DatasetToTfRecord extends PrimitiveOp { * compression), (ii) "ZLIB", or (iii) "GZIP". * @return a new instance of DatasetToTfRecord */ - public static DatasetToTfRecord create(Scope scope, Operand inputDataset, Operand filename, Operand compressionType) { + 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()); 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 90dc80bc15a..78ef176c595 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that batches input elements into a SparseTensor. */ -public final class DenseToSparseBatchDataset extends PrimitiveOp implements Operand { +public final class DenseToSparseBatchDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DenseToSparseBatchDataset operation. @@ -46,7 +48,7 @@ public final class DenseToSparseBatchDataset extends PrimitiveOp implements Oper * @param outputShapes * @return a new instance of DenseToSparseBatchDataset */ - public static DenseToSparseBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Operand rowShape, List> outputTypes, List outputShapes) { + 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()); @@ -54,7 +56,7 @@ public static DenseToSparseBatchDataset create(Scope scope, Operand inputData opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -73,8 +75,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalAssertNextDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalAssertNextDataset.java index a2f9d112692..00b151d58b3 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalAssertNextDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalAssertNextDataset.java @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class ExperimentalAssertNextDataset extends PrimitiveOp implements Operand { +public final class ExperimentalAssertNextDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalAssertNextDataset operation. @@ -41,14 +43,14 @@ public final class ExperimentalAssertNextDataset extends PrimitiveOp implements * @param outputShapes * @return a new instance of ExperimentalAssertNextDataset */ - public static ExperimentalAssertNextDataset create(Scope scope, Operand inputDataset, Operand transformations, List> outputTypes, List outputShapes) { + public static ExperimentalAssertNextDataset create(Scope scope, Operand inputDataset, Operand transformations, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalAssertNextDataset", scope.makeOpName("ExperimentalAssertNextDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(transformations.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -67,8 +69,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalCsvDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalCsvDataset.java index 3a697cfe391..1e7488c9e88 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalCsvDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalCsvDataset.java @@ -22,14 +22,18 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class ExperimentalCsvDataset extends PrimitiveOp implements Operand { +public final class ExperimentalCsvDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalCsvDataset operation. @@ -47,7 +51,7 @@ public final class ExperimentalCsvDataset extends PrimitiveOp implements Operand * @param outputShapes * @return a new instance of ExperimentalCsvDataset */ - public static ExperimentalCsvDataset create(Scope scope, Operand filenames, Operand compressionType, Operand bufferSize, Operand header, Operand fieldDelim, Operand useQuoteDelim, Operand naValue, Operand selectCols, Iterable> recordDefaults, List outputShapes) { + public static ExperimentalCsvDataset 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("ExperimentalCsvDataset")); opBuilder.addInput(filenames.asOutput()); opBuilder.addInput(compressionType.asOutput()); @@ -75,8 +79,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalDirectedInterleaveDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalDirectedInterleaveDataset.java index 39086287aa5..38c57e38494 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalDirectedInterleaveDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalDirectedInterleaveDataset.java @@ -23,15 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A substitute for `InterleaveDataset` on a fixed list of `N` datasets. */ -public final class ExperimentalDirectedInterleaveDataset extends PrimitiveOp implements Operand { +public final class ExperimentalDirectedInterleaveDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalDirectedInterleaveDataset operation. @@ -45,14 +46,14 @@ public final class ExperimentalDirectedInterleaveDataset extends PrimitiveOp imp * @param outputShapes * @return a new instance of ExperimentalDirectedInterleaveDataset */ - public static ExperimentalDirectedInterleaveDataset create(Scope scope, Operand selectorInputDataset, Iterable> dataInputDatasets, List> outputTypes, List outputShapes) { + public static ExperimentalDirectedInterleaveDataset create(Scope scope, Operand selectorInputDataset, Iterable> dataInputDatasets, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalDirectedInterleaveDataset", scope.makeOpName("ExperimentalDirectedInterleaveDataset")); opBuilder.addInput(selectorInputDataset.asOutput()); opBuilder.addInputList(Operands.asOutputs(dataInputDatasets)); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -71,8 +72,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalIgnoreErrorsDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalIgnoreErrorsDataset.java index 79b9a24ad61..090b5ed7d5a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalIgnoreErrorsDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalIgnoreErrorsDataset.java @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that contains the elements of `input_dataset` ignoring errors. */ -public final class ExperimentalIgnoreErrorsDataset extends PrimitiveOp implements Operand { +public final class ExperimentalIgnoreErrorsDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalIgnoreErrorsDataset operation. @@ -41,13 +42,13 @@ public final class ExperimentalIgnoreErrorsDataset extends PrimitiveOp implement * @param outputShapes * @return a new instance of ExperimentalIgnoreErrorsDataset */ - public static ExperimentalIgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + public static ExperimentalIgnoreErrorsDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalIgnoreErrorsDataset", scope.makeOpName("ExperimentalIgnoreErrorsDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -66,8 +67,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalIteratorGetDevice.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalIteratorGetDevice.java index 0ff6ed8ba6a..b8d0ea73c24 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalIteratorGetDevice.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalIteratorGetDevice.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Returns the name of the device on which `resource` has been placed. */ -public final class ExperimentalIteratorGetDevice extends PrimitiveOp implements Operand { +public final class ExperimentalIteratorGetDevice extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalIteratorGetDevice operation. @@ -45,16 +46,16 @@ public static ExperimentalIteratorGetDevice create(Scope scope, Operand resou /** */ - public Output device() { + public Output device() { return device; } @Override - public Output asOutput() { + public Output asOutput() { return device; } - private Output device; + private Output device; private ExperimentalIteratorGetDevice(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalLmdbDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalLmdbDataset.java index e7ff7edb297..d066938dfb9 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalLmdbDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalLmdbDataset.java @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class ExperimentalLmdbDataset extends PrimitiveOp implements Operand { +public final class ExperimentalLmdbDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalLmdbDataset operation. @@ -40,13 +42,13 @@ public final class ExperimentalLmdbDataset extends PrimitiveOp implements Operan * @param outputShapes * @return a new instance of ExperimentalLmdbDataset */ - public static ExperimentalLmdbDataset create(Scope scope, Operand filenames, List> outputTypes, List outputShapes) { + public static ExperimentalLmdbDataset create(Scope scope, Operand filenames, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalLMDBDataset", scope.makeOpName("ExperimentalLmdbDataset")); opBuilder.addInput(filenames.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -65,8 +67,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalNonSerializableDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalNonSerializableDataset.java index ec86f58fe33..77a0b002950 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalNonSerializableDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalNonSerializableDataset.java @@ -23,13 +23,14 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** */ -public final class ExperimentalNonSerializableDataset extends PrimitiveOp implements Operand { +public final class ExperimentalNonSerializableDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalNonSerializableDataset operation. @@ -40,13 +41,13 @@ public final class ExperimentalNonSerializableDataset extends PrimitiveOp implem * @param outputShapes * @return a new instance of ExperimentalNonSerializableDataset */ - public static ExperimentalNonSerializableDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + public static ExperimentalNonSerializableDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalNonSerializableDataset", scope.makeOpName("ExperimentalNonSerializableDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -65,8 +66,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalSleepDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalSleepDataset.java index 97ddc80cce9..ccce220e997 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalSleepDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalSleepDataset.java @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** */ -public final class ExperimentalSleepDataset extends PrimitiveOp implements Operand { +public final class ExperimentalSleepDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalSleepDataset operation. @@ -41,14 +43,14 @@ public final class ExperimentalSleepDataset extends PrimitiveOp implements Opera * @param outputShapes * @return a new instance of ExperimentalSleepDataset */ - public static ExperimentalSleepDataset create(Scope scope, Operand inputDataset, Operand sleepMicroseconds, List> outputTypes, List outputShapes) { + public static ExperimentalSleepDataset create(Scope scope, Operand inputDataset, Operand sleepMicroseconds, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalSleepDataset", scope.makeOpName("ExperimentalSleepDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(sleepMicroseconds.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -67,8 +69,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalThreadPoolDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalThreadPoolDataset.java index 3971d80dba5..13f546cedc4 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalThreadPoolDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalThreadPoolDataset.java @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute `input_dataset`. */ -public final class ExperimentalThreadPoolDataset extends PrimitiveOp implements Operand { +public final class ExperimentalThreadPoolDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalThreadPoolDataset operation. @@ -42,14 +43,14 @@ public final class ExperimentalThreadPoolDataset extends PrimitiveOp implements * @param outputShapes * @return a new instance of ExperimentalThreadPoolDataset */ - public static ExperimentalThreadPoolDataset create(Scope scope, Operand inputDataset, Operand threadPool, List> outputTypes, List outputShapes) { + public static ExperimentalThreadPoolDataset create(Scope scope, Operand inputDataset, Operand threadPool, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalThreadPoolDataset", scope.makeOpName("ExperimentalThreadPoolDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(threadPool.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +69,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalThreadPoolHandle.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalThreadPoolHandle.java index 51a1edeadcf..bca17286e23 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalThreadPoolHandle.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalThreadPoolHandle.java @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Creates a dataset that uses a custom thread pool to compute `input_dataset`. */ -public final class ExperimentalThreadPoolHandle extends PrimitiveOp implements Operand { +public final class ExperimentalThreadPoolHandle extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.ExperimentalThreadPoolHandle} @@ -131,8 +132,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalUniqueDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalUniqueDataset.java index b63464c3aeb..b59069fa3ae 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalUniqueDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ExperimentalUniqueDataset.java @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that contains the unique elements of `input_dataset`. */ -public final class ExperimentalUniqueDataset extends PrimitiveOp implements Operand { +public final class ExperimentalUniqueDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExperimentalUniqueDataset operation. @@ -41,13 +42,13 @@ public final class ExperimentalUniqueDataset extends PrimitiveOp implements Oper * @param outputShapes * @return a new instance of ExperimentalUniqueDataset */ - public static ExperimentalUniqueDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + public static ExperimentalUniqueDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ExperimentalUniqueDataset", scope.makeOpName("ExperimentalUniqueDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -66,8 +67,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 8eddecb919f..e70d7931c58 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 @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset containing elements of first component of `input_dataset` having true in the last component. */ -public final class FilterByLastComponentDataset extends PrimitiveOp implements Operand { +public final class FilterByLastComponentDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new FilterByLastComponentDataset operation. @@ -41,13 +42,13 @@ public final class FilterByLastComponentDataset extends PrimitiveOp implements O * @param outputShapes * @return a new instance of FilterByLastComponentDataset */ - public static FilterByLastComponentDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -66,8 +67,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 5745ad001b5..d5ad1adeb12 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 @@ -23,10 +23,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class FixedLengthRecordDataset extends PrimitiveOp implements Operand { +public final class FixedLengthRecordDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new FixedLengthRecordDataset operation. @@ -40,7 +43,7 @@ public final class FixedLengthRecordDataset extends PrimitiveOp implements Opera * @param compressionType * @return a new instance of FixedLengthRecordDataset */ - public static FixedLengthRecordDataset create(Scope scope, Operand filenames, Operand headerBytes, Operand recordBytes, Operand footerBytes, Operand bufferSize, Operand compressionType) { + 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()); @@ -60,8 +63,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 0ff360a0836..40d7180a69e 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 @@ -23,13 +23,14 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** */ -public final class Iterator extends PrimitiveOp implements Operand { +public final class Iterator extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Iterator operation. @@ -41,14 +42,14 @@ public final class Iterator extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of Iterator */ - public static Iterator create(Scope scope, String sharedName, String container, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); opBuilder.setAttr("shared_name", sharedName); opBuilder.setAttr("container", container); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -67,8 +68,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 74b4b5cae8f..fc35a997257 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 @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class IteratorFromStringHandle extends PrimitiveOp implements Operand { +public final class IteratorFromStringHandle extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.IteratorFromStringHandle} @@ -59,13 +61,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of IteratorFromStringHandle */ - public static IteratorFromStringHandle create(Scope scope, Operand stringHandle, List> outputTypes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); if (options != null) { @@ -97,8 +99,8 @@ public Output resourceHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) resourceHandle; + public Output asOutput() { + return (Output) resourceHandle; } private Output resourceHandle; 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 5965a8119e8..ac2ead9dff6 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 @@ -25,16 +25,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Gets the next output from the given iterator . */ @Operator(group = "data") -public final class IteratorGetNext extends PrimitiveOp implements Iterable> { +public final class IteratorGetNext extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new IteratorGetNext operation. @@ -45,13 +46,13 @@ public final class IteratorGetNext extends PrimitiveOp implements Iterable iterator, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -70,7 +71,7 @@ public List> components() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) components.iterator(); } 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 6fdcd47cfbf..6138afb3f94 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 @@ -23,16 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Gets the next output from the given iterator as an Optional variant. */ @Operator(group = "data") -public final class IteratorGetNextAsOptional extends PrimitiveOp implements Operand { +public final class IteratorGetNextAsOptional extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IteratorGetNextAsOptional operation. @@ -43,13 +44,13 @@ public final class IteratorGetNextAsOptional extends PrimitiveOp implements Oper * @param outputShapes * @return a new instance of IteratorGetNextAsOptional */ - public static IteratorGetNextAsOptional create(Scope scope, Operand iterator, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +69,8 @@ public Output optional() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) optional; + public Output asOutput() { + return (Output) optional; } private Output optional; 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 3a6220283ba..ad31fbfc550 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 @@ -25,10 +25,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Gets the next output from the given iterator. @@ -39,7 +40,7 @@ * operations (e.g. in eager mode). */ @Operator(group = "data") -public final class IteratorGetNextSync extends PrimitiveOp implements Iterable> { +public final class IteratorGetNextSync extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new IteratorGetNextSync operation. @@ -50,13 +51,13 @@ public final class IteratorGetNextSync extends PrimitiveOp implements Iterable iterator, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -75,7 +76,7 @@ public List> components() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) components.iterator(); } 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 260ae89deb5..734c8def224 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Converts the given `resource_handle` representing an iterator to a string. */ @Operator(group = "data") -public final class IteratorToStringHandle extends PrimitiveOp implements Operand { +public final class IteratorToStringHandle extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IteratorToStringHandle operation. @@ -48,16 +49,16 @@ public static IteratorToStringHandle create(Scope scope, Operand resourceHand /** * A string representation of the given handle. */ - public Output stringHandle() { + public Output stringHandle() { return stringHandle; } @Override - public Output asOutput() { + public Output asOutput() { return stringHandle; } - private Output stringHandle; + private Output stringHandle; private IteratorToStringHandle(Operation operation) { super(operation); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/KafkaDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/KafkaDataset.java new file mode 100644 index 00000000000..5d5d1c18311 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/KafkaDataset.java @@ -0,0 +1,91 @@ +/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +=======================================================================*/ + +// This class has been generated, DO NOT EDIT! + +package org.tensorflow.op.data; + +import org.tensorflow.Operand; +import org.tensorflow.Operation; +import org.tensorflow.OperationBuilder; +import org.tensorflow.Output; +import org.tensorflow.op.PrimitiveOp; +import org.tensorflow.op.Scope; +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; + +/** + * Creates a dataset that emits the messages of one or more Kafka topics. + */ +@Operator(group = "data") +public final class KafkaDataset extends PrimitiveOp implements Operand { + + /** + * Factory method to create a class wrapping a new KafkaDataset operation. + * + * @param scope current scope + * @param topics A `tf.string` tensor containing one or more subscriptions, + * in the format of [topic:partition:offset:length], + * by default length is -1 for unlimited. + * @param servers A list of bootstrap servers. + * @param group The consumer group id. + * @param eof If True, the kafka reader will stop on EOF. + * @param timeout The timeout value for the Kafka Consumer to wait + * (in millisecond). + * @param configGlobal A `tf.string` tensor containing global configuration + * properties in [Key=Value] format, + * eg. ["enable.auto.commit=false", "heartbeat.interval.ms=2000"], + * please refer to 'Global configuration properties' in librdkafka doc. + * @param configTopic A `tf.string` tensor containing topic configuration + * properties in [Key=Value] format, eg. ["auto.offset.reset=earliest"], + * please refer to 'Topic configuration properties' in librdkafka doc. + * @return a new instance of KafkaDataset + */ + public static KafkaDataset create(Scope scope, Operand topics, Operand servers, Operand group, Operand eof, Operand timeout, Operand configGlobal, Operand configTopic) { + OperationBuilder opBuilder = scope.env().opBuilder("KafkaDataset", scope.makeOpName("KafkaDataset")); + opBuilder.addInput(topics.asOutput()); + opBuilder.addInput(servers.asOutput()); + opBuilder.addInput(group.asOutput()); + opBuilder.addInput(eof.asOutput()); + opBuilder.addInput(timeout.asOutput()); + opBuilder.addInput(configGlobal.asOutput()); + opBuilder.addInput(configTopic.asOutput()); + opBuilder = scope.applyControlDependencies(opBuilder); + return new KafkaDataset(opBuilder.build()); + } + + /** + */ + public Output handle() { + return handle; + } + + @Override + @SuppressWarnings("unchecked") + public Output asOutput() { + return (Output) handle; + } + + private Output handle; + + private KafkaDataset(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 6b92e81c155..5a90c94ea96 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Records the latency of producing `input_dataset` elements in a StatsAggregator. */ -public final class LatencyStatsDataset extends PrimitiveOp implements Operand { +public final class LatencyStatsDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LatencyStatsDataset operation. @@ -42,14 +44,14 @@ public final class LatencyStatsDataset extends PrimitiveOp implements Operand inputDataset, Operand tag, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -68,8 +70,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 35b86c1f9a8..fb05ff8aefe 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes rectified linear gradients for a LeakyRelu operation. * * @param data type for {@code backprops()} output */ -public final class LeakyReluGrad extends PrimitiveOp implements Operand { +public final class LeakyReluGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.LeakyReluGrad} @@ -60,7 +62,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LeakyReluGrad */ - public static LeakyReluGrad create(Scope scope, Operand gradients, Operand features, Options... options) { + 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()); 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 b8fdd733dba..a51e68c1cdb 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 @@ -23,10 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class MatchingFilesDataset extends PrimitiveOp implements Operand { +public final class MatchingFilesDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MatchingFilesDataset operation. @@ -35,7 +37,7 @@ public final class MatchingFilesDataset extends PrimitiveOp implements Operand patterns) { + public static MatchingFilesDataset create(Scope scope, Operand patterns) { OperationBuilder opBuilder = scope.env().opBuilder("MatchingFilesDataset", scope.makeOpName("MatchingFilesDataset")); opBuilder.addInput(patterns.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -50,8 +52,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 674dd0819cd..80d207a6422 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 @@ -23,16 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Identity transformation that models performance. *

* Identity transformation that models performance. */ -public final class ModelDataset extends PrimitiveOp implements Operand { +public final class ModelDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.ModelDataset} @@ -72,13 +73,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ModelDataset */ - public static ModelDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -121,8 +122,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 c7d53fabf40..a592a63830c 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 @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a MultiDeviceIterator resource. */ -public final class MultiDeviceIterator extends PrimitiveOp implements Operand { +public final class MultiDeviceIterator extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MultiDeviceIterator operation. @@ -45,7 +46,7 @@ public final class MultiDeviceIterator extends PrimitiveOp implements Operand devices, String sharedName, String container, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); String[] devicesArray = new String[devices.size()]; @@ -57,7 +58,7 @@ public static MultiDeviceIterator create(Scope scope, List devices, Stri opBuilder.setAttr("container", container); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -77,8 +78,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 d4ea259b9b7..3fc47769be1 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Generates a MultiDeviceIterator resource from its provided string handle. */ -public final class MultiDeviceIteratorFromStringHandle extends PrimitiveOp implements Operand { +public final class MultiDeviceIteratorFromStringHandle extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.MultiDeviceIteratorFromStringHandle} @@ -60,13 +62,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MultiDeviceIteratorFromStringHandle */ - public static MultiDeviceIteratorFromStringHandle create(Scope scope, Operand stringHandle, List> outputTypes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); if (options != null) { @@ -99,8 +101,8 @@ public Output multiDeviceIterator() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) multiDeviceIterator; + public Output asOutput() { + return (Output) multiDeviceIterator; } private Output multiDeviceIterator; 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 4dc63877b76..fd28ee0daff 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 @@ -25,14 +25,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Gets next element for the provided shard number. */ -public final class MultiDeviceIteratorGetNextFromShard extends PrimitiveOp implements Iterable> { +public final class MultiDeviceIteratorGetNextFromShard extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new MultiDeviceIteratorGetNextFromShard operation. @@ -45,7 +48,7 @@ public final class MultiDeviceIteratorGetNextFromShard extends PrimitiveOp imple * @param outputShapes The list of shapes being produced. * @return a new instance of MultiDeviceIteratorGetNextFromShard */ - public static MultiDeviceIteratorGetNextFromShard create(Scope scope, Operand multiDeviceIterator, Operand shardNum, Operand incarnationId, List> outputTypes, List outputShapes) { + 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()); @@ -53,7 +56,7 @@ public static MultiDeviceIteratorGetNextFromShard create(Scope scope, Operand opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -73,7 +76,7 @@ public List> components() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) components.iterator(); } 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 db3c3056a4f..ac1050d9448 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 @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; /** * Initializes the multi device iterator with the given dataset. */ -public final class MultiDeviceIteratorInit extends PrimitiveOp implements Operand { +public final class MultiDeviceIteratorInit extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MultiDeviceIteratorInit operation. @@ -38,7 +39,7 @@ public final class MultiDeviceIteratorInit extends PrimitiveOp implements Operan * @param maxBufferSize The maximum size of the host side per device buffer to keep. * @return a new instance of MultiDeviceIteratorInit */ - public static MultiDeviceIteratorInit create(Scope scope, Operand dataset, Operand multiDeviceIterator, Operand maxBufferSize) { + 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()); @@ -51,16 +52,16 @@ public static MultiDeviceIteratorInit create(Scope scope, Operand dataset, Op * An int64 indicating which incarnation of the MultiDeviceIterator * is running. */ - public Output incarnationId() { + public Output incarnationId() { return incarnationId; } @Override - public Output asOutput() { + public Output asOutput() { return incarnationId; } - private Output incarnationId; + private Output incarnationId; private MultiDeviceIteratorInit(Operation operation) { super(operation); 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 7afe979686e..fc787b28a94 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 @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Produces a string handle for the given MultiDeviceIterator. */ -public final class MultiDeviceIteratorToStringHandle extends PrimitiveOp implements Operand { +public final class MultiDeviceIteratorToStringHandle extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MultiDeviceIteratorToStringHandle operation. @@ -46,16 +47,16 @@ public static MultiDeviceIteratorToStringHandle create(Scope scope, Operand m /** * A string representing the resource. */ - public Output stringHandle() { + public Output stringHandle() { return stringHandle; } @Override - public Output asOutput() { + public Output asOutput() { return stringHandle; } - private Output stringHandle; + private Output stringHandle; private MultiDeviceIteratorToStringHandle(Operation operation) { super(operation); 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 e10d976296f..a408f1b6a09 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 @@ -23,16 +23,18 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +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`. */ -public final class OptimizeDataset extends PrimitiveOp implements Operand { +public final class OptimizeDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.OptimizeDataset} @@ -64,14 +66,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of OptimizeDataset */ - public static OptimizeDataset create(Scope scope, Operand inputDataset, Operand optimizations, List> outputTypes, List outputShapes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -108,8 +110,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 64f2779707e..f0226124fbe 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 @@ -25,12 +25,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Constructs an Optional variant from a tuple of tensors. */ @Operator(group = "data") -public final class OptionalFromValue extends PrimitiveOp implements Operand { +public final class OptionalFromValue extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new OptionalFromValue operation. @@ -54,8 +55,8 @@ public Output optional() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) optional; + public Output asOutput() { + return (Output) optional; } private Output optional; 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 de21fc8a37d..5165f1f5f9f 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 @@ -25,16 +25,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Returns the value stored in an Optional variant or raises an error if none exists. */ @Operator(group = "data") -public final class OptionalGetValue extends PrimitiveOp implements Iterable> { +public final class OptionalGetValue extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new OptionalGetValue operation. @@ -45,13 +46,13 @@ public final class OptionalGetValue extends PrimitiveOp implements Iterable optional, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -70,7 +71,7 @@ public List> components() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) components.iterator(); } 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 a748bf1f05d..c32d88e4e57 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; /** * Returns true if and only if the given Optional variant has a value. */ @Operator(group = "data") -public final class OptionalHasValue extends PrimitiveOp implements Operand { +public final class OptionalHasValue extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new OptionalHasValue operation. @@ -47,16 +48,16 @@ public static OptionalHasValue create(Scope scope, Operand optional) { /** */ - public Output hasValue() { + public Output hasValue() { return hasValue; } @Override - public Output asOutput() { + public Output asOutput() { return hasValue; } - private Output hasValue; + private Output hasValue; private OptionalHasValue(Operation operation) { super(operation); 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 56bea55c07f..749ce0b9a46 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Creates an Optional variant with no value. */ @Operator(group = "data") -public final class OptionalNone extends PrimitiveOp implements Operand { +public final class OptionalNone extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new OptionalNone operation. @@ -51,8 +52,8 @@ public Output optional() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) optional; + public Output asOutput() { + return (Output) optional; } private Output optional; 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 5873b6ba110..e4af5e2d1cd 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 @@ -22,15 +22,18 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +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. */ -public final class PaddedBatchDataset extends PrimitiveOp implements Operand { +public final class PaddedBatchDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.PaddedBatchDataset} @@ -70,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of PaddedBatchDataset */ - public static PaddedBatchDataset create(Scope scope, Operand inputDataset, Operand batchSize, Iterable> paddedShapes, Iterable> paddingValues, Operand dropRemainder, List outputShapes, Options... options) { + 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()); @@ -108,8 +111,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParseExampleDataset.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParseExampleDataset.java index f04a9b09629..07d381e65ba 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParseExampleDataset.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/data/ParseExampleDataset.java @@ -23,15 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +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. */ -public final class ParseExampleDataset extends PrimitiveOp implements Operand { +public final class ParseExampleDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.ParseExampleDataset} @@ -81,7 +83,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ParseExampleDataset */ - public static ParseExampleDataset create(Scope scope, Operand inputDataset, Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, List denseKeys, List> sparseTypes, List denseShapes, List> outputTypes, List outputShapes, Options... options) { + public static ParseExampleDataset create(Scope scope, Operand inputDataset, Operand numParallelCalls, Iterable> denseDefaults, List sparseKeys, List denseKeys, List> sparseTypes, List denseShapes, List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ParseExampleDataset", scope.makeOpName("ParseExampleDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(numParallelCalls.asOutput()); @@ -99,7 +101,7 @@ public static ParseExampleDataset create(Scope scope, Operand inputDataset, O opBuilder.setAttr("dense_keys", denseKeysArray); DataType[] sparseTypesArray = new DataType[sparseTypes.size()]; for (int i = 0; i < sparseTypesArray.length; ++i) { - sparseTypesArray[i] = DataType.fromClass(sparseTypes.get(i)); + sparseTypesArray[i] = sparseTypes.get(i); } opBuilder.setAttr("sparse_types", sparseTypesArray); Shape[] denseShapesArray = new Shape[denseShapes.size()]; @@ -109,7 +111,7 @@ public static ParseExampleDataset create(Scope scope, Operand inputDataset, O opBuilder.setAttr("dense_shapes", denseShapesArray); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -142,8 +144,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 096630a8aa4..2b5ab1f53cd 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that asynchronously prefetches elements from `input_dataset`. */ -public final class PrefetchDataset extends PrimitiveOp implements Operand { +public final class PrefetchDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.PrefetchDataset} @@ -63,14 +65,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of PrefetchDataset */ - public static PrefetchDataset create(Scope scope, Operand inputDataset, Operand bufferSize, List> outputTypes, List outputShapes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -103,8 +105,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 71df62da0f7..da9cfbc41ed 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a Dataset that returns pseudorandom numbers. */ -public final class RandomDataset extends PrimitiveOp implements Operand { +public final class RandomDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RandomDataset operation. @@ -44,14 +46,14 @@ public final class RandomDataset extends PrimitiveOp implements Operand * @param outputShapes * @return a new instance of RandomDataset */ - public static RandomDataset create(Scope scope, Operand seed, Operand seed2, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -70,8 +72,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 7b15aa0072c..eb9a5e431eb 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset with a range of values. Corresponds to python's xrange. */ -public final class RangeDataset extends PrimitiveOp implements Operand { +public final class RangeDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RangeDataset operation. @@ -43,7 +45,7 @@ public final class RangeDataset extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of RangeDataset */ - public static RangeDataset create(Scope scope, Operand start, Operand stop, Operand step, List> outputTypes, List outputShapes) { + 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()); @@ -51,7 +53,7 @@ public static RangeDataset create(Scope scope, Operand start, Operand handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 f158b146189..2b23ef475fa 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that emits the outputs of `input_dataset` `count` times. */ -public final class RepeatDataset extends PrimitiveOp implements Operand { +public final class RepeatDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RepeatDataset operation. @@ -43,14 +45,14 @@ public final class RepeatDataset extends PrimitiveOp implements Operand * @param outputShapes * @return a new instance of RepeatDataset */ - public static RepeatDataset create(Scope scope, Operand inputDataset, Operand count, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -69,8 +71,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 c712e14af45..c5c438d0cea 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Converts the given `resource_handle` representing an iterator to a variant tensor. */ @Operator(group = "data") -public final class SerializeIterator extends PrimitiveOp implements Operand { +public final class SerializeIterator extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SerializeIterator operation. @@ -55,8 +56,8 @@ public Output serialized() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) serialized; + public Output asOutput() { + return (Output) serialized; } private Output serialized; 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 48af6285bb5..fb30cf7f9b0 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 @@ -23,13 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ -public final class SetStatsAggregatorDataset extends PrimitiveOp implements Operand { +public final class SetStatsAggregatorDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SetStatsAggregatorDataset operation. @@ -43,7 +45,7 @@ public final class SetStatsAggregatorDataset extends PrimitiveOp implements Oper * @param outputShapes * @return a new instance of SetStatsAggregatorDataset */ - public static SetStatsAggregatorDataset create(Scope scope, Operand inputDataset, Operand statsAggregator, Operand tag, Operand counterPrefix, List> outputTypes, List outputShapes) { + 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()); @@ -52,7 +54,7 @@ public static SetStatsAggregatorDataset create(Scope scope, Operand inputData opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -71,8 +73,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 ceab49af5b6..be4a1afc388 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 @@ -23,16 +23,18 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that shuffles and repeats elements from `input_dataset` *

* pseudorandomly. */ -public final class ShuffleAndRepeatDataset extends PrimitiveOp implements Operand { +public final class ShuffleAndRepeatDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ShuffleAndRepeatDataset operation. @@ -52,7 +54,7 @@ public final class ShuffleAndRepeatDataset extends PrimitiveOp implements Operan * @param outputShapes * @return a new instance of ShuffleAndRepeatDataset */ - public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDataset, Operand bufferSize, Operand seed, Operand seed2, Operand count, List> outputTypes, List outputShapes) { + public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDataset, Operand bufferSize, Operand seed, Operand seed2, Operand count, List> outputTypes, List outputShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ShuffleAndRepeatDataset", scope.makeOpName("ShuffleAndRepeatDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(bufferSize.asOutput()); @@ -62,7 +64,7 @@ public static ShuffleAndRepeatDataset create(Scope scope, Operand inputDatase opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -81,8 +83,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 52742e28d8a..c4e52430859 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that shuffles elements from `input_dataset` pseudorandomly. */ -public final class ShuffleDataset extends PrimitiveOp implements Operand { +public final class ShuffleDataset extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.ShuffleDataset} @@ -72,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ShuffleDataset */ - public static ShuffleDataset create(Scope scope, Operand inputDataset, Operand bufferSize, Operand seed, Operand seed2, List> outputTypes, List outputShapes, Options... options) { + public static ShuffleDataset create(Scope scope, Operand inputDataset, Operand bufferSize, Operand seed, Operand seed2, List> outputTypes, List outputShapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ShuffleDataset", scope.makeOpName("ShuffleDataset")); opBuilder.addInput(inputDataset.asOutput()); opBuilder.addInput(bufferSize.asOutput()); @@ -81,7 +83,7 @@ public static ShuffleDataset create(Scope scope, Operand inputDataset, Operan opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -118,8 +120,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 fe94dd1ac72..11bdc66e2f1 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that skips `count` elements from the `input_dataset`. */ -public final class SkipDataset extends PrimitiveOp implements Operand { +public final class SkipDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SkipDataset operation. @@ -43,14 +45,14 @@ public final class SkipDataset extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of SkipDataset */ - public static SkipDataset create(Scope scope, Operand inputDataset, Operand count, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -69,8 +71,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 96b63e4f1c8..6f39647c66d 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 @@ -23,11 +23,13 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that splits a SparseTensor into elements row-wise. */ -public final class SparseTensorSliceDataset extends PrimitiveOp implements Operand { +public final class SparseTensorSliceDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseTensorSliceDataset operation. @@ -38,7 +40,7 @@ public final class SparseTensorSliceDataset extends PrimitiveOp implements Opera * @param denseShape * @return a new instance of SparseTensorSliceDataset */ - public static SparseTensorSliceDataset create(Scope scope, Operand indices, Operand values, Operand denseShape) { + 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()); @@ -55,8 +57,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 6f942382557..c57e83d675c 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Creates a dataset that executes a SQL query and emits rows of the result set. */ -public final class SqlDataset extends PrimitiveOp implements Operand { +public final class SqlDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SqlDataset operation. @@ -43,7 +45,7 @@ public final class SqlDataset extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of SqlDataset */ - public static SqlDataset create(Scope scope, Operand driverName, Operand dataSourceName, Operand query, List> outputTypes, List outputShapes) { + 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()); @@ -51,7 +53,7 @@ public static SqlDataset create(Scope scope, Operand driverName, Operand opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -70,8 +72,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 c21655f2c0d..4e9592d44e0 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 @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Creates a statistics manager resource. */ -public final class StatsAggregatorHandle extends PrimitiveOp implements Operand { +public final class StatsAggregatorHandle extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.data.StatsAggregatorHandle} @@ -102,8 +103,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 8fa273a7d18..c7b1e30d070 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 @@ -23,14 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Creates a dataset that contains `count` elements from the `input_dataset`. */ -public final class TakeDataset extends PrimitiveOp implements Operand { +public final class TakeDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TakeDataset operation. @@ -44,14 +46,14 @@ public final class TakeDataset extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of TakeDataset */ - public static TakeDataset create(Scope scope, Operand inputDataset, Operand count, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -70,8 +72,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 9af25709b76..bf24767728b 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 @@ -22,15 +22,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that emits `components` as a tuple of tensors once. */ -public final class TensorDataset extends PrimitiveOp implements Operand { +public final class TensorDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorDataset operation. @@ -60,8 +61,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 7b2ac67022a..bf13134f7bc 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 @@ -22,15 +22,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that emits each dim-0 slice of `components` once. */ -public final class TensorSliceDataset extends PrimitiveOp implements Operand { +public final class TensorSliceDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorSliceDataset operation. @@ -60,8 +61,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 bde1fa9762f..2f2a720d239 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 @@ -23,11 +23,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Creates a dataset that emits the lines of one or more text files. */ -public final class TextLineDataset extends PrimitiveOp implements Operand { +public final class TextLineDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TextLineDataset operation. @@ -40,7 +43,7 @@ public final class TextLineDataset extends PrimitiveOp implements Operand filenames, Operand compressionType, Operand bufferSize) { + 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()); @@ -57,8 +60,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 558c8cf0532..a91ae4c9e5f 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 @@ -23,11 +23,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Creates a dataset that emits the records from one or more TFRecord files. */ -public final class TfRecordDataset extends PrimitiveOp implements Operand { +public final class TfRecordDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TfRecordDataset operation. @@ -41,7 +44,7 @@ public final class TfRecordDataset extends PrimitiveOp implements Operand filenames, Operand compressionType, Operand bufferSize) { + 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()); @@ -58,8 +61,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 826f48f42d4..caf7de0307a 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 @@ -23,14 +23,15 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A dataset that splits the elements of its input into multiple elements. */ -public final class UnbatchDataset extends PrimitiveOp implements Operand { +public final class UnbatchDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UnbatchDataset operation. @@ -41,13 +42,13 @@ public final class UnbatchDataset extends PrimitiveOp implements Operand * @param outputShapes * @return a new instance of UnbatchDataset */ - public static UnbatchDataset create(Scope scope, Operand inputDataset, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -66,8 +67,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 fcaaf2c1d75..41b64aa09c4 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 @@ -23,14 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * A dataset that creates window datasets from the input dataset. */ -public final class WindowDataset extends PrimitiveOp implements Operand { +public final class WindowDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new WindowDataset operation. @@ -48,7 +51,7 @@ public final class WindowDataset extends PrimitiveOp implements Operand * @param outputShapes * @return a new instance of WindowDataset */ - public static WindowDataset create(Scope scope, Operand inputDataset, Operand size, Operand shift, Operand stride, Operand dropRemainder, List> outputTypes, List outputShapes) { + public static WindowDataset create(Scope scope, Operand inputDataset, Operand size, 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()); @@ -58,7 +61,7 @@ public static WindowDataset create(Scope scope, Operand inputDataset, Operand opBuilder = scope.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -77,8 +80,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 2d57e4ae891..72d47b8ecb2 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 @@ -23,15 +23,16 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Creates a dataset that zips together `input_datasets`. */ -public final class ZipDataset extends PrimitiveOp implements Operand { +public final class ZipDataset extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ZipDataset operation. @@ -42,13 +43,13 @@ public final class ZipDataset extends PrimitiveOp implements Operand { * @param outputShapes * @return a new instance of ZipDataset */ - public static ZipDataset create(Scope scope, Iterable> inputDatasets, List> outputTypes, List outputShapes) { + 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.applyControlDependencies(opBuilder); DataType[] outputTypesArray = new DataType[outputTypes.size()]; for (int i = 0; i < outputTypesArray.length; ++i) { - outputTypesArray[i] = DataType.fromClass(outputTypes.get(i)); + outputTypesArray[i] = outputTypes.get(i); } opBuilder.setAttr("output_types", outputTypesArray); Shape[] outputShapesArray = new Shape[outputShapes.size()]; @@ -67,8 +68,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 8cafae3ce4a..521589dc0df 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Converts each entry in the given tensor to strings. @@ -35,7 +37,7 @@ * tutorial. */ @Operator(group = "dtypes") -public final class AsString extends PrimitiveOp implements Operand { +public final class AsString extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.dtypes.AsString} @@ -105,7 +107,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AsString */ - public static AsString create(Scope scope, Operand input, Options... options) { + public static AsString create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("AsString", scope.makeOpName("AsString")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -173,16 +175,16 @@ public static Options fill(String fill) { /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private AsString(Operation operation) { super(operation); 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 68383454081..6c346f0066e 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Cast x of type SrcT to y of DstT. @@ -32,7 +33,7 @@ * @param data type for {@code y()} output */ @Operator(group = "dtypes") -public final class Cast extends PrimitiveOp implements Operand { +public final class Cast extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.dtypes.Cast} @@ -62,11 +63,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Cast */ - public static Cast create(Scope scope, Operand x, Class DstT, Options... options) { + public static Cast create(Scope scope, Operand x, DataType DstT, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Cast", scope.makeOpName("Cast")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("DstT", DataType.fromClass(DstT)); + opBuilder.setAttr("DstT", DstT); if (options != null) { for (Options opts : options) { if (opts.Truncate != null) { 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 dbb221ec065..0ab9453da92 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Converts two real numbers to a complex number. @@ -47,7 +49,7 @@ * @param data type for {@code out()} output */ @Operator(group = "dtypes") -public final class Complex extends PrimitiveOp implements Operand { +public final class Complex extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Complex operation. @@ -58,12 +60,12 @@ public final class Complex extends PrimitiveOp implements Operand { * @param Tout * @return a new instance of Complex */ - public static Complex create(Scope scope, Operand real, Operand imag, Class Tout) { + public static Complex create(Scope scope, Operand real, Operand imag, DataType Tout) { OperationBuilder opBuilder = scope.env().opBuilder("Complex", scope.makeOpName("Complex")); opBuilder.addInput(real.asOutput()); opBuilder.addInput(imag.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Tout", DataType.fromClass(Tout)); + opBuilder.setAttr("Tout", Tout); return new Complex(opBuilder.build()); } 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 4133440f9d5..755b615b4b7 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Adjust the contrast of one or more images. @@ -41,7 +44,7 @@ * @param data type for {@code output()} output */ @Operator(group = "image") -public final class AdjustContrast extends PrimitiveOp implements Operand { +public final class AdjustContrast extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AdjustContrast operation. @@ -51,7 +54,7 @@ public final class AdjustContrast extends PrimitiveOp implemen * @param contrastFactor A float multiplier for adjusting contrast. * @return a new instance of AdjustContrast */ - public static AdjustContrast create(Scope scope, Operand images, Operand contrastFactor) { + 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()); 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 67eb95e5faa..f723b962540 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Adjust the hue of one or more images. @@ -38,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator(group = "image") -public final class AdjustHue extends PrimitiveOp implements Operand { +public final class AdjustHue extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AdjustHue operation. @@ -48,7 +51,7 @@ public final class AdjustHue extends PrimitiveOp implements Op * @param delta A float delta to add to the hue. * @return a new instance of AdjustHue */ - public static AdjustHue create(Scope scope, Operand images, Operand delta) { + 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()); 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 e1397a5942e..edd9277f5ff 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Adjust the saturation of one or more images. @@ -38,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator(group = "image") -public final class AdjustSaturation extends PrimitiveOp implements Operand { +public final class AdjustSaturation extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AdjustSaturation operation. @@ -48,7 +51,7 @@ public final class AdjustSaturation extends PrimitiveOp implem * @param scale A float scale to add to the saturation. * @return a new instance of AdjustSaturation */ - public static AdjustSaturation create(Scope scope, Operand images, Operand scale) { + 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()); 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 3e012342d61..ed719bf98aa 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 @@ -24,6 +24,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Extracts crops from the input image tensor and resizes them. @@ -45,7 +49,7 @@ * `align_corners=True`. */ @Operator(group = "image") -public final class CropAndResize extends PrimitiveOp implements Operand { +public final class CropAndResize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.CropAndResize} @@ -102,7 +106,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CropAndResize */ - public static CropAndResize create(Scope scope, Operand image, Operand boxes, Operand boxInd, Operand cropSize, Options... options) { + 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()); @@ -141,16 +145,16 @@ public static Options extrapolationValue(Float extrapolationValue) { /** * A 4-D tensor of shape `[num_boxes, crop_height, crop_width, depth]`. */ - public Output crops() { + public Output crops() { return crops; } @Override - public Output asOutput() { + public Output asOutput() { return crops; } - private Output crops; + private Output crops; private CropAndResize(Operation operation) { super(operation); 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 bbece0dd10c..dc4b65a3edc 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 @@ -24,12 +24,16 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradient of the crop_and_resize op wrt the input boxes tensor. */ @Operator(group = "image") -public final class CropAndResizeGradBoxes extends PrimitiveOp implements Operand { +public final class CropAndResizeGradBoxes extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradBoxes} @@ -73,7 +77,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CropAndResizeGradBoxes */ - public static CropAndResizeGradBoxes create(Scope scope, Operand grads, Operand image, Operand boxes, Operand boxInd, Options... options) { + 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()); @@ -101,16 +105,16 @@ public static Options method(String method) { /** * A 2-D tensor of shape `[num_boxes, 4]`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private CropAndResizeGradBoxes(Operation operation) { super(operation); 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 c53c14b2de4..e84eb55cf0c 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 @@ -25,6 +25,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradient of the crop_and_resize op wrt the input image tensor. @@ -32,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "image") -public final class CropAndResizeGradImage extends PrimitiveOp implements Operand { +public final class CropAndResizeGradImage extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.CropAndResizeGradImage} @@ -78,14 +82,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CropAndResizeGradImage */ - public static CropAndResizeGradImage create(Scope scope, Operand grads, Operand boxes, Operand boxInd, Operand imageSize, Class T, Options... options) { + public static CropAndResizeGradImage create(Scope scope, Operand grads, Operand boxes, Operand boxInd, Operand imageSize, DataType T, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CropAndResizeGradImage", scope.makeOpName("CropAndResizeGradImage")); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(boxInd.asOutput()); opBuilder.addInput(imageSize.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("T", DataType.fromClass(T)); + opBuilder.setAttr("T", T); if (options != null) { for (Options opts : options) { if (opts.method != null) { 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 5573175d7e8..8f8ecec8052 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 @@ -24,7 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; /** * Decode and Crop a JPEG-encoded image to a uint8 tensor. @@ -55,7 +57,7 @@ * decoding partial jpeg image. */ @Operator(group = "image") -public final class DecodeAndCropJpeg extends PrimitiveOp implements Operand { +public final class DecodeAndCropJpeg extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.DecodeAndCropJpeg} @@ -137,7 +139,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodeAndCropJpeg */ - public static DecodeAndCropJpeg create(Scope scope, Operand contents, Operand cropWindow, Options... options) { + 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()); @@ -219,16 +221,16 @@ public static Options dctMethod(String dctMethod) { /** * 3-D with shape `[height, width, channels]`.. */ - public Output image() { + public Output image() { return image; } @Override - public Output asOutput() { + public Output asOutput() { return image; } - private Output image; + private Output image; private DecodeAndCropJpeg(Operation operation) { super(operation); 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 9911c28450c..18b16ffcf7f 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 @@ -24,7 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; /** * Decode the first frame of a BMP-encoded image to a uint8 tensor. @@ -44,7 +45,7 @@ * 4: output an RGBA image. */ @Operator(group = "image") -public final class DecodeBmp extends PrimitiveOp implements Operand { +public final class DecodeBmp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.DecodeBmp} @@ -73,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodeBmp */ - public static DecodeBmp create(Scope scope, Operand contents, Options... options) { + public static DecodeBmp create(Scope scope, Operand contents, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeBmp", scope.makeOpName("DecodeBmp")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -97,16 +98,16 @@ public static Options channels(Long channels) { /** * 3-D with shape `[height, width, channels]`. RGB order */ - public Output image() { + public Output image() { return image; } @Override - public Output asOutput() { + public Output asOutput() { return image; } - private Output image; + private Output image; private DecodeBmp(Operation operation) { super(operation); 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 2e9f29eb6b3..0042ffeac39 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 @@ -24,7 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; /** * Decode the frame(s) of a GIF-encoded image to a uint8 tensor. @@ -39,7 +40,7 @@ * `tf.image.decode_image`. */ @Operator(group = "image") -public final class DecodeGif extends PrimitiveOp implements Operand { +public final class DecodeGif extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DecodeGif operation. @@ -48,7 +49,7 @@ public final class DecodeGif extends PrimitiveOp implements Operand { * @param contents 0-D. The GIF-encoded image. * @return a new instance of DecodeGif */ - public static DecodeGif create(Scope scope, Operand contents) { + public static DecodeGif create(Scope scope, Operand contents) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeGif", scope.makeOpName("DecodeGif")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -58,16 +59,16 @@ public static DecodeGif create(Scope scope, Operand contents) { /** * 4-D with shape `[num_frames, height, width, 3]`. RGB channel order. */ - public Output image() { + public Output image() { return image; } @Override - public Output asOutput() { + public Output asOutput() { return image; } - private Output image; + private Output image; private DecodeGif(Operation operation) { super(operation); 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 4fe7c18cb99..b0ff7c262f5 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 @@ -24,7 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; /** * Decode a JPEG-encoded image to a uint8 tensor. @@ -55,7 +56,7 @@ * the same, though it is cleaner to use `tf.image.decode_image`. */ @Operator(group = "image") -public final class DecodeJpeg extends PrimitiveOp implements Operand { +public final class DecodeJpeg extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.DecodeJpeg} @@ -136,7 +137,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodeJpeg */ - public static DecodeJpeg create(Scope scope, Operand contents, Options... options) { + public static DecodeJpeg create(Scope scope, Operand contents, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeJpeg", scope.makeOpName("DecodeJpeg")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -217,16 +218,16 @@ public static Options dctMethod(String dctMethod) { /** * 3-D with shape `[height, width, channels]`.. */ - public Output image() { + public Output image() { return image; } @Override - public Output asOutput() { + public Output asOutput() { return image; } - private Output image; + private Output image; private DecodeJpeg(Operation operation) { super(operation); 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 2788de66b7f..4fec82ea5ec 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 @@ -25,7 +25,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Decode a PNG-encoded image to a uint8 or uint16 tensor. @@ -57,7 +60,7 @@ * @param data type for {@code image()} output */ @Operator(group = "image") -public final class DecodePng extends PrimitiveOp implements Operand { +public final class DecodePng extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.DecodePng} @@ -87,11 +90,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodePng */ - public static DecodePng create(Scope scope, Operand contents, Class dtype, Options... options) { + public static DecodePng create(Scope scope, Operand contents, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodePng", scope.makeOpName("DecodePng")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.channels != null) { @@ -110,8 +113,8 @@ public static DecodePng create(Scope scope, Operand create(Scope scope, Operand contents, Options... options) { - return create(scope, contents, UInt8.class, options); + public static DecodePng create(Scope scope, Operand contents, Options... options) { + return create(scope, contents, TUInt8.DTYPE, options); } /** 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 34976c72e89..92f978471b8 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Draw bounding boxes on a batch of images. @@ -43,7 +46,7 @@ * @param data type for {@code output()} output */ @Operator(group = "image") -public final class DrawBoundingBoxes extends PrimitiveOp implements Operand { +public final class DrawBoundingBoxes extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DrawBoundingBoxes operation. @@ -54,7 +57,7 @@ public final class DrawBoundingBoxes extends PrimitiveOp imple * boxes. * @return a new instance of DrawBoundingBoxes */ - public static DrawBoundingBoxes create(Scope scope, Operand images, Operand boxes) { + public static DrawBoundingBoxes create(Scope scope, Operand images, Operand boxes) { OperationBuilder opBuilder = scope.env().opBuilder("DrawBoundingBoxes", scope.makeOpName("DrawBoundingBoxes")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(boxes.asOutput()); 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 59fe6db7989..2063a7a10b2 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 @@ -24,7 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; /** * JPEG-encode an image. @@ -56,7 +57,7 @@ * 3: Output an RGB image. */ @Operator(group = "image") -public final class EncodeJpeg extends PrimitiveOp implements Operand { +public final class EncodeJpeg extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.EncodeJpeg} @@ -158,7 +159,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of EncodeJpeg */ - public static EncodeJpeg create(Scope scope, Operand image, Options... options) { + public static EncodeJpeg create(Scope scope, Operand image, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EncodeJpeg", scope.makeOpName("EncodeJpeg")); opBuilder.addInput(image.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -263,16 +264,16 @@ public static Options xmpMetadata(String xmpMetadata) { /** * 0-D. JPEG-encoded image. */ - public Output contents() { + public Output contents() { return contents; } @Override - public Output asOutput() { + public Output asOutput() { return contents; } - private Output contents; + private Output contents; private EncodeJpeg(Operation operation) { super(operation); 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 be0c80ba4a9..2a26b0e765b 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 @@ -24,7 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; /** * JPEG encode input image with provided compression quality. @@ -34,7 +36,7 @@ * */ @Operator(group = "image") -public final class EncodeJpegVariableQuality extends PrimitiveOp implements Operand { +public final class EncodeJpegVariableQuality extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new EncodeJpegVariableQuality operation. @@ -44,7 +46,7 @@ public final class EncodeJpegVariableQuality extends PrimitiveOp implements Oper * @param quality An int quality to encode to. * @return a new instance of EncodeJpegVariableQuality */ - public static EncodeJpegVariableQuality create(Scope scope, Operand images, Operand quality) { + 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()); @@ -55,16 +57,16 @@ public static EncodeJpegVariableQuality create(Scope scope, Operand image /** * 0-D. JPEG-encoded image. */ - public Output contents() { + public Output contents() { return contents; } @Override - public Output asOutput() { + public Output asOutput() { return contents; } - private Output contents; + private Output contents; private EncodeJpegVariableQuality(Operation operation) { super(operation); 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 e033df5281f..d3eaf6cffed 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * PNG-encode an image. @@ -49,7 +52,7 @@ * the smallest output, but is slower. */ @Operator(group = "image") -public final class EncodePng extends PrimitiveOp implements Operand { +public final class EncodePng extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.EncodePng} @@ -78,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of EncodePng */ - public static EncodePng create(Scope scope, Operand image, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -102,16 +105,16 @@ public static Options compression(Long compression) { /** * 0-D. PNG-encoded image. */ - public Output contents() { + public Output contents() { return contents; } @Override - public Output asOutput() { + public Output asOutput() { return contents; } - private Output contents; + private Output contents; private EncodePng(Operation operation) { super(operation); 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 e1cfec69dc1..4729b67f918 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,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Extracts a glimpse from the input tensor. @@ -56,7 +58,7 @@ * numbers of pixels. */ @Operator(group = "image") -public final class ExtractGlimpse extends PrimitiveOp implements Operand { +public final class ExtractGlimpse extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.ExtractGlimpse} @@ -123,7 +125,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ExtractGlimpse */ - public static ExtractGlimpse create(Scope scope, Operand input, Operand size, Operand offsets, Options... options) { + public static ExtractGlimpse create(Scope scope, Operand input, Operand size, Operand offsets, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ExtractGlimpse", scope.makeOpName("ExtractGlimpse")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(size.asOutput()); @@ -186,16 +188,16 @@ public static Options noise(String noise) { * A tensor representing the glimpses `[batch_size, * glimpse_height, glimpse_width, channels]`. */ - public Output glimpse() { + public Output glimpse() { return glimpse; } @Override - public Output asOutput() { + public Output asOutput() { return glimpse; } - private Output glimpse; + private Output glimpse; private ExtractGlimpse(Operation operation) { super(operation); 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 f8a52338103..92652980278 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Extract `patches` from `images` and put them in the "depth" output dimension. @@ -32,7 +34,7 @@ * @param data type for {@code patches()} output */ @Operator(group = "image") -public final class ExtractImagePatches extends PrimitiveOp implements Operand { +public final class ExtractImagePatches extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExtractImagePatches operation. @@ -51,7 +53,7 @@ public final class ExtractImagePatches extends PrimitiveOp imp * @param padding The type of padding algorithm to use. * @return a new instance of ExtractImagePatches */ - public static ExtractImagePatches create(Scope scope, Operand images, List ksizes, List strides, List rates, String padding) { + 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.applyControlDependencies(opBuilder); 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 85f9b22f619..a5e03cc5e6c 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 @@ -25,6 +25,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Extract the shape information of a JPEG-encoded image. @@ -34,7 +38,7 @@ * @param data type for {@code imageShape()} output */ @Operator(group = "image") -public final class ExtractJpegShape extends PrimitiveOp implements Operand { +public final class ExtractJpegShape extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ExtractJpegShape operation. @@ -45,11 +49,11 @@ public final class ExtractJpegShape extends PrimitiveOp implem * Defaults to int32. * @return a new instance of ExtractJpegShape */ - public static ExtractJpegShape create(Scope scope, Operand contents, Class outputType) { + public static ExtractJpegShape create(Scope scope, Operand contents, DataType outputType) { OperationBuilder opBuilder = scope.env().opBuilder("ExtractJpegShape", scope.makeOpName("ExtractJpegShape")); opBuilder.addInput(contents.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("output_type", DataType.fromClass(outputType)); + opBuilder.setAttr("output_type", outputType); return new ExtractJpegShape(opBuilder.build()); } @@ -60,8 +64,8 @@ public static ExtractJpegShape create(Scope scope, Operand * @param contents 0-D. The JPEG-encoded image. * @return a new instance of ExtractJpegShape */ - public static ExtractJpegShape create(Scope scope, Operand contents) { - return create(scope, contents, Integer.class); + public static ExtractJpegShape create(Scope scope, Operand contents) { + return create(scope, contents, TInt32.DTYPE); } /** 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 a6dede6b80b..944a1bff4c6 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Convert one or more images from HSV to RGB. @@ -37,7 +39,7 @@ * @param data type for {@code output()} output */ @Operator(group = "image") -public final class HsvToRgb extends PrimitiveOp implements Operand { +public final class HsvToRgb extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new HsvToRgb operation. @@ -46,7 +48,7 @@ public final class HsvToRgb extends PrimitiveOp implements Ope * @param images 1-D or higher rank. HSV data to convert. Last dimension must be size 3. * @return a new instance of HsvToRgb */ - public static HsvToRgb create(Scope scope, Operand images) { + public static HsvToRgb create(Scope scope, Operand images) { OperationBuilder opBuilder = scope.env().opBuilder("HSVToRGB", scope.makeOpName("HsvToRgb")); opBuilder.addInput(images.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 9cd2bbedece..da12e6939d0 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Greedily selects a subset of bounding boxes in descending order of score, @@ -85,7 +88,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of NonMaxSuppression */ - public static NonMaxSuppression create(Scope scope, Operand boxes, Operand scores, Operand maxOutputSize, Operand iouThreshold, Operand scoreThreshold, Options... options) { + public static NonMaxSuppression create(Scope scope, Operand boxes, Operand scores, Operand maxOutputSize, Operand iouThreshold, Operand scoreThreshold, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("NonMaxSuppressionV4", scope.makeOpName("NonMaxSuppression")); opBuilder.addInput(boxes.asOutput()); opBuilder.addInput(scores.asOutput()); @@ -115,7 +118,7 @@ public static Options padToMaxOutputSize(Boolean padToMaxOutputSize) { * A 1-D integer tensor of shape `[M]` representing the selected * indices from the boxes tensor, where `M <= max_output_size`. */ - public Output selectedIndices() { + public Output selectedIndices() { return selectedIndices; } @@ -123,12 +126,12 @@ public Output selectedIndices() { * A 0-D integer tensor representing the number of valid elements in * `selected_indices`, with the valid elements appearing first. */ - public Output validOutputs() { + public Output validOutputs() { return validOutputs; } - private Output selectedIndices; - private Output validOutputs; + private Output selectedIndices; + private Output validOutputs; private NonMaxSuppression(Operation operation) { super(operation); 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 01972dc3749..41470052ee2 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Greedily selects a subset of bounding boxes in descending order of score, @@ -44,7 +46,7 @@ * selected_boxes = tf.gather(boxes, selected_indices) */ @Operator(group = "image") -public final class NonMaxSuppressionWithOverlaps extends PrimitiveOp implements Operand { +public final class NonMaxSuppressionWithOverlaps extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new NonMaxSuppressionWithOverlaps operation. @@ -62,7 +64,7 @@ public final class NonMaxSuppressionWithOverlaps extends PrimitiveOp implements * boxes based on score. * @return a new instance of NonMaxSuppressionWithOverlaps */ - public static NonMaxSuppressionWithOverlaps create(Scope scope, Operand overlaps, Operand scores, Operand maxOutputSize, Operand overlapThreshold, Operand scoreThreshold) { + 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()); @@ -77,16 +79,16 @@ public static NonMaxSuppressionWithOverlaps create(Scope scope, Operand o * A 1-D integer tensor of shape `[M]` representing the selected * indices from the boxes tensor, where `M <= max_output_size`. */ - public Output selectedIndices() { + public Output selectedIndices() { return selectedIndices; } @Override - public Output asOutput() { + public Output asOutput() { return selectedIndices; } - private Output selectedIndices; + private Output selectedIndices; private NonMaxSuppressionWithOverlaps(Operation operation) { super(operation); 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 dc14050baa3..b37306adf05 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Resize quantized `images` to `size` using quantized bilinear interpolation. @@ -33,7 +36,7 @@ * @param data type for {@code resizedImages()} output */ @Operator(group = "image") -public final class QuantizedResizeBilinear extends PrimitiveOp { +public final class QuantizedResizeBilinear extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.image.QuantizedResizeBilinear} @@ -76,7 +79,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedResizeBilinear */ - public static QuantizedResizeBilinear create(Scope scope, Operand images, Operand size, Operand min, Operand max, Options... options) { + public static QuantizedResizeBilinear create(Scope scope, Operand images, Operand size, Operand min, Operand max, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedResizeBilinear", scope.makeOpName("QuantizedResizeBilinear")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(size.asOutput()); @@ -121,19 +124,19 @@ public Output resizedImages() { /** */ - public Output outMin() { + public Output outMin() { return outMin; } /** */ - public Output outMax() { + public Output outMax() { return outMax; } private Output resizedImages; - private Output outMin; - private Output outMax; + private Output outMin; + private Output outMax; private QuantizedResizeBilinear(Operation operation) { super(operation); 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 f3ca09d6b4e..5a1b2055f0f 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Randomly crop `image`. @@ -38,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator(group = "image") -public final class RandomCrop extends PrimitiveOp implements Operand { +public final class RandomCrop extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.RandomCrop} @@ -79,7 +82,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RandomCrop */ - public static RandomCrop create(Scope scope, Operand image, Operand size, Options... options) { + public static RandomCrop create(Scope scope, Operand image, Operand size, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomCrop", scope.makeOpName("RandomCrop")); opBuilder.addInput(image.asOutput()); opBuilder.addInput(size.asOutput()); 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 dd01529633b..074bc61444c 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 @@ -24,6 +24,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Resize `images` to `size` using area interpolation. @@ -41,7 +45,7 @@ * area that intersects the footprint. This is the same as OpenCV's INTER_AREA. */ @Operator(group = "image") -public final class ResizeArea extends PrimitiveOp implements Operand { +public final class ResizeArea extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.ResizeArea} @@ -73,7 +77,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResizeArea */ - public static ResizeArea create(Scope scope, Operand images, Operand size, Options... options) { + public static ResizeArea create(Scope scope, Operand images, Operand size, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeArea", scope.makeOpName("ResizeArea")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(size.asOutput()); @@ -100,16 +104,16 @@ public static Options alignCorners(Boolean alignCorners) { * 4-D with shape * `[batch, new_height, new_width, channels]`. */ - public Output resizedImages() { + public Output resizedImages() { return resizedImages; } @Override - public Output asOutput() { + public Output asOutput() { return resizedImages; } - private Output resizedImages; + private Output resizedImages; private ResizeArea(Operation operation) { super(operation); 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 1186b26ae2a..692088178e7 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 @@ -24,6 +24,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Resize `images` to `size` using bicubic interpolation. @@ -31,7 +35,7 @@ * Input images can be of different types but output images are always float. */ @Operator(group = "image") -public final class ResizeBicubic extends PrimitiveOp implements Operand { +public final class ResizeBicubic extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubic} @@ -72,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResizeBicubic */ - public static ResizeBicubic create(Scope scope, Operand images, Operand size, Options... options) { + public static ResizeBicubic create(Scope scope, Operand images, Operand size, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeBicubic", scope.makeOpName("ResizeBicubic")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(size.asOutput()); @@ -109,16 +113,16 @@ public static Options halfPixelCenters(Boolean halfPixelCenters) { * 4-D with shape * `[batch, new_height, new_width, channels]`. */ - public Output resizedImages() { + public Output resizedImages() { return resizedImages; } @Override - public Output asOutput() { + public Output asOutput() { return resizedImages; } - private Output resizedImages; + private Output resizedImages; private ResizeBicubic(Operation operation) { super(operation); 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 ceaf9dd4227..24c011f4341 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 @@ -23,13 +23,16 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradient of bicubic interpolation. * * @param data type for {@code output()} output */ -public final class ResizeBicubicGrad extends PrimitiveOp implements Operand { +public final class ResizeBicubicGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.ResizeBicubicGrad} @@ -70,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResizeBicubicGrad */ - public static ResizeBicubicGrad create(Scope scope, Operand grads, Operand originalImage, Options... options) { + 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()); 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 56ac725a0e8..eaeedeb3ec9 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 @@ -24,6 +24,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Resize `images` to `size` using bilinear interpolation. @@ -31,7 +35,7 @@ * Input images can be of different types but output images are always float. */ @Operator(group = "image") -public final class ResizeBilinear extends PrimitiveOp implements Operand { +public final class ResizeBilinear extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinear} @@ -72,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResizeBilinear */ - public static ResizeBilinear create(Scope scope, Operand images, Operand size, Options... options) { + public static ResizeBilinear create(Scope scope, Operand images, Operand size, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeBilinear", scope.makeOpName("ResizeBilinear")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(size.asOutput()); @@ -109,16 +113,16 @@ public static Options halfPixelCenters(Boolean halfPixelCenters) { * 4-D with shape * `[batch, new_height, new_width, channels]`. */ - public Output resizedImages() { + public Output resizedImages() { return resizedImages; } @Override - public Output asOutput() { + public Output asOutput() { return resizedImages; } - private Output resizedImages; + private Output resizedImages; private ResizeBilinear(Operation operation) { super(operation); 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 f6e303d785e..37ebd61e152 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 @@ -23,13 +23,16 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradient of bilinear interpolation. * * @param data type for {@code output()} output */ -public final class ResizeBilinearGrad extends PrimitiveOp implements Operand { +public final class ResizeBilinearGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.ResizeBilinearGrad} @@ -70,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResizeBilinearGrad */ - public static ResizeBilinearGrad create(Scope scope, Operand grads, Operand originalImage, Options... options) { + 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()); 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 499a2d7120d..1fbfae437a5 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Resize `images` to `size` using nearest neighbor interpolation. @@ -31,7 +34,7 @@ * @param data type for {@code resizedImages()} output */ @Operator(group = "image") -public final class ResizeNearestNeighbor extends PrimitiveOp implements Operand { +public final class ResizeNearestNeighbor extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighbor} @@ -72,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResizeNearestNeighbor */ - public static ResizeNearestNeighbor create(Scope scope, Operand images, Operand size, Options... options) { + public static ResizeNearestNeighbor create(Scope scope, Operand images, Operand size, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeNearestNeighbor", scope.makeOpName("ResizeNearestNeighbor")); opBuilder.addInput(images.asOutput()); opBuilder.addInput(size.asOutput()); 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 7e2e0132acf..d61ff251300 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 @@ -23,13 +23,16 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradient of nearest neighbor interpolation. * * @param data type for {@code output()} output */ -public final class ResizeNearestNeighborGrad extends PrimitiveOp implements Operand { +public final class ResizeNearestNeighborGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.image.ResizeNearestNeighborGrad} @@ -70,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResizeNearestNeighborGrad */ - public static ResizeNearestNeighborGrad create(Scope scope, Operand grads, Operand size, Options... options) { + public static ResizeNearestNeighborGrad create(Scope scope, Operand grads, Operand size, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResizeNearestNeighborGrad", scope.makeOpName("ResizeNearestNeighborGrad")); opBuilder.addInput(grads.asOutput()); opBuilder.addInput(size.asOutput()); 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 1242eb3e345..4b1b90db689 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Converts one or more images from RGB to HSV. @@ -39,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator(group = "image") -public final class RgbToHsv extends PrimitiveOp implements Operand { +public final class RgbToHsv extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RgbToHsv operation. @@ -48,7 +50,7 @@ public final class RgbToHsv extends PrimitiveOp implements Ope * @param images 1-D or higher rank. RGB data to convert. Last dimension must be size 3. * @return a new instance of RgbToHsv */ - public static RgbToHsv create(Scope scope, Operand images) { + public static RgbToHsv create(Scope scope, Operand images) { OperationBuilder opBuilder = scope.env().opBuilder("RGBToHSV", scope.makeOpName("RgbToHsv")); opBuilder.addInput(images.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 d6ce5294ea7..d7e8b634797 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Generate a single randomly distorted bounding box for an image. @@ -69,7 +72,7 @@ * @param data type for {@code begin()} output */ @Operator(group = "image") -public final class SampleDistortedBoundingBox extends PrimitiveOp { +public final class SampleDistortedBoundingBox extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.image.SampleDistortedBoundingBox} @@ -157,7 +160,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SampleDistortedBoundingBox */ - public static SampleDistortedBoundingBox create(Scope scope, Operand imageSize, Operand boundingBoxes, Operand minObjectCovered, Options... options) { + 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()); @@ -266,13 +269,13 @@ public Output size() { * 3-D with shape `[1, 1, 4]` containing the distorted bounding box. * Provide as input to `tf.image.draw_bounding_boxes`. */ - public Output bboxes() { + public Output bboxes() { return bboxes; } private Output begin; private Output size; - private Output bboxes; + private Output bboxes; private SampleDistortedBoundingBox(Operation operation) { super(operation); 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 1735129f05a..877e5389789 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Decode web-safe base64-encoded strings. @@ -32,7 +33,7 @@ * Web-safe means that input must use - and _ instead of + and /. */ @Operator(group = "io") -public final class DecodeBase64 extends PrimitiveOp implements Operand { +public final class DecodeBase64 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DecodeBase64 operation. @@ -41,7 +42,7 @@ public final class DecodeBase64 extends PrimitiveOp implements Operand { * @param input Base64 strings to decode. * @return a new instance of DecodeBase64 */ - public static DecodeBase64 create(Scope scope, Operand input) { + public static DecodeBase64 create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeBase64", scope.makeOpName("DecodeBase64")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -51,16 +52,16 @@ public static DecodeBase64 create(Scope scope, Operand input) { /** * Decoded strings. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private DecodeBase64(Operation operation) { super(operation); 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 a2efaa23b26..0b9d35dfda7 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Decompress strings. @@ -36,7 +37,7 @@ * element in `bytes`. */ @Operator(group = "io") -public final class DecodeCompressed extends PrimitiveOp implements Operand { +public final class DecodeCompressed extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.DecodeCompressed} @@ -66,7 +67,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodeCompressed */ - public static DecodeCompressed create(Scope scope, Operand bytes, Options... options) { + public static DecodeCompressed create(Scope scope, Operand bytes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeCompressed", scope.makeOpName("DecodeCompressed")); opBuilder.addInput(bytes.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -92,16 +93,16 @@ public static Options compressionType(String compressionType) { * A Tensor with the same shape as input `bytes`, uncompressed * from bytes. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private DecodeCompressed(Operation operation) { super(operation); 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 2ae30d27060..abf4523fceb 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 @@ -28,6 +28,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Convert CSV records to tensors. Each column maps to one tensor. @@ -37,7 +39,7 @@ * Note that we allow leading and trailing spaces with int or float field. */ @Operator(group = "io") -public final class DecodeCsv extends PrimitiveOp implements Iterable> { +public final class DecodeCsv extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.io.DecodeCsv} @@ -99,7 +101,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodeCsv */ - public static DecodeCsv create(Scope scope, Operand records, Iterable> recordDefaults, Options... options) { + 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)); @@ -166,7 +168,7 @@ public List> output() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) output.iterator(); } 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 4275a7c9e2b..12dddb4ac89 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Convert JSON-encoded Example records to binary protocol buffer strings. @@ -36,7 +37,7 @@ * Example-parsing ops. */ @Operator(group = "io") -public final class DecodeJsonExample extends PrimitiveOp implements Operand { +public final class DecodeJsonExample extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DecodeJsonExample operation. @@ -46,7 +47,7 @@ public final class DecodeJsonExample extends PrimitiveOp implements Operand jsonExamples) { + public static DecodeJsonExample create(Scope scope, Operand jsonExamples) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeJSONExample", scope.makeOpName("DecodeJsonExample")); opBuilder.addInput(jsonExamples.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -57,16 +58,16 @@ public static DecodeJsonExample create(Scope scope, Operand jsonExamples * Each string is a binary Example protocol buffer corresponding * to the respective element of `json_examples`. */ - public Output binaryExamples() { + public Output binaryExamples() { return binaryExamples; } @Override - public Output asOutput() { + public Output asOutput() { return binaryExamples; } - private Output binaryExamples; + private Output binaryExamples; private DecodeJsonExample(Operation operation) { super(operation); 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 2329c9109b0..7830dbf750e 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Reinterpret the bytes of a string as a vector of numbers. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "io") -public final class DecodeRaw extends PrimitiveOp implements Operand { +public final class DecodeRaw extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.DecodeRaw} @@ -64,11 +66,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DecodeRaw */ - public static DecodeRaw create(Scope scope, Operand bytes, Class outType, Options... options) { + public static DecodeRaw create(Scope scope, Operand bytes, DataType outType, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("DecodeRaw", scope.makeOpName("DecodeRaw")); opBuilder.addInput(bytes.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); if (options != null) { for (Options opts : options) { if (opts.littleEndian != null) { 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 07297007db8..559fe600908 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Deserialize and concatenate `SparseTensors` from a serialized minibatch. @@ -74,7 +77,7 @@ * @param data type for {@code sparseValues()} output */ @Operator(group = "io") -public final class DeserializeManySparse extends PrimitiveOp { +public final class DeserializeManySparse extends PrimitiveOp { /** * Factory method to create a class wrapping a new DeserializeManySparse operation. @@ -85,17 +88,17 @@ public final class DeserializeManySparse extends PrimitiveOp { * @param dtype The `dtype` of the serialized `SparseTensor` objects. * @return a new instance of DeserializeManySparse */ - public static DeserializeManySparse create(Scope scope, Operand serializedSparse, Class dtype) { + public static DeserializeManySparse create(Scope scope, Operand serializedSparse, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("DeserializeManySparse", scope.makeOpName("DeserializeManySparse")); opBuilder.addInput(serializedSparse.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new DeserializeManySparse(opBuilder.build()); } /** */ - public Output sparseIndices() { + public Output sparseIndices() { return sparseIndices; } @@ -107,13 +110,13 @@ public Output sparseValues() { /** */ - public Output sparseShape() { + public Output sparseShape() { return sparseShape; } - private Output sparseIndices; + private Output sparseIndices; private Output sparseValues; - private Output sparseShape; + private Output sparseShape; private DeserializeManySparse(Operation operation) { super(operation); 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 535d8eaafe3..dea9bd16f15 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Encode strings into web-safe base64 format. @@ -36,7 +37,7 @@ * Web-safe means that the encoder uses - and _ instead of + and /. */ @Operator(group = "io") -public final class EncodeBase64 extends PrimitiveOp implements Operand { +public final class EncodeBase64 extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.EncodeBase64} @@ -65,7 +66,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of EncodeBase64 */ - public static EncodeBase64 create(Scope scope, Operand input, Options... options) { + public static EncodeBase64 create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("EncodeBase64", scope.makeOpName("EncodeBase64")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -89,16 +90,16 @@ public static Options pad(Boolean pad) { /** * Input strings encoded in base64. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private EncodeBase64(Operation operation) { super(operation); 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 1529c05eea2..0c68198670b 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 @@ -23,16 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A queue that produces elements in first-in first-out order. */ @Operator(group = "io") -public final class FifoQueue extends PrimitiveOp implements Operand { +public final class FifoQueue extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.FifoQueue} @@ -94,12 +95,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FifoQueue */ - public static FifoQueue create(Scope scope, List> componentTypes, Options... options) { + public static FifoQueue create(Scope scope, List> componentTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FIFOQueueV2", scope.makeOpName("FifoQueue")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] componentTypesArray = new DataType[componentTypes.size()]; for (int i = 0; i < componentTypesArray.length; ++i) { - componentTypesArray[i] = DataType.fromClass(componentTypes.get(i)); + componentTypesArray[i] = componentTypes.get(i); } opBuilder.setAttr("component_types", componentTypesArray); if (options != null) { @@ -168,8 +169,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 9463c62ad09..0bdac7ceb31 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * A Reader that outputs fixed-length records from a file. */ @Operator(group = "io") -public final class FixedLengthRecordReader extends PrimitiveOp implements Operand { +public final class FixedLengthRecordReader extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.FixedLengthRecordReader} @@ -191,8 +192,8 @@ public Output readerHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) readerHandle; + public Output asOutput() { + return (Output) readerHandle; } private Output readerHandle; 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 53d23fa6b92..8a137a87c7b 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * A Reader that outputs the queued work as both the key and value. @@ -32,7 +33,7 @@ * work string and output (work, work). */ @Operator(group = "io") -public final class IdentityReader extends PrimitiveOp implements Operand { +public final class IdentityReader extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.IdentityReader} @@ -112,8 +113,8 @@ public Output readerHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) readerHandle; + public Output asOutput() { + return (Output) readerHandle; } private Output readerHandle; 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 ff75fd28ccf..5efe9c8b5ea 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * A Reader that outputs the records from a LMDB file. */ @Operator(group = "io") -public final class LmdbReader extends PrimitiveOp implements Operand { +public final class LmdbReader extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.LmdbReader} @@ -103,16 +104,16 @@ public static Options sharedName(String sharedName) { /** * The handle to reference the Reader. */ - public Output readerHandle() { + public Output readerHandle() { return readerHandle; } @Override - public Output asOutput() { + public Output asOutput() { return readerHandle; } - private Output readerHandle; + private Output readerHandle; private LmdbReader(Operation operation) { super(operation); 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 5bf2e9b28e2..2b13bd69943 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Returns the set of files matching one or more glob patterns. @@ -33,7 +34,7 @@ * Note also that the order of filenames returned is deterministic. */ @Operator(group = "io") -public final class MatchingFiles extends PrimitiveOp implements Operand { +public final class MatchingFiles extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MatchingFiles operation. @@ -42,7 +43,7 @@ public final class MatchingFiles extends PrimitiveOp implements Operand * @param pattern Shell wildcard pattern(s). Scalar or vector of type string. * @return a new instance of MatchingFiles */ - public static MatchingFiles create(Scope scope, Operand pattern) { + public static MatchingFiles create(Scope scope, Operand pattern) { OperationBuilder opBuilder = scope.env().opBuilder("MatchingFiles", scope.makeOpName("MatchingFiles")); opBuilder.addInput(pattern.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -52,16 +53,16 @@ public static MatchingFiles create(Scope scope, Operand pattern) { /** * A vector of matching filenames. */ - public Output filenames() { + public Output filenames() { return filenames; } @Override - public Output asOutput() { + public Output asOutput() { return filenames; } - private Output filenames; + private Output filenames; private MatchingFiles(Operation operation) { super(operation); 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 6b46baece02..885123951a6 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 @@ -23,10 +23,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A queue that produces elements in first-in first-out order. @@ -36,7 +37,7 @@ * size of any given element in the minibatch. See below for details. */ @Operator(group = "io") -public final class PaddingFifoQueue extends PrimitiveOp implements Operand { +public final class PaddingFifoQueue extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.PaddingFifoQueue} @@ -102,12 +103,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of PaddingFifoQueue */ - public static PaddingFifoQueue create(Scope scope, List> componentTypes, Options... options) { + public static PaddingFifoQueue create(Scope scope, List> componentTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PaddingFIFOQueueV2", scope.makeOpName("PaddingFifoQueue")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] componentTypesArray = new DataType[componentTypes.size()]; for (int i = 0; i < componentTypesArray.length; ++i) { - componentTypesArray[i] = DataType.fromClass(componentTypes.get(i)); + componentTypesArray[i] = componentTypes.get(i); } opBuilder.setAttr("component_types", componentTypesArray); if (options != null) { @@ -180,8 +181,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 9b6a1cf38cc..5fa13a134a0 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 @@ -24,11 +24,13 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Transforms a vector of brain.Example protos (as strings) into typed tensors. @@ -81,7 +83,7 @@ public final class ParseExample extends PrimitiveOp { * scalar element along the second dimension. * @return a new instance of ParseExample */ - public static ParseExample create(Scope scope, Operand serialized, Operand names, Iterable> sparseKeys, Iterable> denseKeys, Iterable> denseDefaults, List> sparseTypes, List denseShapes) { + public static ParseExample create(Scope scope, Operand serialized, Operand names, Iterable> sparseKeys, Iterable> denseKeys, Iterable> denseDefaults, List> sparseTypes, List denseShapes) { OperationBuilder opBuilder = scope.env().opBuilder("ParseExample", scope.makeOpName("ParseExample")); opBuilder.addInput(serialized.asOutput()); opBuilder.addInput(names.asOutput()); @@ -91,7 +93,7 @@ public static ParseExample create(Scope scope, Operand serialized, Opera opBuilder = scope.applyControlDependencies(opBuilder); DataType[] sparseTypesArray = new DataType[sparseTypes.size()]; for (int i = 0; i < sparseTypesArray.length; ++i) { - sparseTypesArray[i] = DataType.fromClass(sparseTypes.get(i)); + sparseTypesArray[i] = sparseTypes.get(i); } opBuilder.setAttr("sparse_types", sparseTypesArray); Shape[] denseShapesArray = new Shape[denseShapes.size()]; @@ -104,7 +106,7 @@ public static ParseExample create(Scope scope, Operand serialized, Opera /** */ - public List> sparseIndices() { + public List> sparseIndices() { return sparseIndices; } @@ -116,7 +118,7 @@ public List> sparseValues() { /** */ - public List> sparseShapes() { + public List> sparseShapes() { return sparseShapes; } @@ -126,9 +128,9 @@ public List> denseValues() { return denseValues; } - private List> sparseIndices; + private List> sparseIndices; private List> sparseValues; - private List> sparseShapes; + private List> sparseShapes; private List> denseValues; @SuppressWarnings("unchecked") @@ -136,13 +138,13 @@ private ParseExample(Operation operation) { super(operation); int outputIdx = 0; int sparseIndicesLength = operation.outputListLength("sparse_indices"); - sparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, sparseIndicesLength)); + 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)); + sparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, sparseShapesLength)); outputIdx += sparseShapesLength; int denseValuesLength = operation.outputListLength("dense_values"); denseValues = Arrays.asList(operation.outputList(outputIdx, denseValuesLength)); 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 51a94226e10..b8f86055912 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 @@ -24,11 +24,13 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Transforms a vector of brain.SequenceExample protos (as strings) into typed tensors. @@ -154,7 +156,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ParseSequenceExample */ - public static ParseSequenceExample create(Scope scope, Operand serialized, Operand debugName, Iterable> contextDenseDefaults, List featureListDenseMissingAssumedEmpty, List contextSparseKeys, List contextDenseKeys, List featureListSparseKeys, List featureListDenseKeys, List> contextSparseTypes, List> featureListDenseTypes, List> featureListSparseTypes, Options... options) { + public static ParseSequenceExample create(Scope scope, Operand serialized, Operand debugName, Iterable> contextDenseDefaults, List featureListDenseMissingAssumedEmpty, List contextSparseKeys, List contextDenseKeys, List featureListSparseKeys, List featureListDenseKeys, List> contextSparseTypes, List> featureListDenseTypes, List> featureListSparseTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ParseSequenceExample", scope.makeOpName("ParseSequenceExample")); opBuilder.addInput(serialized.asOutput()); opBuilder.addInput(debugName.asOutput()); @@ -187,17 +189,17 @@ public static ParseSequenceExample create(Scope scope, Operand serialize opBuilder.setAttr("feature_list_dense_keys", featureListDenseKeysArray); DataType[] contextSparseTypesArray = new DataType[contextSparseTypes.size()]; for (int i = 0; i < contextSparseTypesArray.length; ++i) { - contextSparseTypesArray[i] = DataType.fromClass(contextSparseTypes.get(i)); + contextSparseTypesArray[i] = contextSparseTypes.get(i); } opBuilder.setAttr("context_sparse_types", contextSparseTypesArray); DataType[] featureListDenseTypesArray = new DataType[featureListDenseTypes.size()]; for (int i = 0; i < featureListDenseTypesArray.length; ++i) { - featureListDenseTypesArray[i] = DataType.fromClass(featureListDenseTypes.get(i)); + featureListDenseTypesArray[i] = featureListDenseTypes.get(i); } opBuilder.setAttr("feature_list_dense_types", featureListDenseTypesArray); DataType[] featureListSparseTypesArray = new DataType[featureListSparseTypes.size()]; for (int i = 0; i < featureListSparseTypesArray.length; ++i) { - featureListSparseTypesArray[i] = DataType.fromClass(featureListSparseTypes.get(i)); + featureListSparseTypesArray[i] = featureListSparseTypes.get(i); } opBuilder.setAttr("feature_list_sparse_types", featureListSparseTypesArray); if (options != null) { @@ -285,7 +287,7 @@ public static Options featureListDenseShapes(List featureListDenseShapes) /** */ - public List> contextSparseIndices() { + public List> contextSparseIndices() { return contextSparseIndices; } @@ -297,7 +299,7 @@ public List> contextSparseValues() { /** */ - public List> contextSparseShapes() { + public List> contextSparseShapes() { return contextSparseShapes; } @@ -309,7 +311,7 @@ public List> contextDenseValues() { /** */ - public List> featureListSparseIndices() { + public List> featureListSparseIndices() { return featureListSparseIndices; } @@ -321,7 +323,7 @@ public List> featureListSparseValues() { /** */ - public List> featureListSparseShapes() { + public List> featureListSparseShapes() { return featureListSparseShapes; } @@ -333,50 +335,50 @@ public List> featureListDenseValues() { /** */ - public List> featureListDenseLengths() { + public List> featureListDenseLengths() { return featureListDenseLengths; } - private List> contextSparseIndices; + private List> contextSparseIndices; private List> contextSparseValues; - private List> contextSparseShapes; + private List> contextSparseShapes; private List> contextDenseValues; - private List> featureListSparseIndices; + private List> featureListSparseIndices; private List> featureListSparseValues; - private List> featureListSparseShapes; + private List> featureListSparseShapes; private List> featureListDenseValues; - private List> featureListDenseLengths; + private List> featureListDenseLengths; @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)); + 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)); + 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)); + 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)); + 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)); + featureListDenseLengths = Arrays.asList((Output[])operation.outputList(outputIdx, featureListDenseLengthsLength)); outputIdx += featureListDenseLengthsLength; } } 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 d1339f77d69..c4466b7bba4 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 @@ -24,11 +24,13 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Transforms a tf.Example proto (as a string) into typed tensors. @@ -72,7 +74,7 @@ public final class ParseSingleExample extends PrimitiveOp { * D1 * .... * DN, in the input. * @return a new instance of ParseSingleExample */ - public static ParseSingleExample create(Scope scope, Operand serialized, Iterable> denseDefaults, Long numSparse, List sparseKeys, List denseKeys, List> sparseTypes, List denseShapes) { + 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)); @@ -90,7 +92,7 @@ public static ParseSingleExample create(Scope scope, Operand serialized, opBuilder.setAttr("dense_keys", denseKeysArray); DataType[] sparseTypesArray = new DataType[sparseTypes.size()]; for (int i = 0; i < sparseTypesArray.length; ++i) { - sparseTypesArray[i] = DataType.fromClass(sparseTypes.get(i)); + sparseTypesArray[i] = sparseTypes.get(i); } opBuilder.setAttr("sparse_types", sparseTypesArray); Shape[] denseShapesArray = new Shape[denseShapes.size()]; @@ -103,7 +105,7 @@ public static ParseSingleExample create(Scope scope, Operand serialized, /** */ - public List> sparseIndices() { + public List> sparseIndices() { return sparseIndices; } @@ -115,7 +117,7 @@ public List> sparseValues() { /** */ - public List> sparseShapes() { + public List> sparseShapes() { return sparseShapes; } @@ -125,9 +127,9 @@ public List> denseValues() { return denseValues; } - private List> sparseIndices; + private List> sparseIndices; private List> sparseValues; - private List> sparseShapes; + private List> sparseShapes; private List> denseValues; @SuppressWarnings("unchecked") @@ -135,13 +137,13 @@ private ParseSingleExample(Operation operation) { super(operation); int outputIdx = 0; int sparseIndicesLength = operation.outputListLength("sparse_indices"); - sparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, sparseIndicesLength)); + 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)); + sparseShapes = Arrays.asList((Output[])operation.outputList(outputIdx, sparseShapesLength)); outputIdx += sparseShapesLength; int denseValuesLength = operation.outputListLength("dense_values"); denseValues = Arrays.asList(operation.outputList(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 0abc798f9cc..269706669ba 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 @@ -24,11 +24,13 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Transforms a scalar brain.SequenceExample proto (as strings) into typed tensors. @@ -118,7 +120,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ParseSingleSequenceExample */ - 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) { + 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()); @@ -131,17 +133,17 @@ public static ParseSingleSequenceExample create(Scope scope, Operand ser opBuilder = scope.applyControlDependencies(opBuilder); DataType[] contextSparseTypesArray = new DataType[contextSparseTypes.size()]; for (int i = 0; i < contextSparseTypesArray.length; ++i) { - contextSparseTypesArray[i] = DataType.fromClass(contextSparseTypes.get(i)); + contextSparseTypesArray[i] = contextSparseTypes.get(i); } opBuilder.setAttr("context_sparse_types", contextSparseTypesArray); DataType[] featureListDenseTypesArray = new DataType[featureListDenseTypes.size()]; for (int i = 0; i < featureListDenseTypesArray.length; ++i) { - featureListDenseTypesArray[i] = DataType.fromClass(featureListDenseTypes.get(i)); + featureListDenseTypesArray[i] = featureListDenseTypes.get(i); } opBuilder.setAttr("feature_list_dense_types", featureListDenseTypesArray); DataType[] featureListSparseTypesArray = new DataType[featureListSparseTypes.size()]; for (int i = 0; i < featureListSparseTypesArray.length; ++i) { - featureListSparseTypesArray[i] = DataType.fromClass(featureListSparseTypes.get(i)); + featureListSparseTypesArray[i] = featureListSparseTypes.get(i); } opBuilder.setAttr("feature_list_sparse_types", featureListSparseTypesArray); if (options != null) { @@ -189,7 +191,7 @@ public static Options featureListDenseShapes(List featureListDenseShapes) /** */ - public List> contextSparseIndices() { + public List> contextSparseIndices() { return contextSparseIndices; } @@ -201,7 +203,7 @@ public List> contextSparseValues() { /** */ - public List> contextSparseShapes() { + public List> contextSparseShapes() { return contextSparseShapes; } @@ -213,7 +215,7 @@ public List> contextDenseValues() { /** */ - public List> featureListSparseIndices() { + public List> featureListSparseIndices() { return featureListSparseIndices; } @@ -225,7 +227,7 @@ public List> featureListSparseValues() { /** */ - public List> featureListSparseShapes() { + public List> featureListSparseShapes() { return featureListSparseShapes; } @@ -235,13 +237,13 @@ public List> featureListDenseValues() { return featureListDenseValues; } - private List> contextSparseIndices; + private List> contextSparseIndices; private List> contextSparseValues; - private List> contextSparseShapes; + private List> contextSparseShapes; private List> contextDenseValues; - private List> featureListSparseIndices; + private List> featureListSparseIndices; private List> featureListSparseValues; - private List> featureListSparseShapes; + private List> featureListSparseShapes; private List> featureListDenseValues; @SuppressWarnings("unchecked") @@ -249,25 +251,25 @@ private ParseSingleSequenceExample(Operation operation) { super(operation); int outputIdx = 0; int contextSparseIndicesLength = operation.outputListLength("context_sparse_indices"); - contextSparseIndices = Arrays.asList((Output[])operation.outputList(outputIdx, contextSparseIndicesLength)); + 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)); + 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)); + 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)); + 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)); 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 93a596da2da..16f94cc290a 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Transforms a serialized tensorflow.TensorProto proto into a Tensor. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "io") -public final class ParseTensor extends PrimitiveOp implements Operand { +public final class ParseTensor extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ParseTensor operation. @@ -43,11 +45,11 @@ public final class ParseTensor extends PrimitiveOp implements Operand { * type of the serialized tensor and no implicit conversion will take place. * @return a new instance of ParseTensor */ - public static ParseTensor create(Scope scope, Operand serialized, Class outType) { + public static ParseTensor create(Scope scope, Operand serialized, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("ParseTensor", scope.makeOpName("ParseTensor")); opBuilder.addInput(serialized.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new ParseTensor(opBuilder.build()); } 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 ef26f096128..07ac425f698 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 @@ -23,10 +23,11 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A queue that produces elements sorted by the first component value. @@ -38,7 +39,7 @@ * entry in their input (resp. output) lists. */ @Operator(group = "io") -public final class PriorityQueue extends PrimitiveOp implements Operand { +public final class PriorityQueue extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.PriorityQueue} @@ -92,12 +93,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of PriorityQueue */ - public static PriorityQueue create(Scope scope, List> componentTypes, List shapes, Options... options) { + public static PriorityQueue create(Scope scope, List> componentTypes, List shapes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("PriorityQueueV2", scope.makeOpName("PriorityQueue")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] componentTypesArray = new DataType[componentTypes.size()]; for (int i = 0; i < componentTypesArray.length; ++i) { - componentTypesArray[i] = DataType.fromClass(componentTypes.get(i)); + componentTypesArray[i] = componentTypes.get(i); } opBuilder.setAttr("component_types", componentTypesArray); Shape[] shapesArray = new Shape[shapes.size()]; @@ -154,8 +155,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 872146f5846..db7972e7f37 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 @@ -28,6 +28,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Dequeues a tuple of one or more tensors from the given queue. @@ -40,7 +41,7 @@ * has been dequeued (or 'timeout_ms' elapses, if specified). */ @Operator(group = "io") -public final class QueueDequeue extends PrimitiveOp implements Iterable> { +public final class QueueDequeue extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.io.QueueDequeue} @@ -72,13 +73,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QueueDequeue */ - public static QueueDequeue create(Scope scope, Operand handle, List> componentTypes, Options... options) { + 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.applyControlDependencies(opBuilder); DataType[] componentTypesArray = new DataType[componentTypes.size()]; for (int i = 0; i < componentTypesArray.length; ++i) { - componentTypesArray[i] = DataType.fromClass(componentTypes.get(i)); + componentTypesArray[i] = componentTypes.get(i); } opBuilder.setAttr("component_types", componentTypesArray); if (options != null) { @@ -109,7 +110,7 @@ public List> components() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) components.iterator(); } 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 f65d007e41d..2113f1eb843 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 @@ -28,6 +28,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Dequeues `n` tuples of one or more tensors from the given queue. @@ -47,7 +49,7 @@ * have been dequeued (or 'timeout_ms' elapses, if specified). */ @Operator(group = "io") -public final class QueueDequeueMany extends PrimitiveOp implements Iterable> { +public final class QueueDequeueMany extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueMany} @@ -80,14 +82,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QueueDequeueMany */ - public static QueueDequeueMany create(Scope scope, Operand handle, Operand n, List> componentTypes, Options... options) { + 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()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] componentTypesArray = new DataType[componentTypes.size()]; for (int i = 0; i < componentTypesArray.length; ++i) { - componentTypesArray[i] = DataType.fromClass(componentTypes.get(i)); + componentTypesArray[i] = componentTypes.get(i); } opBuilder.setAttr("component_types", componentTypesArray); if (options != null) { @@ -118,7 +120,7 @@ public List> components() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) components.iterator(); } 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 7fe8da92f1d..cee3d8a0867 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 @@ -28,6 +28,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Dequeues `n` tuples of one or more tensors from the given queue. @@ -51,7 +53,7 @@ * component of the dequeued tuple. */ @Operator(group = "io") -public final class QueueDequeueUpTo extends PrimitiveOp implements Iterable> { +public final class QueueDequeueUpTo extends PrimitiveOp implements Iterable> { /** * Optional attributes for {@link org.tensorflow.op.io.QueueDequeueUpTo} @@ -84,14 +86,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QueueDequeueUpTo */ - public static QueueDequeueUpTo create(Scope scope, Operand handle, Operand n, List> componentTypes, Options... options) { + 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()); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] componentTypesArray = new DataType[componentTypes.size()]; for (int i = 0; i < componentTypesArray.length; ++i) { - componentTypesArray[i] = DataType.fromClass(componentTypes.get(i)); + componentTypesArray[i] = componentTypes.get(i); } opBuilder.setAttr("component_types", componentTypesArray); if (options != null) { @@ -122,7 +124,7 @@ public List> components() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) components.iterator(); } diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueIsClosed.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueIsClosed.java index 49d2d8799c1..e3adf686ee2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueIsClosed.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/io/QueueIsClosed.java @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; /** * Returns true if queue is closed. @@ -32,7 +33,7 @@ * is open. */ @Operator(group = "io") -public final class QueueIsClosed extends PrimitiveOp implements Operand { +public final class QueueIsClosed extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new QueueIsClosed operation. @@ -50,16 +51,16 @@ public static QueueIsClosed create(Scope scope, Operand handle) { /** */ - public Output isClosed() { + public Output isClosed() { return isClosed; } @Override - public Output asOutput() { + public Output asOutput() { return isClosed; } - private Output isClosed; + private Output isClosed; private QueueIsClosed(Operation operation) { super(operation); 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 de1bb35164f..06cbb0a09ea 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; /** * Computes the number of elements in the given queue. */ @Operator(group = "io") -public final class QueueSize extends PrimitiveOp implements Operand { +public final class QueueSize extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new QueueSize operation. @@ -48,16 +49,16 @@ public static QueueSize create(Scope scope, Operand handle) { /** * The number of elements in the given queue. */ - public Output size() { + public Output size() { return size; } @Override - public Output asOutput() { + public Output asOutput() { return size; } - private Output size; + private Output size; private QueueSize(Operation operation) { super(operation); 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 142cf1048b0..90f3656b292 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 @@ -23,16 +23,17 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A queue that randomizes the order of elements. */ @Operator(group = "io") -public final class RandomShuffleQueue extends PrimitiveOp implements Operand { +public final class RandomShuffleQueue extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.RandomShuffleQueue} @@ -124,12 +125,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RandomShuffleQueue */ - public static RandomShuffleQueue create(Scope scope, List> componentTypes, Options... options) { + public static RandomShuffleQueue create(Scope scope, List> componentTypes, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomShuffleQueueV2", scope.makeOpName("RandomShuffleQueue")); opBuilder = scope.applyControlDependencies(opBuilder); DataType[] componentTypesArray = new DataType[componentTypes.size()]; for (int i = 0; i < componentTypesArray.length; ++i) { - componentTypesArray[i] = DataType.fromClass(componentTypes.get(i)); + componentTypesArray[i] = componentTypes.get(i); } opBuilder.setAttr("component_types", componentTypesArray); if (options != null) { @@ -231,8 +232,8 @@ public Output handle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) handle; + public Output asOutput() { + return (Output) handle; } private Output handle; 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 ad82f5d350c..b5c7ab46ee9 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Reads and outputs the entire contents of the input filename. */ @Operator(group = "io") -public final class ReadFile extends PrimitiveOp implements Operand { +public final class ReadFile extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ReadFile operation. @@ -38,7 +39,7 @@ public final class ReadFile extends PrimitiveOp implements Operand { * @param filename * @return a new instance of ReadFile */ - public static ReadFile create(Scope scope, Operand filename) { + public static ReadFile create(Scope scope, Operand filename) { OperationBuilder opBuilder = scope.env().opBuilder("ReadFile", scope.makeOpName("ReadFile")); opBuilder.addInput(filename.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -47,16 +48,16 @@ public static ReadFile create(Scope scope, Operand filename) { /** */ - public Output contents() { + public Output contents() { return contents; } @Override - public Output asOutput() { + public Output asOutput() { return contents; } - private Output contents; + private Output contents; private ReadFile(Operation operation) { super(operation); 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 d52676c6497..e24c1d272c2 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; /** * Returns the number of records this Reader has produced. @@ -32,7 +33,7 @@ * succeeded. */ @Operator(group = "io") -public final class ReaderNumRecordsProduced extends PrimitiveOp implements Operand { +public final class ReaderNumRecordsProduced extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ReaderNumRecordsProduced operation. @@ -50,16 +51,16 @@ public static ReaderNumRecordsProduced create(Scope scope, Operand readerHand /** */ - public Output recordsProduced() { + public Output recordsProduced() { return recordsProduced; } @Override - public Output asOutput() { + public Output asOutput() { return recordsProduced; } - private Output recordsProduced; + private Output recordsProduced; private ReaderNumRecordsProduced(Operation operation) { super(operation); 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 c937e48744f..fd8b1d881df 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; /** * Returns the number of work units this Reader has finished processing. */ @Operator(group = "io") -public final class ReaderNumWorkUnitsCompleted extends PrimitiveOp implements Operand { +public final class ReaderNumWorkUnitsCompleted extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ReaderNumWorkUnitsCompleted operation. @@ -47,16 +48,16 @@ public static ReaderNumWorkUnitsCompleted create(Scope scope, Operand readerH /** */ - public Output unitsCompleted() { + public Output unitsCompleted() { return unitsCompleted; } @Override - public Output asOutput() { + public Output asOutput() { return unitsCompleted; } - private Output unitsCompleted; + private Output unitsCompleted; private ReaderNumWorkUnitsCompleted(Operation operation) { super(operation); 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 6e9cf97fec2..945ac740421 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Returns the next record (key, value pair) produced by a Reader. @@ -54,19 +55,19 @@ public static ReaderRead create(Scope scope, Operand readerHandle, Operand /** * A scalar. */ - public Output key() { + public Output key() { return key; } /** * A scalar. */ - public Output value() { + public Output value() { return value; } - private Output key; - private Output value; + private Output key; + private Output value; private ReaderRead(Operation operation) { super(operation); 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 0afbfcc587e..3257a82c8d8 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Returns up to `num_records` (key, value) pairs produced by a Reader. @@ -45,7 +47,7 @@ public final class ReaderReadUpTo extends PrimitiveOp { * @param numRecords number of records to read from `Reader`. * @return a new instance of ReaderReadUpTo */ - public static ReaderReadUpTo create(Scope scope, Operand readerHandle, Operand queueHandle, Operand numRecords) { + 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,19 +59,19 @@ public static ReaderReadUpTo create(Scope scope, Operand readerHandle, Operan /** * A 1-D tensor. */ - public Output keys() { + public Output keys() { return keys; } /** * A 1-D tensor. */ - public Output values() { + public Output values() { return values; } - private Output keys; - private Output values; + private Output keys; + private Output values; private ReaderReadUpTo(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 fdd92070de1..25a3eb00ca8 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Restore a reader to a previously saved state. @@ -42,7 +43,7 @@ public final class ReaderRestoreState extends PrimitiveOp { * matching reader_handle. * @return a new instance of ReaderRestoreState */ - public static ReaderRestoreState create(Scope scope, Operand readerHandle, Operand state) { + 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()); 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 62db1b7c293..6aa7853be9d 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Produce a string tensor that encodes the state of a Reader. @@ -32,7 +33,7 @@ * Unimplemented error. */ @Operator(group = "io") -public final class ReaderSerializeState extends PrimitiveOp implements Operand { +public final class ReaderSerializeState extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ReaderSerializeState operation. @@ -50,16 +51,16 @@ public static ReaderSerializeState create(Scope scope, Operand readerHandle) /** */ - public Output state() { + public Output state() { return state; } @Override - public Output asOutput() { + public Output asOutput() { return state; } - private Output state; + private Output state; private ReaderSerializeState(Operation operation) { super(operation); 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 a9405ce22b3..4454dd15cee 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Serialize an `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor` object. @@ -40,7 +43,7 @@ * @param data type for {@code serializedSparse()} output */ @Operator(group = "io") -public final class SerializeManySparse extends PrimitiveOp implements Operand { +public final class SerializeManySparse extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SerializeManySparse operation. @@ -53,13 +56,13 @@ public final class SerializeManySparse extends PrimitiveOp implements Operand * (default) and `variant`. * @return a new instance of SerializeManySparse */ - public static SerializeManySparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Class outType) { + public static SerializeManySparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("SerializeManySparse", scope.makeOpName("SerializeManySparse")); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); opBuilder.addInput(sparseShape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new SerializeManySparse(opBuilder.build()); } @@ -72,8 +75,8 @@ public static SerializeManySparse create(Scope scope, Operand sp * @param sparseShape 1-D. The `shape` of the minibatch `SparseTensor`. * @return a new instance of SerializeManySparse */ - public static SerializeManySparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape) { - return create(scope, sparseIndices, sparseValues, sparseShape, String.class); + public static SerializeManySparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape) { + return create(scope, sparseIndices, sparseValues, sparseShape, TString.DTYPE); } /** 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 7b584715a48..a32f6312d2f 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Serialize a `SparseTensor` into a `[3]` `Tensor` object. @@ -32,7 +35,7 @@ * @param data type for {@code serializedSparse()} output */ @Operator(group = "io") -public final class SerializeSparse extends PrimitiveOp implements Operand { +public final class SerializeSparse extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SerializeSparse operation. @@ -45,13 +48,13 @@ public final class SerializeSparse extends PrimitiveOp implements Operand * (default) and `variant`. * @return a new instance of SerializeSparse */ - public static SerializeSparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Class outType) { + public static SerializeSparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("SerializeSparse", scope.makeOpName("SerializeSparse")); opBuilder.addInput(sparseIndices.asOutput()); opBuilder.addInput(sparseValues.asOutput()); opBuilder.addInput(sparseShape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new SerializeSparse(opBuilder.build()); } @@ -64,8 +67,8 @@ public static SerializeSparse create(Scope scope, Operand sparse * @param sparseShape 1-D. The `shape` of the `SparseTensor`. * @return a new instance of SerializeSparse */ - public static SerializeSparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape) { - return create(scope, sparseIndices, sparseValues, sparseShape, String.class); + public static SerializeSparse create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape) { + return create(scope, sparseIndices, sparseValues, sparseShape, TString.DTYPE); } /** 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 490f338d6a5..e3b6cadfafa 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Transforms a Tensor into a serialized TensorProto proto. */ @Operator(group = "io") -public final class SerializeTensor extends PrimitiveOp implements Operand { +public final class SerializeTensor extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SerializeTensor operation. @@ -38,7 +40,7 @@ public final class SerializeTensor extends PrimitiveOp implements Operand SerializeTensor create(Scope scope, Operand tensor) { + public static SerializeTensor create(Scope scope, Operand tensor) { OperationBuilder opBuilder = scope.env().opBuilder("SerializeTensor", scope.makeOpName("SerializeTensor")); opBuilder.addInput(tensor.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -48,16 +50,16 @@ public static SerializeTensor create(Scope scope, Operand tensor) { /** * A serialized TensorProto proto of the input tensor. */ - public Output serialized() { + public Output serialized() { return serialized; } @Override - public Output asOutput() { + public Output asOutput() { return serialized; } - private Output serialized; + private Output serialized; private SerializeTensor(Operation operation) { super(operation); 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 d1629a79bdc..fbf18c02488 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Generate a sharded filename. The filename is printf formatted as @@ -31,7 +33,7 @@ * %s-%05d-of-%05d, basename, shard, num_shards. */ @Operator(group = "io") -public final class ShardedFilename extends PrimitiveOp implements Operand { +public final class ShardedFilename extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ShardedFilename operation. @@ -42,7 +44,7 @@ public final class ShardedFilename extends PrimitiveOp implements Operand basename, Operand shard, Operand numShards) { + 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()); @@ -53,16 +55,16 @@ public static ShardedFilename create(Scope scope, Operand basename, Oper /** */ - public Output filename() { + public Output filename() { return filename; } @Override - public Output asOutput() { + public Output asOutput() { return filename; } - private Output filename; + private Output filename; private ShardedFilename(Operation operation) { super(operation); 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 da5d6d2c289..635fee0374a 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Generate a glob pattern matching all sharded file names. */ @Operator(group = "io") -public final class ShardedFilespec extends PrimitiveOp implements Operand { +public final class ShardedFilespec extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ShardedFilespec operation. @@ -39,7 +41,7 @@ public final class ShardedFilespec extends PrimitiveOp implements Operand basename, Operand numShards) { + 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()); @@ -49,16 +51,16 @@ public static ShardedFilespec create(Scope scope, Operand basename, Oper /** */ - public Output filename() { + public Output filename() { return filename; } @Override - public Output asOutput() { + public Output asOutput() { return filename; } - private Output filename; + private Output filename; private ShardedFilespec(Operation operation) { super(operation); 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 4aac8c653ae..df0deab98af 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * A Reader that outputs the lines of a file delimited by '\n'. */ @Operator(group = "io") -public final class TextLineReader extends PrimitiveOp implements Operand { +public final class TextLineReader extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.TextLineReader} @@ -128,8 +129,8 @@ public Output readerHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) readerHandle; + public Output asOutput() { + return (Output) readerHandle; } private Output readerHandle; 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 694ab805a9f..0cc44725cbd 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * A Reader that outputs the records from a TensorFlow Records file. */ @Operator(group = "io") -public final class TfRecordReader extends PrimitiveOp implements Operand { +public final class TfRecordReader extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.TfRecordReader} @@ -128,8 +129,8 @@ public Output readerHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) readerHandle; + public Output asOutput() { + return (Output) readerHandle; } private Output readerHandle; 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 5b04001cec8..002708cee8d 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * A Reader that outputs the entire contents of a file as a value. @@ -32,7 +33,7 @@ * be a filename (key) and the contents of that file (value). */ @Operator(group = "io") -public final class WholeFileReader extends PrimitiveOp implements Operand { +public final class WholeFileReader extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.io.WholeFileReader} @@ -112,8 +113,8 @@ public Output readerHandle() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) readerHandle; + public Output asOutput() { + return (Output) readerHandle; } private Output readerHandle; 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 7d93e9b5cb4..e4c10a37e74 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Writes contents to the file at input filename. Creates file and recursively @@ -40,7 +41,7 @@ public final class WriteFile extends PrimitiveOp { * @param contents scalar. The content to be written to the output file. * @return a new instance of WriteFile */ - public static WriteFile create(Scope scope, Operand filename, Operand contents) { + 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()); 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 59dc633cdb7..56d5a70adf9 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Copy a tensor setting everything outside a central band in each innermost matrix @@ -69,7 +71,7 @@ * @param data type for {@code band()} output */ @Operator(group = "linalg") -public final class BandPart extends PrimitiveOp implements Operand { +public final class BandPart extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BandPart operation. @@ -82,7 +84,7 @@ public final class BandPart extends PrimitiveOp implements Operand { * entire upper triangle. * @return a new instance of BandPart */ - public static BandPart create(Scope scope, Operand input, Operand numLower, Operand numUpper) { + 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()); 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 e0751817605..b957a36bf65 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchCholesky extends PrimitiveOp implements Operand { +public final class BatchCholesky extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchCholesky operation. @@ -38,7 +40,7 @@ public final class BatchCholesky extends PrimitiveOp implement * @param input * @return a new instance of BatchCholesky */ - public static BatchCholesky create(Scope scope, Operand input) { + public static BatchCholesky create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchCholesky", scope.makeOpName("BatchCholesky")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 a36f37ddc75..44fbb5b5e0f 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchCholeskyGrad extends PrimitiveOp implements Operand { +public final class BatchCholeskyGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchCholeskyGrad operation. @@ -39,7 +41,7 @@ public final class BatchCholeskyGrad extends PrimitiveOp imple * @param grad * @return a new instance of BatchCholeskyGrad */ - public static BatchCholeskyGrad create(Scope scope, Operand l, Operand grad) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatMul.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatMul.java index 93192f31e4a..bb1260257dc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatMul.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/BatchMatMul.java @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Multiplies slices of two tensors in batches. @@ -50,7 +51,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchMatMul extends PrimitiveOp implements Operand { +public final class BatchMatMul extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatMul} @@ -89,7 +90,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BatchMatMul */ - public static BatchMatMul create(Scope scope, Operand x, Operand y, Options... options) { + public static BatchMatMul create(Scope scope, Operand x, Operand y, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatMul", scope.makeOpName("BatchMatMul")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); 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 03cc5e2b45f..edd1c1354ce 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * @param data type for {@code band()} output */ @Operator(group = "linalg") -public final class BatchMatrixBandPart extends PrimitiveOp implements Operand { +public final class BatchMatrixBandPart extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchMatrixBandPart operation. @@ -40,7 +42,7 @@ public final class BatchMatrixBandPart extends PrimitiveOp implements Operand * @param numUpper * @return a new instance of BatchMatrixBandPart */ - public static BatchMatrixBandPart create(Scope scope, Operand input, Operand numLower, Operand numUpper) { + 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()); 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 920ebcbd5ad..59140a778e9 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchMatrixDeterminant extends PrimitiveOp implements Operand { +public final class BatchMatrixDeterminant extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchMatrixDeterminant operation. @@ -38,7 +39,7 @@ public final class BatchMatrixDeterminant extends PrimitiveOp implements Oper * @param input * @return a new instance of BatchMatrixDeterminant */ - public static BatchMatrixDeterminant create(Scope scope, Operand input) { + public static BatchMatrixDeterminant create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixDeterminant", scope.makeOpName("BatchMatrixDeterminant")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 6e1931fb278..5d4d4ca5e34 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchMatrixDiag extends PrimitiveOp implements Operand { +public final class BatchMatrixDiag extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchMatrixDiag operation. @@ -38,7 +39,7 @@ public final class BatchMatrixDiag extends PrimitiveOp implements Operand * @param diagonal * @return a new instance of BatchMatrixDiag */ - public static BatchMatrixDiag create(Scope scope, Operand diagonal) { + public static BatchMatrixDiag create(Scope scope, Operand diagonal) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixDiag", scope.makeOpName("BatchMatrixDiag")); opBuilder.addInput(diagonal.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 73e684c5dcd..9028f3774e5 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * @param data type for {@code diagonal()} output */ @Operator(group = "linalg") -public final class BatchMatrixDiagPart extends PrimitiveOp implements Operand { +public final class BatchMatrixDiagPart extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchMatrixDiagPart operation. @@ -38,7 +39,7 @@ public final class BatchMatrixDiagPart extends PrimitiveOp implements Operand * @param input * @return a new instance of BatchMatrixDiagPart */ - public static BatchMatrixDiagPart create(Scope scope, Operand input) { + public static BatchMatrixDiagPart create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("BatchMatrixDiagPart", scope.makeOpName("BatchMatrixDiagPart")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 d89f765207d..a2e2b91d4e1 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchMatrixInverse extends PrimitiveOp implements Operand { +public final class BatchMatrixInverse extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixInverse} @@ -58,7 +60,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BatchMatrixInverse */ - public static BatchMatrixInverse create(Scope scope, Operand input, Options... options) { + 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.applyControlDependencies(opBuilder); 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 373e6f8ba0d..eaaabb2b4c8 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchMatrixSetDiag extends PrimitiveOp implements Operand { +public final class BatchMatrixSetDiag extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchMatrixSetDiag operation. @@ -39,7 +40,7 @@ public final class BatchMatrixSetDiag extends PrimitiveOp implements Operand< * @param diagonal * @return a new instance of BatchMatrixSetDiag */ - public static BatchMatrixSetDiag create(Scope scope, Operand input, Operand diagonal) { + 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()); 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 ac76cf71c26..9841d221028 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchMatrixSolve extends PrimitiveOp implements Operand { +public final class BatchMatrixSolve extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolve} @@ -59,7 +61,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BatchMatrixSolve */ - public static BatchMatrixSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { + 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()); 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 c3003c67e8d..a3ca26b2cd1 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 @@ -24,12 +24,15 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchMatrixSolveLs extends PrimitiveOp implements Operand { +public final class BatchMatrixSolveLs extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixSolveLs} @@ -60,7 +63,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BatchMatrixSolveLs */ - public static BatchMatrixSolveLs create(Scope scope, Operand matrix, Operand rhs, Operand l2Regularizer, Options... options) { + 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()); 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 49d0ac3df43..d8ad94c9757 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class BatchMatrixTriangularSolve extends PrimitiveOp implements Operand { +public final class BatchMatrixTriangularSolve extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.BatchMatrixTriangularSolve} @@ -68,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BatchMatrixTriangularSolve */ - public static BatchMatrixTriangularSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { + 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()); 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 2fedef05941..9bb3238b6eb 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * @param data type for {@code e()} output */ @Operator(group = "linalg") -public final class BatchSelfAdjointEig extends PrimitiveOp { +public final class BatchSelfAdjointEig extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.linalg.BatchSelfAdjointEig} @@ -58,7 +60,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BatchSelfAdjointEig */ - public static BatchSelfAdjointEig create(Scope scope, Operand input, Options... options) { + 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.applyControlDependencies(opBuilder); 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 44f6f3ddd21..63c2fbfd9d9 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * @param data type for {@code s()} output */ @Operator(group = "linalg") -public final class BatchSvd extends PrimitiveOp { +public final class BatchSvd extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.linalg.BatchSvd} @@ -67,7 +68,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BatchSvd */ - public static BatchSvd create(Scope scope, Operand input, Options... options) { + 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.applyControlDependencies(opBuilder); 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 a9dfac5eb9c..a23cf0a238e 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the Cholesky decomposition of one or more square matrices. @@ -45,7 +46,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class Cholesky extends PrimitiveOp implements Operand { +public final class Cholesky extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Cholesky operation. @@ -54,7 +55,7 @@ public final class Cholesky extends PrimitiveOp implements Operand { * @param input Shape is `[..., M, M]`. * @return a new instance of Cholesky */ - public static Cholesky create(Scope scope, Operand input) { + public static Cholesky create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Cholesky", scope.makeOpName("Cholesky")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 1f979fd7186..bf1c436e76b 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the reverse mode backpropagated gradient of the Cholesky algorithm. @@ -34,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class CholeskyGrad extends PrimitiveOp implements Operand { +public final class CholeskyGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CholeskyGrad operation. @@ -48,7 +50,7 @@ public final class CholeskyGrad extends PrimitiveOp implements * this tensor. * @return a new instance of CholeskyGrad */ - public static CholeskyGrad create(Scope scope, Operand l, Operand grad) { + 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()); 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 06565abc2e3..cce6d28ba8c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Shuffle dimensions of x according to a permutation and conjugate the result. @@ -35,7 +37,7 @@ * @param data type for {@code y()} output */ @Operator(group = "linalg") -public final class ConjugateTranspose extends PrimitiveOp implements Operand { +public final class ConjugateTranspose extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ConjugateTranspose operation. @@ -45,7 +47,7 @@ public final class ConjugateTranspose extends PrimitiveOp implements Operand< * @param perm * @return a new instance of ConjugateTranspose */ - public static ConjugateTranspose create(Scope scope, Operand x, Operand perm) { + 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()); 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 70cfeb6e7e9..15f1a4fd839 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Compute the pairwise cross product. @@ -35,7 +37,7 @@ * @param data type for {@code product()} output */ @Operator(group = "linalg") -public final class Cross extends PrimitiveOp implements Operand { +public final class Cross extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Cross operation. @@ -45,7 +47,7 @@ public final class Cross extends PrimitiveOp implements Operan * @param b Another tensor, of same type and shape as `a`. * @return a new instance of Cross */ - public static Cross create(Scope scope, Operand a, Operand b) { + 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()); 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 d0a60453e07..ea085ff3be8 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the determinant of one or more square matrices. @@ -35,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class Det extends PrimitiveOp implements Operand { +public final class Det extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Det operation. @@ -44,7 +45,7 @@ public final class Det extends PrimitiveOp implements Operand { * @param input Shape is `[..., M, M]`. * @return a new instance of Det */ - public static Det create(Scope scope, Operand input) { + public static Det create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDeterminant", scope.makeOpName("Det")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Diag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Diag.java index 6159b185349..c4a2f77d64f 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Diag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/Diag.java @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns a batched diagonal tensor with a given batched diagonal values. @@ -58,7 +59,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class Diag extends PrimitiveOp implements Operand { +public final class Diag extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Diag operation. @@ -67,7 +68,7 @@ public final class Diag extends PrimitiveOp implements Operand { * @param diagonal Rank `k`, where `k >= 1`. * @return a new instance of Diag */ - public static Diag create(Scope scope, Operand diagonal) { + public static Diag create(Scope scope, Operand diagonal) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiag", scope.makeOpName("Diag")); opBuilder.addInput(diagonal.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/DiagPart.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/DiagPart.java index 100dba246c4..509e0adba5a 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/DiagPart.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/DiagPart.java @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns the batched diagonal part of a batched tensor. @@ -60,7 +61,7 @@ * @param data type for {@code diagonal()} output */ @Operator(group = "linalg") -public final class DiagPart extends PrimitiveOp implements Operand { +public final class DiagPart extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DiagPart operation. @@ -69,7 +70,7 @@ public final class DiagPart extends PrimitiveOp implements Operand { * @param input Rank `k` tensor where `k >= 2`. * @return a new instance of DiagPart */ - public static DiagPart create(Scope scope, Operand input) { + public static DiagPart create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixDiagPart", scope.makeOpName("DiagPart")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 6a8f751956c..74e71aad25f 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the inverse of one or more square invertible matrices or their @@ -43,7 +44,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class Inv extends PrimitiveOp implements Operand { +public final class Inv extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.Inv} @@ -72,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Inv */ - public static Inv create(Scope scope, Operand input, Options... options) { + public static Inv create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixInverse", scope.makeOpName("Inv")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 6643022a7de..44c72b00d49 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Loads a 2-D (matrix) `Tensor` with name `old_tensor_name` from the checkpoint @@ -70,7 +73,7 @@ * [0.25, -0.25, 42]] */ @Operator(group = "linalg") -public final class LoadAndRemapMatrix extends PrimitiveOp implements Operand { +public final class LoadAndRemapMatrix extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.LoadAndRemapMatrix} @@ -115,7 +118,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LoadAndRemapMatrix */ - public static LoadAndRemapMatrix create(Scope scope, Operand ckptPath, Operand oldTensorName, Operand rowRemapping, Operand colRemapping, Operand initializingValues, Long numRows, Long numCols, Options... options) { + 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()); @@ -148,16 +151,16 @@ public static Options maxRowsInMemory(Long maxRowsInMemory) { * Output matrix containing existing values loaded from the * checkpoint, and with any missing values filled in from initializing_values. */ - public Output outputMatrix() { + public Output outputMatrix() { return outputMatrix; } @Override - public Output asOutput() { + public Output asOutput() { return outputMatrix; } - private Output outputMatrix; + private Output outputMatrix; private LoadAndRemapMatrix(Operation operation) { super(operation); 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 c82abd696b5..a39c0942a24 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the sign and the log of the absolute value of the determinant of @@ -41,7 +42,7 @@ * @param data type for {@code sign()} output */ @Operator(group = "linalg") -public final class LogMatrixDeterminant extends PrimitiveOp { +public final class LogMatrixDeterminant extends PrimitiveOp { /** * Factory method to create a class wrapping a new LogMatrixDeterminant operation. @@ -50,7 +51,7 @@ public final class LogMatrixDeterminant extends PrimitiveOp { * @param input Shape is `[N, M, M]`. * @return a new instance of LogMatrixDeterminant */ - public static LogMatrixDeterminant create(Scope scope, Operand input) { + public static LogMatrixDeterminant create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("LogMatrixDeterminant", scope.makeOpName("LogMatrixDeterminant")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 fdf59686f39..44eddb9feb0 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Multiply the matrix "a" by the matrix "b". @@ -39,7 +40,7 @@ * @param data type for {@code product()} output */ @Operator(group = "linalg") -public final class MatMul extends PrimitiveOp implements Operand { +public final class MatMul extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.MatMul} @@ -78,7 +79,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MatMul */ - public static MatMul create(Scope scope, Operand a, Operand b, Options... options) { + 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()); 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 9171c78147a..d339bb31800 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Computes the matrix logarithm of one or more square matrices: @@ -45,7 +46,7 @@ * * @param data type for {@code output()} output */ -public final class MatrixLogarithm extends PrimitiveOp implements Operand { +public final class MatrixLogarithm extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MatrixLogarithm operation. @@ -54,7 +55,7 @@ public final class MatrixLogarithm extends PrimitiveOp implements Operand * @param input Shape is `[..., M, M]`. * @return a new instance of MatrixLogarithm */ - public static MatrixLogarithm create(Scope scope, Operand input) { + public static MatrixLogarithm create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixLogarithm", scope.makeOpName("MatrixLogarithm")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 10ed9f76b12..6533ccc8c13 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.family.TType; /** * Solves one or more linear least-squares problems. @@ -66,7 +68,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class MatrixSolveLs extends PrimitiveOp implements Operand { +public final class MatrixSolveLs extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.MatrixSolveLs} @@ -101,7 +103,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MatrixSolveLs */ - public static MatrixSolveLs create(Scope scope, Operand matrix, Operand rhs, Operand l2Regularizer, Options... options) { + 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()); 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 6ca481b723c..8fc51dd017f 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the QR decompositions of one or more matrices. @@ -42,7 +43,7 @@ * @param data type for {@code q()} output */ @Operator(group = "linalg") -public final class Qr extends PrimitiveOp { +public final class Qr extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.linalg.Qr} @@ -73,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Qr */ - public static Qr create(Scope scope, Operand input, Options... options) { + public static Qr create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Qr", scope.makeOpName("Qr")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 753c4e48276..b8f729de7bd 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Perform a quantized matrix multiplication of `a` by the matrix `b`. @@ -37,7 +39,7 @@ * @param data type for {@code out()} output */ @Operator(group = "linalg") -public final class QuantizedMatMul extends PrimitiveOp { +public final class QuantizedMatMul extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.linalg.QuantizedMatMul} @@ -83,7 +85,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedMatMul */ - public static QuantizedMatMul create(Scope scope, Operand a, Operand b, Operand minA, Operand maxA, Operand minB, Operand maxB, Class Toutput, Class Tactivation, Options... options) { + public static QuantizedMatMul create(Scope scope, Operand a, Operand b, Operand minA, Operand maxA, Operand minB, Operand maxB, DataType Toutput, DataType Tactivation, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMatMul", scope.makeOpName("QuantizedMatMul")); opBuilder.addInput(a.asOutput()); opBuilder.addInput(b.asOutput()); @@ -92,8 +94,8 @@ public static QuantizedMatMul create(Scope scope, Operand a, opBuilder.addInput(minB.asOutput()); opBuilder.addInput(maxB.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Toutput", DataType.fromClass(Toutput)); - opBuilder.setAttr("Tactivation", DataType.fromClass(Tactivation)); + opBuilder.setAttr("Toutput", Toutput); + opBuilder.setAttr("Tactivation", Tactivation); if (options != null) { for (Options opts : options) { if (opts.transposeA != null) { @@ -130,20 +132,20 @@ public Output out() { /** * The float value that the lowest quantized output value represents. */ - public Output minOut() { + public Output minOut() { return minOut; } /** * The float value that the highest quantized output value represents. */ - public Output maxOut() { + public Output maxOut() { return maxOut; } private Output out; - private Output minOut; - private Output maxOut; + private Output minOut; + private Output maxOut; private QuantizedMatMul(Operation operation) { super(operation); 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 6494ad579cc..732223f82f1 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the eigen decomposition of one or more square self-adjoint matrices. @@ -43,7 +44,7 @@ * @param data type for {@code e()} output */ @Operator(group = "linalg") -public final class SelfAdjointEig extends PrimitiveOp { +public final class SelfAdjointEig extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.linalg.SelfAdjointEig} @@ -73,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SelfAdjointEig */ - public static SelfAdjointEig create(Scope scope, Operand input, Options... options) { + 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.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SetDiag.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SetDiag.java index b3d6f494270..add7a1fe9dc 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SetDiag.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/linalg/SetDiag.java @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns a batched matrix tensor with new batched diagonal values. @@ -44,7 +45,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class SetDiag extends PrimitiveOp implements Operand { +public final class SetDiag extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SetDiag operation. @@ -54,7 +55,7 @@ public final class SetDiag extends PrimitiveOp implements Operand { * @param diagonal Rank `k`, where `k >= 1`. * @return a new instance of SetDiag */ - public static SetDiag create(Scope scope, Operand input, Operand diagonal) { + public static SetDiag create(Scope scope, Operand input, Operand diagonal) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixSetDiag", scope.makeOpName("SetDiag")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(diagonal.asOutput()); 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 0d4e2a2313e..61181ed406d 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Solves systems of linear equations. @@ -38,7 +39,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class Solve extends PrimitiveOp implements Operand { +public final class Solve extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.Solve} @@ -69,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Solve */ - public static Solve create(Scope scope, Operand matrix, Operand rhs, Options... options) { + 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()); 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 9aded4b6445..eed841f6e66 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the matrix square root of one or more square matrices: @@ -47,7 +48,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class Sqrtm extends PrimitiveOp implements Operand { +public final class Sqrtm extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Sqrtm operation. @@ -56,7 +57,7 @@ public final class Sqrtm extends PrimitiveOp implements Operand { * @param input Shape is `[..., M, M]`. * @return a new instance of Sqrtm */ - public static Sqrtm create(Scope scope, Operand input) { + public static Sqrtm create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("MatrixSquareRoot", scope.makeOpName("Sqrtm")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 0d33687fd06..92112bd45ea 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the singular value decompositions of one or more matrices. @@ -43,7 +44,7 @@ * @param data type for {@code s()} output */ @Operator(group = "linalg") -public final class Svd extends PrimitiveOp { +public final class Svd extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.linalg.Svd} @@ -86,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Svd */ - public static Svd create(Scope scope, Operand input, Options... options) { + public static Svd create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Svd", scope.makeOpName("Svd")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 0ab6267ee3e..1acf9766982 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns a diagonal tensor with a given diagonal values. @@ -49,7 +50,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class TensorDiag extends PrimitiveOp implements Operand { +public final class TensorDiag extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorDiag operation. @@ -58,7 +59,7 @@ public final class TensorDiag extends PrimitiveOp implements Operand { * @param diagonal Rank k tensor where k is at most 1. * @return a new instance of TensorDiag */ - public static TensorDiag create(Scope scope, Operand diagonal) { + public static TensorDiag create(Scope scope, Operand diagonal) { OperationBuilder opBuilder = scope.env().opBuilder("Diag", scope.makeOpName("TensorDiag")); opBuilder.addInput(diagonal.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 1f3923d1f34..8d59496f3bf 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns the diagonal part of the tensor. @@ -50,7 +51,7 @@ * @param data type for {@code diagonal()} output */ @Operator(group = "linalg") -public final class TensorDiagPart extends PrimitiveOp implements Operand { +public final class TensorDiagPart extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorDiagPart operation. @@ -59,7 +60,7 @@ public final class TensorDiagPart extends PrimitiveOp implements Operand { * @param input Rank k tensor where k is even and not zero. * @return a new instance of TensorDiagPart */ - public static TensorDiagPart create(Scope scope, Operand input) { + public static TensorDiagPart create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("DiagPart", scope.makeOpName("TensorDiagPart")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 6e13c6de679..7fb8defd058 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Shuffle dimensions of x according to a permutation. @@ -34,7 +36,7 @@ * @param data type for {@code y()} output */ @Operator(group = "linalg") -public final class Transpose extends PrimitiveOp implements Operand { +public final class Transpose extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Transpose operation. @@ -44,7 +46,7 @@ public final class Transpose extends PrimitiveOp implements Operand { * @param perm * @return a new instance of Transpose */ - public static Transpose create(Scope scope, Operand x, Operand perm) { + 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()); 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 0148449cd3f..875059df13e 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Solves systems of linear equations with upper or lower triangular matrices by backsubstitution. @@ -76,7 +77,7 @@ * @param data type for {@code output()} output */ @Operator(group = "linalg") -public final class TriangularSolve extends PrimitiveOp implements Operand { +public final class TriangularSolve extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.linalg.TriangularSolve} @@ -121,7 +122,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TriangularSolve */ - public static TriangularSolve create(Scope scope, Operand matrix, Operand rhs, Options... options) { + 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()); 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 3048c431d97..89284c7ef5a 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the absolute value of a tensor. @@ -35,7 +37,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Abs extends PrimitiveOp implements Operand { +public final class Abs extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Abs operation. @@ -44,7 +46,7 @@ public final class Abs extends PrimitiveOp implements Operand< * @param x * @return a new instance of Abs */ - public static Abs create(Scope scope, Operand x) { + public static Abs create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Abs", scope.makeOpName("Abs")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 b71f4c98bf6..5d87e8eb0f2 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 @@ -21,11 +21,12 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * Returns the element-wise sum of a list of tensors. @@ -42,7 +43,7 @@ * @param data type for {@code sum()} output */ @Operator(group = "math") -public final class AccumulateN extends PrimitiveOp implements Operand { +public final class AccumulateN extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AccumulateN operation. @@ -52,7 +53,7 @@ public final class AccumulateN extends PrimitiveOp implements Operand { * @param shape Shape of elements of `inputs`. * @return a new instance of AccumulateN */ - public static AccumulateN create(Scope scope, Iterable> inputs, Shape shape) { + 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.applyControlDependencies(opBuilder); 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 719e884301c..ae889d3db42 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes acos of x element-wise. @@ -31,7 +32,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Acos extends PrimitiveOp implements Operand { +public final class Acos extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Acos operation. @@ -40,7 +41,7 @@ public final class Acos extends PrimitiveOp implements Operand { * @param x * @return a new instance of Acos */ - public static Acos create(Scope scope, Operand x) { + public static Acos create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Acos", scope.makeOpName("Acos")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 23df29ac673..010ab0bdcb0 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes inverse hyperbolic cosine of x element-wise. @@ -39,7 +40,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Acosh extends PrimitiveOp implements Operand { +public final class Acosh extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Acosh operation. @@ -48,7 +49,7 @@ public final class Acosh extends PrimitiveOp implements Operand { * @param x * @return a new instance of Acosh */ - public static Acosh create(Scope scope, Operand x) { + public static Acosh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Acosh", scope.makeOpName("Acosh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 1bd5be56b53..99bba375776 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns x + y element-wise. @@ -34,7 +35,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Add extends PrimitiveOp implements Operand { +public final class Add extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Add operation. @@ -44,7 +45,7 @@ public final class Add extends PrimitiveOp implements Operand { * @param y * @return a new instance of Add */ - public static Add create(Scope scope, Operand x, Operand y) { + 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()); 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 550c988228d..c39143a697c 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Add all input tensors element wise. @@ -40,7 +41,7 @@ * @param data type for {@code sum()} output */ @Operator(group = "math") -public final class AddN extends PrimitiveOp implements Operand { +public final class AddN extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AddN operation. @@ -49,7 +50,7 @@ public final class AddN extends PrimitiveOp implements Operand { * @param inputs * @return a new instance of AddN */ - public static AddN create(Scope scope, Iterable> inputs) { + public static AddN create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("AddN", scope.makeOpName("AddN")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.applyControlDependencies(opBuilder); 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 da69b651cb4..cb2211622e3 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the argument of a complex number. @@ -48,7 +51,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class Angle extends PrimitiveOp implements Operand { +public final class Angle extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Angle operation. @@ -58,11 +61,11 @@ public final class Angle extends PrimitiveOp implements Operan * @param Tout * @return a new instance of Angle */ - public static Angle create(Scope scope, Operand input, Class Tout) { + public static Angle create(Scope scope, Operand input, DataType Tout) { OperationBuilder opBuilder = scope.env().opBuilder("Angle", scope.makeOpName("Angle")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Tout", DataType.fromClass(Tout)); + opBuilder.setAttr("Tout", Tout); return new Angle(opBuilder.build()); } @@ -73,8 +76,8 @@ public static Angle create(Scope scope, Operand inpu * @param input * @return a new instance of Angle */ - public static Angle create(Scope scope, Operand input) { - return create(scope, input, Float.class); + public static Angle create(Scope scope, Operand input) { + return create(scope, input, TFloat.DTYPE); } /** 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 afc6caa4630..31cfa4d9bec 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Returns the truth value of abs(x-y) < tolerance element-wise. */ @Operator(group = "math") -public final class ApproximateEqual extends PrimitiveOp implements Operand { +public final class ApproximateEqual extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.math.ApproximateEqual} @@ -59,7 +61,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApproximateEqual */ - public static ApproximateEqual create(Scope scope, Operand x, Operand y, Options... options) { + 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()); @@ -83,16 +85,16 @@ public static Options tolerance(Float tolerance) { /** */ - public Output z() { + public Output z() { return z; } @Override - public Output asOutput() { + public Output asOutput() { return z; } - private Output z; + private Output z; private ApproximateEqual(Operation operation) { super(operation); 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 3f2243e7bd2..2188366c2a8 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the index with the largest value across dimensions of a tensor. @@ -45,7 +48,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class ArgMax extends PrimitiveOp implements Operand { +public final class ArgMax extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ArgMax operation. @@ -58,12 +61,12 @@ public final class ArgMax extends PrimitiveOp implements Opera * @param outputType * @return a new instance of ArgMax */ - public static ArgMax create(Scope scope, Operand input, Operand dimension, Class outputType) { + public static ArgMax create(Scope scope, Operand input, Operand dimension, DataType outputType) { OperationBuilder opBuilder = scope.env().opBuilder("ArgMax", scope.makeOpName("ArgMax")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(dimension.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("output_type", DataType.fromClass(outputType)); + opBuilder.setAttr("output_type", outputType); return new ArgMax(opBuilder.build()); } @@ -77,8 +80,8 @@ public static ArgMax create(Scope sco * use dimension = 0. * @return a new instance of ArgMax */ - public static ArgMax create(Scope scope, Operand input, Operand dimension) { - return create(scope, input, dimension, Long.class); + public static ArgMax create(Scope scope, Operand input, Operand dimension) { + return create(scope, input, dimension, TInt64.DTYPE); } /** 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 e6ff7ce499d..86a0a8adc8c 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the index with the smallest value across dimensions of a tensor. @@ -45,7 +48,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class ArgMin extends PrimitiveOp implements Operand { +public final class ArgMin extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ArgMin operation. @@ -58,12 +61,12 @@ public final class ArgMin extends PrimitiveOp implements Opera * @param outputType * @return a new instance of ArgMin */ - public static ArgMin create(Scope scope, Operand input, Operand dimension, Class outputType) { + public static ArgMin create(Scope scope, Operand input, Operand dimension, DataType outputType) { OperationBuilder opBuilder = scope.env().opBuilder("ArgMin", scope.makeOpName("ArgMin")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(dimension.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("output_type", DataType.fromClass(outputType)); + opBuilder.setAttr("output_type", outputType); return new ArgMin(opBuilder.build()); } @@ -77,8 +80,8 @@ public static ArgMin create(Scope sco * use dimension = 0. * @return a new instance of ArgMin */ - public static ArgMin create(Scope scope, Operand input, Operand dimension) { - return create(scope, input, dimension, Long.class); + public static ArgMin create(Scope scope, Operand input, Operand dimension) { + return create(scope, input, dimension, TInt64.DTYPE); } /** 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 a4617921d53..2513c4a4c02 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the trignometric inverse sine of x element-wise. @@ -47,7 +48,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Asin extends PrimitiveOp implements Operand { +public final class Asin extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Asin operation. @@ -56,7 +57,7 @@ public final class Asin extends PrimitiveOp implements Operand { * @param x * @return a new instance of Asin */ - public static Asin create(Scope scope, Operand x) { + public static Asin create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Asin", scope.makeOpName("Asin")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 c411950baba..e4a1d4e1c4c 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes inverse hyperbolic sine of x element-wise. @@ -41,7 +42,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Asinh extends PrimitiveOp implements Operand { +public final class Asinh extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Asinh operation. @@ -50,7 +51,7 @@ public final class Asinh extends PrimitiveOp implements Operand { * @param x * @return a new instance of Asinh */ - public static Asinh create(Scope scope, Operand x) { + public static Asinh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Asinh", scope.makeOpName("Asinh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 d5fb2730785..6db33b0af71 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the trignometric inverse tangent of x element-wise. @@ -47,7 +48,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Atan extends PrimitiveOp implements Operand { +public final class Atan extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Atan operation. @@ -56,7 +57,7 @@ public final class Atan extends PrimitiveOp implements Operand { * @param x * @return a new instance of Atan */ - public static Atan create(Scope scope, Operand x) { + public static Atan create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Atan", scope.makeOpName("Atan")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 8337341e4c2..2b1af49921a 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes arctangent of `y/x` element-wise, respecting signs of the arguments. @@ -37,7 +39,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Atan2 extends PrimitiveOp implements Operand { +public final class Atan2 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Atan2 operation. @@ -47,7 +49,7 @@ public final class Atan2 extends PrimitiveOp implements Operan * @param x * @return a new instance of Atan2 */ - public static Atan2 create(Scope scope, Operand y, Operand x) { + 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()); 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 5f2b4a5e3e6..a3748bdfd32 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes inverse hyperbolic tangent of x element-wise. @@ -43,7 +44,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Atanh extends PrimitiveOp implements Operand { +public final class Atanh extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Atanh operation. @@ -52,7 +53,7 @@ public final class Atanh extends PrimitiveOp implements Operand { * @param x * @return a new instance of Atanh */ - public static Atanh create(Scope scope, Operand x) { + public static Atanh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Atanh", scope.makeOpName("Atanh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 5777af1108d..6b17834bced 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,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the Bessel i0e function of `x` element-wise. @@ -36,7 +38,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class BesselI0e extends PrimitiveOp implements Operand { +public final class BesselI0e extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BesselI0e operation. @@ -45,7 +47,7 @@ public final class BesselI0e extends PrimitiveOp implements Op * @param x * @return a new instance of BesselI0e */ - public static BesselI0e create(Scope scope, Operand x) { + public static BesselI0e create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselI0e", scope.makeOpName("BesselI0e")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 c119feb2b4d..440da5ad11e 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,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the Bessel i1e function of `x` element-wise. @@ -36,7 +38,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class BesselI1e extends PrimitiveOp implements Operand { +public final class BesselI1e extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BesselI1e operation. @@ -45,7 +47,7 @@ public final class BesselI1e extends PrimitiveOp implements Op * @param x * @return a new instance of BesselI1e */ - public static BesselI1e create(Scope scope, Operand x) { + public static BesselI1e create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("BesselI1e", scope.makeOpName("BesselI1e")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 15a837233cb..a285942d0ee 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Compute the regularized incomplete beta integral \\(I_x(a, b)\\). @@ -42,7 +44,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Betainc extends PrimitiveOp implements Operand { +public final class Betainc extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Betainc operation. @@ -53,7 +55,7 @@ public final class Betainc extends PrimitiveOp implements Oper * @param x * @return a new instance of Betainc */ - public static Betainc create(Scope scope, Operand a, Operand b, Operand x) { + 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()); 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 479b9685d3b..a2e812cf09a 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Counts the number of occurrences of each value in an integer array. @@ -39,7 +42,7 @@ * @param data type for {@code bins()} output */ @Operator(group = "math") -public final class Bincount extends PrimitiveOp implements Operand { +public final class Bincount extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Bincount operation. @@ -52,7 +55,7 @@ public final class Bincount extends PrimitiveOp implements Ope * equal to 1. * @return a new instance of Bincount */ - public static Bincount create(Scope scope, Operand arr, Operand size, Operand weights) { + public static Bincount create(Scope scope, Operand arr, Operand size, Operand weights) { OperationBuilder opBuilder = scope.env().opBuilder("Bincount", scope.makeOpName("Bincount")); opBuilder.addInput(arr.asOutput()); opBuilder.addInput(size.asOutput()); 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 6deac52c312..5abebdcbc05 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns element-wise smallest integer not less than x. @@ -31,7 +33,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Ceil extends PrimitiveOp implements Operand { +public final class Ceil extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Ceil operation. @@ -40,7 +42,7 @@ public final class Ceil extends PrimitiveOp implements Operand * @param x * @return a new instance of Ceil */ - public static Ceil create(Scope scope, Operand x) { + public static Ceil create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Ceil", scope.makeOpName("Ceil")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CheckNumerics.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CheckNumerics.java index edc6eb6fd57..f52451da9b5 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CheckNumerics.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/math/CheckNumerics.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Checks a tensor for NaN and Inf values. @@ -34,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class CheckNumerics extends PrimitiveOp implements Operand { +public final class CheckNumerics extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CheckNumerics operation. @@ -44,7 +46,7 @@ public final class CheckNumerics extends PrimitiveOp implement * @param message Prefix of the error message. * @return a new instance of CheckNumerics */ - public static CheckNumerics create(Scope scope, Operand tensor, String message) { + public static CheckNumerics create(Scope scope, Operand tensor, String message) { OperationBuilder opBuilder = scope.env().opBuilder("CheckNumerics", scope.makeOpName("CheckNumerics")); opBuilder.addInput(tensor.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 83388488113..cb7ba0145ce 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 @@ -24,7 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TUInt8; +import org.tensorflow.types.family.TType; /** * Compare values of `input` to `threshold` and pack resulting bits into a `uint8`. @@ -52,7 +53,7 @@ * a `uint8` tensor shaped `[s0, s1, ..., s_n / 8]`. */ @Operator(group = "math") -public final class CompareAndBitpack extends PrimitiveOp implements Operand { +public final class CompareAndBitpack extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new CompareAndBitpack operation. @@ -62,7 +63,7 @@ public final class CompareAndBitpack extends PrimitiveOp implements Operand CompareAndBitpack create(Scope scope, Operand input, Operand threshold) { + 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()); @@ -73,16 +74,16 @@ public static CompareAndBitpack create(Scope scope, Operand input, Operan /** * The bitpacked comparisons. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private CompareAndBitpack(Operation operation) { super(operation); 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 57b1c4c6ce3..f774719c993 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the complex absolute value of a tensor. @@ -37,7 +40,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class ComplexAbs extends PrimitiveOp implements Operand { +public final class ComplexAbs extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ComplexAbs operation. @@ -47,11 +50,11 @@ public final class ComplexAbs extends PrimitiveOp implements O * @param Tout * @return a new instance of ComplexAbs */ - public static ComplexAbs create(Scope scope, Operand x, Class Tout) { + public static ComplexAbs create(Scope scope, Operand x, DataType Tout) { OperationBuilder opBuilder = scope.env().opBuilder("ComplexAbs", scope.makeOpName("ComplexAbs")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Tout", DataType.fromClass(Tout)); + opBuilder.setAttr("Tout", Tout); return new ComplexAbs(opBuilder.build()); } @@ -62,8 +65,8 @@ public static ComplexAbs create(Scope scope, Operand * @param x * @return a new instance of ComplexAbs */ - public static ComplexAbs create(Scope scope, Operand x) { - return create(scope, x, Float.class); + public static ComplexAbs create(Scope scope, Operand x) { + return create(scope, x, TFloat.DTYPE); } /** 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 7546f2b5eb5..727955cf8bf 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns the complex conjugate of a complex number. @@ -45,7 +46,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class Conj extends PrimitiveOp implements Operand { +public final class Conj extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Conj operation. @@ -54,7 +55,7 @@ public final class Conj extends PrimitiveOp implements Operand { * @param input * @return a new instance of Conj */ - public static Conj create(Scope scope, Operand input) { + public static Conj create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("Conj", scope.makeOpName("Conj")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 b242883a852..00a235be6a6 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes cos of x element-wise. @@ -42,7 +43,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Cos extends PrimitiveOp implements Operand { +public final class Cos extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Cos operation. @@ -51,7 +52,7 @@ public final class Cos extends PrimitiveOp implements Operand { * @param x * @return a new instance of Cos */ - public static Cos create(Scope scope, Operand x) { + public static Cos create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Cos", scope.makeOpName("Cos")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 11b7f4e10d7..6901b48a8b2 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes hyperbolic cosine of x element-wise. @@ -41,7 +42,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Cosh extends PrimitiveOp implements Operand { +public final class Cosh extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Cosh operation. @@ -50,7 +51,7 @@ public final class Cosh extends PrimitiveOp implements Operand { * @param x * @return a new instance of Cosh */ - public static Cosh create(Scope scope, Operand x) { + public static Cosh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Cosh", scope.makeOpName("Cosh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 7b43500d185..c3e386a5599 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Compute the cumulative product of the tensor `x` along `axis`. @@ -54,7 +56,7 @@ * @param data type for {@code out()} output */ @Operator(group = "math") -public final class Cumprod extends PrimitiveOp implements Operand { +public final class Cumprod extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.math.Cumprod} @@ -96,7 +98,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Cumprod */ - public static Cumprod create(Scope scope, Operand x, Operand axis, Options... options) { + 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()); 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 fb52444a59e..269afcd36ec 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Compute the cumulative sum of the tensor `x` along `axis`. @@ -54,7 +56,7 @@ * @param data type for {@code out()} output */ @Operator(group = "math") -public final class Cumsum extends PrimitiveOp implements Operand { +public final class Cumsum extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.math.Cumsum} @@ -96,7 +98,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Cumsum */ - public static Cumsum create(Scope scope, Operand x, Operand axis, Options... options) { + 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()); 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 e0b0eee777f..b72d4bd279d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes Psi, the derivative of Lgamma (the log of the absolute value of @@ -33,7 +35,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Digamma extends PrimitiveOp implements Operand { +public final class Digamma extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Digamma operation. @@ -42,7 +44,7 @@ public final class Digamma extends PrimitiveOp implements Oper * @param x * @return a new instance of Digamma */ - public static Digamma create(Scope scope, Operand x) { + public static Digamma create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Digamma", scope.makeOpName("Digamma")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 527595fc52b..af32c87b3e1 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns x / y element-wise. @@ -34,7 +35,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Div extends PrimitiveOp implements Operand { +public final class Div extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Div operation. @@ -44,7 +45,7 @@ public final class Div extends PrimitiveOp implements Operand { * @param y * @return a new instance of Div */ - public static Div create(Scope scope, Operand x, Operand y) { + 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()); 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 e742678da2e..2ae05c3ec6a 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns 0 if the denominator is zero. @@ -35,7 +36,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class DivNoNan extends PrimitiveOp implements Operand { +public final class DivNoNan extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new DivNoNan operation. @@ -45,7 +46,7 @@ public final class DivNoNan extends PrimitiveOp implements Operand { * @param y * @return a new instance of DivNoNan */ - public static DivNoNan create(Scope scope, Operand x, Operand y) { + 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()); 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 e968606db84..3cd80d4053b 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Returns the truth value of (x == y) element-wise. @@ -42,7 +44,7 @@ * */ @Operator(group = "math") -public final class Equal extends PrimitiveOp implements Operand { +public final class Equal extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.math.Equal} @@ -72,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Equal */ - public static Equal create(Scope scope, Operand x, Operand y, Options... options) { + 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()); @@ -96,16 +98,16 @@ public static Options incompatibleShapeError(Boolean incompatibleShapeError) { /** */ - public Output z() { + public Output z() { return z; } @Override - public Output asOutput() { + public Output asOutput() { return z; } - private Output z; + private Output z; private Equal(Operation operation) { super(operation); 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 875b0186daf..b211aa1434a 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the Gauss error function of `x` element-wise. @@ -31,7 +33,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Erf extends PrimitiveOp implements Operand { +public final class Erf extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Erf operation. @@ -40,7 +42,7 @@ public final class Erf extends PrimitiveOp implements Operand< * @param x * @return a new instance of Erf */ - public static Erf create(Scope scope, Operand x) { + public static Erf create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Erf", scope.makeOpName("Erf")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 4c7d373d28d..b424e3fe684 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the complementary error function of `x` element-wise. @@ -31,7 +33,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Erfc extends PrimitiveOp implements Operand { +public final class Erfc extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Erfc operation. @@ -40,7 +42,7 @@ public final class Erfc extends PrimitiveOp implements Operand * @param x * @return a new instance of Erfc */ - public static Erfc create(Scope scope, Operand x) { + public static Erfc create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Erfc", scope.makeOpName("Erfc")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 dfd109d3aba..00feedfc027 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes exponential of x element-wise. \\(y = e^x\\). @@ -57,7 +58,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Exp extends PrimitiveOp implements Operand { +public final class Exp extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Exp operation. @@ -66,7 +67,7 @@ public final class Exp extends PrimitiveOp implements Operand { * @param x * @return a new instance of Exp */ - public static Exp create(Scope scope, Operand x) { + public static Exp create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Exp", scope.makeOpName("Exp")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 809b31ae614..f2ae83d6679 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes `exp(x) - 1` element-wise. @@ -46,7 +47,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Expm1 extends PrimitiveOp implements Operand { +public final class Expm1 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Expm1 operation. @@ -55,7 +56,7 @@ public final class Expm1 extends PrimitiveOp implements Operand { * @param x * @return a new instance of Expm1 */ - public static Expm1 create(Scope scope, Operand x) { + public static Expm1 create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Expm1", scope.makeOpName("Expm1")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 6938723bcd3..7c3ee232177 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Output a fact about factorials. */ @Operator(group = "math") -public final class Fact extends PrimitiveOp implements Operand { +public final class Fact extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Fact operation. @@ -45,16 +46,16 @@ public static Fact create(Scope scope) { /** */ - public Output fact() { + public Output fact() { return fact; } @Override - public Output asOutput() { + public Output asOutput() { return fact; } - private Output fact; + private Output fact; private Fact(Operation operation) { super(operation); 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 57a17cb89b9..1ca73a86e66 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns element-wise largest integer not greater than x. @@ -31,7 +33,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Floor extends PrimitiveOp implements Operand { +public final class Floor extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Floor operation. @@ -40,7 +42,7 @@ public final class Floor extends PrimitiveOp implements Operan * @param x * @return a new instance of Floor */ - public static Floor create(Scope scope, Operand x) { + public static Floor create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Floor", scope.makeOpName("Floor")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 028d934f6c8..e5b4f100e51 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns x // y element-wise. @@ -34,7 +35,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class FloorDiv extends PrimitiveOp implements Operand { +public final class FloorDiv extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new FloorDiv operation. @@ -44,7 +45,7 @@ public final class FloorDiv extends PrimitiveOp implements Operand { * @param y * @return a new instance of FloorDiv */ - public static FloorDiv create(Scope scope, Operand x, Operand y) { + 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()); 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 7e4d44ce1d6..ae19761a41d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns element-wise remainder of division. When `x < 0` xor `y < 0` is @@ -37,7 +39,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class FloorMod extends PrimitiveOp implements Operand { +public final class FloorMod extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new FloorMod operation. @@ -47,7 +49,7 @@ public final class FloorMod extends PrimitiveOp implements Ope * @param y * @return a new instance of FloorMod */ - public static FloorMod create(Scope scope, Operand x, Operand y) { + 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()); 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 c24cb98efe7..77991f78075 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the truth value of (x > y) element-wise. @@ -32,7 +35,7 @@ * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) */ @Operator(group = "math") -public final class Greater extends PrimitiveOp implements Operand { +public final class Greater extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Greater operation. @@ -42,7 +45,7 @@ public final class Greater extends PrimitiveOp implements Operand { * @param y * @return a new instance of Greater */ - public static Greater create(Scope scope, Operand x, Operand y) { + public static Greater create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Greater", scope.makeOpName("Greater")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -52,16 +55,16 @@ public static Greater create(Scope scope, Operand x, Opera /** */ - public Output z() { + public Output z() { return z; } @Override - public Output asOutput() { + public Output asOutput() { return z; } - private Output z; + private Output z; private Greater(Operation operation) { super(operation); 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 ba6f5fd57d4..53e84e68f0a 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the truth value of (x >= y) element-wise. @@ -32,7 +35,7 @@ * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) */ @Operator(group = "math") -public final class GreaterEqual extends PrimitiveOp implements Operand { +public final class GreaterEqual extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new GreaterEqual operation. @@ -42,7 +45,7 @@ public final class GreaterEqual extends PrimitiveOp implements Operand * @param y * @return a new instance of GreaterEqual */ - public static GreaterEqual create(Scope scope, Operand x, Operand y) { + public static GreaterEqual create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("GreaterEqual", scope.makeOpName("GreaterEqual")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -52,16 +55,16 @@ public static GreaterEqual create(Scope scope, Operand x, /** */ - public Output z() { + public Output z() { return z; } @Override - public Output asOutput() { + public Output asOutput() { return z; } - private Output z; + private Output z; private GreaterEqual(Operation operation) { super(operation); 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 24f878fb47f..80b4d57f07c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Compute the lower regularized incomplete Gamma function `P(a, x)`. @@ -44,7 +46,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Igamma extends PrimitiveOp implements Operand { +public final class Igamma extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Igamma operation. @@ -54,7 +56,7 @@ public final class Igamma extends PrimitiveOp implements Opera * @param x * @return a new instance of Igamma */ - public static Igamma create(Scope scope, Operand a, Operand x) { + 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()); 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 613a514c5db..c574d735795 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradient of `igamma(a, x)` wrt `a`. * * @param data type for {@code z()} output */ -public final class IgammaGradA extends PrimitiveOp implements Operand { +public final class IgammaGradA extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IgammaGradA operation. @@ -39,7 +41,7 @@ public final class IgammaGradA extends PrimitiveOp implements * @param x * @return a new instance of IgammaGradA */ - public static IgammaGradA create(Scope scope, Operand a, Operand x) { + 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()); 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 9111c9d6adc..2b8210d544d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Compute the upper regularized incomplete Gamma function `Q(a, x)`. @@ -44,7 +46,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Igammac extends PrimitiveOp implements Operand { +public final class Igammac extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Igammac operation. @@ -54,7 +56,7 @@ public final class Igammac extends PrimitiveOp implements Oper * @param x * @return a new instance of Igammac */ - public static Igammac create(Scope scope, Operand a, Operand x) { + 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()); 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 a23c17c783f..722b1f52985 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the imaginary part of a complex number. @@ -44,7 +47,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class Imag extends PrimitiveOp implements Operand { +public final class Imag extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Imag operation. @@ -54,11 +57,11 @@ public final class Imag extends PrimitiveOp implements Operand * @param Tout * @return a new instance of Imag */ - public static Imag create(Scope scope, Operand input, Class Tout) { + public static Imag create(Scope scope, Operand input, DataType Tout) { OperationBuilder opBuilder = scope.env().opBuilder("Imag", scope.makeOpName("Imag")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Tout", DataType.fromClass(Tout)); + opBuilder.setAttr("Tout", Tout); return new Imag(opBuilder.build()); } @@ -69,8 +72,8 @@ public static Imag create(Scope scope, Operand input * @param input * @return a new instance of Imag */ - public static Imag create(Scope scope, Operand input) { - return create(scope, input, Float.class); + public static Imag create(Scope scope, Operand input) { + return create(scope, input, TFloat.DTYPE); } /** 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 081ecb612c6..9c3aab6c127 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the inverse permutation of a tensor. @@ -47,7 +49,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class InvertPermutation extends PrimitiveOp implements Operand { +public final class InvertPermutation extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new InvertPermutation operation. @@ -56,7 +58,7 @@ public final class InvertPermutation extends PrimitiveOp imple * @param x 1-D. * @return a new instance of InvertPermutation */ - public static InvertPermutation create(Scope scope, Operand x) { + public static InvertPermutation create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("InvertPermutation", scope.makeOpName("InvertPermutation")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 e3dde1f009d..9449af01ab4 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns which elements of x are finite. @@ -33,7 +36,7 @@ * @end_compatibility */ @Operator(group = "math") -public final class IsFinite extends PrimitiveOp implements Operand { +public final class IsFinite extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IsFinite operation. @@ -42,7 +45,7 @@ public final class IsFinite extends PrimitiveOp implements Operand { * @param x * @return a new instance of IsFinite */ - public static IsFinite create(Scope scope, Operand x) { + public static IsFinite create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("IsFinite", scope.makeOpName("IsFinite")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -51,16 +54,16 @@ public static IsFinite create(Scope scope, Operand x) { /** */ - public Output y() { + public Output y() { return y; } @Override - public Output asOutput() { + public Output asOutput() { return y; } - private Output y; + private Output y; private IsFinite(Operation operation) { super(operation); 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 4be229c0eb5..a898234483a 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns which elements of x are Inf. @@ -33,7 +36,7 @@ * @end_compatibility */ @Operator(group = "math") -public final class IsInf extends PrimitiveOp implements Operand { +public final class IsInf extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IsInf operation. @@ -42,7 +45,7 @@ public final class IsInf extends PrimitiveOp implements Operand { * @param x * @return a new instance of IsInf */ - public static IsInf create(Scope scope, Operand x) { + public static IsInf create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("IsInf", scope.makeOpName("IsInf")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -51,16 +54,16 @@ public static IsInf create(Scope scope, Operand x) { /** */ - public Output y() { + public Output y() { return y; } @Override - public Output asOutput() { + public Output asOutput() { return y; } - private Output y; + private Output y; private IsInf(Operation operation) { super(operation); 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 baff4c9f3a9..0ff1eb63d6e 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns which elements of x are NaN. @@ -33,7 +36,7 @@ * @end_compatibility */ @Operator(group = "math") -public final class IsNan extends PrimitiveOp implements Operand { +public final class IsNan extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new IsNan operation. @@ -42,7 +45,7 @@ public final class IsNan extends PrimitiveOp implements Operand { * @param x * @return a new instance of IsNan */ - public static IsNan create(Scope scope, Operand x) { + public static IsNan create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("IsNan", scope.makeOpName("IsNan")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -51,16 +54,16 @@ public static IsNan create(Scope scope, Operand x) { /** */ - public Output y() { + public Output y() { return y; } @Override - public Output asOutput() { + public Output asOutput() { return y; } - private Output y; + private Output y; private IsNan(Operation operation) { super(operation); 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 32a65d8a274..b2d987a2123 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the truth value of (x < y) element-wise. @@ -32,7 +35,7 @@ * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) */ @Operator(group = "math") -public final class Less extends PrimitiveOp implements Operand { +public final class Less extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Less operation. @@ -42,7 +45,7 @@ public final class Less extends PrimitiveOp implements Operand { * @param y * @return a new instance of Less */ - public static Less create(Scope scope, Operand x, Operand y) { + public static Less create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("Less", scope.makeOpName("Less")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -52,16 +55,16 @@ public static Less create(Scope scope, Operand x, Operand< /** */ - public Output z() { + public Output z() { return z; } @Override - public Output asOutput() { + public Output asOutput() { return z; } - private Output z; + private Output z; private Less(Operation operation) { super(operation); 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 5d99ff74b7e..7565eebea70 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the truth value of (x <= y) element-wise. @@ -32,7 +35,7 @@ * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) */ @Operator(group = "math") -public final class LessEqual extends PrimitiveOp implements Operand { +public final class LessEqual extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LessEqual operation. @@ -42,7 +45,7 @@ public final class LessEqual extends PrimitiveOp implements Operand { * @param y * @return a new instance of LessEqual */ - public static LessEqual create(Scope scope, Operand x, Operand y) { + public static LessEqual create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("LessEqual", scope.makeOpName("LessEqual")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -52,16 +55,16 @@ public static LessEqual create(Scope scope, Operand x, Ope /** */ - public Output z() { + public Output z() { return z; } @Override - public Output asOutput() { + public Output asOutput() { return z; } - private Output z; + private Output z; private LessEqual(Operation operation) { super(operation); 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 4d752eb5cbf..7f143cc181a 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the log of the absolute value of `Gamma(x)` element-wise. @@ -31,7 +33,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Lgamma extends PrimitiveOp implements Operand { +public final class Lgamma extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Lgamma operation. @@ -40,7 +42,7 @@ public final class Lgamma extends PrimitiveOp implements Opera * @param x * @return a new instance of Lgamma */ - public static Lgamma create(Scope scope, Operand x) { + public static Lgamma create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Lgamma", scope.makeOpName("Lgamma")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 c70bb40e400..ec80d2316ea 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes natural logarithm of x element-wise. @@ -33,7 +34,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Log extends PrimitiveOp implements Operand { +public final class Log extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Log operation. @@ -42,7 +43,7 @@ public final class Log extends PrimitiveOp implements Operand { * @param x * @return a new instance of Log */ - public static Log create(Scope scope, Operand x) { + public static Log create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Log", scope.makeOpName("Log")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 75e44900fc4..eb42c353616 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes natural logarithm of (1 + x) element-wise. @@ -33,7 +34,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Log1p extends PrimitiveOp implements Operand { +public final class Log1p extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Log1p operation. @@ -42,7 +43,7 @@ public final class Log1p extends PrimitiveOp implements Operand { * @param x * @return a new instance of Log1p */ - public static Log1p create(Scope scope, Operand x) { + public static Log1p create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Log1p", scope.makeOpName("Log1p")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 e51201aa7e1..b2c81707b80 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; /** * Returns the truth value of x AND y element-wise. @@ -32,7 +33,7 @@ * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) */ @Operator(group = "math") -public final class LogicalAnd extends PrimitiveOp implements Operand { +public final class LogicalAnd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LogicalAnd operation. @@ -42,7 +43,7 @@ public final class LogicalAnd extends PrimitiveOp implements Operand { * @param y * @return a new instance of LogicalAnd */ - public static LogicalAnd create(Scope scope, Operand x, Operand y) { + public static LogicalAnd create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("LogicalAnd", scope.makeOpName("LogicalAnd")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -52,16 +53,16 @@ public static LogicalAnd create(Scope scope, Operand x, Operand z() { + public Output z() { return z; } @Override - public Output asOutput() { + public Output asOutput() { return z; } - private Output z; + private Output z; private LogicalAnd(Operation operation) { super(operation); 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 46db569f9bf..23aab32710a 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; /** * Returns the truth value of NOT x element-wise. */ @Operator(group = "math") -public final class LogicalNot extends PrimitiveOp implements Operand { +public final class LogicalNot extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LogicalNot operation. @@ -38,7 +39,7 @@ public final class LogicalNot extends PrimitiveOp implements Operand { * @param x * @return a new instance of LogicalNot */ - public static LogicalNot create(Scope scope, Operand x) { + public static LogicalNot create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("LogicalNot", scope.makeOpName("LogicalNot")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -47,16 +48,16 @@ public static LogicalNot create(Scope scope, Operand x) { /** */ - public Output y() { + public Output y() { return y; } @Override - public Output asOutput() { + public Output asOutput() { return y; } - private Output y; + private Output y; private LogicalNot(Operation operation) { super(operation); 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 39b0faca333..661202da56f 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; /** * Returns the truth value of x OR y element-wise. @@ -32,7 +33,7 @@ * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) */ @Operator(group = "math") -public final class LogicalOr extends PrimitiveOp implements Operand { +public final class LogicalOr extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LogicalOr operation. @@ -42,7 +43,7 @@ public final class LogicalOr extends PrimitiveOp implements Operand { * @param y * @return a new instance of LogicalOr */ - public static LogicalOr create(Scope scope, Operand x, Operand y) { + public static LogicalOr create(Scope scope, Operand x, Operand y) { OperationBuilder opBuilder = scope.env().opBuilder("LogicalOr", scope.makeOpName("LogicalOr")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -52,16 +53,16 @@ public static LogicalOr create(Scope scope, Operand x, Operand /** */ - public Output z() { + public Output z() { return z; } @Override - public Output asOutput() { + public Output asOutput() { return z; } - private Output z; + private Output z; private LogicalOr(Operation operation) { super(operation); 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 b2eb1cac94a..09311de40f0 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the max of x and y (i.e. x > y ? x : y) element-wise. @@ -34,7 +36,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Maximum extends PrimitiveOp implements Operand { +public final class Maximum extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Maximum operation. @@ -44,7 +46,7 @@ public final class Maximum extends PrimitiveOp implements Oper * @param y * @return a new instance of Maximum */ - public static Maximum create(Scope scope, Operand x, Operand y) { + 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()); 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 f35214a2e1b..c825f92fea7 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the mean of elements across dimensions of a tensor. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class Mean extends PrimitiveOp implements Operand { +public final class Mean extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.math.Mean} @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Mean */ - public static Mean create(Scope scope, Operand input, Operand axis, Options... options) { + 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()); 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 f9ba8bf21fc..e095e406e52 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the min of x and y (i.e. x < y ? x : y) element-wise. @@ -34,7 +36,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Minimum extends PrimitiveOp implements Operand { +public final class Minimum extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Minimum operation. @@ -44,7 +46,7 @@ public final class Minimum extends PrimitiveOp implements Oper * @param y * @return a new instance of Minimum */ - public static Minimum create(Scope scope, Operand x, Operand y) { + 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()); 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 0279abf745b..af9627c70c5 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns element-wise remainder of division. This emulates C semantics in that @@ -37,7 +39,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Mod extends PrimitiveOp implements Operand { +public final class Mod extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Mod operation. @@ -47,7 +49,7 @@ public final class Mod extends PrimitiveOp implements Operand< * @param y * @return a new instance of Mod */ - public static Mod create(Scope scope, Operand x, Operand y) { + 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()); 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 e40a424bedf..71e26162ad7 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns x * y element-wise. @@ -34,7 +35,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Mul extends PrimitiveOp implements Operand { +public final class Mul extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Mul operation. @@ -44,7 +45,7 @@ public final class Mul extends PrimitiveOp implements Operand { * @param y * @return a new instance of Mul */ - public static Mul create(Scope scope, Operand x, Operand y) { + 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()); 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 c2afc5f455d..8ef5df0baa0 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes numerical negative value element-wise. @@ -33,7 +34,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Neg extends PrimitiveOp implements Operand { +public final class Neg extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Neg operation. @@ -42,7 +43,7 @@ public final class Neg extends PrimitiveOp implements Operand { * @param x * @return a new instance of Neg */ - public static Neg create(Scope scope, Operand x) { + public static Neg create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Neg", scope.makeOpName("Neg")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 a72ad63aea1..ef609d9a0df 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.family.TType; /** * Returns the truth value of (x != y) element-wise. @@ -32,7 +34,7 @@ * [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) */ @Operator(group = "math") -public final class NotEqual extends PrimitiveOp implements Operand { +public final class NotEqual extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.math.NotEqual} @@ -62,7 +64,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of NotEqual */ - public static NotEqual create(Scope scope, Operand x, Operand y, Options... options) { + 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()); @@ -86,16 +88,16 @@ public static Options incompatibleShapeError(Boolean incompatibleShapeError) { /** */ - public Output z() { + public Output z() { return z; } @Override - public Output asOutput() { + public Output asOutput() { return z; } - private Output z; + private Output z; private NotEqual(Operation operation) { super(operation); 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 f4d2001db96..6bccbd11586 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Compute the polygamma function \\(\psi^{(n)}(x)\\). @@ -38,7 +40,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Polygamma extends PrimitiveOp implements Operand { +public final class Polygamma extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Polygamma operation. @@ -48,7 +50,7 @@ public final class Polygamma extends PrimitiveOp implements Op * @param x * @return a new instance of Polygamma */ - public static Polygamma create(Scope scope, Operand a, Operand x) { + 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()); 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 576caac778b..f270cfaab08 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 @@ -24,7 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TUInt8; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes element-wise population count (a.k.a. popcount, bitsum, bitcount). @@ -37,7 +39,7 @@ * 8- or 16-bit inputs and then aggregate the resulting counts. */ @Operator(group = "math") -public final class PopulationCount extends PrimitiveOp implements Operand { +public final class PopulationCount extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new PopulationCount operation. @@ -46,7 +48,7 @@ public final class PopulationCount extends PrimitiveOp implements Operand * @param x * @return a new instance of PopulationCount */ - public static PopulationCount create(Scope scope, Operand x) { + public static PopulationCount create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("PopulationCount", scope.makeOpName("PopulationCount")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -55,16 +57,16 @@ public static PopulationCount create(Scope scope, Operand /** */ - public Output y() { + public Output y() { return y; } @Override - public Output asOutput() { + public Output asOutput() { return y; } - private Output y; + private Output y; private PopulationCount(Operation operation) { super(operation); 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 dcbae705274..2d3628d8d30 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the power of one value to another. @@ -40,7 +41,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Pow extends PrimitiveOp implements Operand { +public final class Pow extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Pow operation. @@ -50,7 +51,7 @@ public final class Pow extends PrimitiveOp implements Operand { * @param y * @return a new instance of Pow */ - public static Pow create(Scope scope, Operand x, Operand y) { + 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()); 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 fb3d17e44f3..261cb5fa8ae 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Returns x + y element-wise, working on quantized buffers. @@ -32,7 +34,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class QuantizedAdd extends PrimitiveOp { +public final class QuantizedAdd extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedAdd operation. @@ -47,7 +49,7 @@ public final class QuantizedAdd extends PrimitiveOp { * @param Toutput * @return a new instance of QuantizedAdd */ - public static QuantizedAdd create(Scope scope, Operand x, Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, Class Toutput) { + public static QuantizedAdd create(Scope scope, Operand x, Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, DataType Toutput) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedAdd", scope.makeOpName("QuantizedAdd")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -56,7 +58,7 @@ public static QuantizedAdd create(Scope scope, Operand x, Operan opBuilder.addInput(minY.asOutput()); opBuilder.addInput(maxY.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Toutput", DataType.fromClass(Toutput)); + opBuilder.setAttr("Toutput", Toutput); return new QuantizedAdd(opBuilder.build()); } @@ -69,7 +71,7 @@ public Output z() { /** * The float value that the lowest quantized output value represents. */ - public Output minZ() { + public Output minZ() { return minZ; } @@ -79,13 +81,13 @@ public Output minZ() { * NOTE: `math.QuantizedAdd` supports limited forms of broadcasting. More about * broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) */ - public Output maxZ() { + public Output maxZ() { return maxZ; } private Output z; - private Output minZ; - private Output maxZ; + private Output minZ; + private Output maxZ; private QuantizedAdd(Operation operation) { super(operation); 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 8a8ab0734d0..e35cf0e3e21 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Returns x * y element-wise, working on quantized buffers. @@ -32,7 +34,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class QuantizedMul extends PrimitiveOp { +public final class QuantizedMul extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedMul operation. @@ -47,7 +49,7 @@ public final class QuantizedMul extends PrimitiveOp { * @param Toutput * @return a new instance of QuantizedMul */ - public static QuantizedMul create(Scope scope, Operand x, Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, Class Toutput) { + public static QuantizedMul create(Scope scope, Operand x, Operand y, Operand minX, Operand maxX, Operand minY, Operand maxY, DataType Toutput) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedMul", scope.makeOpName("QuantizedMul")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(y.asOutput()); @@ -56,7 +58,7 @@ public static QuantizedMul create(Scope scope, Operand x, Operan opBuilder.addInput(minY.asOutput()); opBuilder.addInput(maxY.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Toutput", DataType.fromClass(Toutput)); + opBuilder.setAttr("Toutput", Toutput); return new QuantizedMul(opBuilder.build()); } @@ -69,7 +71,7 @@ public Output z() { /** * The float value that the lowest quantized output value represents. */ - public Output minZ() { + public Output minZ() { return minZ; } @@ -79,13 +81,13 @@ public Output minZ() { * NOTE: `math.QuantizedMul` supports limited forms of broadcasting. More about * broadcasting [here](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html) */ - public Output maxZ() { + public Output maxZ() { return maxZ; } private Output z; - private Output minZ; - private Output maxZ; + private Output minZ; + private Output maxZ; private QuantizedMul(Operation operation) { super(operation); 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 1b8b79f1bd2..45331e77009 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the real part of a complex number. @@ -44,7 +47,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class Real extends PrimitiveOp implements Operand { +public final class Real extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Real operation. @@ -54,11 +57,11 @@ public final class Real extends PrimitiveOp implements Operand * @param Tout * @return a new instance of Real */ - public static Real create(Scope scope, Operand input, Class Tout) { + public static Real create(Scope scope, Operand input, DataType Tout) { OperationBuilder opBuilder = scope.env().opBuilder("Real", scope.makeOpName("Real")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("Tout", DataType.fromClass(Tout)); + opBuilder.setAttr("Tout", Tout); return new Real(opBuilder.build()); } @@ -69,8 +72,8 @@ public static Real create(Scope scope, Operand input * @param input * @return a new instance of Real */ - public static Real create(Scope scope, Operand input) { - return create(scope, input, Float.class); + public static Real create(Scope scope, Operand input) { + return create(scope, input, TFloat.DTYPE); } /** 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 8cb3fdd8c96..4f3959b21bd 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns x / y element-wise for real types. @@ -36,7 +37,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class RealDiv extends PrimitiveOp implements Operand { +public final class RealDiv extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RealDiv operation. @@ -46,7 +47,7 @@ public final class RealDiv extends PrimitiveOp implements Operand { * @param y * @return a new instance of RealDiv */ - public static RealDiv create(Scope scope, Operand x, Operand y) { + 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()); 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 d7c582911c8..c6b566b0534 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes the reciprocal of x element-wise. @@ -33,7 +34,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Reciprocal extends PrimitiveOp implements Operand { +public final class Reciprocal extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Reciprocal operation. @@ -42,7 +43,7 @@ public final class Reciprocal extends PrimitiveOp implements Operand { * @param x * @return a new instance of Reciprocal */ - public static Reciprocal create(Scope scope, Operand x) { + public static Reciprocal create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Reciprocal", scope.makeOpName("Reciprocal")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 47eaf7ebc15..9a3ceb1b4d9 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Computes the gradient for the inverse of `x` wrt its input. @@ -32,7 +33,7 @@ * * @param data type for {@code z()} output */ -public final class ReciprocalGrad extends PrimitiveOp implements Operand { +public final class ReciprocalGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ReciprocalGrad operation. @@ -42,7 +43,7 @@ public final class ReciprocalGrad extends PrimitiveOp implements Operand { * @param dy * @return a new instance of ReciprocalGrad */ - public static ReciprocalGrad create(Scope scope, Operand y, Operand dy) { + 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()); 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 3449a6e8418..c0e6d1b31b0 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns element-wise integer closest to x. @@ -41,7 +43,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Rint extends PrimitiveOp implements Operand { +public final class Rint extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Rint operation. @@ -50,7 +52,7 @@ public final class Rint extends PrimitiveOp implements Operand * @param x * @return a new instance of Rint */ - public static Rint create(Scope scope, Operand x) { + public static Rint create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Rint", scope.makeOpName("Rint")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 f0b30e5528a..2d7ee0aa467 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Rounds the values of a tensor to the nearest integer, element-wise. @@ -34,7 +35,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Round extends PrimitiveOp implements Operand { +public final class Round extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Round operation. @@ -43,7 +44,7 @@ public final class Round extends PrimitiveOp implements Operand { * @param x * @return a new instance of Round */ - public static Round create(Scope scope, Operand x) { + public static Round create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Round", scope.makeOpName("Round")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 ad306c269a5..e4b4303c708 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes reciprocal of square root of x element-wise. @@ -33,7 +34,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Rsqrt extends PrimitiveOp implements Operand { +public final class Rsqrt extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Rsqrt operation. @@ -42,7 +43,7 @@ public final class Rsqrt extends PrimitiveOp implements Operand { * @param x * @return a new instance of Rsqrt */ - public static Rsqrt create(Scope scope, Operand x) { + public static Rsqrt create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Rsqrt", scope.makeOpName("Rsqrt")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 e0fed0ce6e3..2195769afc2 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Computes the gradient for the rsqrt of `x` wrt its input. @@ -32,7 +33,7 @@ * * @param data type for {@code z()} output */ -public final class RsqrtGrad extends PrimitiveOp implements Operand { +public final class RsqrtGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RsqrtGrad operation. @@ -42,7 +43,7 @@ public final class RsqrtGrad extends PrimitiveOp implements Operand { * @param dy * @return a new instance of RsqrtGrad */ - public static RsqrtGrad create(Scope scope, Operand y, Operand dy) { + 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()); 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 3b54dc4bf0f..be8e5f38c7f 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the maximum along segments of a tensor. @@ -54,7 +56,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class SegmentMax extends PrimitiveOp implements Operand { +public final class SegmentMax extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SegmentMax operation. @@ -65,7 +67,7 @@ public final class SegmentMax extends PrimitiveOp implements O * first dimension. Values should be sorted and can be repeated. * @return a new instance of SegmentMax */ - public static SegmentMax create(Scope scope, Operand data, Operand segmentIds) { + 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()); 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 cb1e0cf3161..5c0c0c3ac95 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the mean along segments of a tensor. @@ -55,7 +57,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class SegmentMean extends PrimitiveOp implements Operand { +public final class SegmentMean extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SegmentMean operation. @@ -66,7 +68,7 @@ public final class SegmentMean extends PrimitiveOp implements Operand { * first dimension. Values should be sorted and can be repeated. * @return a new instance of SegmentMean */ - public static SegmentMean create(Scope scope, Operand data, Operand segmentIds) { + 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()); 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 188bb13d1b3..d777cd60cac 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the minimum along segments of a tensor. @@ -54,7 +56,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class SegmentMin extends PrimitiveOp implements Operand { +public final class SegmentMin extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SegmentMin operation. @@ -65,7 +67,7 @@ public final class SegmentMin extends PrimitiveOp implements O * first dimension. Values should be sorted and can be repeated. * @return a new instance of SegmentMin */ - public static SegmentMin create(Scope scope, Operand data, Operand segmentIds) { + 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()); 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 4ca79ac843a..b3be0ca8362 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the product along segments of a tensor. @@ -54,7 +56,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class SegmentProd extends PrimitiveOp implements Operand { +public final class SegmentProd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SegmentProd operation. @@ -65,7 +67,7 @@ public final class SegmentProd extends PrimitiveOp implements Operand { * first dimension. Values should be sorted and can be repeated. * @return a new instance of SegmentProd */ - public static SegmentProd create(Scope scope, Operand data, Operand segmentIds) { + 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()); 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 f9c71790e5f..d2568fcb35b 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the sum along segments of a tensor. @@ -54,7 +56,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class SegmentSum extends PrimitiveOp implements Operand { +public final class SegmentSum extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SegmentSum operation. @@ -65,7 +67,7 @@ public final class SegmentSum extends PrimitiveOp implements Operand { * first dimension. Values should be sorted and can be repeated. * @return a new instance of SegmentSum */ - public static SegmentSum create(Scope scope, Operand data, Operand segmentIds) { + 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()); 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 542cab728f1..9b2441fb151 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes sigmoid of `x` element-wise. @@ -33,7 +34,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Sigmoid extends PrimitiveOp implements Operand { +public final class Sigmoid extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Sigmoid operation. @@ -42,7 +43,7 @@ public final class Sigmoid extends PrimitiveOp implements Operand { * @param x * @return a new instance of Sigmoid */ - public static Sigmoid create(Scope scope, Operand x) { + public static Sigmoid create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sigmoid", scope.makeOpName("Sigmoid")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 dbc7782fd86..14f700d85d3 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Computes the gradient of the sigmoid of `x` wrt its input. @@ -32,7 +33,7 @@ * * @param data type for {@code z()} output */ -public final class SigmoidGrad extends PrimitiveOp implements Operand { +public final class SigmoidGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SigmoidGrad operation. @@ -42,7 +43,7 @@ public final class SigmoidGrad extends PrimitiveOp implements Operand { * @param dy * @return a new instance of SigmoidGrad */ - public static SigmoidGrad create(Scope scope, Operand y, Operand dy) { + 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()); 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 abf5b454117..e9e8bf3149e 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns an element-wise indication of the sign of a number. @@ -35,7 +36,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Sign extends PrimitiveOp implements Operand { +public final class Sign extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Sign operation. @@ -44,7 +45,7 @@ public final class Sign extends PrimitiveOp implements Operand { * @param x * @return a new instance of Sign */ - public static Sign create(Scope scope, Operand x) { + public static Sign create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sign", scope.makeOpName("Sign")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 74905ac75c9..8c8d098b7b7 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes sine of x element-wise. @@ -41,7 +42,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Sin extends PrimitiveOp implements Operand { +public final class Sin extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Sin operation. @@ -50,7 +51,7 @@ public final class Sin extends PrimitiveOp implements Operand { * @param x * @return a new instance of Sin */ - public static Sin create(Scope scope, Operand x) { + public static Sin create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sin", scope.makeOpName("Sin")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 c561c693852..f3e2835939c 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes hyperbolic sine of x element-wise. @@ -41,7 +42,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Sinh extends PrimitiveOp implements Operand { +public final class Sinh extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Sinh operation. @@ -50,7 +51,7 @@ public final class Sinh extends PrimitiveOp implements Operand { * @param x * @return a new instance of Sinh */ - public static Sinh create(Scope scope, Operand x) { + public static Sinh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sinh", scope.makeOpName("Sinh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 dbaba42df8b..9103ed551ed 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes softplus: `log(exp(features) + 1)`. @@ -31,7 +33,7 @@ * @param data type for {@code activations()} output */ @Operator(group = "math") -public final class Softplus extends PrimitiveOp implements Operand { +public final class Softplus extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Softplus operation. @@ -40,7 +42,7 @@ public final class Softplus extends PrimitiveOp implements Ope * @param features * @return a new instance of Softplus */ - public static Softplus create(Scope scope, Operand features) { + public static Softplus create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Softplus", scope.makeOpName("Softplus")); opBuilder.addInput(features.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 675aad3567b..5e002a9538c 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes softplus gradients for a softplus operation. * * @param data type for {@code backprops()} output */ -public final class SoftplusGrad extends PrimitiveOp implements Operand { +public final class SoftplusGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SoftplusGrad operation. @@ -39,7 +41,7 @@ public final class SoftplusGrad extends PrimitiveOp implements * @param features The features passed as input to the corresponding softplus operation. * @return a new instance of SoftplusGrad */ - public static SoftplusGrad create(Scope scope, Operand gradients, Operand features) { + 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()); 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 ec117ccedcb..3c13be52128 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes square root of x element-wise. @@ -33,7 +34,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Sqrt extends PrimitiveOp implements Operand { +public final class Sqrt extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Sqrt operation. @@ -42,7 +43,7 @@ public final class Sqrt extends PrimitiveOp implements Operand { * @param x * @return a new instance of Sqrt */ - public static Sqrt create(Scope scope, Operand x) { + public static Sqrt create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Sqrt", scope.makeOpName("Sqrt")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 100db9173b4..d70b3ab26c8 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Computes the gradient for the sqrt of `x` wrt its input. @@ -32,7 +33,7 @@ * * @param data type for {@code z()} output */ -public final class SqrtGrad extends PrimitiveOp implements Operand { +public final class SqrtGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SqrtGrad operation. @@ -42,7 +43,7 @@ public final class SqrtGrad extends PrimitiveOp implements Operand { * @param dy * @return a new instance of SqrtGrad */ - public static SqrtGrad create(Scope scope, Operand y, Operand dy) { + 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()); 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 9bcdfb7749d..26c18371258 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes square of x element-wise. @@ -33,7 +34,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Square extends PrimitiveOp implements Operand { +public final class Square extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Square operation. @@ -42,7 +43,7 @@ public final class Square extends PrimitiveOp implements Operand { * @param x * @return a new instance of Square */ - public static Square create(Scope scope, Operand x) { + public static Square create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Square", scope.makeOpName("Square")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 c72b871eb41..ff6c8c3bf91 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns (x - y)(x - y) element-wise. @@ -34,7 +35,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class SquaredDifference extends PrimitiveOp implements Operand { +public final class SquaredDifference extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SquaredDifference operation. @@ -44,7 +45,7 @@ public final class SquaredDifference extends PrimitiveOp implements Operand SquaredDifference create(Scope scope, Operand x, Operand y) { + 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()); 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 0aed952fcd9..68828b7d8da 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns x - y element-wise. @@ -34,7 +35,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Sub extends PrimitiveOp implements Operand { +public final class Sub extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Sub operation. @@ -44,7 +45,7 @@ public final class Sub extends PrimitiveOp implements Operand { * @param y * @return a new instance of Sub */ - public static Sub create(Scope scope, Operand x, Operand y) { + 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()); 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 ab4cd8fc789..d63b0e6dd8a 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes tan of x element-wise. @@ -42,7 +43,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Tan extends PrimitiveOp implements Operand { +public final class Tan extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Tan operation. @@ -51,7 +52,7 @@ public final class Tan extends PrimitiveOp implements Operand { * @param x * @return a new instance of Tan */ - public static Tan create(Scope scope, Operand x) { + public static Tan create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Tan", scope.makeOpName("Tan")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 d7eb23c20f2..8dffb1b6059 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes hyperbolic tangent of `x` element-wise. @@ -41,7 +42,7 @@ * @param data type for {@code y()} output */ @Operator(group = "math") -public final class Tanh extends PrimitiveOp implements Operand { +public final class Tanh extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Tanh operation. @@ -50,7 +51,7 @@ public final class Tanh extends PrimitiveOp implements Operand { * @param x * @return a new instance of Tanh */ - public static Tanh create(Scope scope, Operand x) { + public static Tanh create(Scope scope, Operand x) { OperationBuilder opBuilder = scope.env().opBuilder("Tanh", scope.makeOpName("Tanh")); opBuilder.addInput(x.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 60d358b6ea3..767474679d6 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Computes the gradient for the tanh of `x` wrt its input. @@ -32,7 +33,7 @@ * * @param data type for {@code z()} output */ -public final class TanhGrad extends PrimitiveOp implements Operand { +public final class TanhGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TanhGrad operation. @@ -42,7 +43,7 @@ public final class TanhGrad extends PrimitiveOp implements Operand { * @param dy * @return a new instance of TanhGrad */ - public static TanhGrad create(Scope scope, Operand y, Operand dy) { + 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()); 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 2c02733a143..95841359c11 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns x / y element-wise for integer types. @@ -39,7 +40,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class TruncateDiv extends PrimitiveOp implements Operand { +public final class TruncateDiv extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TruncateDiv operation. @@ -49,7 +50,7 @@ public final class TruncateDiv extends PrimitiveOp implements Operand { * @param y * @return a new instance of TruncateDiv */ - public static TruncateDiv create(Scope scope, Operand x, Operand y) { + 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()); 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 54fbb2032f7..f651b07f20e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns element-wise remainder of division. This emulates C semantics in that @@ -37,7 +39,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class TruncateMod extends PrimitiveOp implements Operand { +public final class TruncateMod extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TruncateMod operation. @@ -47,7 +49,7 @@ public final class TruncateMod extends PrimitiveOp implements * @param y * @return a new instance of TruncateMod */ - public static TruncateMod create(Scope scope, Operand x, Operand y) { + 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()); 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 e4acd147ac1..7019e5c7a5d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the maximum along segments of a tensor. @@ -62,7 +64,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class UnsortedSegmentMax extends PrimitiveOp implements Operand { +public final class UnsortedSegmentMax extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UnsortedSegmentMax operation. @@ -73,7 +75,7 @@ public final class UnsortedSegmentMax extends PrimitiveOp impl * @param numSegments * @return a new instance of UnsortedSegmentMax */ - public static UnsortedSegmentMax create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { + 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()); 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 a18a32b283d..e32fcad9bd5 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the minimum along segments of a tensor. @@ -56,7 +58,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class UnsortedSegmentMin extends PrimitiveOp implements Operand { +public final class UnsortedSegmentMin extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UnsortedSegmentMin operation. @@ -67,7 +69,7 @@ public final class UnsortedSegmentMin extends PrimitiveOp impl * @param numSegments * @return a new instance of UnsortedSegmentMin */ - public static UnsortedSegmentMin create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { + 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()); 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 52d5bb3e0a3..25efa5bf7c4 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the product along segments of a tensor. @@ -55,7 +57,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class UnsortedSegmentProd extends PrimitiveOp implements Operand { +public final class UnsortedSegmentProd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UnsortedSegmentProd operation. @@ -66,7 +68,7 @@ public final class UnsortedSegmentProd extends PrimitiveOp implements Operand * @param numSegments * @return a new instance of UnsortedSegmentProd */ - public static UnsortedSegmentProd create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { + 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()); 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 74a1bfe774c..aaa4035482d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the sum along segments of a tensor. @@ -58,7 +60,7 @@ * @param data type for {@code output()} output */ @Operator(group = "math") -public final class UnsortedSegmentSum extends PrimitiveOp implements Operand { +public final class UnsortedSegmentSum extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UnsortedSegmentSum operation. @@ -69,7 +71,7 @@ public final class UnsortedSegmentSum extends PrimitiveOp implements Operand< * @param numSegments * @return a new instance of UnsortedSegmentSum */ - public static UnsortedSegmentSum create(Scope scope, Operand data, Operand segmentIds, Operand numSegments) { + 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()); 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 56b788f1406..b26a8dacc78 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns 0 if x == 0, and x / y otherwise, elementwise. @@ -31,7 +32,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Xdivy extends PrimitiveOp implements Operand { +public final class Xdivy extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Xdivy operation. @@ -41,7 +42,7 @@ public final class Xdivy extends PrimitiveOp implements Operand { * @param y * @return a new instance of Xdivy */ - public static Xdivy create(Scope scope, Operand x, Operand y) { + 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()); 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 d689e62d504..4fc91183fb4 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Returns 0 if x == 0, and x * log(y) otherwise, elementwise. @@ -31,7 +32,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Xlogy extends PrimitiveOp implements Operand { +public final class Xlogy extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Xlogy operation. @@ -41,7 +42,7 @@ public final class Xlogy extends PrimitiveOp implements Operand { * @param y * @return a new instance of Xlogy */ - public static Xlogy create(Scope scope, Operand x, Operand y) { + 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()); 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 37531d72504..433f727292c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Compute the Hurwitz zeta function \\(\zeta(x, q)\\). @@ -35,7 +37,7 @@ * @param data type for {@code z()} output */ @Operator(group = "math") -public final class Zeta extends PrimitiveOp implements Operand { +public final class Zeta extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Zeta operation. @@ -45,7 +47,7 @@ public final class Zeta extends PrimitiveOp implements Operand * @param q * @return a new instance of Zeta */ - public static Zeta create(Scope scope, Operand x, Operand q) { + 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()); 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 b3c46193650..d89158d2c88 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Performs average pooling on the input. @@ -35,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class AvgPool extends PrimitiveOp implements Operand { +public final class AvgPool extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.AvgPool} @@ -71,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AvgPool */ - public static AvgPool create(Scope scope, Operand value, List ksize, List strides, String padding, Options... options) { + 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.applyControlDependencies(opBuilder); 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 e77ac2b2adf..d0c56a08a9e 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Performs 3D average pooling on the input. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class AvgPool3d extends PrimitiveOp implements Operand { +public final class AvgPool3d extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3d} @@ -70,7 +72,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AvgPool3d */ - public static AvgPool3d create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { + 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.applyControlDependencies(opBuilder); 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 89e95f9963e..bf058167183 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradients of average pooling function. @@ -32,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class AvgPool3dGrad extends PrimitiveOp implements Operand { +public final class AvgPool3dGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.AvgPool3dGrad} @@ -71,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AvgPool3dGrad */ - public static AvgPool3dGrad create(Scope scope, Operand origInputShape, Operand grad, List ksize, List strides, String padding, Options... options) { + 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()); 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 e2d9bc5d359..0f7c1dfd529 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 @@ -24,13 +24,16 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradients of the average pooling function. * * @param data type for {@code output()} output */ -public final class AvgPoolGrad extends PrimitiveOp implements Operand { +public final class AvgPoolGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.AvgPoolGrad} @@ -68,7 +71,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AvgPoolGrad */ - public static AvgPoolGrad create(Scope scope, Operand origInputShape, Operand grad, List ksize, List strides, String padding, Options... options) { + 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()); 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 8dd759470dc..60058feaea4 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Batch normalization. @@ -33,7 +34,7 @@ * @param data type for {@code result()} output */ @Operator(group = "nn") -public final class BatchNormWithGlobalNormalization extends PrimitiveOp implements Operand { +public final class BatchNormWithGlobalNormalization extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchNormWithGlobalNormalization operation. @@ -56,7 +57,7 @@ public final class BatchNormWithGlobalNormalization extends PrimitiveOp imple * needs to be multiplied with gamma. * @return a new instance of BatchNormWithGlobalNormalization */ - public static BatchNormWithGlobalNormalization create(Scope scope, Operand t, Operand m, Operand v, Operand beta, Operand gamma, Float varianceEpsilon, Boolean scaleAfterNormalization) { + 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()); 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 0c1f29df260..e2f26aff2f7 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Gradients for batch normalization. @@ -33,7 +34,7 @@ * @param data type for {@code dx()} output */ @Operator(group = "nn") -public final class BatchNormWithGlobalNormalizationGrad extends PrimitiveOp { +public final class BatchNormWithGlobalNormalizationGrad extends PrimitiveOp { /** * Factory method to create a class wrapping a new BatchNormWithGlobalNormalizationGrad operation. @@ -55,7 +56,7 @@ public final class BatchNormWithGlobalNormalizationGrad extends PrimitiveOp { * needs to be multiplied with gamma. * @return a new instance of BatchNormWithGlobalNormalizationGrad */ - public static BatchNormWithGlobalNormalizationGrad create(Scope scope, Operand t, Operand m, Operand v, Operand gamma, Operand backprop, Float varianceEpsilon, Boolean scaleAfterNormalization) { + 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()); 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 c0156b4dadb..d4af0d9a04f 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Adds `bias` to `value`. @@ -34,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class BiasAdd extends PrimitiveOp implements Operand { +public final class BiasAdd extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.BiasAdd} @@ -70,7 +71,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BiasAdd */ - public static BiasAdd create(Scope scope, Operand value, Operand bias, Options... options) { + 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()); 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 1172dc6138a..ffa37470080 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * The backward operation for "BiasAdd" on the "bias" tensor. @@ -35,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class BiasAddGrad extends PrimitiveOp implements Operand { +public final class BiasAddGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.BiasAddGrad} @@ -70,7 +71,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of BiasAddGrad */ - public static BiasAddGrad create(Scope scope, Operand outBackprop, Options... options) { + 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.applyControlDependencies(opBuilder); 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 7023882c3c1..5cd96977f17 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** * Computes the ids of the positions in sampled_candidates that match true_labels. @@ -76,7 +79,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ComputeAccidentalHits */ - public static ComputeAccidentalHits create(Scope scope, Operand trueClasses, Operand sampledCandidates, Long numTrue, Options... options) { + 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()); @@ -114,7 +117,7 @@ public static Options seed2(Long seed2) { /** * A vector of indices corresponding to rows of true_candidates. */ - public Output indices() { + public Output indices() { return indices; } @@ -122,7 +125,7 @@ public Output indices() { * A vector of IDs of positions in sampled_candidates that match a true_label * for the row with the corresponding index in indices. */ - public Output ids() { + public Output ids() { return ids; } @@ -130,13 +133,13 @@ public Output ids() { * A vector of the same length as indices and ids, in which each element * is -FLOAT_MAX. */ - public Output weights() { + public Output weights() { return weights; } - private Output indices; - private Output ids; - private Output weights; + private Output indices; + private Output ids; + private Output weights; private ComputeAccidentalHits(Operation operation) { super(operation); 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 01174a742a2..6c5800e9dc4 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes a 2-D convolution given 4-D `input` and `filter` tensors. @@ -54,7 +56,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class Conv2d extends PrimitiveOp implements Operand { +public final class Conv2d extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.Conv2d} @@ -128,7 +130,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Conv2d */ - public static Conv2d create(Scope scope, Operand input, Operand filter, List strides, String padding, Options... options) { + 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()); 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 b7f34c9014e..bfee3a19eeb 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradients of convolution with respect to the filter. @@ -32,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class Conv2dBackpropFilter extends PrimitiveOp implements Operand { +public final class Conv2dBackpropFilter extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropFilter} @@ -108,7 +111,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Conv2dBackpropFilter */ - public static Conv2dBackpropFilter create(Scope scope, Operand input, Operand filterSizes, Operand outBackprop, List strides, String padding, Options... options) { + 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()); 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 8b1bf33b786..46ead2864fe 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradients of convolution with respect to the input. @@ -32,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class Conv2dBackpropInput extends PrimitiveOp implements Operand { +public final class Conv2dBackpropInput extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.Conv2dBackpropInput} @@ -108,7 +111,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Conv2dBackpropInput */ - public static Conv2dBackpropInput create(Scope scope, Operand inputSizes, Operand filter, Operand outBackprop, List strides, String padding, Options... options) { + 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()); 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 ae258baa8cb..4fed9096d6b 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes a 3-D convolution given 5-D `input` and `filter` tensors. @@ -38,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class Conv3d extends PrimitiveOp implements Operand { +public final class Conv3d extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.Conv3d} @@ -89,7 +91,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Conv3d */ - public static Conv3d create(Scope scope, Operand input, Operand filter, List strides, String padding, Options... options) { + 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()); 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 08a13e1f0bd..c67d2aa8415 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradients of 3-D convolution with respect to the filter. @@ -32,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class Conv3dBackpropFilter extends PrimitiveOp implements Operand { +public final class Conv3dBackpropFilter extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropFilter} @@ -87,7 +90,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Conv3dBackpropFilter */ - public static Conv3dBackpropFilter create(Scope scope, Operand input, Operand filterSizes, Operand outBackprop, List strides, String padding, Options... options) { + 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()); 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 2d1da92eb6b..152be1576e7 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradients of 3-D convolution with respect to the input. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class Conv3dBackpropInput extends PrimitiveOp implements Operand { +public final class Conv3dBackpropInput extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.Conv3dBackpropInput} @@ -87,7 +89,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Conv3dBackpropInput */ - public static Conv3dBackpropInput create(Scope scope, Operand inputSizes, Operand filter, Operand outBackprop, List strides, String padding, Options... options) { + 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()); 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 2f29f2c7f2d..e252d26be69 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 @@ -26,6 +26,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** * Performs beam search decoding on the logits given in input. @@ -69,7 +72,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CtcBeamSearchDecoder */ - public static CtcBeamSearchDecoder create(Scope scope, Operand inputs, Operand sequenceLength, Long beamWidth, Long topPaths, Options... options) { + 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()); @@ -98,7 +101,7 @@ public static Options mergeRepeated(Boolean mergeRepeated) { * size `(total_decoded_outputs[j] x 2)`, has indices of a * `SparseTensor`. The rows store: [batch, time]. */ - public List> decodedIndices() { + public List> decodedIndices() { return decodedIndices; } @@ -107,7 +110,7 @@ public List> decodedIndices() { * size `(length total_decoded_outputs[j])`, has the values of a * `SparseTensor`. The vector stores the decoded classes for beam j. */ - public List> decodedValues() { + public List> decodedValues() { return decodedValues; } @@ -116,7 +119,7 @@ public List> decodedValues() { * size `(2)`, stores the shape of the decoded `SparseTensor[j]`. * Its values are: `[batch_size, max_decoded_length[j]]`. */ - public List> decodedShape() { + public List> decodedShape() { return decodedShape; } @@ -124,27 +127,27 @@ public List> decodedShape() { * A matrix, shaped: `(batch_size x top_paths)`. The * sequence log-probabilities. */ - public Output logProbability() { + public Output logProbability() { return logProbability; } - private List> decodedIndices; - private List> decodedValues; - private List> decodedShape; - private Output logProbability; + 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)); + decodedIndices = Arrays.asList((Output[])operation.outputList(outputIdx, decodedIndicesLength)); outputIdx += decodedIndicesLength; int decodedValuesLength = operation.outputListLength("decoded_values"); - decodedValues = Arrays.asList((Output[])operation.outputList(outputIdx, decodedValuesLength)); + decodedValues = Arrays.asList((Output[])operation.outputList(outputIdx, decodedValuesLength)); outputIdx += decodedValuesLength; int decodedShapeLength = operation.outputListLength("decoded_shape"); - decodedShape = Arrays.asList((Output[])operation.outputList(outputIdx, decodedShapeLength)); + decodedShape = Arrays.asList((Output[])operation.outputList(outputIdx, decodedShapeLength)); outputIdx += decodedShapeLength; logProbability = operation.output(outputIdx++); } 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 95de2b91e62..3f57337a300 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** * Performs greedy decoding on the logits given in inputs. @@ -69,7 +72,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CtcGreedyDecoder */ - public static CtcGreedyDecoder create(Scope scope, Operand inputs, Operand sequenceLength, Options... options) { + 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()); @@ -95,7 +98,7 @@ public static Options mergeRepeated(Boolean mergeRepeated) { * Indices matrix, size `(total_decoded_outputs x 2)`, * of a `SparseTensor`. The rows store: [batch, time]. */ - public Output decodedIndices() { + public Output decodedIndices() { return decodedIndices; } @@ -103,7 +106,7 @@ public Output decodedIndices() { * Values vector, size: `(total_decoded_outputs)`, * of a `SparseTensor`. The vector stores the decoded classes. */ - public Output decodedValues() { + public Output decodedValues() { return decodedValues; } @@ -111,7 +114,7 @@ public Output decodedValues() { * Shape vector, size `(2)`, of the decoded SparseTensor. * Values are: `[batch_size, max_decoded_length]`. */ - public Output decodedShape() { + public Output decodedShape() { return decodedShape; } @@ -119,14 +122,14 @@ public Output decodedShape() { * Matrix, size `(batch_size x 1)`, containing sequence * log-probabilities. */ - public Output logProbability() { + public Output logProbability() { return logProbability; } - private Output decodedIndices; - private Output decodedValues; - private Output decodedShape; - private Output logProbability; + private Output decodedIndices; + private Output decodedValues; + private Output decodedShape; + private Output logProbability; private CtcGreedyDecoder(Operation operation) { super(operation); 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 0b9d0a1c37b..17a9b5f929d 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; /** * Calculates the CTC Loss (log probability) for each batch entry. Also calculates @@ -89,7 +92,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CtcLoss */ - public static CtcLoss create(Scope scope, Operand inputs, Operand labelsIndices, Operand labelsValues, Operand sequenceLength, Options... options) { + 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()); @@ -141,7 +144,7 @@ public static Options ignoreLongerOutputsThanInputs(Boolean ignoreLongerOutputsT /** * A vector (batch) containing log-probabilities. */ - public Output loss() { + public Output loss() { return loss; } @@ -149,12 +152,12 @@ public Output loss() { * The gradient of `loss`. 3-D, shape: * `(max_time x batch_size x num_classes)`. */ - public Output gradient() { + public Output gradient() { return gradient; } - private Output loss; - private Output gradient; + private Output loss; + private Output gradient; private CtcLoss(Operation operation) { super(operation); 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 6d58696078a..e956636e8b6 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 @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * A RNN backed by cuDNN. @@ -63,7 +65,7 @@ * * @param data type for {@code output()} output */ -public final class CudnnRnn extends PrimitiveOp { +public final class CudnnRnn extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.CudnnRnn} @@ -149,7 +151,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CudnnRnn */ - public static CudnnRnn create(Scope scope, Operand input, Operand inputH, Operand inputC, Operand params, Options... options) { + public static CudnnRnn create(Scope scope, Operand input, Operand inputH, Operand inputC, Operand params, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNV2", scope.makeOpName("CudnnRnn")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputH.asOutput()); 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 2be481864d9..6f9df68ab88 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 @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Backprop step of CudnnRNN. @@ -72,7 +74,7 @@ * * @param data type for {@code inputBackprop()} output */ -public final class CudnnRnnBackprop extends PrimitiveOp { +public final class CudnnRnnBackprop extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.CudnnRnnBackprop} @@ -157,7 +159,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CudnnRnnBackprop */ - public static CudnnRnnBackprop create(Scope scope, Operand input, Operand inputH, Operand inputC, Operand params, Operand output, Operand outputH, Operand outputC, Operand outputBackprop, Operand outputHBackprop, Operand outputCBackprop, Operand reserveSpace, Operand hostReserved, Options... options) { + public static CudnnRnnBackprop create(Scope scope, Operand input, Operand inputH, Operand inputC, Operand params, Operand output, Operand outputH, Operand outputC, Operand outputBackprop, Operand outputHBackprop, Operand outputCBackprop, Operand reserveSpace, Operand hostReserved, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNBackpropV2", scope.makeOpName("CudnnRnnBackprop")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputH.asOutput()); 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 65343be704e..dca79d4db78 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Converts CudnnRNN params from canonical form to usable form. @@ -62,7 +65,7 @@ * @param data type for {@code params()} output */ @Operator(group = "nn") -public final class CudnnRnnCanonicalToParams extends PrimitiveOp implements Operand { +public final class CudnnRnnCanonicalToParams extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.CudnnRnnCanonicalToParams} @@ -140,7 +143,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CudnnRnnCanonicalToParams */ - public static CudnnRnnCanonicalToParams create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Iterable> weights, Iterable> biases, Options... options) { + public static CudnnRnnCanonicalToParams create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Iterable> weights, Iterable> biases, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNCanonicalToParams", scope.makeOpName("CudnnRnnCanonicalToParams")); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); 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 8c3d6b2e772..d213fc6a4e4 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes size of weights that can be used by a Cudnn RNN model. @@ -54,7 +57,7 @@ * @param data type for {@code paramsSize()} output */ @Operator(group = "nn") -public final class CudnnRnnParamsSize extends PrimitiveOp implements Operand { +public final class CudnnRnnParamsSize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.CudnnRnnParamsSize} @@ -141,14 +144,14 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CudnnRnnParamsSize */ - public static CudnnRnnParamsSize create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Class T, Class S, Options... options) { + public static CudnnRnnParamsSize create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, DataType T, DataType S, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNParamsSize", scope.makeOpName("CudnnRnnParamsSize")); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); opBuilder.addInput(inputSize.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("T", DataType.fromClass(T)); - opBuilder.setAttr("S", DataType.fromClass(S)); + opBuilder.setAttr("T", T); + opBuilder.setAttr("S", S); if (options != null) { for (Options opts : options) { if (opts.rnnMode != null) { 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 f5e3407813a..3b9a603134e 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 @@ -26,6 +26,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Retrieves CudnnRNN params in canonical form. @@ -63,7 +66,7 @@ * @param data type for {@code weights()} output */ @Operator(group = "nn") -public final class CudnnRnnParamsToCanonical extends PrimitiveOp { +public final class CudnnRnnParamsToCanonical extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.CudnnRnnParamsToCanonical} @@ -141,7 +144,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of CudnnRnnParamsToCanonical */ - public static CudnnRnnParamsToCanonical create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Operand params, Long numParams, Options... options) { + public static CudnnRnnParamsToCanonical create(Scope scope, Operand numLayers, Operand numUnits, Operand inputSize, Operand params, Long numParams, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("CudnnRNNParamsToCanonical", scope.makeOpName("CudnnRnnParamsToCanonical")); opBuilder.addInput(numLayers.asOutput()); opBuilder.addInput(numUnits.asOutput()); 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 73fa180a1e1..fa08f02cfce 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the dimension index in the destination data format given the one in @@ -33,7 +35,7 @@ * @param data type for {@code y()} output */ @Operator(group = "nn") -public final class DataFormatDimMap extends PrimitiveOp implements Operand { +public final class DataFormatDimMap extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.DataFormatDimMap} @@ -72,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DataFormatDimMap */ - public static DataFormatDimMap create(Scope scope, Operand x, Options... options) { + 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.applyControlDependencies(opBuilder); 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 2286c63bcf7..55f2a4ccbae 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the permuted vector/tensor in the destination data format given the @@ -33,7 +35,7 @@ * @param data type for {@code y()} output */ @Operator(group = "nn") -public final class DataFormatVecPermute extends PrimitiveOp implements Operand { +public final class DataFormatVecPermute extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.DataFormatVecPermute} @@ -71,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DataFormatVecPermute */ - public static DataFormatVecPermute create(Scope scope, Operand x, Options... options) { + 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.applyControlDependencies(opBuilder); 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 f42f2077831..d25fd293f86 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * DepthToSpace for tensors of type T. @@ -111,7 +112,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class DepthToSpace extends PrimitiveOp implements Operand { +public final class DepthToSpace extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.DepthToSpace} @@ -141,7 +142,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DepthToSpace */ - public static DepthToSpace create(Scope scope, Operand input, Long blockSize, Options... options) { + 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.applyControlDependencies(opBuilder); 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 42bb7ee0ea7..7e0c19eebdc 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes a 2-D depthwise convolution given 4-D `input` and `filter` tensors. @@ -49,7 +51,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class DepthwiseConv2dNative extends PrimitiveOp implements Operand { +public final class DepthwiseConv2dNative extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNative} @@ -99,7 +101,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DepthwiseConv2dNative */ - public static DepthwiseConv2dNative create(Scope scope, Operand input, Operand filter, List strides, String padding, Options... options) { + 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()); 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 192bb0f8769..d2a7bd16444 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradients of depthwise convolution with respect to the filter. @@ -32,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class DepthwiseConv2dNativeBackpropFilter extends PrimitiveOp implements Operand { +public final class DepthwiseConv2dNativeBackpropFilter extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropFilter} @@ -90,7 +93,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DepthwiseConv2dNativeBackpropFilter */ - public static DepthwiseConv2dNativeBackpropFilter create(Scope scope, Operand input, Operand filterSizes, Operand outBackprop, List strides, String padding, Options... options) { + 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()); 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 ee9198bc79e..08206d31e08 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradients of depthwise convolution with respect to the input. @@ -32,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class DepthwiseConv2dNativeBackpropInput extends PrimitiveOp implements Operand { +public final class DepthwiseConv2dNativeBackpropInput extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.DepthwiseConv2dNativeBackpropInput} @@ -89,7 +92,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DepthwiseConv2dNativeBackpropInput */ - public static DepthwiseConv2dNativeBackpropInput create(Scope scope, Operand inputSizes, Operand filter, Operand outBackprop, List strides, String padding, Options... options) { + 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()); 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 716c14cd316..2aef4a33e1e 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the grayscale dilation of 4-D `input` and 3-D `filter` tensors. @@ -56,7 +58,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class Dilation2d extends PrimitiveOp implements Operand { +public final class Dilation2d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Dilation2d operation. @@ -71,7 +73,7 @@ public final class Dilation2d extends PrimitiveOp implements O * @param padding The type of padding algorithm to use. * @return a new instance of Dilation2d */ - public static Dilation2d create(Scope scope, Operand input, Operand filter, List strides, List rates, String padding) { + 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()); 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 4b57a90c7a4..b0525e30f5b 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradient of morphological 2-D dilation with respect to the filter. @@ -32,7 +34,7 @@ * @param data type for {@code filterBackprop()} output */ @Operator(group = "nn") -public final class Dilation2dBackpropFilter extends PrimitiveOp implements Operand { +public final class Dilation2dBackpropFilter extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Dilation2dBackpropFilter operation. @@ -48,7 +50,7 @@ public final class Dilation2dBackpropFilter extends PrimitiveO * @param padding The type of padding algorithm to use. * @return a new instance of Dilation2dBackpropFilter */ - public static Dilation2dBackpropFilter create(Scope scope, Operand input, Operand filter, Operand outBackprop, List strides, List rates, String padding) { + 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()); 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 dde8a1c3b3c..78f5edda97c 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the gradient of morphological 2-D dilation with respect to the input. @@ -32,7 +34,7 @@ * @param data type for {@code inBackprop()} output */ @Operator(group = "nn") -public final class Dilation2dBackpropInput extends PrimitiveOp implements Operand { +public final class Dilation2dBackpropInput extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Dilation2dBackpropInput operation. @@ -48,7 +50,7 @@ public final class Dilation2dBackpropInput extends PrimitiveOp * @param padding The type of padding algorithm to use. * @return a new instance of Dilation2dBackpropInput */ - public static Dilation2dBackpropInput create(Scope scope, Operand input, Operand filter, Operand outBackprop, List strides, List rates, String padding) { + 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()); 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 63b5796cfdd..7383ad20305 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes exponential linear: `exp(features) - 1` if < 0, `features` otherwise. @@ -34,7 +36,7 @@ * @param data type for {@code activations()} output */ @Operator(group = "nn") -public final class Elu extends PrimitiveOp implements Operand { +public final class Elu extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Elu operation. @@ -43,7 +45,7 @@ public final class Elu extends PrimitiveOp implements Operand< * @param features * @return a new instance of Elu */ - public static Elu create(Scope scope, Operand features) { + public static Elu create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Elu", scope.makeOpName("Elu")); opBuilder.addInput(features.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 c3f9bdd20db..5e62171e1c1 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradients for the exponential linear (Elu) operation. * * @param data type for {@code backprops()} output */ -public final class EluGrad extends PrimitiveOp implements Operand { +public final class EluGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new EluGrad operation. @@ -39,7 +41,7 @@ public final class EluGrad extends PrimitiveOp implements Oper * @param outputs The outputs of the corresponding Elu operation. * @return a new instance of EluGrad */ - public static EluGrad create(Scope scope, Operand gradients, Operand outputs) { + 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()); 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 bef37316635..aeb650033f5 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Generates labels for candidate sampling with a learned unigram distribution. @@ -163,7 +165,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FixedUnigramCandidateSampler */ - public static FixedUnigramCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -285,7 +287,7 @@ public static Options seed2(Long seed2) { * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. */ - public Output sampledCandidates() { + public Output sampledCandidates() { return sampledCandidates; } @@ -294,7 +296,7 @@ public Output sampledCandidates() { * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. */ - public Output trueExpectedCount() { + public Output trueExpectedCount() { return trueExpectedCount; } @@ -304,13 +306,13 @@ public Output trueExpectedCount() { * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. */ - public Output sampledExpectedCount() { + public Output sampledExpectedCount() { return sampledExpectedCount; } - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; + private Output sampledCandidates; + private Output trueExpectedCount; + private Output sampledExpectedCount; private FixedUnigramCandidateSampler(Operation operation) { super(operation); 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 6dbdeee7c0a..328cd1f38e1 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Performs fractional average pooling on the input. @@ -37,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class FractionalAvgPool extends PrimitiveOp { +public final class FractionalAvgPool extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPool} @@ -123,7 +126,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FractionalAvgPool */ - public static FractionalAvgPool create(Scope scope, Operand value, List poolingRatio, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -214,20 +217,20 @@ public Output output() { /** * row pooling sequence, needed to calculate gradient. */ - public Output rowPoolingSequence() { + public Output rowPoolingSequence() { return rowPoolingSequence; } /** * column pooling sequence, needed to calculate gradient. */ - public Output colPoolingSequence() { + public Output colPoolingSequence() { return colPoolingSequence; } private Output output; - private Output rowPoolingSequence; - private Output colPoolingSequence; + private Output rowPoolingSequence; + private Output colPoolingSequence; private FractionalAvgPool(Operation operation) { super(operation); 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 3ae4f58eed2..bac330212c0 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 @@ -23,6 +23,9 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradient of the FractionalAvgPool function. @@ -35,7 +38,7 @@ * * @param data type for {@code output()} output */ -public final class FractionalAvgPoolGrad extends PrimitiveOp implements Operand { +public final class FractionalAvgPoolGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.FractionalAvgPoolGrad} @@ -78,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FractionalAvgPoolGrad */ - public static FractionalAvgPoolGrad create(Scope scope, Operand origInputTensorShape, Operand outBackprop, Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { + 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()); 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 b4be4d7cae0..75ce7438eda 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Performs fractional max pooling on the input. @@ -61,7 +64,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class FractionalMaxPool extends PrimitiveOp { +public final class FractionalMaxPool extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPool} @@ -147,7 +150,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FractionalMaxPool */ - public static FractionalMaxPool create(Scope scope, Operand value, List poolingRatio, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -238,20 +241,20 @@ public Output output() { /** * row pooling sequence, needed to calculate gradient. */ - public Output rowPoolingSequence() { + public Output rowPoolingSequence() { return rowPoolingSequence; } /** * column pooling sequence, needed to calculate gradient. */ - public Output colPoolingSequence() { + public Output colPoolingSequence() { return colPoolingSequence; } private Output output; - private Output rowPoolingSequence; - private Output colPoolingSequence; + private Output rowPoolingSequence; + private Output colPoolingSequence; private FractionalMaxPool(Operation operation) { super(operation); 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 8fff60353c0..f3c7ec84f8d 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 @@ -23,13 +23,16 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradient of the FractionalMaxPool function. * * @param data type for {@code output()} output */ -public final class FractionalMaxPoolGrad extends PrimitiveOp implements Operand { +public final class FractionalMaxPoolGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.FractionalMaxPoolGrad} @@ -73,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FractionalMaxPoolGrad */ - public static FractionalMaxPoolGrad create(Scope scope, Operand origInput, Operand origOutput, Operand outBackprop, Operand rowPoolingSequence, Operand colPoolingSequence, Options... options) { + 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()); 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 24747439ca5..b9522fc2e82 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Batch normalization. @@ -35,7 +37,7 @@ * @param data type for {@code batchMean()} output */ @Operator(group = "nn") -public final class FusedBatchNorm extends PrimitiveOp { +public final class FusedBatchNorm extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNorm} @@ -89,7 +91,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FusedBatchNorm */ - public static FusedBatchNorm create(Scope scope, Operand x, Operand scale, Operand offset, Operand mean, Operand variance, Options... options) { + public static FusedBatchNorm create(Scope scope, Operand x, Operand scale, Operand offset, Operand mean, Operand variance, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FusedBatchNormV2", scope.makeOpName("FusedBatchNorm")); opBuilder.addInput(x.asOutput()); opBuilder.addInput(scale.asOutput()); 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 add23a2f2c4..d25585f3e68 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Gradient for batch normalization. @@ -35,7 +38,7 @@ * @param data type for {@code scaleBackprop()} output */ @Operator(group = "nn") -public final class FusedBatchNormGrad extends PrimitiveOp { +public final class FusedBatchNormGrad extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.FusedBatchNormGrad} @@ -95,7 +98,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FusedBatchNormGrad */ - public static FusedBatchNormGrad create(Scope scope, Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, Operand reserveSpace2, Options... options) { + public static FusedBatchNormGrad create(Scope scope, Operand yBackprop, Operand x, Operand scale, Operand reserveSpace1, Operand reserveSpace2, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("FusedBatchNormGradV2", scope.makeOpName("FusedBatchNormGrad")); opBuilder.addInput(yBackprop.asOutput()); opBuilder.addInput(x.asOutput()); 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 ea395403fac..41e5762c1dc 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Performs a padding as a preprocess during a convolution. @@ -44,7 +47,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class FusedPadConv2d extends PrimitiveOp implements Operand { +public final class FusedPadConv2d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new FusedPadConv2d operation. @@ -61,7 +64,7 @@ public final class FusedPadConv2d extends PrimitiveOp implemen * @param padding The type of padding algorithm to use. * @return a new instance of FusedPadConv2d */ - public static FusedPadConv2d create(Scope scope, Operand input, Operand paddings, Operand filter, String mode, List strides, String padding) { + 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()); 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 90924370c38..9e85486151e 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Performs a resize and padding as a preprocess during a convolution. @@ -43,7 +46,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class FusedResizeAndPadConv2d extends PrimitiveOp implements Operand { +public final class FusedResizeAndPadConv2d extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.FusedResizeAndPadConv2d} @@ -83,7 +86,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FusedResizeAndPadConv2d */ - public static FusedResizeAndPadConv2d create(Scope scope, Operand input, Operand size, Operand paddings, Operand filter, String mode, List strides, String padding, Options... options) { + public static FusedResizeAndPadConv2d create(Scope scope, Operand input, Operand size, 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()); 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 0e46ec56ecb..fb6b6c4818d 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 @@ -24,6 +24,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Says whether the targets are in the top `K` predictions. @@ -44,7 +48,7 @@ * $$out_i = predictions_{i, targets_i} \in TopKIncludingTies(predictions_i)$$ */ @Operator(group = "nn") -public final class InTopK extends PrimitiveOp implements Operand { +public final class InTopK extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new InTopK operation. @@ -55,7 +59,7 @@ public final class InTopK extends PrimitiveOp implements Operand { * @param k Number of top elements to look at for computing precision. * @return a new instance of InTopK */ - public static InTopK create(Scope scope, Operand predictions, Operand targets, Operand k) { + 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()); @@ -67,16 +71,16 @@ public static InTopK create(Scope scope, Operand predi /** * Computed precision at `k` as a `bool Tensor`. */ - public Output precision() { + public Output precision() { return precision; } @Override - public Output asOutput() { + public Output asOutput() { return precision; } - private Output precision; + private Output precision; private InTopK(Operation operation) { super(operation); 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 c71f385d7ba..26a1be0b4e3 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Computes the gradient for the inverse of `x` wrt its input. @@ -32,7 +33,7 @@ * * @param data type for {@code z()} output */ -public final class InvGrad extends PrimitiveOp implements Operand { +public final class InvGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new InvGrad operation. @@ -42,7 +43,7 @@ public final class InvGrad extends PrimitiveOp implements Operand { * @param dy * @return a new instance of InvGrad */ - public static InvGrad create(Scope scope, Operand y, Operand dy) { + 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()); 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 4544788a34a..2d1f8361b96 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * L2 Loss. @@ -35,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class L2Loss extends PrimitiveOp implements Operand { +public final class L2Loss extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new L2Loss operation. @@ -44,7 +46,7 @@ public final class L2Loss extends PrimitiveOp implements Opera * @param t Typically 2-D, but may have any dimensions. * @return a new instance of L2Loss */ - public static L2Loss create(Scope scope, Operand t) { + public static L2Loss create(Scope scope, Operand t) { OperationBuilder opBuilder = scope.env().opBuilder("L2Loss", scope.makeOpName("L2Loss")); opBuilder.addInput(t.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 8888c986d9f..a9e3956b515 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes rectified linear: `max(features, features * alpha)`. * * @param data type for {@code activations()} output */ -public final class LeakyRelu extends PrimitiveOp implements Operand { +public final class LeakyRelu extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.LeakyRelu} @@ -58,7 +60,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LeakyRelu */ - public static LeakyRelu create(Scope scope, Operand features, Options... options) { + 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.applyControlDependencies(opBuilder); 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 c179f222a5f..373e2a1689d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Generates labels for candidate sampling with a learned unigram distribution. @@ -86,7 +88,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LearnedUnigramCandidateSampler */ - public static LearnedUnigramCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -127,7 +129,7 @@ public static Options seed2(Long seed2) { * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. */ - public Output sampledCandidates() { + public Output sampledCandidates() { return sampledCandidates; } @@ -136,7 +138,7 @@ public Output sampledCandidates() { * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. */ - public Output trueExpectedCount() { + public Output trueExpectedCount() { return trueExpectedCount; } @@ -146,13 +148,13 @@ public Output trueExpectedCount() { * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. */ - public Output sampledExpectedCount() { + public Output sampledExpectedCount() { return sampledExpectedCount; } - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; + private Output sampledCandidates; + private Output trueExpectedCount; + private Output sampledExpectedCount; private LearnedUnigramCandidateSampler(Operation operation) { super(operation); 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 67195a10aff..1a7e149665e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Local Response Normalization. @@ -43,7 +45,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class LocalResponseNormalization extends PrimitiveOp implements Operand { +public final class LocalResponseNormalization extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalization} @@ -99,7 +101,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LocalResponseNormalization */ - public static LocalResponseNormalization create(Scope scope, Operand input, Options... options) { + 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.applyControlDependencies(opBuilder); 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 18aa2082b83..fdbeff877a9 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Gradients for Local Response Normalization. * * @param data type for {@code output()} output */ -public final class LocalResponseNormalizationGrad extends PrimitiveOp implements Operand { +public final class LocalResponseNormalizationGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.LocalResponseNormalizationGrad} @@ -87,7 +89,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LocalResponseNormalizationGrad */ - public static LocalResponseNormalizationGrad create(Scope scope, Operand inputGrads, Operand inputImage, Operand outputImage, Options... options) { + 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()); 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 ca74c354ba0..69539bdda02 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes log softmax activations. @@ -35,7 +37,7 @@ * @param data type for {@code logsoftmax()} output */ @Operator(group = "nn") -public final class LogSoftmax extends PrimitiveOp implements Operand { +public final class LogSoftmax extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new LogSoftmax operation. @@ -44,7 +46,7 @@ public final class LogSoftmax extends PrimitiveOp implements O * @param logits 2-D with shape `[batch_size, num_classes]`. * @return a new instance of LogSoftmax */ - public static LogSoftmax create(Scope scope, Operand logits) { + public static LogSoftmax create(Scope scope, Operand logits) { OperationBuilder opBuilder = scope.env().opBuilder("LogSoftmax", scope.makeOpName("LogSoftmax")); opBuilder.addInput(logits.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 28e645dd8f5..2d29c22534d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Performs max pooling on the input. @@ -31,7 +33,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class MaxPool extends PrimitiveOp implements Operand { +public final class MaxPool extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.MaxPool} @@ -68,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MaxPool */ - public static MaxPool create(Scope scope, Operand input, Operand ksize, Operand strides, String padding, Options... options) { + 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()); 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 30f7c8e0743..05d6dac03ed 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Performs 3D max pooling on the input. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class MaxPool3d extends PrimitiveOp implements Operand { +public final class MaxPool3d extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3d} @@ -70,7 +72,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MaxPool3d */ - public static MaxPool3d create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { + 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.applyControlDependencies(opBuilder); 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 d4d1f97c7a7..62515c5eb8c 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradients of max pooling function. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class MaxPool3dGrad extends PrimitiveOp implements Operand { +public final class MaxPool3dGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGrad} @@ -72,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MaxPool3dGrad */ - public static MaxPool3dGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, List ksize, List strides, String padding, Options... options) { + 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()); 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 90dbaf29876..a0861ad05b7 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes second-order gradients of the maxpooling function. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class MaxPool3dGradGrad extends PrimitiveOp implements Operand { +public final class MaxPool3dGradGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.MaxPool3dGradGrad} @@ -72,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MaxPool3dGradGrad */ - public static MaxPool3dGradGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, List ksize, List strides, String padding, Options... options) { + 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()); 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 4122d18236a..b1e5c127302 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradients of the maxpooling function. @@ -31,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class MaxPoolGrad extends PrimitiveOp implements Operand { +public final class MaxPoolGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGrad} @@ -70,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MaxPoolGrad */ - public static MaxPoolGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, Operand ksize, Operand strides, String padding, Options... options) { + 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()); 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 89b400f5d47..595144efa7b 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes second-order gradients of the maxpooling function. @@ -31,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class MaxPoolGradGrad extends PrimitiveOp implements Operand { +public final class MaxPoolGradGrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGrad} @@ -70,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MaxPoolGradGrad */ - public static MaxPoolGradGrad create(Scope scope, Operand origInput, Operand origOutput, Operand grad, Operand ksize, Operand strides, String padding, Options... options) { + 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()); 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 79f691e6a3c..80f2000353c 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes second-order gradients of the maxpooling function. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class MaxPoolGradGradWithArgmax extends PrimitiveOp implements Operand { +public final class MaxPoolGradGradWithArgmax extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradGradWithArgmax} @@ -68,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MaxPoolGradGradWithArgmax */ - public static MaxPoolGradGradWithArgmax create(Scope scope, Operand input, Operand grad, Operand argmax, List ksize, List strides, String padding, Options... options) { + 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()); 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 dca992e3390..a73fd009656 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 @@ -24,13 +24,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradients of the maxpooling function. * * @param data type for {@code output()} output */ -public final class MaxPoolGradWithArgmax extends PrimitiveOp implements Operand { +public final class MaxPoolGradWithArgmax extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolGradWithArgmax} @@ -66,7 +68,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MaxPoolGradWithArgmax */ - public static MaxPoolGradWithArgmax create(Scope scope, Operand input, Operand grad, Operand argmax, List ksize, List strides, String padding, Options... options) { + 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()); 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 db7130685d2..c0dff4a6b72 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 @@ -26,6 +26,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Performs max pooling on the input and outputs both max values and indices. @@ -44,7 +47,7 @@ * @param data type for {@code argmax()} output */ @Operator(group = "nn") -public final class MaxPoolWithArgmax extends PrimitiveOp { +public final class MaxPoolWithArgmax extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.MaxPoolWithArgmax} @@ -78,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MaxPoolWithArgmax */ - public static MaxPoolWithArgmax create(Scope scope, Operand input, List ksize, List strides, Class Targmax, String padding, Options... options) { + public static MaxPoolWithArgmax create(Scope scope, Operand input, List ksize, List strides, DataType Targmax, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("MaxPoolWithArgmax", scope.makeOpName("MaxPoolWithArgmax")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -92,7 +95,7 @@ public static MaxPoolWithArgmax creat stridesArray[i] = strides.get(i); } opBuilder.setAttr("strides", stridesArray); - opBuilder.setAttr("Targmax", DataType.fromClass(Targmax)); + opBuilder.setAttr("Targmax", Targmax); opBuilder.setAttr("padding", padding); if (options != null) { for (Options opts : options) { @@ -116,8 +119,8 @@ public static MaxPoolWithArgmax creat * @param options carries optional attributes values * @return a new instance of MaxPoolWithArgmax */ - public static MaxPoolWithArgmax create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { - return create(scope, input, ksize, strides, Long.class, padding, options); + public static MaxPoolWithArgmax create(Scope scope, Operand input, List ksize, List strides, String padding, Options... options) { + return create(scope, input, ksize, strides, TInt64.DTYPE, padding, options); } /** 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 9dd0eba2023..efb70c97090 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Finds values of the `n`-th order statistic for the last dimension. @@ -39,7 +42,7 @@ * @param data type for {@code values()} output */ @Operator(group = "nn") -public final class NthElement extends PrimitiveOp implements Operand { +public final class NthElement extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.NthElement} @@ -71,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of NthElement */ - public static NthElement create(Scope scope, Operand input, Operand n, Options... options) { + 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()); 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 f9109f6dd37..79fb6244157 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Produces the average pool of the input tensor for quantized types. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class QuantizedAvgPool extends PrimitiveOp { +public final class QuantizedAvgPool extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedAvgPool operation. @@ -48,7 +50,7 @@ public final class QuantizedAvgPool extends PrimitiveOp { * @param padding The type of padding algorithm to use. * @return a new instance of QuantizedAvgPool */ - public static QuantizedAvgPool create(Scope scope, Operand input, Operand minInput, Operand maxInput, List ksize, List strides, String padding) { + 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()); @@ -77,20 +79,20 @@ public Output output() { /** * The float value that the lowest quantized output value represents. */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** * The float value that the highest quantized output value represents. */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedAvgPool(Operation operation) { super(operation); 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 2fa73c36f23..64fc23dbce9 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Quantized Batch normalization. @@ -35,7 +37,7 @@ * @param data type for {@code result()} output */ @Operator(group = "nn") -public final class QuantizedBatchNormWithGlobalNormalization extends PrimitiveOp { +public final class QuantizedBatchNormWithGlobalNormalization extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedBatchNormWithGlobalNormalization operation. @@ -69,7 +71,7 @@ public final class QuantizedBatchNormWithGlobalNormalization extends Primitiv * needs to be multiplied with gamma. * @return a new instance of QuantizedBatchNormWithGlobalNormalization */ - 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) { + 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, DataType outType, Float varianceEpsilon, Boolean scaleAfterNormalization) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedBatchNormWithGlobalNormalization", scope.makeOpName("QuantizedBatchNormWithGlobalNormalization")); opBuilder.addInput(t.asOutput()); opBuilder.addInput(tMin.asOutput()); @@ -87,7 +89,7 @@ public static QuantizedBatchNormWithGlobalNormalization create(Scope s opBuilder.addInput(gammaMin.asOutput()); opBuilder.addInput(gammaMax.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); opBuilder.setAttr("variance_epsilon", varianceEpsilon); opBuilder.setAttr("scale_after_normalization", scaleAfterNormalization); return new QuantizedBatchNormWithGlobalNormalization(opBuilder.build()); @@ -101,19 +103,19 @@ public Output result() { /** */ - public Output resultMin() { + public Output resultMin() { return resultMin; } /** */ - public Output resultMax() { + public Output resultMax() { return resultMax; } private Output result; - private Output resultMin; - private Output resultMax; + private Output resultMin; + private Output resultMax; private QuantizedBatchNormWithGlobalNormalization(Operation operation) { super(operation); 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 85a258ca8f8..fc0ce4bf954 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Adds Tensor 'bias' to Tensor 'input' for Quantized types. @@ -34,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class QuantizedBiasAdd extends PrimitiveOp { +public final class QuantizedBiasAdd extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedBiasAdd operation. @@ -49,7 +51,7 @@ public final class QuantizedBiasAdd extends PrimitiveOp { * @param outType * @return a new instance of QuantizedBiasAdd */ - public static QuantizedBiasAdd create(Scope scope, Operand input, Operand bias, Operand minInput, Operand maxInput, Operand minBias, Operand maxBias, Class outType) { + public static QuantizedBiasAdd create(Scope scope, Operand input, Operand bias, Operand minInput, Operand maxInput, Operand minBias, Operand maxBias, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedBiasAdd", scope.makeOpName("QuantizedBiasAdd")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(bias.asOutput()); @@ -58,7 +60,7 @@ public static QuantizedBiasAdd create(Scope scope, Operand input opBuilder.addInput(minBias.asOutput()); opBuilder.addInput(maxBias.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new QuantizedBiasAdd(opBuilder.build()); } @@ -71,20 +73,20 @@ public Output output() { /** * The float value that the lowest quantized output value represents. */ - public Output minOut() { + public Output minOut() { return minOut; } /** * The float value that the highest quantized output value represents. */ - public Output maxOut() { + public Output maxOut() { return maxOut; } private Output output; - private Output minOut; - private Output maxOut; + private Output minOut; + private Output maxOut; private QuantizedBiasAdd(Operation operation) { super(operation); 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 b74526baedf..4b0e48b9dc0 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 @@ -26,6 +26,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes a 2D convolution given quantized 4D input and filter tensors. @@ -38,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class QuantizedConv2d extends PrimitiveOp { +public final class QuantizedConv2d extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.QuantizedConv2d} @@ -80,7 +82,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedConv2d */ - 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) { + public static QuantizedConv2d create(Scope scope, Operand input, Operand filter, Operand minInput, Operand maxInput, Operand minFilter, Operand maxFilter, DataType outType, List strides, String padding, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedConv2D", scope.makeOpName("QuantizedConv2d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(filter.asOutput()); @@ -89,7 +91,7 @@ public static QuantizedConv2d create(Scope scope, Operand input, opBuilder.addInput(minFilter.asOutput()); opBuilder.addInput(maxFilter.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); long[] stridesArray = new long[strides.size()]; for (int i = 0; i < stridesArray.length; ++i) { stridesArray[i] = strides.get(i); @@ -130,20 +132,20 @@ public Output output() { /** * The float value that the lowest quantized output value represents. */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** * The float value that the highest quantized output value represents. */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedConv2d(Operation operation) { super(operation); 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 bec6ef0d238..d9eb35d84e0 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Quantized Instance normalization. @@ -31,7 +33,7 @@ * @param data type for {@code y()} output */ @Operator(group = "nn") -public final class QuantizedInstanceNorm extends PrimitiveOp { +public final class QuantizedInstanceNorm extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.QuantizedInstanceNorm} @@ -100,7 +102,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizedInstanceNorm */ - public static QuantizedInstanceNorm create(Scope scope, Operand x, Operand xMin, Operand xMax, Options... options) { + 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()); @@ -175,20 +177,20 @@ public Output y() { /** * The value represented by the lowest quantized output. */ - public Output yMin() { + public Output yMin() { return yMin; } /** * The value represented by the highest quantized output. */ - public Output yMax() { + public Output yMax() { return yMax; } private Output y; - private Output yMin; - private Output yMax; + private Output yMin; + private Output yMax; private QuantizedInstanceNorm(Operation operation) { super(operation); 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 9af1dd479b0..d85ee17007a 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Produces the max pool of the input tensor for quantized types. @@ -32,7 +34,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class QuantizedMaxPool extends PrimitiveOp { +public final class QuantizedMaxPool extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedMaxPool operation. @@ -48,7 +50,7 @@ public final class QuantizedMaxPool extends PrimitiveOp { * @param padding The type of padding algorithm to use. * @return a new instance of QuantizedMaxPool */ - public static QuantizedMaxPool create(Scope scope, Operand input, Operand minInput, Operand maxInput, List ksize, List strides, String padding) { + 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()); @@ -77,20 +79,20 @@ public Output output() { /** * The float value that the lowest quantized output value represents. */ - public Output minOutput() { + public Output minOutput() { return minOutput; } /** * The float value that the highest quantized output value represents. */ - public Output maxOutput() { + public Output maxOutput() { return maxOutput; } private Output output; - private Output minOutput; - private Output maxOutput; + private Output minOutput; + private Output maxOutput; private QuantizedMaxPool(Operation operation) { super(operation); 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 396d4b5a9ba..88c0b8c3847 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes Quantized Rectified Linear: `max(features, 0)` @@ -32,7 +34,7 @@ * @param data type for {@code activations()} output */ @Operator(group = "nn") -public final class QuantizedRelu extends PrimitiveOp { +public final class QuantizedRelu extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedRelu operation. @@ -44,13 +46,13 @@ public final class QuantizedRelu extends PrimitiveOp { * @param outType * @return a new instance of QuantizedRelu */ - public static QuantizedRelu create(Scope scope, Operand features, Operand minFeatures, Operand maxFeatures, Class outType) { + public static QuantizedRelu create(Scope scope, Operand features, Operand minFeatures, Operand maxFeatures, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedRelu", scope.makeOpName("QuantizedRelu")); opBuilder.addInput(features.asOutput()); opBuilder.addInput(minFeatures.asOutput()); opBuilder.addInput(maxFeatures.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new QuantizedRelu(opBuilder.build()); } @@ -64,20 +66,20 @@ public Output activations() { /** * The float value that the lowest quantized value represents. */ - public Output minActivations() { + public Output minActivations() { return minActivations; } /** * The float value that the highest quantized value represents. */ - public Output maxActivations() { + public Output maxActivations() { return maxActivations; } private Output activations; - private Output minActivations; - private Output maxActivations; + private Output minActivations; + private Output maxActivations; private QuantizedRelu(Operation operation) { super(operation); 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 7845874980a..3f1eaf13263 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes Quantized Rectified Linear 6: `min(max(features, 0), 6)` @@ -32,7 +34,7 @@ * @param data type for {@code activations()} output */ @Operator(group = "nn") -public final class QuantizedRelu6 extends PrimitiveOp { +public final class QuantizedRelu6 extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedRelu6 operation. @@ -44,13 +46,13 @@ public final class QuantizedRelu6 extends PrimitiveOp { * @param outType * @return a new instance of QuantizedRelu6 */ - public static QuantizedRelu6 create(Scope scope, Operand features, Operand minFeatures, Operand maxFeatures, Class outType) { + public static QuantizedRelu6 create(Scope scope, Operand features, Operand minFeatures, Operand maxFeatures, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedRelu6", scope.makeOpName("QuantizedRelu6")); opBuilder.addInput(features.asOutput()); opBuilder.addInput(minFeatures.asOutput()); opBuilder.addInput(maxFeatures.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new QuantizedRelu6(opBuilder.build()); } @@ -64,20 +66,20 @@ public Output activations() { /** * The float value that the lowest quantized value represents. */ - public Output minActivations() { + public Output minActivations() { return minActivations; } /** * The float value that the highest quantized value represents. */ - public Output maxActivations() { + public Output maxActivations() { return maxActivations; } private Output activations; - private Output minActivations; - private Output maxActivations; + private Output minActivations; + private Output maxActivations; private QuantizedRelu6(Operation operation) { super(operation); 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 233a5037b68..592541176d5 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes Quantized Rectified Linear X: `min(max(features, 0), max_value)` @@ -32,7 +34,7 @@ * @param data type for {@code activations()} output */ @Operator(group = "nn") -public final class QuantizedReluX extends PrimitiveOp { +public final class QuantizedReluX extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizedReluX operation. @@ -45,14 +47,14 @@ public final class QuantizedReluX extends PrimitiveOp { * @param outType * @return a new instance of QuantizedReluX */ - public static QuantizedReluX create(Scope scope, Operand features, Operand maxValue, Operand minFeatures, Operand maxFeatures, Class outType) { + public static QuantizedReluX create(Scope scope, Operand features, Operand maxValue, Operand minFeatures, Operand maxFeatures, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizedReluX", scope.makeOpName("QuantizedReluX")); opBuilder.addInput(features.asOutput()); opBuilder.addInput(maxValue.asOutput()); opBuilder.addInput(minFeatures.asOutput()); opBuilder.addInput(maxFeatures.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new QuantizedReluX(opBuilder.build()); } @@ -66,20 +68,20 @@ public Output activations() { /** * The float value that the lowest quantized value represents. */ - public Output minActivations() { + public Output minActivations() { return minActivations; } /** * The float value that the highest quantized value represents. */ - public Output maxActivations() { + public Output maxActivations() { return maxActivations; } private Output activations; - private Output minActivations; - private Output maxActivations; + private Output minActivations; + private Output maxActivations; private QuantizedReluX(Operation operation) { super(operation); 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 f7477259958..3f4e3fce523 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Computes rectified linear: `max(features, 0)`. @@ -31,7 +32,7 @@ * @param data type for {@code activations()} output */ @Operator(group = "nn") -public final class Relu extends PrimitiveOp implements Operand { +public final class Relu extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Relu operation. @@ -40,7 +41,7 @@ public final class Relu extends PrimitiveOp implements Operand { * @param features * @return a new instance of Relu */ - public static Relu create(Scope scope, Operand features) { + public static Relu create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Relu", scope.makeOpName("Relu")); opBuilder.addInput(features.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 69a1d302470..f2cf696a5c9 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes rectified linear 6: `min(max(features, 0), 6)`. @@ -31,7 +33,7 @@ * @param data type for {@code activations()} output */ @Operator(group = "nn") -public final class Relu6 extends PrimitiveOp implements Operand { +public final class Relu6 extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Relu6 operation. @@ -40,7 +42,7 @@ public final class Relu6 extends PrimitiveOp implements Operan * @param features * @return a new instance of Relu6 */ - public static Relu6 create(Scope scope, Operand features) { + public static Relu6 create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Relu6", scope.makeOpName("Relu6")); opBuilder.addInput(features.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 eb50a72e769..ecdc5d24b78 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes rectified linear 6 gradients for a Relu6 operation. * * @param data type for {@code backprops()} output */ -public final class Relu6Grad extends PrimitiveOp implements Operand { +public final class Relu6Grad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Relu6Grad operation. @@ -40,7 +42,7 @@ public final class Relu6Grad extends PrimitiveOp implements Op * its output; using either one produces the same result. * @return a new instance of Relu6Grad */ - public static Relu6Grad create(Scope scope, Operand gradients, Operand features) { + 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()); 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 b68a8cc0a22..47b3d9241a2 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes rectified linear gradients for a Relu operation. * * @param data type for {@code backprops()} output */ -public final class ReluGrad extends PrimitiveOp implements Operand { +public final class ReluGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ReluGrad operation. @@ -40,7 +42,7 @@ public final class ReluGrad extends PrimitiveOp implements Ope * the outputs of that operation (both work equivalently). * @return a new instance of ReluGrad */ - public static ReluGrad create(Scope scope, Operand gradients, Operand features) { + 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()); 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 c1597e2a1d3..fc80021e265 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes scaled exponential linear: `scale * alpha * (exp(features) - 1)` @@ -39,7 +41,7 @@ * @param data type for {@code activations()} output */ @Operator(group = "nn") -public final class Selu extends PrimitiveOp implements Operand { +public final class Selu extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Selu operation. @@ -48,7 +50,7 @@ public final class Selu extends PrimitiveOp implements Operand * @param features * @return a new instance of Selu */ - public static Selu create(Scope scope, Operand features) { + public static Selu create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Selu", scope.makeOpName("Selu")); opBuilder.addInput(features.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 92b9f5b5c8c..7893d8c0eb7 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradients for the scaled exponential linear (Selu) operation. * * @param data type for {@code backprops()} output */ -public final class SeluGrad extends PrimitiveOp implements Operand { +public final class SeluGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SeluGrad operation. @@ -39,7 +41,7 @@ public final class SeluGrad extends PrimitiveOp implements Ope * @param outputs The outputs of the corresponding Selu operation. * @return a new instance of SeluGrad */ - public static SeluGrad create(Scope scope, Operand gradients, Operand outputs) { + 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()); 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 da261adedc3..3c0ec267cf3 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes softmax activations. @@ -35,7 +37,7 @@ * @param data type for {@code softmax()} output */ @Operator(group = "nn") -public final class Softmax extends PrimitiveOp implements Operand { +public final class Softmax extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Softmax operation. @@ -44,7 +46,7 @@ public final class Softmax extends PrimitiveOp implements Oper * @param logits 2-D with shape `[batch_size, num_classes]`. * @return a new instance of Softmax */ - public static Softmax create(Scope scope, Operand logits) { + public static Softmax create(Scope scope, Operand logits) { OperationBuilder opBuilder = scope.env().opBuilder("Softmax", scope.makeOpName("Softmax")); opBuilder.addInput(logits.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftmaxCrossEntropyWithLogits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftmaxCrossEntropyWithLogits.java index ece8b8ac2a6..a8be93c1eed 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftmaxCrossEntropyWithLogits.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SoftmaxCrossEntropyWithLogits.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes softmax cross entropy cost and gradients to backpropagate. @@ -33,7 +35,7 @@ * @param data type for {@code loss()} output */ @Operator(group = "nn") -public final class SoftmaxCrossEntropyWithLogits extends PrimitiveOp { +public final class SoftmaxCrossEntropyWithLogits extends PrimitiveOp { /** * Factory method to create a class wrapping a new SoftmaxCrossEntropyWithLogits operation. @@ -45,7 +47,7 @@ public final class SoftmaxCrossEntropyWithLogits extends Primi * probability distribution. * @return a new instance of SoftmaxCrossEntropyWithLogits */ - public static SoftmaxCrossEntropyWithLogits create(Scope scope, Operand features, Operand labels) { + 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()); 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 db48ffe4119..74b948b3bfd 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes softsign: `features / (abs(features) + 1)`. @@ -31,7 +33,7 @@ * @param data type for {@code activations()} output */ @Operator(group = "nn") -public final class Softsign extends PrimitiveOp implements Operand { +public final class Softsign extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Softsign operation. @@ -40,7 +42,7 @@ public final class Softsign extends PrimitiveOp implements Ope * @param features * @return a new instance of Softsign */ - public static Softsign create(Scope scope, Operand features) { + public static Softsign create(Scope scope, Operand features) { OperationBuilder opBuilder = scope.env().opBuilder("Softsign", scope.makeOpName("Softsign")); opBuilder.addInput(features.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 dea4aaca7e1..b3e5e77dee6 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes softsign gradients for a softsign operation. * * @param data type for {@code backprops()} output */ -public final class SoftsignGrad extends PrimitiveOp implements Operand { +public final class SoftsignGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SoftsignGrad operation. @@ -39,7 +41,7 @@ public final class SoftsignGrad extends PrimitiveOp implements * @param features The features passed as input to the corresponding softsign operation. * @return a new instance of SoftsignGrad */ - public static SoftsignGrad create(Scope scope, Operand gradients, Operand features) { + 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()); 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 bfe3fcca9cd..460b37dc01b 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * SpaceToBatch for 4-D tensors of type T. @@ -39,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class SpaceToBatch extends PrimitiveOp implements Operand { +public final class SpaceToBatch extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SpaceToBatch operation. @@ -118,7 +120,7 @@ public final class SpaceToBatch extends PrimitiveOp implements Operand { * @param blockSize * @return a new instance of SpaceToBatch */ - public static SpaceToBatch create(Scope scope, Operand input, Operand paddings, Long blockSize) { + 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()); 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 2ad167375c6..ea428e1a6ae 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * SpaceToDepth for tensors of type T. @@ -105,7 +106,7 @@ * @param data type for {@code output()} output */ @Operator(group = "nn") -public final class SpaceToDepth extends PrimitiveOp implements Operand { +public final class SpaceToDepth extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.nn.SpaceToDepth} @@ -135,7 +136,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SpaceToDepth */ - public static SpaceToDepth create(Scope scope, Operand input, Long blockSize, Options... options) { + 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.applyControlDependencies(opBuilder); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.java index fd45de33ac1..954ed93595e 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/SparseSoftmaxCrossEntropyWithLogits.java @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes softmax cross entropy cost and gradients to backpropagate. @@ -38,7 +40,7 @@ * @param data type for {@code loss()} output */ @Operator(group = "nn") -public final class SparseSoftmaxCrossEntropyWithLogits extends PrimitiveOp { +public final class SparseSoftmaxCrossEntropyWithLogits extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseSoftmaxCrossEntropyWithLogits operation. @@ -49,7 +51,7 @@ public final class SparseSoftmaxCrossEntropyWithLogits extends * This is the label for the given minibatch entry. * @return a new instance of SparseSoftmaxCrossEntropyWithLogits */ - public static SparseSoftmaxCrossEntropyWithLogits create(Scope scope, Operand features, Operand labels) { + 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()); 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 6d4eab1b9b4..5d77751fe67 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Finds values and indices of the `k` largest elements for the last dimension. @@ -42,7 +45,7 @@ * @param data type for {@code values()} output */ @Operator(group = "nn") -public final class TopK extends PrimitiveOp { +public final class TopK extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.nn.TopK} @@ -74,7 +77,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TopK */ - public static TopK create(Scope scope, Operand input, Operand k, Options... options) { + 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()); @@ -107,12 +110,12 @@ public Output values() { /** * The indices of `values` within the last dimension of `input`. */ - public Output indices() { + public Output indices() { return indices; } private Output values; - private Output indices; + private Output indices; private TopK(Operation operation) { super(operation); 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 1d68f254080..dc492763f53 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Dequantize the 'input' tensor into a float Tensor. @@ -97,7 +99,7 @@ * */ @Operator(group = "quantization") -public final class Dequantize extends PrimitiveOp implements Operand { +public final class Dequantize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.quantization.Dequantize} @@ -128,7 +130,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Dequantize */ - public static Dequantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, Options... options) { + public static Dequantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Dequantize", scope.makeOpName("Dequantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minRange.asOutput()); @@ -153,16 +155,16 @@ public static Options mode(String mode) { /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Dequantize(Operation operation) { super(operation); 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 1a0311441b7..59607793e7e 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; /** * Fake-quantize the 'inputs' tensor, type float to 'outputs' tensor of same type. @@ -46,7 +47,7 @@ * Quantization is called fake since the output is still in floating point. */ @Operator(group = "quantization") -public final class FakeQuantWithMinMaxArgs extends PrimitiveOp implements Operand { +public final class FakeQuantWithMinMaxArgs extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgs} @@ -102,7 +103,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FakeQuantWithMinMaxArgs */ - public static FakeQuantWithMinMaxArgs create(Scope scope, Operand inputs, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -155,16 +156,16 @@ public static Options narrowRange(Boolean narrowRange) { /** */ - public Output outputs() { + public Output outputs() { return outputs; } @Override - public Output asOutput() { + public Output asOutput() { return outputs; } - private Output outputs; + private Output outputs; private FakeQuantWithMinMaxArgs(Operation operation) { super(operation); 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 bdb51a899f0..dcd357a4674 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; /** * Compute gradients for a FakeQuantWithMinMaxArgs operation. */ @Operator(group = "quantization") -public final class FakeQuantWithMinMaxArgsGradient extends PrimitiveOp implements Operand { +public final class FakeQuantWithMinMaxArgsGradient extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxArgsGradient} @@ -86,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FakeQuantWithMinMaxArgsGradient */ - public static FakeQuantWithMinMaxArgsGradient create(Scope scope, Operand gradients, Operand inputs, Options... options) { + 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()); @@ -142,16 +143,16 @@ public static Options narrowRange(Boolean narrowRange) { * Backpropagated gradients below the FakeQuantWithMinMaxArgs operation: * `gradients * (inputs >= min && inputs <= max)`. */ - public Output backprops() { + public Output backprops() { return backprops; } @Override - public Output asOutput() { + public Output asOutput() { return backprops; } - private Output backprops; + private Output backprops; private FakeQuantWithMinMaxArgsGradient(Operation operation) { super(operation); 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 ee6f4fd53e5..1227f9f370a 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; /** * Fake-quantize the 'inputs' tensor of type float via global float scalars `min` @@ -49,7 +50,7 @@ * values. */ @Operator(group = "quantization") -public final class FakeQuantWithMinMaxVars extends PrimitiveOp implements Operand { +public final class FakeQuantWithMinMaxVars extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVars} @@ -89,7 +90,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FakeQuantWithMinMaxVars */ - public static FakeQuantWithMinMaxVars create(Scope scope, Operand inputs, Operand min, Operand max, Options... options) { + 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()); @@ -124,16 +125,16 @@ public static Options narrowRange(Boolean narrowRange) { /** */ - public Output outputs() { + public Output outputs() { return outputs; } @Override - public Output asOutput() { + public Output asOutput() { return outputs; } - private Output outputs; + private Output outputs; private FakeQuantWithMinMaxVars(Operation operation) { super(operation); 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 e5b721b2fec..2dd91ba0a1f 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; /** * Compute gradients for a FakeQuantWithMinMaxVars operation. @@ -71,7 +72,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FakeQuantWithMinMaxVarsGradient */ - public static FakeQuantWithMinMaxVarsGradient create(Scope scope, Operand gradients, Operand inputs, Operand min, Operand max, Options... options) { + 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()); @@ -109,7 +110,7 @@ public static Options narrowRange(Boolean narrowRange) { * Backpropagated gradients w.r.t. inputs: * `gradients * (inputs >= min && inputs <= max)`. */ - public Output backpropsWrtInput() { + public Output backpropsWrtInput() { return backpropsWrtInput; } @@ -117,7 +118,7 @@ public Output backpropsWrtInput() { * Backpropagated gradients w.r.t. min parameter: * `sum(gradients * (inputs < min))`. */ - public Output backpropWrtMin() { + public Output backpropWrtMin() { return backpropWrtMin; } @@ -125,13 +126,13 @@ public Output backpropWrtMin() { * Backpropagated gradients w.r.t. max parameter: * `sum(gradients * (inputs > max))`. */ - public Output backpropWrtMax() { + public Output backpropWrtMax() { return backpropWrtMax; } - private Output backpropsWrtInput; - private Output backpropWrtMin; - private Output backpropWrtMax; + private Output backpropsWrtInput; + private Output backpropWrtMin; + private Output backpropWrtMax; private FakeQuantWithMinMaxVarsGradient(Operation operation) { super(operation); 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 1e8b3851075..1f687df4a6c 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; /** * Fake-quantize the 'inputs' tensor of type float and one of the shapes: `[d]`, @@ -50,7 +51,7 @@ * values. */ @Operator(group = "quantization") -public final class FakeQuantWithMinMaxVarsPerChannel extends PrimitiveOp implements Operand { +public final class FakeQuantWithMinMaxVarsPerChannel extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.quantization.FakeQuantWithMinMaxVarsPerChannel} @@ -90,7 +91,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FakeQuantWithMinMaxVarsPerChannel */ - public static FakeQuantWithMinMaxVarsPerChannel create(Scope scope, Operand inputs, Operand min, Operand max, Options... options) { + 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()); @@ -125,16 +126,16 @@ public static Options narrowRange(Boolean narrowRange) { /** */ - public Output outputs() { + public Output outputs() { return outputs; } @Override - public Output asOutput() { + public Output asOutput() { return outputs; } - private Output outputs; + private Output outputs; private FakeQuantWithMinMaxVarsPerChannel(Operation operation) { super(operation); 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 2b45b700de3..44ceddd379c 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; /** * Compute gradients for a FakeQuantWithMinMaxVarsPerChannel operation. @@ -73,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of FakeQuantWithMinMaxVarsPerChannelGradient */ - public static FakeQuantWithMinMaxVarsPerChannelGradient create(Scope scope, Operand gradients, Operand inputs, Operand min, Operand max, Options... options) { + 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()); @@ -112,7 +113,7 @@ public static Options narrowRange(Boolean narrowRange) { * `inputs`: * `gradients * (inputs >= min && inputs <= max)`. */ - public Output backpropsWrtInput() { + public Output backpropsWrtInput() { return backpropsWrtInput; } @@ -120,7 +121,7 @@ public Output backpropsWrtInput() { * Backpropagated gradients w.r.t. min parameter, shape `[d]`: * `sum_per_d(gradients * (inputs < min))`. */ - public Output backpropWrtMin() { + public Output backpropWrtMin() { return backpropWrtMin; } @@ -128,13 +129,13 @@ public Output backpropWrtMin() { * Backpropagated gradients w.r.t. max parameter, shape `[d]`: * `sum_per_d(gradients * (inputs > max))`. */ - public Output backpropWrtMax() { + public Output backpropWrtMax() { return backpropWrtMax; } - private Output backpropsWrtInput; - private Output backpropWrtMin; - private Output backpropWrtMax; + private Output backpropsWrtInput; + private Output backpropWrtMin; + private Output backpropWrtMax; private FakeQuantWithMinMaxVarsPerChannelGradient(Operation operation) { super(operation); 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 652ec6892fb..aa0c1dc1119 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Quantize the 'input' tensor of type float to 'output' tensor of type 'T'. @@ -117,7 +119,7 @@ * @param data type for {@code output()} output */ @Operator(group = "quantization") -public final class Quantize extends PrimitiveOp { +public final class Quantize extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.quantization.Quantize} @@ -158,13 +160,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Quantize */ - public static Quantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, Class T, Options... options) { + public static Quantize create(Scope scope, Operand input, Operand minRange, Operand maxRange, DataType T, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizeV2", scope.makeOpName("Quantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(minRange.asOutput()); opBuilder.addInput(maxRange.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("T", DataType.fromClass(T)); + opBuilder.setAttr("T", T); if (options != null) { for (Options opts : options) { if (opts.mode != null) { @@ -202,20 +204,20 @@ public Output output() { /** * The actual minimum scalar value used for the output. */ - public Output outputMin() { + public Output outputMin() { return outputMin; } /** * The actual maximum scalar value used for the output. */ - public Output outputMax() { + public Output outputMax() { return outputMax; } private Output output; - private Output outputMin; - private Output outputMax; + private Output outputMin; + private Output outputMax; private Quantize(Operation operation) { super(operation); 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 b30c73db39e..4afc6eb3122 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Quantizes then dequantizes a tensor. @@ -34,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator(group = "quantization") -public final class QuantizeAndDequantize extends PrimitiveOp implements Operand { +public final class QuantizeAndDequantize extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.quantization.QuantizeAndDequantize} @@ -84,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of QuantizeAndDequantize */ - public static QuantizeAndDequantize create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand numBits, Options... options) { + 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()); 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 15bd1a9b32d..6fe679de04b 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Convert the quantized 'input' tensor into a lower-precision 'output', using the @@ -55,7 +57,7 @@ * @param data type for {@code output()} output */ @Operator(group = "quantization") -public final class QuantizeDownAndShrinkRange extends PrimitiveOp { +public final class QuantizeDownAndShrinkRange extends PrimitiveOp { /** * Factory method to create a class wrapping a new QuantizeDownAndShrinkRange operation. @@ -67,13 +69,13 @@ public final class QuantizeDownAndShrinkRange extends PrimitiveOp { * @param outType The type of the output. Should be a lower bit depth than Tinput. * @return a new instance of QuantizeDownAndShrinkRange */ - public static QuantizeDownAndShrinkRange create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Class outType) { + public static QuantizeDownAndShrinkRange create(Scope scope, Operand input, Operand inputMin, Operand inputMax, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("QuantizeDownAndShrinkRange", scope.makeOpName("QuantizeDownAndShrinkRange")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); opBuilder.addInput(inputMax.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new QuantizeDownAndShrinkRange(opBuilder.build()); } @@ -86,20 +88,20 @@ public Output output() { /** * The float value that the minimum quantized output value represents. */ - public Output outputMin() { + public Output outputMin() { return outputMin; } /** * The float value that the maximum quantized output value represents. */ - public Output outputMax() { + public Output outputMax() { return outputMax; } private Output output; - private Output outputMin; - private Output outputMax; + private Output outputMin; + private Output outputMax; private QuantizeDownAndShrinkRange(Operation operation) { super(operation); 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 7bc74021a7b..43c0af63e4e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Computes a range that covers the actual values present in a quantized tensor. @@ -45,7 +47,7 @@ public final class RequantizationRange extends PrimitiveOp { * @param inputMax The float value that the maximum quantized input value represents. * @return a new instance of RequantizationRange */ - public static RequantizationRange create(Scope scope, Operand input, Operand inputMin, Operand inputMax) { + 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,19 +59,19 @@ public static RequantizationRange create(Scope scope, Operand input, Oper /** * The computed min output. */ - public Output outputMin() { + public Output outputMin() { return outputMin; } /** * the computed max output. */ - public Output outputMax() { + public Output outputMax() { return outputMax; } - private Output outputMin; - private Output outputMax; + private Output outputMin; + private Output outputMax; private RequantizationRange(Operation operation) { super(operation); 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 ff32f7d3305..fae364d9904 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TType; /** * Converts the quantized `input` tensor into a lower-precision `output`. @@ -40,7 +42,7 @@ * @param data type for {@code output()} output */ @Operator(group = "quantization") -public final class Requantize extends PrimitiveOp { +public final class Requantize extends PrimitiveOp { /** * Factory method to create a class wrapping a new Requantize operation. @@ -54,7 +56,7 @@ public final class Requantize extends PrimitiveOp { * @param outType The type of the output. Should be a lower bit depth than Tinput. * @return a new instance of Requantize */ - public static Requantize create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, Class outType) { + public static Requantize create(Scope scope, Operand input, Operand inputMin, Operand inputMax, Operand requestedOutputMin, Operand requestedOutputMax, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("Requantize", scope.makeOpName("Requantize")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(inputMin.asOutput()); @@ -62,7 +64,7 @@ public static Requantize create(Scope scope, Operand input, Operand opBuilder.addInput(requestedOutputMin.asOutput()); opBuilder.addInput(requestedOutputMax.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new Requantize(opBuilder.build()); } @@ -75,20 +77,20 @@ public Output output() { /** * The requested_output_min value is copied into this output. */ - public Output outputMin() { + public Output outputMin() { return outputMin; } /** * The requested_output_max value is copied into this output. */ - public Output outputMax() { + public Output outputMax() { return outputMax; } private Output output; - private Output outputMin; - private Output outputMax; + private Output outputMin; + private Output outputMax; private Requantize(Operation operation) { super(operation); 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 20a6c7236fb..c48efbc5b81 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Generates labels for candidate sampling with a learned unigram distribution. @@ -85,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AllCandidateSampler */ - public static AllCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -125,7 +127,7 @@ public static Options seed2(Long seed2) { * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. */ - public Output sampledCandidates() { + public Output sampledCandidates() { return sampledCandidates; } @@ -134,7 +136,7 @@ public Output sampledCandidates() { * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. */ - public Output trueExpectedCount() { + public Output trueExpectedCount() { return trueExpectedCount; } @@ -144,13 +146,13 @@ public Output trueExpectedCount() { * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. */ - public Output sampledExpectedCount() { + public Output sampledExpectedCount() { return sampledExpectedCount; } - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; + private Output sampledCandidates; + private Output trueExpectedCount; + private Output sampledExpectedCount; private AllCandidateSampler(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 2c29adc26a4..7388ba3f8ae 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Generates labels for candidate sampling with a log-uniform distribution. @@ -86,7 +88,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of LogUniformCandidateSampler */ - public static LogUniformCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -127,7 +129,7 @@ public static Options seed2(Long seed2) { * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. */ - public Output sampledCandidates() { + public Output sampledCandidates() { return sampledCandidates; } @@ -136,7 +138,7 @@ public Output sampledCandidates() { * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. */ - public Output trueExpectedCount() { + public Output trueExpectedCount() { return trueExpectedCount; } @@ -146,13 +148,13 @@ public Output trueExpectedCount() { * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. */ - public Output sampledExpectedCount() { + public Output sampledExpectedCount() { return sampledExpectedCount; } - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; + private Output sampledCandidates; + private Output trueExpectedCount; + private Output sampledExpectedCount; private LogUniformCandidateSampler(Operation operation) { super(operation); 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 15b05300e00..cb7c2a7e603 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 @@ -25,6 +25,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Draws samples from a multinomial distribution. @@ -32,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class Multinomial extends PrimitiveOp implements Operand { +public final class Multinomial extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.Multinomial} @@ -74,12 +78,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Multinomial */ - public static Multinomial create(Scope scope, Operand logits, Operand numSamples, Class outputDtype, Options... options) { + public static Multinomial create(Scope scope, Operand logits, Operand numSamples, DataType outputDtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("Multinomial", scope.makeOpName("Multinomial")); opBuilder.addInput(logits.asOutput()); opBuilder.addInput(numSamples.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("output_dtype", DataType.fromClass(outputDtype)); + opBuilder.setAttr("output_dtype", outputDtype); if (options != null) { for (Options opts : options) { if (opts.seed != null) { @@ -103,8 +107,8 @@ public static Multinomial create(Scope s * @param options carries optional attributes values * @return a new instance of Multinomial */ - public static Multinomial create(Scope scope, Operand logits, Operand numSamples, Options... options) { - return create(scope, logits, numSamples, Long.class, options); + public static Multinomial create(Scope scope, Operand logits, Operand numSamples, Options... options) { + return create(scope, logits, numSamples, TInt64.DTYPE, options); } /** 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 03b91c7435e..38607d6422c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs random values from a normal distribution. The parameters may each be a @@ -34,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class ParameterizedTruncatedNormal extends PrimitiveOp implements Operand { +public final class ParameterizedTruncatedNormal extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.ParameterizedTruncatedNormal} @@ -79,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ParameterizedTruncatedNormal */ - public static ParameterizedTruncatedNormal create(Scope scope, Operand shape, Operand means, Operand stdevs, Operand minvals, Operand maxvals, Options... options) { + 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()); 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 bbb073aa4cb..366cafbd4fa 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs random values from the Gamma distribution(s) described by alpha. @@ -35,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class RandomGamma extends PrimitiveOp implements Operand { +public final class RandomGamma extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.RandomGamma} @@ -78,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RandomGamma */ - public static RandomGamma create(Scope scope, Operand shape, Operand alpha, Options... options) { + 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()); 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 37aa663268c..730ade6017a 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 @@ -23,13 +23,15 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the derivative of a Gamma random sample w.r.t. `alpha`. * * @param data type for {@code output()} output */ -public final class RandomGammaGrad extends PrimitiveOp implements Operand { +public final class RandomGammaGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RandomGammaGrad operation. @@ -39,7 +41,7 @@ public final class RandomGammaGrad extends PrimitiveOp impleme * @param sample * @return a new instance of RandomGammaGrad */ - public static RandomGammaGrad create(Scope scope, Operand alpha, Operand sample) { + 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()); 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 f6a0cf8b093..17518c2d7b1 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs random values from the Poisson distribution(s) described by rate. @@ -42,7 +45,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class RandomPoisson extends PrimitiveOp implements Operand { +public final class RandomPoisson extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.RandomPoisson} @@ -86,12 +89,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RandomPoisson */ - public static RandomPoisson create(Scope scope, Operand shape, Operand rate, Class dtype, Options... options) { + public static RandomPoisson create(Scope scope, Operand shape, Operand rate, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomPoissonV2", scope.makeOpName("RandomPoisson")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(rate.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.seed != null) { @@ -116,8 +119,8 @@ public static RandomPoiss * @param options carries optional attributes values * @return a new instance of RandomPoisson */ - public static RandomPoisson create(Scope scope, Operand shape, Operand rate, Options... options) { - return create(scope, shape, rate, Long.class, options); + public static RandomPoisson create(Scope scope, Operand shape, Operand rate, Options... options) { + return create(scope, shape, rate, TInt64.DTYPE, options); } /** 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 6895aa03c46..ebadaaf3153 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Randomly shuffles a tensor along its first dimension. @@ -41,7 +42,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class RandomShuffle extends PrimitiveOp implements Operand { +public final class RandomShuffle extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.RandomShuffle} @@ -81,7 +82,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RandomShuffle */ - public static RandomShuffle create(Scope scope, Operand value, Options... options) { + 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.applyControlDependencies(opBuilder); 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 d9d226193f2..92010a1e8aa 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs random values from a normal distribution. @@ -34,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class RandomStandardNormal extends PrimitiveOp implements Operand { +public final class RandomStandardNormal extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.RandomStandardNormal} @@ -75,11 +77,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RandomStandardNormal */ - public static RandomStandardNormal create(Scope scope, Operand shape, Class dtype, Options... options) { + public static RandomStandardNormal create(Scope scope, Operand shape, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomStandardNormal", scope.makeOpName("RandomStandardNormal")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.seed != null) { 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 25df799cc73..8b69522c455 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs random values from a uniform distribution. @@ -35,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class RandomUniform extends PrimitiveOp implements Operand { +public final class RandomUniform extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.RandomUniform} @@ -76,11 +78,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RandomUniform */ - public static RandomUniform create(Scope scope, Operand shape, Class dtype, Options... options) { + public static RandomUniform create(Scope scope, Operand shape, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RandomUniform", scope.makeOpName("RandomUniform")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.seed != null) { 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 07044d19575..16c18135aa7 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs random integers from a uniform distribution. @@ -39,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class RandomUniformInt extends PrimitiveOp implements Operand { +public final class RandomUniformInt extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.RandomUniformInt} @@ -81,7 +83,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RandomUniformInt */ - public static RandomUniformInt create(Scope scope, Operand shape, Operand minval, Operand maxval, Options... options) { + 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()); 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 f114a2a0f84..058a88ddd95 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Emits randomized records. */ @Operator(group = "random") -public final class RecordInput extends PrimitiveOp implements Operand { +public final class RecordInput extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.RecordInput} @@ -181,16 +182,16 @@ public static Options compressionType(String compressionType) { /** * A tensor of shape [batch_size]. */ - public Output records() { + public Output records() { return records; } @Override - public Output asOutput() { + public Output asOutput() { return records; } - private Output records; + private Output records; private RecordInput(Operation operation) { super(operation); 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 1bdf6b9343c..0640df07aa2 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 @@ -25,6 +25,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Draws samples from a multinomial distribution. @@ -32,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class StatelessMultinomial extends PrimitiveOp implements Operand { +public final class StatelessMultinomial extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatelessMultinomial operation. @@ -45,13 +49,13 @@ public final class StatelessMultinomial extends PrimitiveOp im * @param outputDtype * @return a new instance of StatelessMultinomial */ - public static StatelessMultinomial create(Scope scope, Operand logits, Operand numSamples, Operand seed, Class outputDtype) { + public static StatelessMultinomial create(Scope scope, Operand logits, Operand numSamples, Operand seed, DataType outputDtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessMultinomial", scope.makeOpName("StatelessMultinomial")); opBuilder.addInput(logits.asOutput()); opBuilder.addInput(numSamples.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("output_dtype", DataType.fromClass(outputDtype)); + opBuilder.setAttr("output_dtype", outputDtype); return new StatelessMultinomial(opBuilder.build()); } @@ -65,8 +69,8 @@ public static StatelessMu * @param seed 2 seeds (shape [2]). * @return a new instance of StatelessMultinomial */ - public static StatelessMultinomial create(Scope scope, Operand logits, Operand numSamples, Operand seed) { - return create(scope, logits, numSamples, seed, Long.class); + public static StatelessMultinomial create(Scope scope, Operand logits, Operand numSamples, Operand seed) { + return create(scope, logits, numSamples, seed, TInt64.DTYPE); } /** 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 0df4d6ea355..69f6631cab8 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom values from a normal distribution. @@ -36,7 +39,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class StatelessRandomNormal extends PrimitiveOp implements Operand { +public final class StatelessRandomNormal extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatelessRandomNormal operation. @@ -47,12 +50,12 @@ public final class StatelessRandomNormal extends PrimitiveOp i * @param dtype The type of the output. * @return a new instance of StatelessRandomNormal */ - public static StatelessRandomNormal create(Scope scope, Operand shape, Operand seed, Class dtype) { + public static StatelessRandomNormal create(Scope scope, Operand shape, Operand seed, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomNormal", scope.makeOpName("StatelessRandomNormal")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new StatelessRandomNormal(opBuilder.build()); } @@ -64,8 +67,8 @@ public static StatelessRa * @param seed 2 seeds (shape [2]). * @return a new instance of StatelessRandomNormal */ - public static StatelessRandomNormal create(Scope scope, Operand shape, Operand seed) { - return create(scope, shape, seed, Float.class); + public static StatelessRandomNormal create(Scope scope, Operand shape, Operand seed) { + return create(scope, shape, seed, TFloat.DTYPE); } /** 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 95ff7c62786..9a469e17c18 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom random values from a uniform distribution. @@ -37,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class StatelessRandomUniform extends PrimitiveOp implements Operand { +public final class StatelessRandomUniform extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatelessRandomUniform operation. @@ -48,12 +51,12 @@ public final class StatelessRandomUniform extends PrimitiveOp * @param dtype The type of the output. * @return a new instance of StatelessRandomUniform */ - public static StatelessRandomUniform create(Scope scope, Operand shape, Operand seed, Class dtype) { + public static StatelessRandomUniform create(Scope scope, Operand shape, Operand seed, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessRandomUniform", scope.makeOpName("StatelessRandomUniform")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new StatelessRandomUniform(opBuilder.build()); } @@ -65,8 +68,8 @@ public static StatelessRa * @param seed 2 seeds (shape [2]). * @return a new instance of StatelessRandomUniform */ - public static StatelessRandomUniform create(Scope scope, Operand shape, Operand seed) { - return create(scope, shape, seed, Float.class); + public static StatelessRandomUniform create(Scope scope, Operand shape, Operand seed) { + return create(scope, shape, seed, TFloat.DTYPE); } /** 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 5a77fed170a..a15836217ba 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 @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom random integers from a uniform distribution. @@ -33,7 +35,7 @@ * * @param data type for {@code output()} output */ -public final class StatelessRandomUniformInt extends PrimitiveOp implements Operand { +public final class StatelessRandomUniformInt extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatelessRandomUniformInt operation. @@ -45,7 +47,7 @@ public final class StatelessRandomUniformInt extends Primitive * @param maxval Maximum value (exclusive, scalar). * @return a new instance of StatelessRandomUniformInt */ - public static StatelessRandomUniformInt create(Scope scope, Operand shape, Operand seed, Operand minval, Operand maxval) { + 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()); 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 bd0003ff606..69faa19f1ea 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs deterministic pseudorandom values from a truncated normal distribution. @@ -38,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class StatelessTruncatedNormal extends PrimitiveOp implements Operand { +public final class StatelessTruncatedNormal extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatelessTruncatedNormal operation. @@ -49,12 +52,12 @@ public final class StatelessTruncatedNormal extends PrimitiveO * @param dtype The type of the output. * @return a new instance of StatelessTruncatedNormal */ - public static StatelessTruncatedNormal create(Scope scope, Operand shape, Operand seed, Class dtype) { + public static StatelessTruncatedNormal create(Scope scope, Operand shape, Operand seed, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("StatelessTruncatedNormal", scope.makeOpName("StatelessTruncatedNormal")); opBuilder.addInput(shape.asOutput()); opBuilder.addInput(seed.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new StatelessTruncatedNormal(opBuilder.build()); } @@ -66,8 +69,8 @@ public static StatelessTr * @param seed 2 seeds (shape [2]). * @return a new instance of StatelessTruncatedNormal */ - public static StatelessTruncatedNormal create(Scope scope, Operand shape, Operand seed) { - return create(scope, shape, seed, Float.class); + public static StatelessTruncatedNormal create(Scope scope, Operand shape, Operand seed) { + return create(scope, shape, seed, TFloat.DTYPE); } /** 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 a34b1b25c2e..bb9199222ef 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs random values from a truncated normal distribution. @@ -36,7 +38,7 @@ * @param data type for {@code output()} output */ @Operator(group = "random") -public final class TruncatedNormal extends PrimitiveOp implements Operand { +public final class TruncatedNormal extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.random.TruncatedNormal} @@ -77,11 +79,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TruncatedNormal */ - public static TruncatedNormal create(Scope scope, Operand shape, Class dtype, Options... options) { + public static TruncatedNormal create(Scope scope, Operand shape, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TruncatedNormal", scope.makeOpName("TruncatedNormal")); opBuilder.addInput(shape.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.seed != null) { 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 077eee151f6..d800efbe92c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Generates labels for candidate sampling with a uniform distribution. @@ -86,7 +88,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of UniformCandidateSampler */ - public static UniformCandidateSampler create(Scope scope, Operand trueClasses, Long numTrue, Long numSampled, Boolean unique, Long rangeMax, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -127,7 +129,7 @@ public static Options seed2(Long seed2) { * A vector of length num_sampled, in which each element is * the ID of a sampled candidate. */ - public Output sampledCandidates() { + public Output sampledCandidates() { return sampledCandidates; } @@ -136,7 +138,7 @@ public Output sampledCandidates() { * the number of times each candidate is expected to occur in a batch * of sampled candidates. If unique=true, then this is a probability. */ - public Output trueExpectedCount() { + public Output trueExpectedCount() { return trueExpectedCount; } @@ -146,13 +148,13 @@ public Output trueExpectedCount() { * to occur in a batch of sampled candidates. If unique=true, then this is a * probability. */ - public Output sampledExpectedCount() { + public Output sampledExpectedCount() { return sampledExpectedCount; } - private Output sampledCandidates; - private Output trueExpectedCount; - private Output sampledExpectedCount; + private Output sampledCandidates; + private Output trueExpectedCount; + private Output sampledExpectedCount; private UniformCandidateSampler(Operation operation) { super(operation); 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 7b5159580c2..b854e96d14c 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 @@ -24,11 +24,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** */ @Operator(group = "signal") -public final class BatchFft extends PrimitiveOp implements Operand { +public final class BatchFft extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchFft operation. @@ -52,8 +53,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 01c0903ab22..ed9de68e5fe 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 @@ -24,11 +24,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** */ @Operator(group = "signal") -public final class BatchFft2d extends PrimitiveOp implements Operand { +public final class BatchFft2d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchFft2d operation. @@ -52,8 +53,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 79a880ea712..34bd692f66a 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 @@ -24,11 +24,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** */ @Operator(group = "signal") -public final class BatchFft3d extends PrimitiveOp implements Operand { +public final class BatchFft3d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchFft3d operation. @@ -52,8 +53,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 e5509c4dcd9..e239c370a73 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 @@ -24,11 +24,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** */ @Operator(group = "signal") -public final class BatchIfft extends PrimitiveOp implements Operand { +public final class BatchIfft extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchIfft operation. @@ -52,8 +53,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 4cea9f4cb4a..dbce8f2b2f0 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 @@ -24,11 +24,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** */ @Operator(group = "signal") -public final class BatchIfft2d extends PrimitiveOp implements Operand { +public final class BatchIfft2d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchIfft2d operation. @@ -52,8 +53,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 070629b1327..c0cbab82a00 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 @@ -24,11 +24,12 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** */ @Operator(group = "signal") -public final class BatchIfft3d extends PrimitiveOp implements Operand { +public final class BatchIfft3d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new BatchIfft3d operation. @@ -52,8 +53,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 bf2745b0708..414fb0d4063 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Fast Fourier transform. @@ -34,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "signal") -public final class Fft extends PrimitiveOp implements Operand { +public final class Fft extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Fft operation. @@ -43,7 +44,7 @@ public final class Fft extends PrimitiveOp implements Operand { * @param input A complex tensor. * @return a new instance of Fft */ - public static Fft create(Scope scope, Operand input) { + public static Fft create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("FFT", scope.makeOpName("Fft")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 e7140c8bc85..4b564b5731e 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * 2D fast Fourier transform. @@ -34,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "signal") -public final class Fft2d extends PrimitiveOp implements Operand { +public final class Fft2d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Fft2d operation. @@ -43,7 +44,7 @@ public final class Fft2d extends PrimitiveOp implements Operand { * @param input A complex tensor. * @return a new instance of Fft2d */ - public static Fft2d create(Scope scope, Operand input) { + public static Fft2d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("FFT2D", scope.makeOpName("Fft2d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 158390d6766..ff0477af5d9 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * 3D fast Fourier transform. @@ -34,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "signal") -public final class Fft3d extends PrimitiveOp implements Operand { +public final class Fft3d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Fft3d operation. @@ -43,7 +44,7 @@ public final class Fft3d extends PrimitiveOp implements Operand { * @param input A complex64 tensor. * @return a new instance of Fft3d */ - public static Fft3d create(Scope scope, Operand input) { + public static Fft3d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("FFT3D", scope.makeOpName("Fft3d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 d8e1032af09..a5dd1c7f7b4 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Inverse fast Fourier transform. @@ -34,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "signal") -public final class Ifft extends PrimitiveOp implements Operand { +public final class Ifft extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Ifft operation. @@ -43,7 +44,7 @@ public final class Ifft extends PrimitiveOp implements Operand { * @param input A complex tensor. * @return a new instance of Ifft */ - public static Ifft create(Scope scope, Operand input) { + public static Ifft create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("IFFT", scope.makeOpName("Ifft")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 226b96a46ca..289c9298e25 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Inverse 2D fast Fourier transform. @@ -34,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "signal") -public final class Ifft2d extends PrimitiveOp implements Operand { +public final class Ifft2d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Ifft2d operation. @@ -43,7 +44,7 @@ public final class Ifft2d extends PrimitiveOp implements Operand { * @param input A complex tensor. * @return a new instance of Ifft2d */ - public static Ifft2d create(Scope scope, Operand input) { + public static Ifft2d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("IFFT2D", scope.makeOpName("Ifft2d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 69bde0f2d55..a68a10470bb 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Inverse 3D fast Fourier transform. @@ -34,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "signal") -public final class Ifft3d extends PrimitiveOp implements Operand { +public final class Ifft3d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Ifft3d operation. @@ -43,7 +44,7 @@ public final class Ifft3d extends PrimitiveOp implements Operand { * @param input A complex64 tensor. * @return a new instance of Ifft3d */ - public static Ifft3d create(Scope scope, Operand input) { + public static Ifft3d create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("IFFT3D", scope.makeOpName("Ifft3d")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); 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 8e9d2918b1a..b4cd088d21c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Inverse real-valued fast Fourier transform. @@ -43,7 +45,7 @@ * larger, the dimension is padded with zeros. */ @Operator(group = "signal") -public final class Irfft extends PrimitiveOp implements Operand { +public final class Irfft extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Irfft operation. @@ -53,7 +55,7 @@ public final class Irfft extends PrimitiveOp implements Operand { * @param fftLength An int32 tensor of shape [1]. The FFT length. * @return a new instance of Irfft */ - public static Irfft create(Scope scope, Operand input, Operand fftLength) { + public static Irfft create(Scope scope, Operand input, Operand fftLength) { OperationBuilder opBuilder = scope.env().opBuilder("IRFFT", scope.makeOpName("Irfft")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); @@ -70,16 +72,16 @@ public static Irfft create(Scope scope, Operand input, Operand fftLe * Equivalent to np.fft.irfft * @end_compatibility */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Irfft(Operation operation) { super(operation); 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 ffa6b995432..067136d5c98 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Inverse 2D real-valued fast Fourier transform. @@ -44,7 +46,7 @@ * the dimension is padded with zeros. */ @Operator(group = "signal") -public final class Irfft2d extends PrimitiveOp implements Operand { +public final class Irfft2d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Irfft2d operation. @@ -54,7 +56,7 @@ public final class Irfft2d extends PrimitiveOp implements Operand { * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. * @return a new instance of Irfft2d */ - public static Irfft2d create(Scope scope, Operand input, Operand fftLength) { + public static Irfft2d create(Scope scope, Operand input, Operand fftLength) { OperationBuilder opBuilder = scope.env().opBuilder("IRFFT2D", scope.makeOpName("Irfft2d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); @@ -71,16 +73,16 @@ public static Irfft2d create(Scope scope, Operand input, Operand fft * Equivalent to np.fft.irfft2 * @end_compatibility */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Irfft2d(Operation operation) { super(operation); 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 3baf6e8d714..e46141e4579 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Inverse 3D real-valued fast Fourier transform. @@ -44,7 +46,7 @@ * the dimension is padded with zeros. */ @Operator(group = "signal") -public final class Irfft3d extends PrimitiveOp implements Operand { +public final class Irfft3d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Irfft3d operation. @@ -54,7 +56,7 @@ public final class Irfft3d extends PrimitiveOp implements Operand { * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. * @return a new instance of Irfft3d */ - public static Irfft3d create(Scope scope, Operand input, Operand fftLength) { + public static Irfft3d create(Scope scope, Operand input, Operand fftLength) { OperationBuilder opBuilder = scope.env().opBuilder("IRFFT3D", scope.makeOpName("Irfft3d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); @@ -71,16 +73,16 @@ public static Irfft3d create(Scope scope, Operand input, Operand fft * Equivalent to np.irfftn with 3 dimensions. * @end_compatibility */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Irfft3d(Operation operation) { super(operation); 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 2f0fec0dfd4..f1ea47136ea 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Real-valued fast Fourier transform. @@ -40,7 +43,7 @@ * the dimension is padded with zeros. */ @Operator(group = "signal") -public final class Rfft extends PrimitiveOp implements Operand { +public final class Rfft extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Rfft operation. @@ -50,7 +53,7 @@ public final class Rfft extends PrimitiveOp implements Operand { * @param fftLength An int32 tensor of shape [1]. The FFT length. * @return a new instance of Rfft */ - public static Rfft create(Scope scope, Operand input, Operand fftLength) { + public static Rfft create(Scope scope, Operand input, Operand fftLength) { OperationBuilder opBuilder = scope.env().opBuilder("RFFT", scope.makeOpName("Rfft")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); @@ -73,8 +76,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 bd45b327979..9b565babfea 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * 2D real-valued fast Fourier transform. @@ -41,7 +44,7 @@ * the dimension is padded with zeros. */ @Operator(group = "signal") -public final class Rfft2d extends PrimitiveOp implements Operand { +public final class Rfft2d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Rfft2d operation. @@ -51,7 +54,7 @@ public final class Rfft2d extends PrimitiveOp implements Operand { * @param fftLength An int32 tensor of shape [2]. The FFT length for each dimension. * @return a new instance of Rfft2d */ - public static Rfft2d create(Scope scope, Operand input, Operand fftLength) { + public static Rfft2d create(Scope scope, Operand input, Operand fftLength) { OperationBuilder opBuilder = scope.env().opBuilder("RFFT2D", scope.makeOpName("Rfft2d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); @@ -75,8 +78,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 d734057433a..da223606375 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * 3D real-valued fast Fourier transform. @@ -41,7 +44,7 @@ * the dimension is padded with zeros. */ @Operator(group = "signal") -public final class Rfft3d extends PrimitiveOp implements Operand { +public final class Rfft3d extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Rfft3d operation. @@ -51,7 +54,7 @@ public final class Rfft3d extends PrimitiveOp implements Operand { * @param fftLength An int32 tensor of shape [3]. The FFT length for each dimension. * @return a new instance of Rfft3d */ - public static Rfft3d create(Scope scope, Operand input, Operand fftLength) { + public static Rfft3d create(Scope scope, Operand input, Operand fftLength) { OperationBuilder opBuilder = scope.env().opBuilder("RFFT3D", scope.makeOpName("Rfft3d")); opBuilder.addInput(input.asOutput()); opBuilder.addInput(fftLength.asOutput()); @@ -75,8 +78,8 @@ public Output output() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) output; + public Output asOutput() { + return (Output) output; } private Output output; 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 2c41eca4baa..a252355e7cb 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Add an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles. @@ -51,7 +53,7 @@ * `TakeManySparseFromTensorsMap`. Ensure the Operations are colocated. */ @Operator(group = "sparse") -public final class AddManySparseToTensorsMap extends PrimitiveOp implements Operand { +public final class AddManySparseToTensorsMap extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.sparse.AddManySparseToTensorsMap} @@ -94,7 +96,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AddManySparseToTensorsMap */ - public static AddManySparseToTensorsMap create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Options... options) { + 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()); @@ -132,16 +134,16 @@ public static Options sharedName(String sharedName) { * 1-D. The handles of the `SparseTensor` now stored in the * `SparseTensorsMap`. Shape: `[N]`. */ - public Output sparseHandles() { + public Output sparseHandles() { return sparseHandles; } @Override - public Output asOutput() { + public Output asOutput() { return sparseHandles; } - private Output sparseHandles; + private Output sparseHandles; private AddManySparseToTensorsMap(Operation operation) { super(operation); 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 7019a26e120..ea2a006443a 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Add a `SparseTensor` to a `SparseTensorsMap` return its handle. @@ -44,7 +46,7 @@ * `TakeManySparseFromTensorsMap`. Ensure the Operations are colocated. */ @Operator(group = "sparse") -public final class AddSparseToTensorsMap extends PrimitiveOp implements Operand { +public final class AddSparseToTensorsMap extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.sparse.AddSparseToTensorsMap} @@ -85,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AddSparseToTensorsMap */ - public static AddSparseToTensorsMap create(Scope scope, Operand sparseIndices, Operand sparseValues, Operand sparseShape, Options... options) { + 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()); @@ -123,16 +125,16 @@ public static Options sharedName(String sharedName) { * 0-D. The handle of the `SparseTensor` now stored in the * `SparseTensorsMap`. */ - public Output sparseHandle() { + public Output sparseHandle() { return sparseHandle; } @Override - public Output asOutput() { + public Output asOutput() { return sparseHandle; } - private Output sparseHandle; + private Output sparseHandle; private AddSparseToTensorsMap(Operation operation) { super(operation); 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 c5d8f2cb41c..c0beffa68a0 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Applies set operation along last dimension of 2 `Tensor` inputs. @@ -39,7 +41,7 @@ * @param data type for {@code resultValues()} output */ @Operator(group = "sparse") -public final class DenseToDenseSetOperation extends PrimitiveOp { +public final class DenseToDenseSetOperation extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.sparse.DenseToDenseSetOperation} @@ -72,7 +74,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DenseToDenseSetOperation */ - public static DenseToDenseSetOperation create(Scope scope, Operand set1, Operand set2, String setOperation, Options... options) { + 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()); @@ -98,7 +100,7 @@ public static Options validateIndices(Boolean validateIndices) { /** * 2D indices of a `SparseTensor`. */ - public Output resultIndices() { + public Output resultIndices() { return resultIndices; } @@ -114,13 +116,13 @@ public Output resultValues() { * 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. */ - public Output resultShape() { + public Output resultShape() { return resultShape; } - private Output resultIndices; + private Output resultIndices; private Output resultValues; - private Output resultShape; + private Output resultShape; private DenseToDenseSetOperation(Operation operation) { super(operation); 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 e193d9cc836..73bb2ae701e 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Applies set operation along last dimension of `Tensor` and `SparseTensor`. @@ -47,7 +49,7 @@ * @param data type for {@code resultValues()} output */ @Operator(group = "sparse") -public final class DenseToSparseSetOperation extends PrimitiveOp { +public final class DenseToSparseSetOperation extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.sparse.DenseToSparseSetOperation} @@ -85,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of DenseToSparseSetOperation */ - public static DenseToSparseSetOperation create(Scope scope, Operand set1, Operand set2Indices, Operand set2Values, Operand set2Shape, String setOperation, Options... options) { + 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()); @@ -113,7 +115,7 @@ public static Options validateIndices(Boolean validateIndices) { /** * 2D indices of a `SparseTensor`. */ - public Output resultIndices() { + public Output resultIndices() { return resultIndices; } @@ -129,13 +131,13 @@ public Output resultValues() { * 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. */ - public Output resultShape() { + public Output resultShape() { return resultShape; } - private Output resultIndices; + private Output resultIndices; private Output resultValues; - private Output resultShape; + private Output resultShape; private DenseToSparseSetOperation(Operation operation) { super(operation); 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 304d4579d78..ab375589e44 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Deserialize `SparseTensor` objects. @@ -74,7 +76,7 @@ * @param data type for {@code sparseValues()} output */ @Operator(group = "sparse") -public final class DeserializeSparse extends PrimitiveOp { +public final class DeserializeSparse extends PrimitiveOp { /** * Factory method to create a class wrapping a new DeserializeSparse operation. @@ -85,17 +87,17 @@ public final class DeserializeSparse extends PrimitiveOp { * @param dtype The `dtype` of the serialized `SparseTensor` objects. * @return a new instance of DeserializeSparse */ - public static DeserializeSparse create(Scope scope, Operand serializedSparse, Class dtype) { + public static DeserializeSparse create(Scope scope, Operand serializedSparse, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("DeserializeSparse", scope.makeOpName("DeserializeSparse")); opBuilder.addInput(serializedSparse.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new DeserializeSparse(opBuilder.build()); } /** */ - public Output sparseIndices() { + public Output sparseIndices() { return sparseIndices; } @@ -107,13 +109,13 @@ public Output sparseValues() { /** */ - public Output sparseShape() { + public Output sparseShape() { return sparseShape; } - private Output sparseIndices; + private Output sparseIndices; private Output sparseValues; - private Output sparseShape; + private Output sparseShape; private DeserializeSparse(Operation operation) { super(operation); 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 8b6b45f058a..b1c5a388f67 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 @@ -23,6 +23,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Applies a sparse gradient to a given accumulator. @@ -49,7 +52,7 @@ public final class SparseAccumulatorApplyGradient extends PrimitiveOp { * case the input is ignored during validation. * @return a new instance of SparseAccumulatorApplyGradient */ - public static SparseAccumulatorApplyGradient create(Scope scope, Operand handle, Operand localStep, Operand gradientIndices, Operand gradientValues, Operand gradientShape, Boolean hasKnownShape) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorTakeGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorTakeGradient.java index 6e62cc0e484..d98bd85b0a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorTakeGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/sparse/SparseAccumulatorTakeGradient.java @@ -25,6 +25,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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.TType; /** * Extracts the average sparse gradient in a SparseConditionalAccumulator. @@ -39,7 +43,7 @@ * @param data type for {@code values()} output */ @Operator(group = "sparse") -public final class SparseAccumulatorTakeGradient extends PrimitiveOp { +public final class SparseAccumulatorTakeGradient extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseAccumulatorTakeGradient operation. @@ -51,19 +55,19 @@ public final class SparseAccumulatorTakeGradient extends PrimitiveOp { * of the accumulator. * @return a new instance of SparseAccumulatorTakeGradient */ - public static SparseAccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, Class dtype) { + public static SparseAccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("SparseAccumulatorTakeGradient", scope.makeOpName("SparseAccumulatorTakeGradient")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numRequired.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new SparseAccumulatorTakeGradient(opBuilder.build()); } /** * Indices of the average of the accumulated sparse gradients. */ - public Output indices() { + public Output indices() { return indices; } @@ -77,13 +81,13 @@ public Output values() { /** * Shape of the average of the accumulated sparse gradients. */ - public Output shape() { + public Output shape() { return shape; } - private Output indices; + private Output indices; private Output values; - private Output shape; + private Output shape; private SparseAccumulatorTakeGradient(Operation operation) { super(operation); 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 8213ae13dc1..e178631f42c 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Adds two `SparseTensor` objects to produce another `SparseTensor`. @@ -45,7 +48,7 @@ * @param data type for {@code sumValues()} output */ @Operator(group = "sparse") -public final class SparseAdd extends PrimitiveOp { +public final class SparseAdd extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseAdd operation. @@ -61,7 +64,7 @@ public final class SparseAdd extends PrimitiveOp { * pair takes space. * @return a new instance of SparseAdd */ - public static SparseAdd create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand bIndices, Operand bValues, Operand bShape, Operand thresh) { + 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,7 +79,7 @@ public static SparseAdd create(Scope scope, Operand sumIndices() { + public Output sumIndices() { return sumIndices; } @@ -88,13 +91,13 @@ public Output sumValues() { /** */ - public Output sumShape() { + public Output sumShape() { return sumShape; } - private Output sumIndices; + private Output sumIndices; private Output sumValues; - private Output sumShape; + private Output sumShape; private SparseAdd(Operation operation) { super(operation); 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 0952cd2e7bd..5fed2c0c871 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * The gradient operator for the SparseAdd op. @@ -36,7 +38,7 @@ * @param data type for {@code aValGrad()} output */ @Operator(group = "sparse") -public final class SparseAddGrad extends PrimitiveOp { +public final class SparseAddGrad extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseAddGrad operation. @@ -50,7 +52,7 @@ public final class SparseAddGrad extends PrimitiveOp { * `[nnz(sum), ndims]`. * @return a new instance of SparseAddGrad */ - public static SparseAddGrad create(Scope scope, Operand backpropValGrad, Operand aIndices, Operand bIndices, Operand sumIndices) { + 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()); 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 5566807c81d..b159063e686 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Concatenates a list of `SparseTensor` along the specified dimension. @@ -74,7 +76,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseConcat extends PrimitiveOp { +public final class SparseConcat extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseConcat operation. @@ -87,7 +89,7 @@ public final class SparseConcat extends PrimitiveOp { * where rank is the number of dimensions in each input `SparseTensor`. * @return a new instance of SparseConcat */ - public static SparseConcat create(Scope scope, Iterable> indices, Iterable> values, Iterable> shapes, Long concatDim) { + 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)); @@ -100,7 +102,7 @@ public static SparseConcat create(Scope scope, Iterable> in /** * 2-D. Indices of the concatenated `SparseTensor`. */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -114,13 +116,13 @@ public Output outputValues() { /** * 1-D. Shape of the concatenated `SparseTensor`. */ - public Output outputShape() { + public Output outputShape() { return outputShape; } - private Output outputIndices; + private Output outputIndices; private Output outputValues; - private Output outputShape; + private Output outputShape; private SparseConcat(Operation operation) { super(operation); 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 5fa61be5922..287b5163c42 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 @@ -22,10 +22,12 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * A conditional accumulator for aggregating sparse gradients. @@ -38,7 +40,7 @@ * the accumulator. */ @Operator(group = "sparse") -public final class SparseConditionalAccumulator extends PrimitiveOp implements Operand { +public final class SparseConditionalAccumulator extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.sparse.SparseConditionalAccumulator} @@ -88,10 +90,10 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseConditionalAccumulator */ - public static SparseConditionalAccumulator create(Scope scope, Class dtype, Shape shape, Options... options) { + public static SparseConditionalAccumulator create(Scope scope, DataType dtype, Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseConditionalAccumulator", scope.makeOpName("SparseConditionalAccumulator")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); opBuilder.setAttr("shape", shape); if (options != null) { for (Options opts : options) { @@ -135,16 +137,16 @@ public static Options reductionType(String reductionType) { /** * The handle to the accumulator. */ - public Output handle() { + public Output handle() { return handle; } @Override - public Output asOutput() { + public Output asOutput() { return handle; } - private Output handle; + private Output handle; private SparseConditionalAccumulator(Operation operation) { super(operation); 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 7fbf1f01ba3..eb7d474c237 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 @@ -26,6 +26,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Generates sparse cross from a list of sparse and dense tensors. @@ -70,7 +72,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseCross extends PrimitiveOp { +public final class SparseCross extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseCross operation. @@ -90,7 +92,7 @@ public final class SparseCross extends PrimitiveOp { * @param internalType * @return a new instance of SparseCross */ - public static SparseCross create(Scope scope, Iterable> indices, Iterable> values, Iterable> shapes, Iterable> denseInputs, Boolean hashedOutput, Long numBuckets, Long hashKey, Class outType, Class internalType) { + public static SparseCross create(Scope scope, Iterable> indices, Iterable> values, Iterable> shapes, Iterable> denseInputs, Boolean hashedOutput, Long numBuckets, Long hashKey, DataType outType, DataType internalType) { OperationBuilder opBuilder = scope.env().opBuilder("SparseCross", scope.makeOpName("SparseCross")); opBuilder.addInputList(Operands.asOutputs(indices)); opBuilder.addInputList(Operands.asOutputs(values)); @@ -100,15 +102,15 @@ public static SparseCross create(Scope scope, Iterable> opBuilder.setAttr("hashed_output", hashedOutput); opBuilder.setAttr("num_buckets", numBuckets); opBuilder.setAttr("hash_key", hashKey); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); - opBuilder.setAttr("internal_type", DataType.fromClass(internalType)); + opBuilder.setAttr("out_type", outType); + opBuilder.setAttr("internal_type", internalType); return new SparseCross(opBuilder.build()); } /** * 2-D. Indices of the concatenated `SparseTensor`. */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -123,13 +125,13 @@ public Output outputValues() { /** * 1-D. Shape of the concatenated `SparseTensor`. */ - public Output outputShape() { + public Output outputShape() { return outputShape; } - private Output outputIndices; + private Output outputIndices; private Output outputValues; - private Output outputShape; + private Output outputShape; private SparseCross(Operation operation) { super(operation); 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 7206c575a09..a08df4d299c 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Adds up a SparseTensor and a dense Tensor, using these special rules: @@ -40,7 +42,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseDenseCwiseAdd extends PrimitiveOp implements Operand { +public final class SparseDenseCwiseAdd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseDenseCwiseAdd operation. @@ -53,7 +55,7 @@ public final class SparseDenseCwiseAdd extends PrimitiveOp implements Operand * @param dense `R`-D. The dense Tensor operand. * @return a new instance of SparseDenseCwiseAdd */ - public static SparseDenseCwiseAdd create(Scope scope, Operand spIndices, Operand spValues, Operand spShape, Operand dense) { + 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()); 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 0ecc4202f6f..a49569cc1dd 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Component-wise divides a SparseTensor by a dense Tensor. @@ -34,7 +36,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseDenseCwiseDiv extends PrimitiveOp implements Operand { +public final class SparseDenseCwiseDiv extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseDenseCwiseDiv operation. @@ -47,7 +49,7 @@ public final class SparseDenseCwiseDiv extends PrimitiveOp implements Operand * @param dense `R`-D. The dense Tensor operand. * @return a new instance of SparseDenseCwiseDiv */ - public static SparseDenseCwiseDiv create(Scope scope, Operand spIndices, Operand spValues, Operand spShape, Operand dense) { + 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()); 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 b5313e8ddfb..df5ce8696f3 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Component-wise multiplies a SparseTensor by a dense Tensor. @@ -38,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseDenseCwiseMul extends PrimitiveOp implements Operand { +public final class SparseDenseCwiseMul extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseDenseCwiseMul operation. @@ -51,7 +53,7 @@ public final class SparseDenseCwiseMul extends PrimitiveOp implements Operand * @param dense `R`-D. The dense Tensor operand. * @return a new instance of SparseDenseCwiseMul */ - public static SparseDenseCwiseMul create(Scope scope, Operand spIndices, Operand spValues, Operand spShape, Operand dense) { + 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()); 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 1e3a9e5f179..b927b5eb0d9 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Fills empty rows in the input 2-D `SparseTensor` with a default value. @@ -68,7 +71,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseFillEmptyRows extends PrimitiveOp { +public final class SparseFillEmptyRows extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseFillEmptyRows operation. @@ -82,7 +85,7 @@ public final class SparseFillEmptyRows extends PrimitiveOp { * output indices: 2-D. the indices of the filled sparse tensor. * @return a new instance of SparseFillEmptyRows */ - public static SparseFillEmptyRows create(Scope scope, Operand indices, Operand values, Operand denseShape, Operand defaultValue) { + 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()); @@ -94,7 +97,7 @@ public static SparseFillEmptyRows create(Scope scope, Operand indic /** */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -109,21 +112,21 @@ public Output outputValues() { * 1-D. whether the dense row was missing in the * input sparse tensor. */ - public Output emptyRowIndicator() { + public Output emptyRowIndicator() { return emptyRowIndicator; } /** * 1-D. a map from the input indices to the output indices. */ - public Output reverseIndexMap() { + public Output reverseIndexMap() { return reverseIndexMap; } - private Output outputIndices; + private Output outputIndices; private Output outputValues; - private Output emptyRowIndicator; - private Output reverseIndexMap; + private Output emptyRowIndicator; + private Output reverseIndexMap; private SparseFillEmptyRows(Operation operation) { super(operation); 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 af952c6f48a..a252ba63a79 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * The gradient of SparseFillEmptyRows. @@ -40,7 +42,7 @@ * @param data type for {@code dValues()} output */ @Operator(group = "sparse") -public final class SparseFillEmptyRowsGrad extends PrimitiveOp { +public final class SparseFillEmptyRowsGrad extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseFillEmptyRowsGrad operation. @@ -50,7 +52,7 @@ public final class SparseFillEmptyRowsGrad extends PrimitiveOp { * @param gradValues 1-D. The gradients from backprop. * @return a new instance of SparseFillEmptyRowsGrad */ - public static SparseFillEmptyRowsGrad create(Scope scope, Operand reverseIndexMap, Operand gradValues) { + 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()); 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 b4978aa4a4c..210782d1441 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Multiply matrix "a" by matrix "b". @@ -39,7 +42,7 @@ * in the input gradient when that gradient comes from a Relu. */ @Operator(group = "sparse") -public final class SparseMatMul extends PrimitiveOp implements Operand { +public final class SparseMatMul extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.sparse.SparseMatMul} @@ -96,7 +99,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseMatMul */ - public static SparseMatMul create(Scope scope, Operand a, Operand b, Options... options) { + 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()); @@ -150,16 +153,16 @@ public static Options bIsSparse(Boolean bIsSparse) { /** */ - public Output product() { + public Output product() { return product; } @Override - public Output asOutput() { + public Output asOutput() { return product; } - private Output product; + private Output product; private SparseMatMul(Operation operation) { super(operation); 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 7b399d15ff3..cf203dfe25c 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 @@ -24,6 +24,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the max of elements across dimensions of a SparseTensor. @@ -44,7 +48,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseReduceMax extends PrimitiveOp implements Operand { +public final class SparseReduceMax extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMax} @@ -77,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseReduceMax */ - public static SparseReduceMax create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { + 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()); 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 06f9d79d429..867e382d872 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 @@ -24,6 +24,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the max of elements across dimensions of a SparseTensor. @@ -44,7 +48,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseReduceMaxSparse extends PrimitiveOp { +public final class SparseReduceMaxSparse extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceMaxSparse} @@ -77,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseReduceMaxSparse */ - public static SparseReduceMaxSparse create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { + 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()); @@ -103,7 +107,7 @@ public static Options keepDims(Boolean keepDims) { /** */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -115,13 +119,13 @@ public Output outputValues() { /** */ - public Output outputShape() { + public Output outputShape() { return outputShape; } - private Output outputIndices; + private Output outputIndices; private Output outputValues; - private Output outputShape; + private Output outputShape; private SparseReduceMaxSparse(Operation operation) { super(operation); 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 81ca8cd6287..ae248c14f30 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Computes the sum of elements across dimensions of a SparseTensor. @@ -44,7 +47,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseReduceSum extends PrimitiveOp implements Operand { +public final class SparseReduceSum extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSum} @@ -77,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseReduceSum */ - public static SparseReduceSum create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { + 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()); 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 3cb7d8f4246..9429c1934e5 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Computes the sum of elements across dimensions of a SparseTensor. @@ -44,7 +47,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseReduceSumSparse extends PrimitiveOp { +public final class SparseReduceSumSparse extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.sparse.SparseReduceSumSparse} @@ -77,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseReduceSumSparse */ - public static SparseReduceSumSparse create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape, Operand reductionAxes, Options... options) { + 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()); @@ -103,7 +106,7 @@ public static Options keepDims(Boolean keepDims) { /** */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -115,13 +118,13 @@ public Output outputValues() { /** */ - public Output outputShape() { + public Output outputShape() { return outputShape; } - private Output outputIndices; + private Output outputIndices; private Output outputValues; - private Output outputShape; + private Output outputShape; private SparseReduceSumSparse(Operation operation) { super(operation); 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 a29e4225324..9b7b1fa2af5 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Reorders a SparseTensor into the canonical, row-major ordering. @@ -40,7 +42,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseReorder extends PrimitiveOp { +public final class SparseReorder extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseReorder operation. @@ -52,7 +54,7 @@ public final class SparseReorder extends PrimitiveOp { * @param inputShape 1-D. Shape of the input SparseTensor. * @return a new instance of SparseReorder */ - public static SparseReorder create(Scope scope, Operand inputIndices, Operand inputValues, Operand inputShape) { + 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()); @@ -65,7 +67,7 @@ public static SparseReorder create(Scope scope, Operand inputIndice * 2-D. `N x R` matrix with the same indices as input_indices, but * in canonical row-major ordering. */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -76,7 +78,7 @@ public Output outputValues() { return outputValues; } - private Output outputIndices; + private Output outputIndices; private Output outputValues; private SparseReorder(Operation operation) { 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 fa01b3f03c2..d4e2beb880a 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; /** * Reshapes a SparseTensor to represent values in a new dense shape. @@ -57,7 +58,7 @@ public final class SparseReshape extends PrimitiveOp { * @param newShape 1-D. `R_out` vector with the requested new dense shape. * @return a new instance of SparseReshape */ - public static SparseReshape create(Scope scope, Operand inputIndices, Operand inputShape, Operand newShape) { + 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()); @@ -70,7 +71,7 @@ public static SparseReshape create(Scope scope, Operand inputIndices, Oper * 2-D. `N x R_out` matrix with the updated indices of non-empty * values in the output SparseTensor. */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -79,12 +80,12 @@ public Output outputIndices() { * SparseTensor. This is the same as `new_shape` but with any -1 dimensions * filled in. */ - public Output outputShape() { + public Output outputShape() { return outputShape; } - private Output outputIndices; - private Output outputShape; + private Output outputIndices; + private Output outputShape; private SparseReshape(Operation operation) { super(operation); 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 293e89925c0..ebd8de75a26 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the mean along sparse segments of a tensor. @@ -36,7 +39,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseSegmentMean extends PrimitiveOp implements Operand { +public final class SparseSegmentMean extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSegmentMean operation. @@ -47,7 +50,7 @@ public final class SparseSegmentMean extends PrimitiveOp imple * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @return a new instance of SparseSegmentMean */ - public static SparseSegmentMean create(Scope scope, Operand data, Operand indices, Operand segmentIds) { + 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()); 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 21ca5f6b2ff..e59c2e61b77 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradients for SparseSegmentMean. @@ -34,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseSegmentMeanGrad extends PrimitiveOp implements Operand { +public final class SparseSegmentMeanGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSegmentMeanGrad operation. @@ -46,7 +49,7 @@ public final class SparseSegmentMeanGrad extends PrimitiveOp i * @param outputDim0 dimension 0 of "data" passed to SparseSegmentMean op. * @return a new instance of SparseSegmentMeanGrad */ - public static SparseSegmentMeanGrad create(Scope scope, Operand grad, Operand indices, Operand segmentIds, Operand outputDim0) { + 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()); 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 d0892757cf6..c7a290b36e8 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the mean along sparse segments of a tensor. @@ -38,7 +41,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseSegmentMeanWithNumSegments extends PrimitiveOp implements Operand { +public final class SparseSegmentMeanWithNumSegments extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSegmentMeanWithNumSegments operation. @@ -50,7 +53,7 @@ public final class SparseSegmentMeanWithNumSegments extends Pr * @param numSegments Should equal the number of distinct segment IDs. * @return a new instance of SparseSegmentMeanWithNumSegments */ - public static SparseSegmentMeanWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, Operand numSegments) { + 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()); 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 4e2a851f043..b6118392dbe 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the sum along sparse segments of a tensor divided by the sqrt of N. @@ -36,7 +39,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseSegmentSqrtN extends PrimitiveOp implements Operand { +public final class SparseSegmentSqrtN extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSegmentSqrtN operation. @@ -47,7 +50,7 @@ public final class SparseSegmentSqrtN extends PrimitiveOp impl * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @return a new instance of SparseSegmentSqrtN */ - public static SparseSegmentSqrtN create(Scope scope, Operand data, Operand indices, Operand segmentIds) { + 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()); 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 1f935e4b9d1..4e301e581a9 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes gradients for SparseSegmentSqrtN. @@ -34,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseSegmentSqrtNGrad extends PrimitiveOp implements Operand { +public final class SparseSegmentSqrtNGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSegmentSqrtNGrad operation. @@ -46,7 +49,7 @@ public final class SparseSegmentSqrtNGrad extends PrimitiveOp * @param outputDim0 dimension 0 of "data" passed to SparseSegmentSqrtN op. * @return a new instance of SparseSegmentSqrtNGrad */ - public static SparseSegmentSqrtNGrad create(Scope scope, Operand grad, Operand indices, Operand segmentIds, Operand outputDim0) { + 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()); 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 e64f0cd2ae7..ff32720f85f 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the sum along sparse segments of a tensor divided by the sqrt of N. @@ -40,7 +43,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseSegmentSqrtNWithNumSegments extends PrimitiveOp implements Operand { +public final class SparseSegmentSqrtNWithNumSegments extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSegmentSqrtNWithNumSegments operation. @@ -52,7 +55,7 @@ public final class SparseSegmentSqrtNWithNumSegments extends P * @param numSegments Should equal the number of distinct segment IDs. * @return a new instance of SparseSegmentSqrtNWithNumSegments */ - public static SparseSegmentSqrtNWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, Operand numSegments) { + 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()); 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 e4e1e4552f9..8ddd494f226 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the sum along sparse segments of a tensor. @@ -61,7 +64,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseSegmentSum extends PrimitiveOp implements Operand { +public final class SparseSegmentSum extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSegmentSum operation. @@ -72,7 +75,7 @@ public final class SparseSegmentSum extends PrimitiveOp implem * @param segmentIds A 1-D tensor. Values should be sorted and can be repeated. * @return a new instance of SparseSegmentSum */ - public static SparseSegmentSum create(Scope scope, Operand data, Operand indices, Operand segmentIds) { + 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()); 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 35f7dcf6ec2..24f0fc5be35 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Computes the sum along sparse segments of a tensor. @@ -59,7 +62,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseSegmentSumWithNumSegments extends PrimitiveOp implements Operand { +public final class SparseSegmentSumWithNumSegments extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSegmentSumWithNumSegments operation. @@ -71,7 +74,7 @@ public final class SparseSegmentSumWithNumSegments extends Pri * @param numSegments Should equal the number of distinct segment IDs. * @return a new instance of SparseSegmentSumWithNumSegments */ - public static SparseSegmentSumWithNumSegments create(Scope scope, Operand data, Operand indices, Operand segmentIds, Operand numSegments) { + 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()); 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 7a1b01270c4..b3c375cd534 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Slice a `SparseTensor` based on the `start` and `size`. @@ -47,7 +49,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseSlice extends PrimitiveOp { +public final class SparseSlice extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseSlice operation. @@ -62,7 +64,7 @@ public final class SparseSlice extends PrimitiveOp { * sparse tensors. * @return a new instance of SparseSlice */ - public static SparseSlice create(Scope scope, Operand indices, Operand values, Operand shape, Operand start, Operand size) { + public static SparseSlice create(Scope scope, Operand indices, Operand values, Operand shape, Operand start, Operand size) { OperationBuilder opBuilder = scope.env().opBuilder("SparseSlice", scope.makeOpName("SparseSlice")); opBuilder.addInput(indices.asOutput()); opBuilder.addInput(values.asOutput()); @@ -75,7 +77,7 @@ public static SparseSlice create(Scope scope, Operand indices, Oper /** */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -91,13 +93,13 @@ public Output outputValues() { * A list of 1-D tensors represents the shape of the output sparse * tensors. */ - public Output outputShape() { + public Output outputShape() { return outputShape; } - private Output outputIndices; + private Output outputIndices; private Output outputValues; - private Output outputShape; + private Output outputShape; private SparseSlice(Operation operation) { super(operation); 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 8d94122ed98..373d7b5be49 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * The gradient operator for the SparseSlice op. @@ -35,7 +37,7 @@ * @param data type for {@code valGrad()} output */ @Operator(group = "sparse") -public final class SparseSliceGrad extends PrimitiveOp implements Operand { +public final class SparseSliceGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSliceGrad operation. @@ -48,7 +50,7 @@ public final class SparseSliceGrad extends PrimitiveOp implements Operand * @param outputIndices 2-D. The `indices` of the sliced `SparseTensor`. * @return a new instance of SparseSliceGrad */ - public static SparseSliceGrad create(Scope scope, Operand backpropValGrad, Operand inputIndices, Operand inputStart, Operand outputIndices) { + 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()); 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 f71f0e05558..750de57c936 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Applies softmax to a batched N-D `SparseTensor`. @@ -47,7 +50,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseSoftmax extends PrimitiveOp implements Operand { +public final class SparseSoftmax extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseSoftmax operation. @@ -59,7 +62,7 @@ public final class SparseSoftmax extends PrimitiveOp implement * @param spShape 1-D. Shape of the input SparseTensor. * @return a new instance of SparseSoftmax */ - public static SparseSoftmax create(Scope scope, Operand spIndices, Operand spValues, Operand spShape) { + 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()); 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 0ccafcd5462..d10e40a65fc 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Returns the element-wise max of two SparseTensors. @@ -33,7 +36,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseSparseMaximum extends PrimitiveOp { +public final class SparseSparseMaximum extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseSparseMaximum operation. @@ -48,7 +51,7 @@ public final class SparseSparseMaximum extends PrimitiveOp { * @param bShape counterpart to `a_shape` for the other operand; the two shapes must be equal. * @return a new instance of SparseSparseMaximum */ - public static SparseSparseMaximum create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand bIndices, Operand bValues, Operand bShape) { + 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()); @@ -63,7 +66,7 @@ public static SparseSparseMaximum create(Scope scope, Oper /** * 2-D. The indices of the output SparseTensor. */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -74,7 +77,7 @@ public Output outputValues() { return outputValues; } - private Output outputIndices; + private Output outputIndices; private Output outputValues; private SparseSparseMaximum(Operation operation) { 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 4099c9d44fb..1bbfc56e33d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Returns the element-wise min of two SparseTensors. @@ -33,7 +35,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseSparseMinimum extends PrimitiveOp { +public final class SparseSparseMinimum extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseSparseMinimum operation. @@ -48,7 +50,7 @@ public final class SparseSparseMinimum extends PrimitiveOp { * @param bShape counterpart to `a_shape` for the other operand; the two shapes must be equal. * @return a new instance of SparseSparseMinimum */ - public static SparseSparseMinimum create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand bIndices, Operand bValues, Operand bShape) { + 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()); @@ -63,7 +65,7 @@ public static SparseSparseMinimum create(Scope scope, Operand aIndi /** * 2-D. The indices of the output SparseTensor. */ - public Output outputIndices() { + public Output outputIndices() { return outputIndices; } @@ -74,7 +76,7 @@ public Output outputValues() { return outputValues; } - private Output outputIndices; + private Output outputIndices; private Output outputValues; private SparseSparseMinimum(Operation operation) { 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 0fafdf7f38e..f6b0cb47621 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 @@ -26,6 +26,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Split a `SparseTensor` into `num_split` tensors along one dimension. @@ -51,7 +53,7 @@ * @param data type for {@code outputValues()} output */ @Operator(group = "sparse") -public final class SparseSplit extends PrimitiveOp { +public final class SparseSplit extends PrimitiveOp { /** * Factory method to create a class wrapping a new SparseSplit operation. @@ -67,7 +69,7 @@ public final class SparseSplit extends PrimitiveOp { * @param numSplit The number of ways to split. * @return a new instance of SparseSplit */ - public static SparseSplit create(Scope scope, Operand splitDim, Operand indices, Operand values, Operand shape, Long numSplit) { + 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()); @@ -80,7 +82,7 @@ public static SparseSplit create(Scope scope, Operand splitDim, Ope /** */ - public List> outputIndices() { + public List> outputIndices() { return outputIndices; } @@ -96,26 +98,26 @@ public List> outputValues() { * A list of 1-D tensors represents the shape of the output sparse * tensors. */ - public List> outputShape() { + public List> outputShape() { return outputShape; } - private List> outputIndices; + private List> outputIndices; private List> outputValues; - private List> outputShape; + 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)); + 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)); + 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 2c27031864b..9e17afe9044 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Adds up a `SparseTensor` and a dense `Tensor`, producing a dense `Tensor`. @@ -33,7 +35,7 @@ * @param data type for {@code output()} output */ @Operator(group = "sparse") -public final class SparseTensorDenseAdd extends PrimitiveOp implements Operand { +public final class SparseTensorDenseAdd extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SparseTensorDenseAdd operation. @@ -45,7 +47,7 @@ public final class SparseTensorDenseAdd extends PrimitiveOp implements Operan * @param b `ndims`-D Tensor. With shape `a_shape`. * @return a new instance of SparseTensorDenseAdd */ - public static SparseTensorDenseAdd create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand b) { + 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()); 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 8d6b02e7ad4..379a61e262a 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Multiply SparseTensor (of rank 2) "A" by dense matrix "B". @@ -41,7 +44,7 @@ * @param data type for {@code product()} output */ @Operator(group = "sparse") -public final class SparseTensorDenseMatMul extends PrimitiveOp implements Operand { +public final class SparseTensorDenseMatMul extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.sparse.SparseTensorDenseMatMul} @@ -84,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseTensorDenseMatMul */ - public static SparseTensorDenseMatMul create(Scope scope, Operand aIndices, Operand aValues, Operand aShape, Operand b, Options... options) { + 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()); 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 08a9994b220..d467cf08b86 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Converts a sparse representation into a dense tensor. @@ -49,7 +51,7 @@ * @param data type for {@code dense()} output */ @Operator(group = "sparse") -public final class SparseToDense extends PrimitiveOp implements Operand { +public final class SparseToDense extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.sparse.SparseToDense} @@ -85,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseToDense */ - public static SparseToDense create(Scope scope, Operand sparseIndices, Operand outputShape, Operand sparseValues, Operand defaultValue, Options... options) { + 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()); 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 7018f43e82b..01cc10bc1a2 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Applies set operation along last dimension of 2 `SparseTensor` inputs. @@ -55,7 +57,7 @@ * @param data type for {@code resultValues()} output */ @Operator(group = "sparse") -public final class SparseToSparseSetOperation extends PrimitiveOp { +public final class SparseToSparseSetOperation extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.sparse.SparseToSparseSetOperation} @@ -98,7 +100,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseToSparseSetOperation */ - public static SparseToSparseSetOperation create(Scope scope, Operand set1Indices, Operand set1Values, Operand set1Shape, Operand set2Indices, Operand set2Values, Operand set2Shape, String setOperation, Options... options) { + 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()); @@ -128,7 +130,7 @@ public static Options validateIndices(Boolean validateIndices) { /** * 2D indices of a `SparseTensor`. */ - public Output resultIndices() { + public Output resultIndices() { return resultIndices; } @@ -144,13 +146,13 @@ public Output resultValues() { * 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. */ - public Output resultShape() { + public Output resultShape() { return resultShape; } - private Output resultIndices; + private Output resultIndices; private Output resultValues; - private Output resultShape; + private Output resultShape; private SparseToSparseSetOperation(Operation operation) { super(operation); 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 93ce8141b96..e09ba0f8a5c 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Read `SparseTensors` from a `SparseTensorsMap` and concatenate them. @@ -77,7 +79,7 @@ * @param data type for {@code sparseValues()} output */ @Operator(group = "sparse") -public final class TakeManySparseFromTensorsMap extends PrimitiveOp { +public final class TakeManySparseFromTensorsMap extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.sparse.TakeManySparseFromTensorsMap} @@ -120,11 +122,11 @@ private Options() { * @param options carries optional attributes values * @return a new instance of TakeManySparseFromTensorsMap */ - public static TakeManySparseFromTensorsMap create(Scope scope, Operand sparseHandles, Class dtype, Options... options) { + public static TakeManySparseFromTensorsMap create(Scope scope, Operand sparseHandles, DataType dtype, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("TakeManySparseFromTensorsMap", scope.makeOpName("TakeManySparseFromTensorsMap")); opBuilder.addInput(sparseHandles.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); if (options != null) { for (Options opts : options) { if (opts.container != null) { @@ -157,7 +159,7 @@ public static Options sharedName(String sharedName) { /** * 2-D. The `indices` of the minibatch `SparseTensor`. */ - public Output sparseIndices() { + public Output sparseIndices() { return sparseIndices; } @@ -171,13 +173,13 @@ public Output sparseValues() { /** * 1-D. The `shape` of the minibatch `SparseTensor`. */ - public Output sparseShape() { + public Output sparseShape() { return sparseShape; } - private Output sparseIndices; + private Output sparseIndices; private Output sparseValues; - private Output sparseShape; + private Output sparseShape; private TakeManySparseFromTensorsMap(Operation operation) { super(operation); 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 62e81851ff5..338d012502c 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Joins the strings in the given list of string tensors into one tensor; @@ -32,7 +33,7 @@ * with the given separator (default is an empty separator). */ @Operator(group = "strings") -public final class Join extends PrimitiveOp implements Operand { +public final class Join extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.strings.Join} @@ -63,7 +64,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Join */ - public static Join create(Scope scope, Iterable> inputs, Options... options) { + public static Join create(Scope scope, Iterable> inputs, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringJoin", scope.makeOpName("Join")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.applyControlDependencies(opBuilder); @@ -86,16 +87,16 @@ public static Options separator(String separator) { /** */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Join(Operation operation) { super(operation); 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 cf28fe3d69c..fca425016ee 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Joins a string Tensor across the given dimensions. @@ -53,7 +55,7 @@ * */ @Operator(group = "strings") -public final class ReduceJoin extends PrimitiveOp implements Operand { +public final class ReduceJoin extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.strings.ReduceJoin} @@ -94,7 +96,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ReduceJoin */ - public static ReduceJoin create(Scope scope, Operand inputs, Operand reductionIndices, Options... options) { + 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()); @@ -130,16 +132,16 @@ public static Options separator(String separator) { * Has shape equal to that of the input with reduced dimensions removed or * set to `1` depending on `keep_dims`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private ReduceJoin(Operation operation) { super(operation); 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 ef99dcaf7f0..1cde782f776 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TString; /** * Check if the input matches the regex pattern. @@ -36,7 +38,7 @@ * The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ @Operator(group = "strings") -public final class RegexFullMatch extends PrimitiveOp implements Operand { +public final class RegexFullMatch extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new RegexFullMatch operation. @@ -46,7 +48,7 @@ public final class RegexFullMatch extends PrimitiveOp implements Operand input, Operand pattern) { + 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()); @@ -57,16 +59,16 @@ public static RegexFullMatch create(Scope scope, Operand input, Operand< /** * A bool tensor with the same shape as `input`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private RegexFullMatch(Operation operation) { super(operation); 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 90abd5d9d97..6f36f23a7ba 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Replaces matches of the `pattern` regular expression in `input` with the @@ -32,7 +33,7 @@ * It follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ @Operator(group = "strings") -public final class RegexReplace extends PrimitiveOp implements Operand { +public final class RegexReplace extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.strings.RegexReplace} @@ -66,7 +67,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RegexReplace */ - public static RegexReplace create(Scope scope, Operand input, Operand pattern, Operand rewrite, Options... options) { + 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()); @@ -94,16 +95,16 @@ public static Options replaceGlobal(Boolean replaceGlobal) { /** * The text after applying pattern match and rewrite substitution. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private RegexReplace(Operation operation) { super(operation); 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 ba57d3fc909..e94fcb976eb 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 @@ -23,6 +23,8 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TString; /** * Check if the input matches the regex pattern. @@ -34,7 +36,7 @@ *

* The pattern follows the re2 syntax (https://github.com/google/re2/wiki/Syntax) */ -public final class StaticRegexFullMatch extends PrimitiveOp implements Operand { +public final class StaticRegexFullMatch extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StaticRegexFullMatch operation. @@ -44,7 +46,7 @@ public final class StaticRegexFullMatch extends PrimitiveOp implements Operand input, String pattern) { + public static StaticRegexFullMatch create(Scope scope, Operand input, String pattern) { OperationBuilder opBuilder = scope.env().opBuilder("StaticRegexFullMatch", scope.makeOpName("StaticRegexFullMatch")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -55,16 +57,16 @@ public static StaticRegexFullMatch create(Scope scope, Operand input, St /** * A bool tensor with the same shape as `input`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private StaticRegexFullMatch(Operation operation) { super(operation); 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 af094e057c1..ff1b4de21a3 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 @@ -23,13 +23,14 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +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 PrimitiveOp implements Operand { +public final class StaticRegexReplace extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.strings.StaticRegexReplace} @@ -61,7 +62,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StaticRegexReplace */ - public static StaticRegexReplace create(Scope scope, Operand input, String pattern, String rewrite, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -88,16 +89,16 @@ public static Options replaceGlobal(Boolean replaceGlobal) { /** * The text after applying pattern and rewrite. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private StaticRegexReplace(Operation operation) { super(operation); 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 cabf4dce51f..4a03a879efa 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Formats a string template using a list of tensors. @@ -32,7 +33,7 @@ * Formats a string template using a list of tensors, pretty-printing tensor summaries. */ @Operator(group = "strings") -public final class StringFormat extends PrimitiveOp implements Operand { +public final class StringFormat extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.strings.StringFormat} @@ -123,16 +124,16 @@ public static Options summarize(Long summarize) { /** * = The resulting string scalar. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private StringFormat(Operation operation) { super(operation); 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 bbac3a54868..3f0e188ef95 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * String lengths of `input`. @@ -31,7 +33,7 @@ * Computes the length of each string given in the input tensor. */ @Operator(group = "strings") -public final class StringLength extends PrimitiveOp implements Operand { +public final class StringLength extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.strings.StringLength} @@ -64,7 +66,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StringLength */ - public static StringLength create(Scope scope, Operand input, Options... options) { + public static StringLength create(Scope scope, Operand input, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("StringLength", scope.makeOpName("StringLength")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -93,16 +95,16 @@ public static Options unit(String unit) { * Integer tensor that has the same shape as `input`. The output contains the * element-wise string lengths of `input`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private StringLength(Operation operation) { super(operation); 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 a56d350e51f..3cffb728f23 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Split elements of `source` based on `sep` into a `SparseTensor`. @@ -83,7 +85,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of StringSplit */ - public static StringSplit create(Scope scope, Operand input, Operand sep, Options... options) { + 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()); @@ -107,25 +109,25 @@ public static Options maxsplit(Long maxsplit) { /** */ - public Output indices() { + public Output indices() { return indices; } /** */ - public Output values() { + public Output values() { return values; } /** */ - public Output shape() { + public Output shape() { return shape; } - private Output indices; - private Output values; - private Output shape; + private Output indices; + private Output values; + private Output shape; private StringSplit(Operation operation) { super(operation); 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 ffa6f27797c..492625c1ebb 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 @@ -24,12 +24,13 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Strip leading and trailing whitespaces from the Tensor. */ @Operator(group = "strings") -public final class Strip extends PrimitiveOp implements Operand { +public final class Strip extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new Strip operation. @@ -38,7 +39,7 @@ public final class Strip extends PrimitiveOp implements Operand { * @param input A string `Tensor` of any shape. * @return a new instance of Strip */ - public static Strip create(Scope scope, Operand input) { + public static Strip create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("StringStrip", scope.makeOpName("Strip")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -48,16 +49,16 @@ public static Strip create(Scope scope, Operand input) { /** * A string `Tensor` of the same shape as the input. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Strip(Operation operation) { super(operation); 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 baeb6e50400..fe597d9be1c 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Return substrings from `Tensor` of strings. @@ -99,7 +102,7 @@ * */ @Operator(group = "strings") -public final class Substr extends PrimitiveOp implements Operand { +public final class Substr extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.strings.Substr} @@ -134,7 +137,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of Substr */ - public static Substr create(Scope scope, Operand input, Operand pos, Operand len, Options... options) { + 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()); @@ -164,16 +167,16 @@ public static Options unit(String unit) { /** * Tensor of substrings */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private Substr(Operation operation) { super(operation); 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 568af6a5c5f..5bfebd648c2 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Converts each string in the input Tensor to its hash mod by a number of buckets. @@ -36,7 +38,7 @@ * `tf.string_to_hash_bucket_fast()` or `tf.string_to_hash_bucket_strong()`. */ @Operator(group = "strings") -public final class ToHashBucket extends PrimitiveOp implements Operand { +public final class ToHashBucket extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ToHashBucket operation. @@ -46,7 +48,7 @@ public final class ToHashBucket extends PrimitiveOp implements Operand { * @param numBuckets The number of buckets. * @return a new instance of ToHashBucket */ - public static ToHashBucket create(Scope scope, Operand stringTensor, Long numBuckets) { + public static ToHashBucket create(Scope scope, Operand stringTensor, Long numBuckets) { OperationBuilder opBuilder = scope.env().opBuilder("StringToHashBucket", scope.makeOpName("ToHashBucket")); opBuilder.addInput(stringTensor.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -57,16 +59,16 @@ public static ToHashBucket create(Scope scope, Operand stringTensor, Lon /** * A Tensor of the same shape as the input `string_tensor`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private ToHashBucket(Operation operation) { super(operation); 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 5726d89ae0e..16686ee8dd0 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Converts each string in the input Tensor to its hash mod by a number of buckets. @@ -36,7 +38,7 @@ * `tf.string_to_hash_bucket_strong`. */ @Operator(group = "strings") -public final class ToHashBucketFast extends PrimitiveOp implements Operand { +public final class ToHashBucketFast extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ToHashBucketFast operation. @@ -46,7 +48,7 @@ public final class ToHashBucketFast extends PrimitiveOp implements Operand * @param numBuckets The number of buckets. * @return a new instance of ToHashBucketFast */ - public static ToHashBucketFast create(Scope scope, Operand input, Long numBuckets) { + public static ToHashBucketFast create(Scope scope, Operand input, Long numBuckets) { OperationBuilder opBuilder = scope.env().opBuilder("StringToHashBucketFast", scope.makeOpName("ToHashBucketFast")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -57,16 +59,16 @@ public static ToHashBucketFast create(Scope scope, Operand input, Long n /** * A Tensor of the same shape as the input `string_tensor`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private ToHashBucketFast(Operation operation) { super(operation); 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 76fcb3d319a..5dcb826ac0e 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Converts each string in the input Tensor to its hash mod by a number of buckets. @@ -44,7 +46,7 @@ * time than `tf.string_to_hash_bucket_fast`. */ @Operator(group = "strings") -public final class ToHashBucketStrong extends PrimitiveOp implements Operand { +public final class ToHashBucketStrong extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ToHashBucketStrong operation. @@ -56,7 +58,7 @@ public final class ToHashBucketStrong extends PrimitiveOp implements Operand input, Long numBuckets, List key) { + 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.applyControlDependencies(opBuilder); @@ -72,16 +74,16 @@ public static ToHashBucketStrong create(Scope scope, Operand input, Long /** * A Tensor of the same shape as the input `string_tensor`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private ToHashBucketStrong(Operation operation) { super(operation); 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 7517b0852d8..a5a3b4bc2db 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 @@ -25,6 +25,10 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Converts each string in the input Tensor to the specified numeric type. @@ -35,7 +39,7 @@ * @param data type for {@code output()} output */ @Operator(group = "strings") -public final class ToNumber extends PrimitiveOp implements Operand { +public final class ToNumber extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ToNumber operation. @@ -45,11 +49,11 @@ public final class ToNumber extends PrimitiveOp implements Ope * @param outType The numeric type to interpret each string in `string_tensor` as. * @return a new instance of ToNumber */ - public static ToNumber create(Scope scope, Operand stringTensor, Class outType) { + public static ToNumber create(Scope scope, Operand stringTensor, DataType outType) { OperationBuilder opBuilder = scope.env().opBuilder("StringToNumber", scope.makeOpName("ToNumber")); opBuilder.addInput(stringTensor.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("out_type", DataType.fromClass(outType)); + opBuilder.setAttr("out_type", outType); return new ToNumber(opBuilder.build()); } @@ -60,8 +64,8 @@ public static ToNumber create(Scope scope, Operand * @param stringTensor * @return a new instance of ToNumber */ - public static ToNumber create(Scope scope, Operand stringTensor) { - return create(scope, stringTensor, Float.class); + public static ToNumber create(Scope scope, Operand stringTensor) { + return create(scope, stringTensor, TFloat.DTYPE); } /** 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 fc959f0b38e..e2963710cb9 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 @@ -24,6 +24,11 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Decodes each string in `input` into a sequence of Unicode code points. @@ -53,7 +58,7 @@ * * @param data type for {@code rowSplits()} output */ -public final class UnicodeDecodeWithOffsets extends PrimitiveOp { +public final class UnicodeDecodeWithOffsets extends PrimitiveOp { /** * Optional attributes for {@link org.tensorflow.op.strings.UnicodeDecodeWithOffsets} @@ -114,12 +119,12 @@ private Options() { * @param options carries optional attributes values * @return a new instance of UnicodeDecodeWithOffsets */ - public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, String inputEncoding, Class Tsplits, Options... options) { + public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, String inputEncoding, DataType Tsplits, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("UnicodeDecodeWithOffsets", scope.makeOpName("UnicodeDecodeWithOffsets")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); opBuilder.setAttr("input_encoding", inputEncoding); - opBuilder.setAttr("Tsplits", DataType.fromClass(Tsplits)); + opBuilder.setAttr("Tsplits", Tsplits); if (options != null) { for (Options opts : options) { if (opts.errors != null) { @@ -147,8 +152,8 @@ public static UnicodeDecodeWithOffsets create(Scope scope, * @param options carries optional attributes values * @return a new instance of UnicodeDecodeWithOffsets */ - public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, String inputEncoding, Options... options) { - return create(scope, input, inputEncoding, Long.class, options); + public static UnicodeDecodeWithOffsets create(Scope scope, Operand input, String inputEncoding, Options... options) { + return create(scope, input, inputEncoding, TInt64.DTYPE, options); } /** @@ -192,7 +197,7 @@ public Output rowSplits() { /** * A 1D int32 Tensor containing the decoded codepoints. */ - public Output charValues() { + public Output charValues() { return charValues; } @@ -200,13 +205,13 @@ public Output charValues() { * A 1D int32 Tensor containing the byte index in the input string where each * character in `char_values` starts. */ - public Output charToByteStarts() { + public Output charToByteStarts() { return charToByteStarts; } private Output rowSplits; - private Output charValues; - private Output charToByteStarts; + private Output charValues; + private Output charToByteStarts; private UnicodeDecodeWithOffsets(Operation operation) { super(operation); 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 3ef65dc3bb9..ff78f0afc13 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; /** * Determine the script codes of a given tensor of Unicode integer code points. @@ -35,7 +36,7 @@ * match input shape. */ @Operator(group = "strings") -public final class UnicodeScript extends PrimitiveOp implements Operand { +public final class UnicodeScript extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new UnicodeScript operation. @@ -44,7 +45,7 @@ public final class UnicodeScript extends PrimitiveOp implements Operand * @param input A Tensor of int32 Unicode code points. * @return a new instance of UnicodeScript */ - public static UnicodeScript create(Scope scope, Operand input) { + public static UnicodeScript create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("UnicodeScript", scope.makeOpName("UnicodeScript")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -54,16 +55,16 @@ public static UnicodeScript create(Scope scope, Operand input) { /** * A Tensor of int32 script codes corresponding to each input code point. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private UnicodeScript(Operation operation) { super(operation); 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 5f92fc940a3..5fe5ab641cc 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Transcode the input text from a source encoding to a destination encoding. @@ -54,7 +55,7 @@ * but as metadata, and so is not preserved in the output. */ @Operator(group = "strings") -public final class UnicodeTranscode extends PrimitiveOp implements Operand { +public final class UnicodeTranscode extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.strings.UnicodeTranscode} @@ -120,7 +121,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of UnicodeTranscode */ - public static UnicodeTranscode create(Scope scope, Operand input, String inputEncoding, String outputEncoding, Options... options) { + 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.applyControlDependencies(opBuilder); @@ -181,16 +182,16 @@ public static Options replaceControlCharacters(Boolean replaceControlCharacters) /** * A string tensor containing unicode text encoded using `output_encoding`. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private UnicodeTranscode(Operation operation) { super(operation); 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 ac1d69c5cca..5e4749c7abc 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TString; /** * Outputs a `Summary` protocol buffer with audio. @@ -44,7 +46,7 @@ * generated sequentially as 'tag/audio/0', 'tag/audio/1', etc. */ @Operator(group = "summary") -public final class AudioSummary extends PrimitiveOp implements Operand { +public final class AudioSummary extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.summary.AudioSummary} @@ -75,7 +77,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of AudioSummary */ - public static AudioSummary create(Scope scope, Operand tag, Operand tensor, Operand sampleRate, Options... options) { + 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()); @@ -101,16 +103,16 @@ public static Options maxOutputs(Long maxOutputs) { /** * Scalar. Serialized `Summary` protocol buffer. */ - public Output summary() { + public Output summary() { return summary; } @Override - public Output asOutput() { + public Output asOutput() { return summary; } - private Output summary; + private Output summary; private AudioSummary(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 42e390e8683..073f633c185 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 @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** */ @@ -38,7 +39,7 @@ public final class CreateSummaryDbWriter extends PrimitiveOp { * @param userName * @return a new instance of CreateSummaryDbWriter */ - public static CreateSummaryDbWriter create(Scope scope, Operand writer, Operand dbUri, Operand experimentName, Operand runName, Operand userName) { + 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()); 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 86b236a40b1..cf7dd18f7d4 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 @@ -22,6 +22,8 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** */ @@ -38,7 +40,7 @@ public final class CreateSummaryFileWriter extends PrimitiveOp { * @param filenameSuffix * @return a new instance of CreateSummaryFileWriter */ - public static CreateSummaryFileWriter create(Scope scope, Operand writer, Operand logdir, Operand maxQueue, Operand flushMillis, Operand filenameSuffix) { + 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()); 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 3890ebe73fb..2fcc318baa5 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs a `Summary` protocol buffer with a histogram. @@ -35,7 +38,7 @@ * This op reports an `InvalidArgument` error if any value is not finite. */ @Operator(group = "summary") -public final class HistogramSummary extends PrimitiveOp implements Operand { +public final class HistogramSummary extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new HistogramSummary operation. @@ -45,7 +48,7 @@ public final class HistogramSummary extends PrimitiveOp implements Operand HistogramSummary create(Scope scope, Operand tag, Operand values) { + 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()); @@ -56,16 +59,16 @@ public static HistogramSummary create(Scope scope, Operand summary() { + public Output summary() { return summary; } @Override - public Output asOutput() { + public Output asOutput() { return summary; } - private Output summary; + private Output summary; private HistogramSummary(Operation operation) { super(operation); 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 f0af64451f2..d1bdb8440a3 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs a `Summary` protocol buffer with images. @@ -77,7 +80,7 @@ * red. */ @Operator(group = "summary") -public final class ImageSummary extends PrimitiveOp implements Operand { +public final class ImageSummary extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.summary.ImageSummary} @@ -117,7 +120,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ImageSummary */ - public static ImageSummary create(Scope scope, Operand tag, Operand tensor, Options... options) { + 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()); @@ -152,16 +155,16 @@ public static Options badColor(Tensor badColor) { /** * Scalar. Serialized `Summary` protocol buffer. */ - public Output summary() { + public Output summary() { return summary; } @Override - public Output asOutput() { + public Output asOutput() { return summary; } - private Output summary; + private Output summary; private ImageSummary(Operation operation) { super(operation); 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 ca279814773..adb1b50b924 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 @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** */ @@ -35,7 +36,7 @@ public final class ImportEvent extends PrimitiveOp { * @param event * @return a new instance of ImportEvent */ - public static ImportEvent create(Scope scope, Operand writer, Operand event) { + 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()); 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 b2107dc3b34..92231500590 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 @@ -25,6 +25,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Merges summaries. @@ -38,7 +39,7 @@ * in the summaries to merge use the same tag. */ @Operator(group = "summary") -public final class MergeSummary extends PrimitiveOp implements Operand { +public final class MergeSummary extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new MergeSummary operation. @@ -48,7 +49,7 @@ public final class MergeSummary extends PrimitiveOp implements Operand { * buffers. * @return a new instance of MergeSummary */ - public static MergeSummary create(Scope scope, Iterable> inputs) { + public static MergeSummary create(Scope scope, Iterable> inputs) { OperationBuilder opBuilder = scope.env().opBuilder("MergeSummary", scope.makeOpName("MergeSummary")); opBuilder.addInputList(Operands.asOutputs(inputs)); opBuilder = scope.applyControlDependencies(opBuilder); @@ -58,16 +59,16 @@ public static MergeSummary create(Scope scope, Iterable> inputs) /** * Scalar. Serialized `Summary` protocol buffer. */ - public Output summary() { + public Output summary() { return summary; } @Override - public Output asOutput() { + public Output asOutput() { return summary; } - private Output summary; + private Output summary; private MergeSummary(Operation operation) { super(operation); 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 98fdb9a4b5e..34bca53b6ba 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Outputs a `Summary` protocol buffer with scalar values. @@ -32,7 +35,7 @@ * has a summary value for each tag-value pair in `tags` and `values`. */ @Operator(group = "summary") -public final class ScalarSummary extends PrimitiveOp implements Operand { +public final class ScalarSummary extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new ScalarSummary operation. @@ -42,7 +45,7 @@ public final class ScalarSummary extends PrimitiveOp implements Operand * @param values Same shape as `tags. Values for the summary. * @return a new instance of ScalarSummary */ - public static ScalarSummary create(Scope scope, Operand tags, Operand values) { + 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()); @@ -53,16 +56,16 @@ public static ScalarSummary create(Scope scope, Operand summary() { + public Output summary() { return summary; } @Override - public Output asOutput() { + public Output asOutput() { return summary; } - private Output summary; + private Output summary; private ScalarSummary(Operation operation) { super(operation); 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 3eb408f81b9..dc4372025c0 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 @@ -23,11 +23,12 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TString; /** * Produces a summary of any statistics recorded by the given statistics manager. */ -public final class StatsAggregatorSummary extends PrimitiveOp implements Operand { +public final class StatsAggregatorSummary extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new StatsAggregatorSummary operation. @@ -45,16 +46,16 @@ public static StatsAggregatorSummary create(Scope scope, Operand iterator) { /** */ - public Output summary() { + public Output summary() { return summary; } @Override - public Output asOutput() { + public Output asOutput() { return summary; } - private Output summary; + private Output summary; private StatsAggregatorSummary(Operation operation) { super(operation); 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 0ec10e8ba35..4240013fa5f 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 @@ -23,10 +23,11 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** */ -public final class SummaryWriter extends PrimitiveOp implements Operand { +public final class SummaryWriter extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.summary.SummaryWriter} @@ -101,8 +102,8 @@ public Output writer() { @Override @SuppressWarnings("unchecked") - public Output asOutput() { - return (Output) writer; + public Output asOutput() { + return (Output) writer; } private Output writer; 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 8ccde18421f..11e4c2603a0 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Outputs a `Summary` protocol buffer with a tensor and per-plugin data. */ @Operator(group = "summary") -public final class TensorSummary extends PrimitiveOp implements Operand { +public final class TensorSummary extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TensorSummary operation. @@ -41,7 +43,7 @@ public final class TensorSummary extends PrimitiveOp implements Operand * data. * @return a new instance of TensorSummary */ - public static TensorSummary create(Scope scope, Operand tag, Operand tensor, Operand serializedSummaryMetadata) { + 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()); @@ -52,16 +54,16 @@ public static TensorSummary create(Scope scope, Operand tag, Operand /** */ - public Output summary() { + public Output summary() { return summary; } @Override - public Output asOutput() { + public Output asOutput() { return summary; } - private Output summary; + private Output summary; private TensorSummary(Operation operation) { super(operation); 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 2fa63f9d7ae..d5fdaa6baef 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 @@ -22,6 +22,9 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** */ @@ -58,7 +61,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of WriteAudioSummary */ - public static WriteAudioSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand tensor, Operand sampleRate, Options... options) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteGraphSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteGraphSummary.java index e00392e7d3f..6476ba15c06 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteGraphSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteGraphSummary.java @@ -22,6 +22,8 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** */ @@ -36,7 +38,7 @@ public final class WriteGraphSummary extends PrimitiveOp { * @param tensor * @return a new instance of WriteGraphSummary */ - public static WriteGraphSummary create(Scope scope, Operand writer, Operand step, Operand tensor) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteHistogramSummary.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteHistogramSummary.java index 3927383bf92..ad617d9d8b8 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteHistogramSummary.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/summary/WriteHistogramSummary.java @@ -22,6 +22,10 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** */ @@ -37,7 +41,7 @@ public final class WriteHistogramSummary extends PrimitiveOp { * @param values * @return a new instance of WriteHistogramSummary */ - public static WriteHistogramSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand values) { + 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()); 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 fdaa895095f..cc2d95a719d 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 @@ -22,7 +22,11 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; -import org.tensorflow.types.UInt8; +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; /** */ @@ -59,7 +63,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of WriteImageSummary */ - public static WriteImageSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand tensor, Operand badColor, Options... options) { + 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()); 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 234eeff3cb4..4cc58ebf05c 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 @@ -22,6 +22,10 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** */ @@ -37,7 +41,7 @@ public final class WriteScalarSummary extends PrimitiveOp { * @param value * @return a new instance of WriteScalarSummary */ - public static WriteScalarSummary create(Scope scope, Operand writer, Operand step, Operand tag, Operand value) { + 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()); 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 875cc002da1..97fac69c568 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 @@ -22,6 +22,9 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** */ @@ -38,7 +41,7 @@ public final class WriteSummary extends PrimitiveOp { * @param summaryMetadata * @return a new instance of WriteSummary */ - public static WriteSummary create(Scope scope, Operand writer, Operand step, Operand tensor, Operand tag, Operand summaryMetadata) { + 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()); 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 59a8b944bff..02c24c761f0 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 @@ -23,6 +23,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Applies a gradient to a given accumulator. @@ -41,7 +44,7 @@ public final class AccumulatorApplyGradient extends PrimitiveOp { * @param gradient A tensor of the gradient to be accumulated. * @return a new instance of AccumulatorApplyGradient */ - public static AccumulatorApplyGradient create(Scope scope, Operand handle, Operand localStep, Operand gradient) { + 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()); 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 1cd6128f313..3342737d9fe 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; /** * Returns the number of gradients aggregated in the given accumulators. */ @Operator(group = "train") -public final class AccumulatorNumAccumulated extends PrimitiveOp implements Operand { +public final class AccumulatorNumAccumulated extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AccumulatorNumAccumulated operation. @@ -38,7 +40,7 @@ public final class AccumulatorNumAccumulated extends PrimitiveOp implements Oper * @param handle The handle to an accumulator. * @return a new instance of AccumulatorNumAccumulated */ - public static AccumulatorNumAccumulated create(Scope scope, Operand handle) { + public static AccumulatorNumAccumulated create(Scope scope, Operand handle) { OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorNumAccumulated", scope.makeOpName("AccumulatorNumAccumulated")); opBuilder.addInput(handle.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -48,16 +50,16 @@ public static AccumulatorNumAccumulated create(Scope scope, Operand hand /** * The number of gradients aggregated in the given accumulator. */ - public Output numAccumulated() { + public Output numAccumulated() { return numAccumulated; } @Override - public Output asOutput() { + public Output asOutput() { return numAccumulated; } - private Output numAccumulated; + private Output numAccumulated; private AccumulatorNumAccumulated(Operation operation) { super(operation); 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 2410fa84f25..4c7555a7c06 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Updates the accumulator with a new value for global_step. @@ -41,7 +43,7 @@ public final class AccumulatorSetGlobalStep extends PrimitiveOp { * @param newGlobalStep The new global_step value to set. * @return a new instance of AccumulatorSetGlobalStep */ - public static AccumulatorSetGlobalStep create(Scope scope, Operand handle, Operand newGlobalStep) { + 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()); 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 7097e287c9f..e689861fd96 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 @@ -25,6 +25,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Extracts the average gradient in the given ConditionalAccumulator. @@ -38,7 +41,7 @@ * @param data type for {@code average()} output */ @Operator(group = "train") -public final class AccumulatorTakeGradient extends PrimitiveOp implements Operand { +public final class AccumulatorTakeGradient extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new AccumulatorTakeGradient operation. @@ -50,12 +53,12 @@ public final class AccumulatorTakeGradient extends PrimitiveOp implements Ope * of the accumulator. * @return a new instance of AccumulatorTakeGradient */ - public static AccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, Class dtype) { + public static AccumulatorTakeGradient create(Scope scope, Operand handle, Operand numRequired, DataType dtype) { OperationBuilder opBuilder = scope.env().opBuilder("AccumulatorTakeGradient", scope.makeOpName("AccumulatorTakeGradient")); opBuilder.addInput(handle.asOutput()); opBuilder.addInput(numRequired.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); return new AccumulatorTakeGradient(opBuilder.build()); } 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 bf8548492d0..1b450ae6ec3 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 @@ -23,6 +23,7 @@ import org.tensorflow.Output; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the AdaMax algorithm. @@ -33,7 +34,7 @@ * * @param data type for {@code out()} output */ -public final class ApplyAdaMax extends PrimitiveOp implements Operand { +public final class ApplyAdaMax extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyAdaMax} @@ -72,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyAdaMax */ - 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) { + 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()); 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 9263bf24506..779d89698fd 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the adadelta scheme. @@ -36,7 +37,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyAdadelta extends PrimitiveOp implements Operand { +public final class ApplyAdadelta extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyAdadelta} @@ -72,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyAdadelta */ - public static ApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Options... options) { + 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()); 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 da9f22d63d6..6fa6877c75e 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the adagrad scheme. @@ -34,7 +35,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyAdagrad extends PrimitiveOp implements Operand { +public final class ApplyAdagrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagrad} @@ -77,7 +78,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyAdagrad */ - public static ApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Options... options) { + 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()); 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 92774306704..821a568f761 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the proximal adagrad scheme. @@ -31,7 +33,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyAdagradDa extends PrimitiveOp implements Operand { +public final class ApplyAdagradDa extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyAdagradDa} @@ -68,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyAdagradDa */ - public static ApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { + 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()); 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 687d7a65b71..15643d0e50f 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the Adam algorithm. @@ -36,7 +37,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyAdam extends PrimitiveOp implements Operand { +public final class ApplyAdam extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyAdam} @@ -85,7 +86,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyAdam */ - 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) { + 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()); 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 e2c2c243fe4..a6bc2255c82 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the AddSign update. @@ -35,7 +36,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyAddSign extends PrimitiveOp implements Operand { +public final class ApplyAddSign extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyAddSign} @@ -72,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyAddSign */ - public static ApplyAddSign create(Scope scope, Operand var, Operand m, Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, Options... options) { + 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()); 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 efc9b7c76f8..458d92d427d 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the centered RMSProp algorithm. @@ -50,7 +51,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyCenteredRmsProp extends PrimitiveOp implements Operand { +public final class ApplyCenteredRmsProp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyCenteredRmsProp} @@ -89,7 +90,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyCenteredRmsProp */ - 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) { + 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()); 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 5003f176d4c..819c6fbe95a 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the Ftrl-proximal scheme. @@ -39,7 +40,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyFtrl extends PrimitiveOp implements Operand { +public final class ApplyFtrl extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyFtrl} @@ -78,7 +79,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyFtrl */ - 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) { + 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()); 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 3f5852283f5..474788ffbd1 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' by subtracting 'alpha' * 'delta' from it. @@ -31,7 +32,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyGradientDescent extends PrimitiveOp implements Operand { +public final class ApplyGradientDescent extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyGradientDescent} @@ -63,7 +64,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyGradientDescent */ - public static ApplyGradientDescent create(Scope scope, Operand var, Operand alpha, Operand delta, Options... options) { + 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()); 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 254be2deafa..faa0c1b9741 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the momentum scheme. Set use_nesterov = True if you @@ -36,7 +37,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyMomentum extends PrimitiveOp implements Operand { +public final class ApplyMomentum extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyMomentum} @@ -82,7 +83,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyMomentum */ - public static ApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { + 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()); 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 e08ec4a0bbb..ab0ef999380 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the AddSign update. @@ -35,7 +36,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyPowerSign extends PrimitiveOp implements Operand { +public final class ApplyPowerSign extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyPowerSign} @@ -72,7 +73,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyPowerSign */ - public static ApplyPowerSign create(Scope scope, Operand var, Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, Operand grad, Options... options) { + 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()); 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 0a4a169e156..d756cd7c5f5 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' and '*accum' according to FOBOS with Adagrad learning rate. @@ -35,7 +36,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyProximalAdagrad extends PrimitiveOp implements Operand { +public final class ApplyProximalAdagrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalAdagrad} @@ -70,7 +71,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyProximalAdagrad */ - public static ApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Options... options) { + 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()); 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 f22686eabcb..eb98a880a9f 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' as FOBOS algorithm with fixed learning rate. @@ -34,7 +35,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyProximalGradientDescent extends PrimitiveOp implements Operand { +public final class ApplyProximalGradientDescent extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyProximalGradientDescent} @@ -68,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyProximalGradientDescent */ - public static ApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, Options... options) { + 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()); 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 5d9ccaa0147..729e4fb607d 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the RMSProp algorithm. @@ -42,7 +43,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class ApplyRmsProp extends PrimitiveOp implements Operand { +public final class ApplyRmsProp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ApplyRmsProp} @@ -80,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ApplyRmsProp */ - public static ApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { + 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()); 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 1157cb00f8d..71cd278a96d 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 @@ -22,10 +22,12 @@ import org.tensorflow.Operation; import org.tensorflow.OperationBuilder; import org.tensorflow.Output; -import org.tensorflow.Shape; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * A conditional accumulator for aggregating gradients. @@ -38,7 +40,7 @@ * the accumulator. */ @Operator(group = "train") -public final class ConditionalAccumulator extends PrimitiveOp implements Operand { +public final class ConditionalAccumulator extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.ConditionalAccumulator} @@ -88,10 +90,10 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ConditionalAccumulator */ - public static ConditionalAccumulator create(Scope scope, Class dtype, Shape shape, Options... options) { + public static ConditionalAccumulator create(Scope scope, DataType dtype, Shape shape, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ConditionalAccumulator", scope.makeOpName("ConditionalAccumulator")); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dtype", DataType.fromClass(dtype)); + opBuilder.setAttr("dtype", dtype); opBuilder.setAttr("shape", shape); if (options != null) { for (Options opts : options) { @@ -135,16 +137,16 @@ public static Options reductionType(String reductionType) { /** * The handle to the accumulator. */ - public Output handle() { + public Output handle() { return handle; } @Override - public Output asOutput() { + public Output asOutput() { return handle; } - private Output handle; + private Output handle; private ConditionalAccumulator(Operation operation) { super(operation); 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 72bd31765cd..2789f119eb9 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Given a path to new and old vocabulary files, returns a remapping Tensor of @@ -91,7 +94,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of GenerateVocabRemapping */ - public static GenerateVocabRemapping create(Scope scope, Operand newVocabFile, Operand oldVocabFile, Long newVocabOffset, Long numNewVocab, Options... options) { + 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()); @@ -121,19 +124,19 @@ public static Options oldVocabSize(Long oldVocabSize) { * 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. */ - public Output remapping() { + public Output remapping() { return remapping; } /** * Number of new vocab entries found in old vocab. */ - public Output numPresent() { + public Output numPresent() { return numPresent; } - private Output remapping; - private Output numPresent; + private Output remapping; + private Output numPresent; private GenerateVocabRemapping(Operation operation) { super(operation); 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 5f0d4cb1751..f54f6b0cedf 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * V2 format specific: merges the metadata files of sharded checkpoints. The @@ -68,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of MergeV2Checkpoints */ - public static MergeV2Checkpoints create(Scope scope, Operand checkpointPrefixes, Operand destinationPrefix, Options... options) { + 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()); 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 d3d146b4dfe..43191e763ce 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** * Training via negative sampling. @@ -44,7 +46,7 @@ public final class NegTrain extends PrimitiveOp { * @param numNegativeSamples Number of negative samples per example. * @return a new instance of NegTrain */ - public static NegTrain create(Scope scope, Operand wIn, Operand wOut, Operand examples, Operand labels, Operand lr, List vocabCount, Long numNegativeSamples) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/PreventGradient.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/PreventGradient.java index ede8e0b11e1..7e0c8502be2 100644 --- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/PreventGradient.java +++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/train/PreventGradient.java @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * An identity op that triggers an error if a gradient is requested. @@ -39,7 +40,7 @@ * @param data type for {@code output()} output */ @Operator(group = "train") -public final class PreventGradient extends PrimitiveOp implements Operand { +public final class PreventGradient extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.PreventGradient} @@ -69,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of PreventGradient */ - public static PreventGradient create(Scope scope, Operand input, Options... options) { + 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.applyControlDependencies(opBuilder); 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 b1d2907d3b8..204fe1ae3d8 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 @@ -22,6 +22,7 @@ import org.tensorflow.OperationBuilder; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the AdaMax algorithm. @@ -69,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyAdaMax */ - 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) { + 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()); 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 c8909c6d1f2..9c0ddc200ae 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the adadelta scheme. @@ -69,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyAdadelta */ - public static ResourceApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Options... options) { + 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()); 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 c62fdebd34e..6bb58df1c68 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,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the adagrad scheme. @@ -74,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyAdagrad */ - public static ResourceApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Options... options) { + public static ResourceApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("ResourceApplyAdagrad", scope.makeOpName("ResourceApplyAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); 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 f173947b5c8..2871841b8fb 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the proximal adagrad scheme. @@ -65,7 +67,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyAdagradDa */ - public static ResourceApplyAdagradDa create(Scope scope, Operand var, Operand gradientAccumulator, Operand gradientSquaredAccumulator, Operand grad, Operand lr, Operand l1, Operand l2, Operand globalStep, Options... options) { + 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()); 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 414ae9c88dc..2383586a28f 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the Adam algorithm. @@ -82,7 +83,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyAdam */ - 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) { + 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()); 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 085f50106bf..9ceb2051930 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the AddSign update. @@ -69,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyAddSign */ - public static ResourceApplyAddSign create(Scope scope, Operand var, Operand m, Operand lr, Operand alpha, Operand signDecay, Operand beta, Operand grad, Options... options) { + 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()); 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 eb238cdca6d..2d8f10647e7 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the centered RMSProp algorithm. @@ -86,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyCenteredRmsProp */ - 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) { + 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()); 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 225ba816b24..e72f20ff25e 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the Ftrl-proximal scheme. @@ -75,7 +76,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyFtrl */ - 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) { + 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()); 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 4cb535df56a..7d31c3a5872 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' by subtracting 'alpha' * 'delta' from it. @@ -60,7 +61,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyGradientDescent */ - public static ResourceApplyGradientDescent create(Scope scope, Operand var, Operand alpha, Operand delta, Options... options) { + 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()); 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 915902e57c6..9ca882b6276 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the momentum scheme. Set use_nesterov = True if you @@ -79,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyMomentum */ - public static ResourceApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand momentum, Options... options) { + 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()); 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 9c2669d14bc..6ca6715137f 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the AddSign update. @@ -69,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyPowerSign */ - public static ResourceApplyPowerSign create(Scope scope, Operand var, Operand m, Operand lr, Operand logbase, Operand signDecay, Operand beta, Operand grad, Options... options) { + 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()); 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 2151c65b88c..d7fe4432a15 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' and '*accum' according to FOBOS with Adagrad learning rate. @@ -67,7 +68,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyProximalAdagrad */ - public static ResourceApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Options... options) { + 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()); 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 9eeb3079af4..5a545cf9c4c 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' as FOBOS algorithm with fixed learning rate. @@ -65,7 +66,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyProximalGradientDescent */ - public static ResourceApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand delta, Options... options) { + 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()); 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 54af4c19763..335667eaae5 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 @@ -23,6 +23,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the RMSProp algorithm. @@ -77,7 +78,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceApplyRmsProp */ - public static ResourceApplyRmsProp create(Scope scope, Operand var, Operand ms, Operand mom, Operand lr, Operand rho, Operand momentum, Operand epsilon, Operand grad, Options... options) { + 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()); 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 54a43176034..31a26ad1de1 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * var: Should be from a Variable(). @@ -65,7 +67,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyAdadelta */ - public static ResourceSparseApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Operand indices, Options... options) { + 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()); 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 d594ec19999..a86e6915546 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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. @@ -76,7 +78,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyAdagrad */ - public static ResourceSparseApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Options... options) { + 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()); 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 27c69356309..c48bde1e9cd 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 @@ -23,6 +23,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update entries in '*var' and '*accum' according to the proximal adagrad scheme. @@ -66,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyAdagradDa */ - 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) { + 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()); 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 0823cc88297..43768c3fc0e 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the centered RMSProp algorithm. @@ -85,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyCenteredRmsProp */ - 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) { + 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()); 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 dabd99378c6..c8787121096 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update relevant entries in '*var' according to the Ftrl-proximal scheme. @@ -77,7 +79,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyFtrl */ - 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) { + 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()); 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 31913c66da6..833f0ec4138 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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 momentum scheme. @@ -82,7 +84,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyMomentum */ - public static ResourceSparseApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, Options... options) { + 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()); 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 5ec0f053ce5..6679e09139e 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Sparse update entries in '*var' and '*accum' according to FOBOS algorithm. @@ -70,7 +72,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyProximalAdagrad */ - public static ResourceSparseApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { + 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()); 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 2f258ab1d2b..115953d7bff 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Sparse update '*var' as FOBOS algorithm with fixed learning rate. @@ -67,7 +69,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyProximalGradientDescent */ - public static ResourceSparseApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { + 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()); 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 8ae16ea5c70..163f28c3f4e 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 @@ -23,6 +23,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the RMSProp algorithm. @@ -78,7 +80,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of ResourceSparseApplyRmsProp */ - 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) { + 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()); 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 5ab8db3403c..f6eb3f1e751 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 @@ -28,6 +28,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Restores tensors from a V2 checkpoint. @@ -47,7 +49,7 @@ * Callers must ensure all the named tensors are indeed stored in the checkpoint. */ @Operator(group = "train") -public final class Restore extends PrimitiveOp implements Iterable> { +public final class Restore extends PrimitiveOp implements Iterable> { /** * Factory method to create a class wrapping a new Restore operation. @@ -61,7 +63,7 @@ public final class Restore extends PrimitiveOp implements Iterable prefix, Operand tensorNames, Operand shapeAndSlices, List> dtypes) { + 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()); @@ -69,7 +71,7 @@ public static Restore create(Scope scope, Operand prefix, Operand> tensors() { @Override @SuppressWarnings({"rawtypes", "unchecked"}) - public Iterator> iterator() { + public Iterator> iterator() { return (Iterator) tensors.iterator(); } 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 4edc59931f1..bffa944bc9d 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 @@ -25,6 +25,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** * Restores a tensor from checkpoint files. @@ -39,7 +41,7 @@ * @param data type for {@code tensor()} output */ @Operator(group = "train") -public final class RestoreSlice extends PrimitiveOp implements Operand { +public final class RestoreSlice extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.RestoreSlice} @@ -75,13 +77,13 @@ private Options() { * @param options carries optional attributes values * @return a new instance of RestoreSlice */ - public static RestoreSlice create(Scope scope, Operand filePattern, Operand tensorName, Operand shapeAndSlice, Class dt, Options... options) { + public static RestoreSlice create(Scope scope, Operand filePattern, Operand tensorName, Operand shapeAndSlice, DataType dt, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("RestoreSlice", scope.makeOpName("RestoreSlice")); opBuilder.addInput(filePattern.asOutput()); opBuilder.addInput(tensorName.asOutput()); opBuilder.addInput(shapeAndSlice.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); - opBuilder.setAttr("dt", DataType.fromClass(dt)); + opBuilder.setAttr("dt", dt); if (options != null) { for (Options opts : options) { if (opts.preferredShard != null) { 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 f56f4a9b9ba..91a8a1f2a51 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Saves tensors in V2 checkpoint format. @@ -47,7 +48,7 @@ public final class Save extends PrimitiveOp { * @param tensors `N` tensors to save. * @return a new instance of Save */ - public static Save create(Scope scope, Operand prefix, Operand tensorNames, Operand shapeAndSlices, Iterable> tensors) { + 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()); 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 3df127c1e4b..e3f0b346124 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TString; /** * Saves input tensors slices to disk. @@ -73,7 +74,7 @@ public final class SaveSlices extends PrimitiveOp { * @param data `N` tensors to save. * @return a new instance of SaveSlices */ - public static SaveSlices create(Scope scope, Operand filename, Operand tensorNames, Operand shapesAndSlices, Iterable> data) { + 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()); 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 cb5c885f4c7..8286cb92f0c 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 @@ -24,12 +24,14 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; /** * Computes fingerprints of the input strings. */ @Operator(group = "train") -public final class SdcaFprint extends PrimitiveOp implements Operand { +public final class SdcaFprint extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new SdcaFprint operation. @@ -38,7 +40,7 @@ public final class SdcaFprint extends PrimitiveOp implements Operand { * @param input vector of strings to compute fingerprints on. * @return a new instance of SdcaFprint */ - public static SdcaFprint create(Scope scope, Operand input) { + public static SdcaFprint create(Scope scope, Operand input) { OperationBuilder opBuilder = scope.env().opBuilder("SdcaFprint", scope.makeOpName("SdcaFprint")); opBuilder.addInput(input.asOutput()); opBuilder = scope.applyControlDependencies(opBuilder); @@ -49,16 +51,16 @@ public static SdcaFprint create(Scope scope, Operand input) { * 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. */ - public Output output() { + public Output output() { return output; } @Override - public Output asOutput() { + public Output asOutput() { return output; } - private Output output; + private Output output; private SdcaFprint(Operation operation) { super(operation); 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 2f18e53407c..1a2de51a4c9 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 @@ -26,6 +26,8 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt64; /** * Distributed version of Stochastic Dual Coordinate Ascent (SDCA) optimizer for @@ -99,7 +101,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SdcaOptimizer */ - 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) { + 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)); @@ -138,7 +140,7 @@ public static Options adaptive(Boolean adaptive) { * a list of vectors containing the updated example state * data. */ - public Output outExampleStateData() { + public Output outExampleStateData() { return outExampleStateData; } @@ -146,7 +148,7 @@ public Output outExampleStateData() { * a list of vectors where each value is the delta * weights associated with a sparse feature group. */ - public List> outDeltaSparseWeights() { + public List> outDeltaSparseWeights() { return outDeltaSparseWeights; } @@ -154,13 +156,13 @@ public List> outDeltaSparseWeights() { * a list of vectors where the values are the delta * weights associated with a dense feature group. */ - public List> outDeltaDenseWeights() { + public List> outDeltaDenseWeights() { return outDeltaDenseWeights; } - private Output outExampleStateData; - private List> outDeltaSparseWeights; - private List> outDeltaDenseWeights; + private Output outExampleStateData; + private List> outDeltaSparseWeights; + private List> outDeltaDenseWeights; @SuppressWarnings("unchecked") private SdcaOptimizer(Operation operation) { @@ -168,10 +170,10 @@ private SdcaOptimizer(Operation operation) { int outputIdx = 0; outExampleStateData = operation.output(outputIdx++); int outDeltaSparseWeightsLength = operation.outputListLength("out_delta_sparse_weights"); - outDeltaSparseWeights = Arrays.asList((Output[])operation.outputList(outputIdx, outDeltaSparseWeightsLength)); + 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)); + outDeltaDenseWeights = Arrays.asList((Output[])operation.outputList(outputIdx, outDeltaDenseWeightsLength)); outputIdx += outDeltaDenseWeightsLength; } } 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 1b228281454..24ea202a749 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 @@ -24,6 +24,7 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TFloat; /** * Applies L1 regularization shrink step on the parameters. @@ -41,7 +42,7 @@ public final class SdcaShrinkL1 extends PrimitiveOp { * @param l2 Symmetric l2 regularization strength. Should be a positive float. * @return a new instance of SdcaShrinkL1 */ - public static SdcaShrinkL1 create(Scope scope, Iterable> weights, Float l1, Float l2) { + 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.applyControlDependencies(opBuilder); 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 fa0b951ab60..2ab3ac45709 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * var: Should be from a Variable(). @@ -31,7 +33,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class SparseApplyAdadelta extends PrimitiveOp implements Operand { +public final class SparseApplyAdadelta extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdadelta} @@ -68,7 +70,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyAdadelta */ - public static SparseApplyAdadelta create(Scope scope, Operand var, Operand accum, Operand accumUpdate, Operand lr, Operand rho, Operand epsilon, Operand grad, Operand indices, Options... options) { + 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()); 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 a5ab8579cdc..515df94837e 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,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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. @@ -35,7 +37,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class SparseApplyAdagrad extends PrimitiveOp implements Operand { +public final class SparseApplyAdagrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagrad} @@ -79,7 +81,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyAdagrad */ - public static SparseApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Options... options) { + public static SparseApplyAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Options... options) { OperationBuilder opBuilder = scope.env().opBuilder("SparseApplyAdagrad", scope.makeOpName("SparseApplyAdagrad")); opBuilder.addInput(var.asOutput()); opBuilder.addInput(accum.asOutput()); 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 bd63ff92d86..f18d46be664 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 @@ -24,6 +24,9 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update entries in '*var' and '*accum' according to the proximal adagrad scheme. @@ -31,7 +34,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class SparseApplyAdagradDa extends PrimitiveOp implements Operand { +public final class SparseApplyAdagradDa extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.SparseApplyAdagradDa} @@ -69,7 +72,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyAdagradDa */ - 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) { + 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()); 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 fef12ee9630..031d490be50 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the centered RMSProp algorithm. @@ -48,7 +50,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class SparseApplyCenteredRmsProp extends PrimitiveOp implements Operand { +public final class SparseApplyCenteredRmsProp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.SparseApplyCenteredRmsProp} @@ -88,7 +90,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyCenteredRmsProp */ - 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) { + 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()); 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 b77d5971ffa..40362945c22 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update relevant entries in '*var' according to the Ftrl-proximal scheme. @@ -40,7 +42,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class SparseApplyFtrl extends PrimitiveOp implements Operand { +public final class SparseApplyFtrl extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.SparseApplyFtrl} @@ -80,7 +82,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyFtrl */ - 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) { + 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()); 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 0b155c84dfd..cf836ce7909 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; 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 momentum scheme. @@ -38,7 +40,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class SparseApplyMomentum extends PrimitiveOp implements Operand { +public final class SparseApplyMomentum extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.SparseApplyMomentum} @@ -85,7 +87,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyMomentum */ - public static SparseApplyMomentum create(Scope scope, Operand var, Operand accum, Operand lr, Operand grad, Operand indices, Operand momentum, Options... options) { + 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()); 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 6d1e4b63074..f35c5e64493 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Sparse update entries in '*var' and '*accum' according to FOBOS algorithm. @@ -37,7 +39,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class SparseApplyProximalAdagrad extends PrimitiveOp implements Operand { +public final class SparseApplyProximalAdagrad extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalAdagrad} @@ -73,7 +75,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyProximalAdagrad */ - public static SparseApplyProximalAdagrad create(Scope scope, Operand var, Operand accum, Operand lr, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { + 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()); 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 81b0057d6ab..834dbab192d 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Sparse update '*var' as FOBOS algorithm with fixed learning rate. @@ -35,7 +37,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class SparseApplyProximalGradientDescent extends PrimitiveOp implements Operand { +public final class SparseApplyProximalGradientDescent extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.SparseApplyProximalGradientDescent} @@ -70,7 +72,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyProximalGradientDescent */ - public static SparseApplyProximalGradientDescent create(Scope scope, Operand var, Operand alpha, Operand l1, Operand l2, Operand grad, Operand indices, Options... options) { + 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()); 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 f877e241cdb..20276170dc2 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * Update '*var' according to the RMSProp algorithm. @@ -42,7 +44,7 @@ * @param data type for {@code out()} output */ @Operator(group = "train") -public final class SparseApplyRmsProp extends PrimitiveOp implements Operand { +public final class SparseApplyRmsProp extends PrimitiveOp implements Operand { /** * Optional attributes for {@link org.tensorflow.op.train.SparseApplyRmsProp} @@ -81,7 +83,7 @@ private Options() { * @param options carries optional attributes values * @return a new instance of SparseApplyRmsProp */ - 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) { + 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()); 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 c0bc9692d92..41e368957d8 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 @@ -24,6 +24,8 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** * Returns the gradient of `Tile`. @@ -35,7 +37,7 @@ * @param data type for {@code output()} output */ @Operator(group = "train") -public final class TileGrad extends PrimitiveOp implements Operand { +public final class TileGrad extends PrimitiveOp implements Operand { /** * Factory method to create a class wrapping a new TileGrad operation. @@ -45,7 +47,7 @@ public final class TileGrad extends PrimitiveOp implements Operand { * @param multiples * @return a new instance of TileGrad */ - public static TileGrad create(Scope scope, Operand input, Operand multiples) { + 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()); diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractOperation.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractOperation.java index 23b1753e2cb..6511c72b814 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/AbstractOperation.java @@ -15,6 +15,9 @@ package org.tensorflow; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; + /** * Base class for {@link Operation} implementations. * @@ -33,9 +36,8 @@ public Output[] outputList(int idx, int length) { } @Override - @SuppressWarnings({"rawtypes", "unchecked"}) - public Output output(int idx) { - return new Output(this, idx); + public Output output(int idx) { + return new Output<>(this, idx); } @Override @@ -65,7 +67,7 @@ public String toString() { * @param outputIdx index of the output of this operation * @return output tensor shape */ - abstract long[] shape(int outputIdx); + abstract Shape shape(int outputIdx); /** * Returns the datatype of the tensor of the {@code outputIdx}th output of this operation. @@ -73,7 +75,7 @@ public String toString() { * @param outputIdx index of the output of this operation * @return output tensor datatype */ - abstract DataType dtype(int outputIdx); + abstract DataType dtype(int outputIdx); /** * Returns the tensor of the {@code outputIdx}th output of this operation. diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DataType.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DataType.java index 516655040ba..a50969e9f27 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DataType.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DataType.java @@ -15,49 +15,36 @@ package org.tensorflow; -import java.util.HashMap; -import java.util.Map; - -import org.tensorflow.types.UInt8; - -/** Represents the type of elements in a {@link Tensor} as an enum. */ -public enum DataType { - /** 32-bit single precision floating point. */ - FLOAT(1, 4), - - /** 64-bit double precision floating point. */ - DOUBLE(2, 8), - - /** 32-bit signed integer. */ - INT32(3, 4), - - /** 8-bit unsigned integer. */ - UINT8(4, 1), +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; + +/** Represents a type of elements in a {@link Tensor} */ +public final class DataType { + + @FunctionalInterface + public interface TensorMapper { + + /** + * Maps tensor memory to a data structure for manipulating elements of this type. + * + * @param nativeTensor pointer to the native tensor + * @param shape the shape of the tensor + * @return data structure of elements of this type + */ + T apply(TF_Tensor nativeTensor, Shape shape); + } /** - * A sequence of bytes. + * Creates a new datatype * - *

TensorFlow uses the STRING type for an arbitrary sequence of bytes. - */ - STRING(7, -1), - - /** 64-bit signed integer. */ - INT64(9, 8), - - /** Boolean. */ - BOOL(10, 1); - - private final int value; - - private final int byteSize; - - /** + * @param name readable-name for this type * @param value must match the corresponding TF_* value in the TensorFlow C API. * @param byteSize size of an element of this type, in bytes, -1 if unknown + * @param tensorMapper method for mapping tensor memory to elements of this type */ - DataType(int value, int byteSize) { - this.value = value; - this.byteSize = byteSize; + public static DataType create(String name, int value, int byteSize, TensorMapper tensorMapper) { + return new DataType<>(name, value, byteSize, tensorMapper); } /** @@ -67,50 +54,39 @@ public int byteSize() { return byteSize; } - /** Corresponding value of the TF_DataType enum in the TensorFlow C API. */ - int c() { - return value; + /** + * Returns a readable name for this type + */ + public String name() { + return name; } - // Cached to avoid copying it - private static final DataType[] values = values(); - - static DataType fromC(int c) { - for (DataType t : values) { - if (t.value == c) { - return t; - } - } - throw new IllegalArgumentException( - "DataType " + c + " is not recognized in Java (version " + TensorFlow.version() + ")"); + /** + * Returns the numeric code for this datatype, as recognized by the native library (C API) + */ + int nativeCode() { + return nativeCode; } /** - * Returns the DataType of a Tensor whose elements have the type specified by class {@code c}. + * Maps a tensor to a data structure for manipulating elements of this type. * - * @param c The class describing the TensorFlow type of interest. - * @return The {@code DataType} enum corresponding to {@code c}. - * @throws IllegalArgumentException if objects of {@code c} do not correspond to a TensorFlow - * datatype. + * @param tensor tensor to map + * @return data structure of elements of this type */ - public static DataType fromClass(Class c) { - DataType dtype = typeCodes.get(c); - if (dtype == null) { - throw new IllegalArgumentException( - c.getName() + " objects cannot be used as elements in a TensorFlow Tensor"); - } - return dtype; + T map(Tensor tensor) { + return tensorMapper.apply(tensor.getNative(), tensor.shape()); } - private static final Map, DataType> typeCodes = new HashMap<>(); + private final int nativeCode; + private final int byteSize; + private final String name; + private final TensorMapper tensorMapper; - static { - typeCodes.put(Float.class, DataType.FLOAT); - typeCodes.put(Double.class, DataType.DOUBLE); - typeCodes.put(Integer.class, DataType.INT32); - typeCodes.put(UInt8.class, DataType.UINT8); - typeCodes.put(Long.class, DataType.INT64); - typeCodes.put(Boolean.class, DataType.BOOL); - typeCodes.put(String.class, DataType.STRING); + private DataType(String name, int nativeCode, int byteSize, TensorMapper tensorMapper) { + this.name = name; + this.nativeCode = nativeCode; + this.byteSize = byteSize; + this.tensorMapper = tensorMapper; } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DataTypes.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DataTypes.java new file mode 100644 index 00000000000..c3a6dbdb36a --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/DataTypes.java @@ -0,0 +1,53 @@ +package org.tensorflow; + +import java.util.HashMap; +import java.util.Map; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; + +/** + * Utility class for working with {@link DataType} objects. + */ +final class DataTypes { + + /** + * Find a data type from the type code returned by the native layer (C API). + * + *

Only data types registered via {@link #register(DataType)} can be resolved. + * + * @param nativeCode native code + * @return data type for this code + * @throws IllegalArgumentException if the code matches no registered data type + */ + static DataType fromNativeCode(int nativeCode) { + DataType dataType = DATA_TYPE_REGISTRY.get(nativeCode); + if (dataType == null) { + throw new IllegalArgumentException( + "DataType " + nativeCode + " is not recognized in Java (version " + TensorFlow.version() + ")"); + } + return dataType; + } + + private static final Map> DATA_TYPE_REGISTRY = new HashMap<>(); + + static { + register(TBool.DTYPE); + register(TDouble.DTYPE); + register(TFloat.DTYPE); + register(TInt32.DTYPE); + register(TInt64.DTYPE); + register(TString.DTYPE); + register(TUInt8.DTYPE); + } + + // TODO (karllessard): Right now this method is private but we might want to expose it + // to allow user to register custom data types? + private static void register(DataType dataType) { + DATA_TYPE_REGISTRY.put(dataType.nativeCode(), dataType); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperation.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperation.java index b6e1fa6db6c..702234931e0 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperation.java @@ -16,6 +16,7 @@ package org.tensorflow; import java.util.concurrent.atomic.AtomicReferenceArray; +import org.tensorflow.tools.Shape; /** * Implementation of an {@link Operation} executed eagerly. @@ -38,7 +39,7 @@ class EagerOperation extends AbstractOperation { this.type = type; this.name = name; this.nativeRef = new NativeReference(session, this, opNativeHandle, outputNativeHandles); - this.outputTensors = new AtomicReferenceArray>(outputNativeHandles.length); + this.outputTensors = new AtomicReferenceArray<>(outputNativeHandles.length); } @Override @@ -72,7 +73,7 @@ public long getUnsafeNativeHandle(int outputIndex) { } @Override - public long[] shape(int outputIndex) { + public Shape shape(int outputIndex) { // If the tensor of this output has already been resolved, return its shape. // Otherwise, retrieve the tensor shape from the native library. Tensor tensor = outputTensors.get(outputIndex); @@ -84,11 +85,11 @@ public long[] shape(int outputIndex) { for (int i = 0; i < shape.length; ++i) { shape[i] = dim(outputNativeHandle, i); } - return shape; + return Shape.make(shape); } @Override - public DataType dtype(int outputIndex) { + public DataType dtype(int outputIndex) { // If the tensor of this output has already been resolved, return its datatype. // Otherwise, retrieve the tensor datatype from the native library. Tensor tensor = outputTensors.get(outputIndex); @@ -96,7 +97,7 @@ public DataType dtype(int outputIndex) { return tensor.dataType(); } long outputNativeHandle = getUnsafeNativeHandle(outputIndex); - return DataType.fromC(dataType(outputNativeHandle)); + return DataTypes.fromNativeCode(dataType(outputNativeHandle)); } @Override diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperationBuilder.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperationBuilder.java index 7e5a9a778a4..d2968004a9a 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperationBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerOperationBuilder.java @@ -17,6 +17,7 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import org.tensorflow.tools.Shape; /** * An {@link OperationBuilder} for building {@link Operation Operations} that are executed eagerly. @@ -81,7 +82,7 @@ public EagerOperationBuilder setAttr(String name, String[] values) { for (int i = 0; i < values.length; ++i) { objects[i] = values[i].getBytes(utf8); } - setAttrStringList(nativeRef.opHandle, name, values); + setAttrStringList(nativeRef.opHandle, name, objects); return this; } @@ -128,16 +129,16 @@ public EagerOperationBuilder setAttr(String name, boolean[] values) { } @Override - public EagerOperationBuilder setAttr(String name, DataType value) { - setAttrType(nativeRef.opHandle, name, value.c()); + public EagerOperationBuilder setAttr(String name, DataType value) { + setAttrType(nativeRef.opHandle, name, value.nativeCode()); return this; } @Override - public EagerOperationBuilder setAttr(String name, DataType[] values) { + public EagerOperationBuilder setAttr(String name, DataType[] values) { int[] c = new int[values.length]; for (int i = 0; i < values.length; ++i) { - c[i] = values[i].c(); + c[i] = values[i].nativeCode(); } setAttrTypeList(nativeRef.opHandle, name, c); return this; diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerSession.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerSession.java index cbb878ed867..71619b516c5 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerSession.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/EagerSession.java @@ -41,7 +41,7 @@ public final class EagerSession implements ExecutionEnvironment, AutoCloseable { * Controls how to act when we try to run an operation on a given device but some input tensors * are not on that device. */ - public static enum DevicePlacementPolicy { + public enum DevicePlacementPolicy { /** Running operations with input tensors on the wrong device will fail. */ EXPLICIT(0), @@ -58,7 +58,7 @@ public static enum DevicePlacementPolicy { /** Placement policy which silently copies int32 tensors but not other dtypes. */ SILENT_FOR_INT32(3); - private DevicePlacementPolicy(int code) { + DevicePlacementPolicy(int code) { this.code = code; } @@ -77,7 +77,7 @@ private DevicePlacementPolicy(int code) { *

{@code EagerSession} instances can be notified in different ways when TensorFlow objects are * no longer being referred, so they can proceed to the cleanup of any resources they owned. */ - public static enum ResourceCleanupStrategy { + public enum ResourceCleanupStrategy { /** * Monitor and delete unused resources from a new thread running in background. @@ -274,6 +274,13 @@ public static EagerSession getDefault() { synchronized (EagerSession.class) { if (defaultSession == null) { defaultSession = options().build(); + + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + defaultSession.doClose(); + } + }); } } } @@ -321,18 +328,11 @@ public static EagerSession.Options options() { } @Override - public synchronized void close() { + public void close() { if (this == defaultSession) { throw new IllegalStateException("Default eager session cannot be closed"); } - if (nativeHandle != 0L) { - if (resourceCleanupStrategy == ResourceCleanupStrategy.IN_BACKGROUND) { - nativeResources.stopCleanupThread(); - } - nativeResources.deleteAll(); - delete(nativeHandle); - nativeHandle = 0L; - } + doClose(); } @Override @@ -523,6 +523,17 @@ private void checkSession() { } } + private synchronized void doClose() { + if (nativeHandle != 0L) { + if (resourceCleanupStrategy == ResourceCleanupStrategy.IN_BACKGROUND) { + nativeResources.stopCleanupThread(); + } + nativeResources.deleteAll(); + delete(nativeHandle); + nativeHandle = 0L; + } + } + private static native long allocate(boolean async, int devicePlacementPolicy, byte[] config); private static native void delete(long handle); diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Graph.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Graph.java index 3a175b17ecc..73e8e34e152 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Graph.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Graph.java @@ -247,14 +247,20 @@ public Output[] addGradients(Output y, Output[] x) { * *

Example usage (prior to Java 8): * - *

{@code WhileSubgraphBuilder bodyGraphBuilder = new WhileSubgraphBuilder() { @Override public - * void buildSubgraph(Graph bodyGraph, Output[] bodyInputs, Output[] bodyOutputs) { // build - * body subgraph } }; } - * - *

Example usage (after Java 8): - * - *

{@code WhileSubgraphBuilder bodyGraphBuilder = (bodyGraph, bodyInputs, bodyOutputs) -> { // - * build body subgraph };} + *

{@code
+   * WhileSubgraphBuilder bodyGraphBuilder = new WhileSubgraphBuilder() {
+   *   @Override
+   *   public void buildSubgraph(Graph bodyGraph, Output[] bodyInputs, Output[] bodyOutputs) { // build
+   *     body subgraph
+   *   }
+   * };
+   * }
+ * Example usage (after Java 8): + *
{@code
+   * WhileSubgraphBuilder bodyGraphBuilder = (bodyGraph, bodyInputs, bodyOutputs) -> { //
+   *   build body subgraph
+   * };
+   * }
*/ public interface WhileSubgraphBuilder { /** diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java index be56ac889c1..68b1edad399 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperation.java @@ -15,6 +15,8 @@ package org.tensorflow; +import org.tensorflow.tools.Shape; + /** * Implementation for an {@link Operation} added as a node to a {@link Graph}. * @@ -120,20 +122,21 @@ long getUnsafeNativeHandle(int outputIdx) { } @Override - long[] shape(int outputIdx) { + Shape shape(int outputIdx) { Graph.Reference r = graph.ref(); try { - return shape(r.nativeHandle(), getUnsafeNativeHandle(), outputIdx); + long[] shape = shape(r.nativeHandle(), getUnsafeNativeHandle(), outputIdx); + return shape == null ? Shape.unknown() : Shape.make(shape); } finally { r.close(); } } @Override - DataType dtype(int outputIdx) { + DataType dtype(int outputIdx) { Graph.Reference r = graph.ref(); try { - return DataType.fromC(dtype(r.nativeHandle(), getUnsafeNativeHandle(), outputIdx)); + return DataTypes.fromNativeCode(dtype(r.nativeHandle(), getUnsafeNativeHandle(), outputIdx)); } finally { r.close(); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationBuilder.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationBuilder.java index 7567e1e7251..41f6374363c 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/GraphOperationBuilder.java @@ -16,6 +16,7 @@ package org.tensorflow; import java.nio.charset.Charset; +import org.tensorflow.tools.Shape; /** An {@link OperationBuilder} for adding {@link GraphOperation}s to a {@link Graph}. */ public final class GraphOperationBuilder implements OperationBuilder { @@ -188,7 +189,7 @@ public GraphOperationBuilder setAttr(String name, boolean[] value) { public GraphOperationBuilder setAttr(String name, DataType value) { Graph.Reference r = graph.ref(); try { - setAttrType(unsafeNativeHandle, name, value.c()); + setAttrType(unsafeNativeHandle, name, value.nativeCode()); } finally { r.close(); } @@ -199,7 +200,7 @@ public GraphOperationBuilder setAttr(String name, DataType value) { public GraphOperationBuilder setAttr(String name, DataType[] value) { int[] ctypes = new int[value.length]; for (int i = 0; i < value.length; ++i) { - ctypes[i] = value[i].c(); + ctypes[i] = value[i].nativeCode(); } Graph.Reference r = graph.ref(); try { diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeLibrary.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeLibrary.java index f67d91c5016..b0733a22646 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeLibrary.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/NativeLibrary.java @@ -45,7 +45,7 @@ final class NativeLibrary { private static final String JNI_LIBNAME = "tensorflow_jni"; public static void load() { - org.bytedeco.javacpp.Loader.load(org.tensorflow.c_api.global.tensorflow.class); + org.bytedeco.javacpp.Loader.load(org.tensorflow.internal.c_api.global.tensorflow.class); if (isLoaded() || tryLoadLibrary()) { // Either: diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operand.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operand.java index 61082e83d5a..06977891956 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operand.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operand.java @@ -15,6 +15,8 @@ package org.tensorflow; +import org.tensorflow.types.family.TType; + /** * Interface implemented by operands of a TensorFlow operation. * @@ -34,10 +36,10 @@ * ops.array().concat(0, split); * } */ -public interface Operand { +public interface Operand { /** - * Returns the symbolic handle of a tensor. + * Returns the symbolic handle of the tensor. * *

Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is * used to obtain a symbolic handle that represents the computation of the input. @@ -45,4 +47,15 @@ public interface Operand { * @see OperationBuilder#addInput(Output) */ Output asOutput(); + + /** + * Returns the data of the tensor. + * + * This only works when running in an eager execution + * + * @throws IllegalStateException if this is an operand of a graph + */ + default T data() { + return asOutput().tensor().data(); + } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operation.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operation.java index 7dae6c263f3..1cc175da161 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operation.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Operation.java @@ -15,6 +15,8 @@ package org.tensorflow; +import org.tensorflow.types.family.TType; + /** * Performs computation on Tensors. * @@ -68,7 +70,7 @@ public interface Operation { * @param The expected element type of the tensors produced by this output. * @param idx The index of the output among the outputs produced by this operation. */ - Output output(int idx); + Output output(int idx); /** * Returns the size of the given inputs list of Tensors for this operation. diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationBuilder.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationBuilder.java index d78f404fb16..2d061216dcd 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationBuilder.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/OperationBuilder.java @@ -15,6 +15,8 @@ package org.tensorflow; +import org.tensorflow.tools.Shape; + /** * A builder for {@link Operation}s. * @@ -46,7 +48,7 @@ public interface OperationBuilder { * *

The OperationBuilder is not usable after build() returns. */ - public Operation build(); + Operation build(); /** * Add the output of another operation as the next input of the operation being built. @@ -54,7 +56,7 @@ public interface OperationBuilder { * @param input {@link Output} supposed to be the input of the operation being built. * @return the OperationBuilder instance for chaining. */ - public OperationBuilder addInput(Output input); + OperationBuilder addInput(Output input); /** * Add the outputs of another operation as the next inputs of the operation being built. @@ -62,7 +64,7 @@ public interface OperationBuilder { * @param inputs list of {@link Output} supposed to be the inputs of the operation being built. * @return the OperationBuilder instance for chaining. */ - public OperationBuilder addInputList(Output[] inputs); + OperationBuilder addInputList(Output[] inputs); /** * Ensure that the operation does not execute before the control operation does. @@ -77,7 +79,7 @@ public interface OperationBuilder { * @param control operation that must be executed before running this operation. * @return the OperationBuilder instance for chaining. */ - public OperationBuilder addControlInput(Operation control); + OperationBuilder addControlInput(Operation control); /** * Set the device requested for computing the operation being built. @@ -85,7 +87,7 @@ public interface OperationBuilder { * @param device the requested device, as a string * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setDevice(String device); + OperationBuilder setDevice(String device); /** * Set the string values of an attribute of the operation being built. @@ -94,7 +96,7 @@ public interface OperationBuilder { * @param value attribute values * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, String[] value); + OperationBuilder setAttr(String name, String[] value); /** * Set the string value of an attribute of the operation being built. @@ -103,7 +105,7 @@ public interface OperationBuilder { * @param value attribute value * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, String value); + OperationBuilder setAttr(String name, String value); /** * Set the byte values of an attribute of the operation being built. @@ -112,7 +114,7 @@ public interface OperationBuilder { * @param value attribute values * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, byte[] value); + OperationBuilder setAttr(String name, byte[] value); /** * Set the long value of an attribute of the operation being built. @@ -121,7 +123,7 @@ public interface OperationBuilder { * @param value attribute value * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, long value); + OperationBuilder setAttr(String name, long value); /** * Set the long values of an attribute of the operation being built. @@ -130,7 +132,7 @@ public interface OperationBuilder { * @param value attribute values * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, long[] value); + OperationBuilder setAttr(String name, long[] value); /** * Set the float value of an attribute of the operation being built. @@ -139,7 +141,7 @@ public interface OperationBuilder { * @param value attribute value * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, float value); + OperationBuilder setAttr(String name, float value); /** * Set the float values of an attribute of the operation being built. @@ -148,7 +150,7 @@ public interface OperationBuilder { * @param value attribute values * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, float[] value); + OperationBuilder setAttr(String name, float[] value); /** * Set the boolean value of an attribute of the operation being built. @@ -157,7 +159,7 @@ public interface OperationBuilder { * @param value attribute value * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, boolean value); + OperationBuilder setAttr(String name, boolean value); /** * Set the boolean values of an attribute of the operation being built. @@ -166,7 +168,7 @@ public interface OperationBuilder { * @param value attribute values * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, boolean[] value); + OperationBuilder setAttr(String name, boolean[] value); /** * Set the type value of an attribute of the operation being built. @@ -175,7 +177,7 @@ public interface OperationBuilder { * @param value attribute value * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, DataType value); + OperationBuilder setAttr(String name, DataType value); /** * Set the type values of an attribute of the operation being built. @@ -184,7 +186,7 @@ public interface OperationBuilder { * @param value attribute values * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, DataType[] value); + OperationBuilder setAttr(String name, DataType[] value); /** * Set the tensor value of an attribute of the operation being built. @@ -193,7 +195,7 @@ public interface OperationBuilder { * @param value attribute value * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, Tensor value); + OperationBuilder setAttr(String name, Tensor value); /** * Set the tensor values of an attribute of the operation being built. @@ -202,7 +204,7 @@ public interface OperationBuilder { * @param value attribute values * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, Tensor[] value); + OperationBuilder setAttr(String name, Tensor[] value); /** * Set the shape value of an attribute of the operation being built. @@ -211,7 +213,7 @@ public interface OperationBuilder { * @param value attribute value * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, Shape value); + OperationBuilder setAttr(String name, Shape value); /** * Set the shape values of an attribute of the operation being built. @@ -220,5 +222,5 @@ public interface OperationBuilder { * @param value attribute values * @return the OperationBuilder instance for chaining. */ - public OperationBuilder setAttr(String name, Shape[] value); + OperationBuilder setAttr(String name, Shape[] value); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Output.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Output.java index f6fc1ac8cfe..b298f57d9fb 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Output.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Output.java @@ -16,6 +16,8 @@ package org.tensorflow; import java.util.Objects; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.family.TType; /** * A symbolic handle to a tensor produced by an {@link Operation}. @@ -26,7 +28,7 @@ *

By implementing the {@link Operand} interface, instances of this class also act as operands to * {@link org.tensorflow.op.Op Op} instances. */ -public final class Output implements Operand { +public final class Output implements Operand { /** Returns the Operation that will produce the tensor referred to by this Output. */ public Operation op() { @@ -40,12 +42,13 @@ public int index() { /** Returns the (possibly partially known) shape of the tensor referred to by this Output. */ public Shape shape() { - return new Shape(operation.shape(index)); + return operation.shape(index); } /** Returns the DataType of the tensor referred to by this Output. */ - public DataType dataType() { - return operation.dtype(index); + @SuppressWarnings("unchecked") + public DataType dataType() { + return (DataType)operation.dtype(index); } /** @@ -55,6 +58,9 @@ public DataType dataType() { * environments, output tensors must be fetched by running a session, using {@link * Session.Runner#fetch(Output)}. * + *

It is recommended to close explicitly the returned tensor as soon as possible, since the + * garbage collector is not aware of the amount of memory it consumes, which can be significant. + * * @return tensor * @throws IllegalStateException if this output results from a graph * @see EagerSession diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java index bdcb4fdf4bb..e1b236074e4 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Session.java @@ -337,7 +337,7 @@ private Run runHelper(boolean wantMetadata) { } finally { runRef.close(); } - List> outputs = new ArrayList>(); + List> outputs = new ArrayList<>(); for (long h : outputTensorHandles) { try { outputs.add(Tensor.fromHandle(h)); @@ -401,10 +401,10 @@ private Output parseOutput(String opName) { } } - private ArrayList> inputs = new ArrayList>(); - private ArrayList> inputTensors = new ArrayList>(); - private ArrayList> outputs = new ArrayList>(); - private ArrayList targets = new ArrayList(); + private ArrayList> inputs = new ArrayList<>(); + private ArrayList> inputTensors = new ArrayList<>(); + private ArrayList> outputs = new ArrayList<>(); + private ArrayList targets = new ArrayList<>(); private byte[] runOptions = null; } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Shape.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Shape.java deleted file mode 100644 index d533c3d480f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Shape.java +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -package org.tensorflow; - -import java.util.Arrays; - -/** The possibly partially known shape of a tensor produced by an operation. */ -public final class Shape { - - /** Create a Shape representing an unknown number of dimensions. */ - public static Shape unknown() { - return new Shape(null); - } - - /** Create a Shape representing a scalar value. */ - public static Shape scalar() { - return new Shape(new long[0]); - } - - /** - * Create a Shape representing an N-dimensional value. - * - *

Creates a Shape representing an N-dimensional value (N being at least 1), with the provided - * size for each dimension. A -1 indicates that the size of the corresponding dimension is - * unknown. For example: - * - *

{@code
-   * // A 2-element vector.
-   * Shape vector = Shape.create(2);
-   *
-   * // A 2x3 matrix.
-   * Shape matrix = Shape.create(2, 3);
-   *
-   * // A matrix with 4 columns but an unknown number of rows.
-   * // This is typically used to indicate the shape of tensors that represent
-   * // a variable-sized batch of values. The Shape below might represent a
-   * // variable-sized batch of 4-element vectors.
-   * Shape batch = Shape.create(-1, 4);
-   * }
- */ - public static Shape make(long firstDimensionSize, long... otherDimensionSizes) { - long[] shape = new long[otherDimensionSizes.length + 1]; - shape[0] = firstDimensionSize; - System.arraycopy(otherDimensionSizes, 0, shape, 1, otherDimensionSizes.length); - return new Shape(shape); - } - - /** - * Number of dimensions represented by this shape. - * - * @return -1 if the number of dimensions is unknown, 0 if the shape represents a scalar, 1 for a - * vector, 2 for a matrix etc. - */ - public int numDimensions() { - return shape == null ? -1 : shape.length; - } - - /** - * The size of the i-th dimension. - * - * @return The size of the requested dimension or -1 if it is unknown. - */ - public long size(int i) { - return shape[i]; - } - - @Override - public int hashCode() { - return Arrays.hashCode(shape); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - - if (obj instanceof Shape && Arrays.equals(this.shape, ((Shape) obj).shape)) { - return !hasUnknownDimension(); - } - - return super.equals(obj); - } - - /** Succinct description of the shape meant for debugging. */ - @Override - public String toString() { - if (shape == null) { - return ""; - } - return Arrays.toString(shape).replace("-1", "?"); - } - - // Package-private constructor. - Shape(long[] shape) { - this.shape = shape; - } - - // Package-private accessor. - // The idea is that the public API does not expose the internal array. - long[] asArray() { - return shape; - } - - private long[] shape; - - private boolean hasUnknownDimension() { - if (shape == null) { - return true; - } - - for (long dimension : shape) { - if (dimension == -1) { - return true; - } - } - - return false; - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java index 8472509a9fa..67bf02f12de 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensor.java @@ -26,6 +26,17 @@ import java.nio.LongBuffer; import java.util.Arrays; import java.util.HashMap; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.internal.c_api.global.tensorflow; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; +import org.tensorflow.types.family.TType; /** * A statically typed multi-dimensional array whose elements are of a type described by T. @@ -42,7 +53,7 @@ * } * } */ -public final class Tensor implements AutoCloseable { +public final class Tensor implements AutoCloseable { /** * Creates a Tensor from a Java object. @@ -97,13 +108,12 @@ public final class Tensor implements AutoCloseable { * @param obj The object to convert to a {@code Tensor}. Note that whether it is compatible * with the type T is not checked by the type system. For type-safe creation of tensors, use * {@link Tensors}. - * @param type The class object representing the type T. + * @param dtype The tensor element data type * @throws IllegalArgumentException if {@code obj} is not compatible with the TensorFlow type * system. */ @SuppressWarnings("unchecked") - public static Tensor create(Object obj, Class type) { - DataType dtype = DataType.fromClass(type); + public static Tensor create(Object obj, DataType dtype) { if (!objectCompatWithType(obj, dtype)) { throw new IllegalArgumentException( "DataType of object does not match T (expected " @@ -112,7 +122,21 @@ public static Tensor create(Object obj, Class type) { + dataTypeOf(obj) + ")"); } - return (Tensor) create(obj, dtype); + long[] dimSizes = new long[numDimensions(obj, dtype)]; + fillShape(obj, 0, dimSizes); + Tensor t = new Tensor(dtype, Shape.make(dimSizes)); + long nativeHandle; + if (t.dtype != TString.DTYPE) { + long byteSize = elemByteSize(t.dtype) * t.shape.size(); + nativeHandle = allocate(t.dtype.nativeCode(), dimSizes, byteSize); + setValue(nativeHandle, obj); + } else if (t.shape.numDimensions() != 0) { + nativeHandle = allocateNonScalarBytes(dimSizes, (Object[]) obj); + } else { + nativeHandle = allocateScalarBytes((byte[]) obj); + } + t.nativeRef = new NativeReference(nativeHandle); + return t; } /** @@ -126,34 +150,6 @@ public static Tensor create(Object obj) { return create(obj, dataTypeOf(obj)); } - /** - * Create a Tensor of data type {@code dtype} from a Java object. Requires the parameter {@code T} - * to match {@code type}, but this condition is not checked. - * - * @param obj the object supplying the tensor data. - * @param dtype the data type of the tensor to create. It must be compatible with the run-time - * type of the object. - * @return the new tensor - */ - private static Tensor create(Object obj, DataType dtype) { - @SuppressWarnings("rawtypes") - Tensor t = new Tensor(dtype); - t.shapeCopy = new long[numDimensions(obj, dtype)]; - fillShape(obj, 0, t.shapeCopy); - long nativeHandle; - if (t.dtype != DataType.STRING) { - int byteSize = elemByteSize(t.dtype) * numElements(t.shapeCopy); - nativeHandle = allocate(t.dtype.c(), t.shapeCopy, byteSize); - setValue(nativeHandle, obj); - } else if (t.shapeCopy.length != 0) { - nativeHandle = allocateNonScalarBytes(t.shapeCopy, (Object[]) obj); - } else { - nativeHandle = allocateScalarBytes((byte[]) obj); - } - t.nativeRef = new NativeReference(nativeHandle); - return t; - } - /** * Create a {@link Integer} Tensor with data from the given buffer. * @@ -166,8 +162,8 @@ private static Tensor create(Object obj, DataType dtype) { * @param data a buffer containing the tensor data. * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public static Tensor create(long[] shape, IntBuffer data) { - Tensor t = allocateForBuffer(DataType.INT32, shape, data.remaining()); + public static Tensor create(long[] shape, IntBuffer data) { + Tensor t = allocateForBuffer(TInt32.DTYPE, shape, data.remaining()); t.buffer().asIntBuffer().put(data); return t; } @@ -184,8 +180,8 @@ public static Tensor create(long[] shape, IntBuffer data) { * @param data a buffer containing the tensor data. * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public static Tensor create(long[] shape, FloatBuffer data) { - Tensor t = allocateForBuffer(DataType.FLOAT, shape, data.remaining()); + public static Tensor create(long[] shape, FloatBuffer data) { + Tensor t = allocateForBuffer(TFloat.DTYPE, shape, data.remaining()); t.buffer().asFloatBuffer().put(data); return t; } @@ -202,8 +198,8 @@ public static Tensor create(long[] shape, FloatBuffer data) { * @param data a buffer containing the tensor data. * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public static Tensor create(long[] shape, DoubleBuffer data) { - Tensor t = allocateForBuffer(DataType.DOUBLE, shape, data.remaining()); + public static Tensor create(long[] shape, DoubleBuffer data) { + Tensor t = allocateForBuffer(TDouble.DTYPE, shape, data.remaining()); t.buffer().asDoubleBuffer().put(data); return t; } @@ -220,8 +216,8 @@ public static Tensor create(long[] shape, DoubleBuffer data) { * @param data a buffer containing the tensor data. * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public static Tensor create(long[] shape, LongBuffer data) { - Tensor t = allocateForBuffer(DataType.INT64, shape, data.remaining()); + public static Tensor create(long[] shape, LongBuffer data) { + Tensor t = allocateForBuffer(TInt64.DTYPE, shape, data.remaining()); t.buffer().asLongBuffer().put(data); return t; } @@ -235,21 +231,15 @@ public static Tensor create(long[] shape, LongBuffer data) { * API. * * @param the tensor element type - * @param type the tensor element type, represented as a class object. + * @param dtype the tensor element data type * @param shape the tensor shape. * @param data a buffer containing the tensor data. * @throws IllegalArgumentException If the tensor datatype or shape is not compatible with the * buffer */ - public static Tensor create(Class type, long[] shape, ByteBuffer data) { - @SuppressWarnings("unchecked") - Tensor ret = (Tensor) create(DataType.fromClass(type), shape, data); - return ret; - } - - private static Tensor create(DataType dtype, long[] shape, ByteBuffer data) { + public static Tensor create(DataType dtype, long[] shape, ByteBuffer data) { int nremaining; - if (dtype != DataType.STRING) { + if (dtype != TString.DTYPE) { int elemBytes = elemByteSize(dtype); if (data.remaining() % elemBytes != 0) { throw new IllegalArgumentException( @@ -261,23 +251,33 @@ private static Tensor create(DataType dtype, long[] shape, ByteBuffer data) { } else { nremaining = data.remaining(); } - Tensor t = allocateForBuffer(dtype, shape, nremaining); + Tensor t = allocateForBuffer(dtype, shape, nremaining); t.buffer().put(data); return t; } + public static Tensor allocate(DataType dtype, Shape shape) { + return allocate(dtype, shape, shape.size() * dtype.byteSize()); + } + + public static Tensor allocate(DataType dtype, Shape shape, long size) { + Tensor t = new Tensor<>(dtype, shape); + long nativeHandle = allocate(t.dtype.nativeCode(), shape.asArray(), size); + t.nativeRef = new NativeReference(nativeHandle); + return t; + } + /** * Returns this Tensor object with the type {@code Tensor}. This method is useful when given a * value of type {@code Tensor}. * - * @param type any (non-null) array of the correct type. + * @param dt any supported tensor data type * @throws IllegalArgumentException if the actual data type of this object does not match the type * {@code U}. */ @SuppressWarnings("unchecked") - public Tensor expect(Class type) { - DataType dt = DataType.fromClass(type); - if (!dt.equals(dtype)) { + public Tensor expect(DataType dt) { + if (!dt.equals(this.dtype)) { throw new IllegalArgumentException( "Cannot cast from tensor of " + dtype + " to tensor of " + dt); } @@ -287,21 +287,20 @@ public Tensor expect(Class type) { // Helper function to allocate a Tensor for the create() methods that create a Tensor from // a java.nio.Buffer. // Requires: dataType matches T - private static Tensor allocateForBuffer(DataType dataType, long[] shape, int nBuffered) { - final int nflattened = numElements(shape); - int nbytes = 0; - if (dataType != DataType.STRING) { + private static Tensor allocateForBuffer(DataType dataType, long[] dimSizes, int nBuffered) { + final int nflattened = numElements(dimSizes); + int nbytes; + if (dataType != TString.DTYPE) { if (nBuffered != nflattened) { - throw incompatibleBuffer(nBuffered, shape); + throw incompatibleBuffer(nBuffered, dimSizes); } nbytes = nflattened * elemByteSize(dataType); } else { // DT_STRING tensor encoded in a ByteBuffer. nbytes = nBuffered; } - Tensor t = new Tensor(dataType); - t.shapeCopy = Arrays.copyOf(shape, shape.length); - long nativeHandle = allocate(t.dtype.c(), t.shapeCopy, nbytes); + Tensor t = new Tensor<>(dataType, Shape.make(dimSizes)); + long nativeHandle = allocate(t.dtype.nativeCode(), dimSizes, nbytes); t.nativeRef = new NativeReference(nativeHandle); return t; } @@ -320,38 +319,34 @@ public void close() { } /** Returns the {@link DataType} of elements stored in the Tensor. */ - public DataType dataType() { + public DataType dataType() { return dtype; } - /** - * Returns the number of dimensions (sometimes referred to as rank) of the Tensor. - * - *

Will be 0 for a scalar, 1 for a vector, 2 for a matrix, 3 for a 3-dimensional tensor etc. - */ - public int numDimensions() { - return shapeCopy.length; + public T data() { + // Note: we don't synchronize, as mapping tensor memory should be thread-safe + if (data == null) { + data = dtype.map(this); + } + return data; } /** Returns the size, in bytes, of the tensor data. */ - public int numBytes() { - return buffer().remaining(); - } - - /** Returns the number of elements in a flattened (1-D) view of the tensor. */ - public int numElements() { - return numElements(shapeCopy); + public long numBytes() { + if (numBytes == null) { + numBytes = tensorflow.TF_TensorByteSize(nativeRef.cTensor); + } + return numBytes; } /** * Returns the shape of * the Tensor, i.e., the sizes of each dimension. * - * @return an array where the i-th element is the size of the i-th dimension of the tensor. + * @return shape of this tensor */ - public long[] shape() { - return shapeCopy; + public Shape shape() { + return shape; } /** @@ -449,7 +444,7 @@ public U copyTo(U dst) { * @throws IllegalArgumentException If the tensor data type is not {@link Integer} */ public void writeTo(IntBuffer dst) { - if (dtype != DataType.INT32) { + if (dtype != TInt32.DTYPE) { throw incompatibleBuffer(dst, dtype); } ByteBuffer src = buffer(); @@ -467,7 +462,7 @@ public void writeTo(IntBuffer dst) { * @throws IllegalArgumentException If the tensor datatype is not {@link Float} */ public void writeTo(FloatBuffer dst) { - if (dtype != DataType.FLOAT) { + if (dtype != TFloat.DTYPE) { throw incompatibleBuffer(dst, dtype); } ByteBuffer src = buffer(); @@ -485,7 +480,7 @@ public void writeTo(FloatBuffer dst) { * @throws IllegalArgumentException If the tensor datatype is not {@link Double} */ public void writeTo(DoubleBuffer dst) { - if (dtype != DataType.DOUBLE) { + if (dtype != TDouble.DTYPE) { throw incompatibleBuffer(dst, dtype); } ByteBuffer src = buffer(); @@ -503,7 +498,7 @@ public void writeTo(DoubleBuffer dst) { * @throws IllegalArgumentException If the tensor datatype is not {@link Long} */ public void writeTo(LongBuffer dst) { - if (dtype != DataType.INT64) { + if (dtype != TInt64.DTYPE) { throw incompatibleBuffer(dst, dtype); } ByteBuffer src = buffer(); @@ -527,7 +522,7 @@ public void writeTo(ByteBuffer dst) { /** Returns a string describing the type and shape of the Tensor. */ @Override public String toString() { - return String.format("%s tensor with shape %s", dtype.toString(), Arrays.toString(shape())); + return String.format("%s tensor with shape %s", dtype.toString(), shape); } /** @@ -536,9 +531,7 @@ public String toString() { *

Takes ownership of the handle. */ static Tensor fromHandle(long handle) { - @SuppressWarnings("rawtypes") - Tensor t = new Tensor(DataType.fromC(dtype(handle))); - t.shapeCopy = shape(handle); + Tensor t = new Tensor<>(DataTypes.fromNativeCode(dtype(handle)), Shape.make(shape(handle))); t.nativeRef = new NativeReference(handle); return t; } @@ -558,19 +551,26 @@ long getNativeHandle() { return nativeRef.tensorHandle; } + TF_Tensor getNative() { + return nativeRef.cTensor; + } + private NativeReference nativeRef = null; - private final DataType dtype; - private long[] shapeCopy = null; + private final DataType dtype; + private final Shape shape; + private T data = null; + private Long numBytes = null; - private Tensor(DataType t) { - dtype = t; + private Tensor(DataType dtype, Shape shape) { + this.dtype = dtype; + this.shape = shape; } private ByteBuffer buffer() { return buffer(getNativeHandle()).order(ByteOrder.nativeOrder()); } - private static IllegalArgumentException incompatibleBuffer(Buffer buf, DataType dataType) { + private static IllegalArgumentException incompatibleBuffer(Buffer buf, DataType dataType) { return new IllegalArgumentException( String.format("cannot use %s with Tensor of type %s", buf.getClass().getName(), dataType)); } @@ -591,7 +591,7 @@ private static int numElements(long[] shape) { return n; } - private static int elemByteSize(DataType dataType) { + private static int elemByteSize(DataType dataType) { int size = dataType.byteSize(); if (size < 0) { throw new IllegalArgumentException("STRING tensors do not have a fixed element size"); @@ -599,13 +599,6 @@ private static int elemByteSize(DataType dataType) { return size; } - private static void throwExceptionIfNotByteOfByteArrays(Object array) { - if (!array.getClass().getName().equals("[[B")) { - throw new IllegalArgumentException( - "object cannot be converted to a Tensor as it includes an array with null elements"); - } - } - /** * Reference to the underlying native tensor * @@ -633,13 +626,13 @@ private class EagerReference extends EagerSession.NativeReference { @Override void delete() { // Mark this eager reference as cleared since it has been deleted by the session - NativeReference.this.eagerRef = null; - NativeReference.this.release(); + Tensor.NativeReference.this.eagerRef = null; + Tensor.NativeReference.this.release(); } } NativeReference(long tensorHandle) { - this.tensorHandle = tensorHandle; + setTensorHandle(tensorHandle); } void eager(EagerSession session, Tensor tensor) { @@ -657,29 +650,35 @@ synchronized void release() { eagerRef = null; } Tensor.delete(tensorHandle); - tensorHandle = 0L; + setTensorHandle(0L); } } private long tensorHandle; + private final TF_Tensor cTensor = new TF_Tensor(); private EagerReference eagerRef; + + private void setTensorHandle(long tensorHandle) { + this.tensorHandle = tensorHandle; + cTensor.temporaryHackToSetAddressFromHandle(tensorHandle); + } } - private static HashMap, DataType> classDataTypes = new HashMap<>(); + private static HashMap, DataType> classDataTypes = new HashMap<>(); static { - classDataTypes.put(int.class, DataType.INT32); - classDataTypes.put(Integer.class, DataType.INT32); - classDataTypes.put(long.class, DataType.INT64); - classDataTypes.put(Long.class, DataType.INT64); - classDataTypes.put(float.class, DataType.FLOAT); - classDataTypes.put(Float.class, DataType.FLOAT); - classDataTypes.put(double.class, DataType.DOUBLE); - classDataTypes.put(Double.class, DataType.DOUBLE); - classDataTypes.put(byte.class, DataType.STRING); - classDataTypes.put(Byte.class, DataType.STRING); - classDataTypes.put(boolean.class, DataType.BOOL); - classDataTypes.put(Boolean.class, DataType.BOOL); + classDataTypes.put(int.class, TInt32.DTYPE); + classDataTypes.put(Integer.class, TInt32.DTYPE); + classDataTypes.put(long.class, TInt64.DTYPE); + classDataTypes.put(Long.class, TInt64.DTYPE); + classDataTypes.put(float.class, TFloat.DTYPE); + classDataTypes.put(Float.class, TFloat.DTYPE); + classDataTypes.put(double.class, TDouble.DTYPE); + classDataTypes.put(Double.class, TDouble.DTYPE); + classDataTypes.put(byte.class, TString.DTYPE); + classDataTypes.put(Byte.class, TString.DTYPE); + classDataTypes.put(boolean.class, TBool.DTYPE); + classDataTypes.put(Boolean.class, TBool.DTYPE); } /** The class for the data type to which Java object o corresponds. */ @@ -696,13 +695,13 @@ private static Class baseObjType(Object o) { * represent more than one TensorFlow data type; for example, 'byte' can represent both {@code * uint8} and {@code string}, with the latter being the default interpretation. */ - private static DataType dataTypeOf(Object o) { + private static DataType dataTypeOf(Object o) { Class c = baseObjType(o); return dataTypeFromClass(c); } - private static DataType dataTypeFromClass(Class c) { - DataType ret = classDataTypes.get(c); + private static DataType dataTypeFromClass(Class c) { + DataType ret = classDataTypes.get(c); if (ret != null) { return ret; } @@ -717,9 +716,9 @@ private static DataType dataTypeFromClass(Class c) { * @param o The object to inspect. It must be a valid representation of the given data type. * @param dtype The expected data type of the tensor. */ - private static int numDimensions(Object o, DataType dtype) { + private static int numDimensions(Object o, DataType dtype) { int ret = numArrayDimensions(o); - if (dtype == DataType.STRING && ret > 0) { + if (dtype == TString.DTYPE && ret > 0) { return ret - 1; } return ret; @@ -761,9 +760,9 @@ private static void fillShape(Object o, int dim, long[] shape) { } /** Returns whether the object {@code obj} can represent a tensor with data type {@code dtype}. */ - private static boolean objectCompatWithType(Object obj, DataType dtype) { + private static boolean objectCompatWithType(Object obj, DataType dtype) { Class c = baseObjType(obj); - DataType dto = dataTypeFromClass(c); + DataType dto = dataTypeFromClass(c); int nd = numDimensions(obj, dto); if (!c.isPrimitive() && c != String.class && nd != 0) { throw new IllegalArgumentException( @@ -772,14 +771,14 @@ private static boolean objectCompatWithType(Object obj, DataType dtype) { if (dto.equals(dtype)) { return true; } - if (dto == DataType.STRING && dtype == DataType.UINT8) { + if (dto == TString.DTYPE && dtype == TUInt8.DTYPE) { return true; } return false; } private void throwExceptionIfTypeIsIncompatible(Object o) { - final int rank = numDimensions(); + final int rank = shape.numDimensions(); final int oRank = numDimensions(o, dtype); if (oRank != rank) { throw new IllegalArgumentException( @@ -795,11 +794,11 @@ private void throwExceptionIfTypeIsIncompatible(Object o) { long[] oShape = new long[rank]; fillShape(o, 0, oShape); for (int i = 0; i < oShape.length; ++i) { - if (oShape[i] != shape()[i]) { + if (oShape[i] != shape.size(i)) { throw new IllegalArgumentException( String.format( "cannot copy Tensor with shape %s into object with shape %s", - Arrays.toString(shape()), Arrays.toString(oShape))); + shape, Arrays.toString(oShape))); } } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensors.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensors.java index c828d23efcf..7e8cf6e8e99 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensors.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/Tensors.java @@ -17,6 +17,14 @@ import static java.nio.charset.StandardCharsets.UTF_8; +import java.nio.charset.Charset; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; + /** Type-safe factory methods for creating {@link org.tensorflow.Tensor} objects. */ public final class Tensors { private Tensors() {} @@ -26,8 +34,8 @@ private Tensors() {} * * @param data The string to put into the new scalar tensor. */ - public static Tensor create(String data) { - return Tensor.create(data.getBytes(UTF_8), String.class); + public static Tensor create(String data) { + return Tensor.create(data.getBytes(UTF_8), TString.DTYPE); } /** @@ -36,8 +44,8 @@ public static Tensor create(String data) { * @param charset The encoding from String to bytes. * @param data The string to put into the new scalar tensor. */ - public static Tensor create(String data, java.nio.charset.Charset charset) { - return Tensor.create(data.getBytes(charset), String.class); + public static Tensor create(String data, Charset charset) { + return Tensor.create(data.getBytes(charset), TString.DTYPE); } /** @@ -45,8 +53,8 @@ public static Tensor create(String data, java.nio.charset.Charset charse * * @param data The value to put into the new scalar tensor. */ - public static Tensor create(float data) { - return Tensor.create(data, Float.class); + public static Tensor create(float data) { + return Tensor.create(data, TFloat.DTYPE); } /** @@ -55,8 +63,8 @@ public static Tensor create(float data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(float[] data) { - return Tensor.create(data, Float.class); + public static Tensor create(float[] data) { + return Tensor.create(data, TFloat.DTYPE); } /** @@ -65,8 +73,8 @@ public static Tensor create(float[] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(float[][] data) { - return Tensor.create(data, Float.class); + public static Tensor create(float[][] data) { + return Tensor.create(data, TFloat.DTYPE); } /** @@ -75,8 +83,8 @@ public static Tensor create(float[][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(float[][][] data) { - return Tensor.create(data, Float.class); + public static Tensor create(float[][][] data) { + return Tensor.create(data, TFloat.DTYPE); } /** @@ -85,8 +93,8 @@ public static Tensor create(float[][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(float[][][][] data) { - return Tensor.create(data, Float.class); + public static Tensor create(float[][][][] data) { + return Tensor.create(data, TFloat.DTYPE); } /** @@ -95,8 +103,8 @@ public static Tensor create(float[][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(float[][][][][] data) { - return Tensor.create(data, Float.class); + public static Tensor create(float[][][][][] data) { + return Tensor.create(data, TFloat.DTYPE); } /** @@ -105,8 +113,8 @@ public static Tensor create(float[][][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(float[][][][][][] data) { - return Tensor.create(data, Float.class); + public static Tensor create(float[][][][][][] data) { + return Tensor.create(data, TFloat.DTYPE); } /** @@ -114,8 +122,8 @@ public static Tensor create(float[][][][][][] data) { * * @param data The value to put into the new scalar tensor. */ - public static Tensor create(double data) { - return Tensor.create(data, Double.class); + public static Tensor create(double data) { + return Tensor.create(data, TDouble.DTYPE); } /** @@ -124,8 +132,8 @@ public static Tensor create(double data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(double[] data) { - return Tensor.create(data, Double.class); + public static Tensor create(double[] data) { + return Tensor.create(data, TDouble.DTYPE); } /** @@ -134,8 +142,8 @@ public static Tensor create(double[] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(double[][] data) { - return Tensor.create(data, Double.class); + public static Tensor create(double[][] data) { + return Tensor.create(data, TDouble.DTYPE); } /** @@ -144,8 +152,8 @@ public static Tensor create(double[][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(double[][][] data) { - return Tensor.create(data, Double.class); + public static Tensor create(double[][][] data) { + return Tensor.create(data, TDouble.DTYPE); } /** @@ -154,8 +162,8 @@ public static Tensor create(double[][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(double[][][][] data) { - return Tensor.create(data, Double.class); + public static Tensor create(double[][][][] data) { + return Tensor.create(data, TDouble.DTYPE); } /** @@ -164,8 +172,8 @@ public static Tensor create(double[][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(double[][][][][] data) { - return Tensor.create(data, Double.class); + public static Tensor create(double[][][][][] data) { + return Tensor.create(data, TDouble.DTYPE); } /** @@ -174,8 +182,8 @@ public static Tensor create(double[][][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(double[][][][][][] data) { - return Tensor.create(data, Double.class); + public static Tensor create(double[][][][][][] data) { + return Tensor.create(data, TDouble.DTYPE); } /** @@ -183,8 +191,8 @@ public static Tensor create(double[][][][][][] data) { * * @param data The value to put into the new scalar tensor. */ - public static Tensor create(int data) { - return Tensor.create(data, Integer.class); + public static Tensor create(int data) { + return Tensor.create(data, TInt32.DTYPE); } /** @@ -193,8 +201,8 @@ public static Tensor create(int data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(int[] data) { - return Tensor.create(data, Integer.class); + public static Tensor create(int[] data) { + return Tensor.create(data, TInt32.DTYPE); } /** @@ -203,8 +211,8 @@ public static Tensor create(int[] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(int[][] data) { - return Tensor.create(data, Integer.class); + public static Tensor create(int[][] data) { + return Tensor.create(data, TInt32.DTYPE); } /** @@ -213,8 +221,8 @@ public static Tensor create(int[][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(int[][][] data) { - return Tensor.create(data, Integer.class); + public static Tensor create(int[][][] data) { + return Tensor.create(data, TInt32.DTYPE); } /** @@ -223,8 +231,8 @@ public static Tensor create(int[][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(int[][][][] data) { - return Tensor.create(data, Integer.class); + public static Tensor create(int[][][][] data) { + return Tensor.create(data, TInt32.DTYPE); } /** @@ -233,8 +241,8 @@ public static Tensor create(int[][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(int[][][][][] data) { - return Tensor.create(data, Integer.class); + public static Tensor create(int[][][][][] data) { + return Tensor.create(data, TInt32.DTYPE); } /** @@ -243,68 +251,68 @@ public static Tensor create(int[][][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(int[][][][][][] data) { - return Tensor.create(data, Integer.class); + public static Tensor create(int[][][][][][] data) { + return Tensor.create(data, TInt32.DTYPE); } /** * Creates a scalar tensor containing a single {@code byte} element. * - * @param data An array containing the data to put into the new tensor. String elements are + * @param data An array containing the data to put into the new tensor. TString elements are * sequences of bytes from the last array dimension. */ - public static Tensor create(byte[] data) { - return Tensor.create(data, String.class); + public static Tensor create(byte[] data) { + return Tensor.create(data, TString.DTYPE); } /** * Creates a rank-1 tensor of {@code byte} elements. * - * @param data An array containing the data to put into the new tensor. String elements are + * @param data An array containing the data to put into the new tensor. TString elements are * sequences of bytes from the last array dimension. */ - public static Tensor create(byte[][] data) { - return Tensor.create(data, String.class); + public static Tensor create(byte[][] data) { + return Tensor.create(data, TString.DTYPE); } /** * Creates a rank-2 tensor of {@code byte} elements. * - * @param data An array containing the data to put into the new tensor. String elements are + * @param data An array containing the data to put into the new tensor. TString elements are * sequences of bytes from the last array dimension. */ - public static Tensor create(byte[][][] data) { - return Tensor.create(data, String.class); + public static Tensor create(byte[][][] data) { + return Tensor.create(data, TString.DTYPE); } /** * Creates a rank-3 tensor of {@code byte} elements. * - * @param data An array containing the data to put into the new tensor. String elements are + * @param data An array containing the data to put into the new tensor. TString elements are * sequences of bytes from the last array dimension. */ - public static Tensor create(byte[][][][] data) { - return Tensor.create(data, String.class); + public static Tensor create(byte[][][][] data) { + return Tensor.create(data, TString.DTYPE); } /** * Creates a rank-4 tensor of {@code byte} elements. * - * @param data An array containing the data to put into the new tensor. String elements are + * @param data An array containing the data to put into the new tensor. TString elements are * sequences of bytes from the last array dimension. */ - public static Tensor create(byte[][][][][] data) { - return Tensor.create(data, String.class); + public static Tensor create(byte[][][][][] data) { + return Tensor.create(data, TString.DTYPE); } /** * Creates a rank-5 tensor of {@code byte} elements. * - * @param data An array containing the data to put into the new tensor. String elements are + * @param data An array containing the data to put into the new tensor. TString elements are * sequences of bytes from the last array dimension. */ - public static Tensor create(byte[][][][][][] data) { - return Tensor.create(data, String.class); + public static Tensor create(byte[][][][][][] data) { + return Tensor.create(data, TString.DTYPE); } /** @@ -312,8 +320,8 @@ public static Tensor create(byte[][][][][][] data) { * * @param data The value to put into the new scalar tensor. */ - public static Tensor create(long data) { - return Tensor.create(data, Long.class); + public static Tensor create(long data) { + return Tensor.create(data, TInt64.DTYPE); } /** @@ -322,8 +330,8 @@ public static Tensor create(long data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(long[] data) { - return Tensor.create(data, Long.class); + public static Tensor create(long[] data) { + return Tensor.create(data, TInt64.DTYPE); } /** @@ -332,8 +340,8 @@ public static Tensor create(long[] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(long[][] data) { - return Tensor.create(data, Long.class); + public static Tensor create(long[][] data) { + return Tensor.create(data, TInt64.DTYPE); } /** @@ -342,8 +350,8 @@ public static Tensor create(long[][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(long[][][] data) { - return Tensor.create(data, Long.class); + public static Tensor create(long[][][] data) { + return Tensor.create(data, TInt64.DTYPE); } /** @@ -352,8 +360,8 @@ public static Tensor create(long[][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(long[][][][] data) { - return Tensor.create(data, Long.class); + public static Tensor create(long[][][][] data) { + return Tensor.create(data, TInt64.DTYPE); } /** @@ -362,8 +370,8 @@ public static Tensor create(long[][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(long[][][][][] data) { - return Tensor.create(data, Long.class); + public static Tensor create(long[][][][][] data) { + return Tensor.create(data, TInt64.DTYPE); } /** @@ -372,8 +380,8 @@ public static Tensor create(long[][][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(long[][][][][][] data) { - return Tensor.create(data, Long.class); + public static Tensor create(long[][][][][][] data) { + return Tensor.create(data, TInt64.DTYPE); } /** @@ -381,8 +389,8 @@ public static Tensor create(long[][][][][][] data) { * * @param data The value to put into the new scalar tensor. */ - public static Tensor create(boolean data) { - return Tensor.create(data, Boolean.class); + public static Tensor create(boolean data) { + return Tensor.create(data, TBool.DTYPE); } /** @@ -391,8 +399,8 @@ public static Tensor create(boolean data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(boolean[] data) { - return Tensor.create(data, Boolean.class); + public static Tensor create(boolean[] data) { + return Tensor.create(data, TBool.DTYPE); } /** @@ -401,8 +409,8 @@ public static Tensor create(boolean[] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(boolean[][] data) { - return Tensor.create(data, Boolean.class); + public static Tensor create(boolean[][] data) { + return Tensor.create(data, TBool.DTYPE); } /** @@ -411,8 +419,8 @@ public static Tensor create(boolean[][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(boolean[][][] data) { - return Tensor.create(data, Boolean.class); + public static Tensor create(boolean[][][] data) { + return Tensor.create(data, TBool.DTYPE); } /** @@ -421,8 +429,8 @@ public static Tensor create(boolean[][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(boolean[][][][] data) { - return Tensor.create(data, Boolean.class); + public static Tensor create(boolean[][][][] data) { + return Tensor.create(data, TBool.DTYPE); } /** @@ -431,8 +439,8 @@ public static Tensor create(boolean[][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(boolean[][][][][] data) { - return Tensor.create(data, Boolean.class); + public static Tensor create(boolean[][][][][] data) { + return Tensor.create(data, TBool.DTYPE); } /** @@ -441,7 +449,7 @@ public static Tensor create(boolean[][][][][] data) { * @param data An array containing the values to put into the new tensor. The dimensions of the * new tensor will match those of the array. */ - public static Tensor create(boolean[][][][][][] data) { - return Tensor.create(data, Boolean.class); + public static Tensor create(boolean[][][][][][] data) { + return Tensor.create(data, TBool.DTYPE); } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/StringTensorBuffer.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/StringTensorBuffer.java new file mode 100644 index 00000000000..f47f16b817e --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/StringTensorBuffer.java @@ -0,0 +1,110 @@ +package org.tensorflow.internal.buffer; + +import com.google.common.base.Charsets; +import java.nio.ReadOnlyBufferException; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.impl.AbstractDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; +import org.tensorflow.tools.ndarray.NdArray; + +public class StringTensorBuffer extends AbstractDataBuffer { + + @Override + public long size() { + return offsets.size(); + } + + @Override + public String getObject(long index) { + Validator.getArgs(this, index); + long offset = offsets.getLong(index); + + // Read string length as a varint from the given offset + byte b; + int pos = 0; + int length = 0; + do { + b = data.getByte(offset++); + length |= (b & 0x7F) << pos++; + } while ((b & 0x80) != 0); + + // Read string of the given length + byte[] bytes = new byte[length]; + data.offset(offset).read(bytes); + + return new String(bytes, Charsets.UTF_8); + } + + @Override + public DataBuffer setObject(String value, long index) { + throw new ReadOnlyBufferException(); + } + + @Override + public boolean isReadOnly() { + return true; + } + + @Override + public DataBuffer copyTo(DataBuffer dst, long size) { + if (size == size() && dst instanceof StringTensorBuffer) { + StringTensorBuffer tensorDst = (StringTensorBuffer) dst; + if (offsets.size() != size || data.size() != size) { + throw new IllegalArgumentException( + "Cannot copy string tensor data to another tensor of a different size"); + } + offsets.copyTo(tensorDst.offsets, size); + data.copyTo(tensorDst.data, size); + } else { + slowCopyTo(dst, size); + } + return this; + } + + @Override + public DataBuffer offset(long index) { + return new StringTensorBuffer(offsets.offset(index), data.offset(offsets.getLong(index))); + } + + @Override + public DataBuffer narrow(long size) { + return new StringTensorBuffer(offsets.narrow(size), data.narrow(offsets.getLong(size))); + } + + public void init(NdArray src) { + DataWriter writer = new DataWriter(); + src.scalars().forEach(s -> writer.writeNext(s.getObject())); + } + + StringTensorBuffer(LongDataBuffer offsets, ByteDataBuffer data) { + this.offsets = offsets; + this.data = data; + } + + private class DataWriter { + long count = 0; + long dataIndex = 0; + + void writeNext(String value) { + offsets.setLong(dataIndex, count++); + + // Encode string length as a varint first + int v = value.length(); + while (v >= 0x80) { + data.setByte((byte) ((v & 0x7F) | 0x80), dataIndex++); + v >>= 7; + } + data.setByte((byte) v, dataIndex++); + + // Then write string data bytes + byte[] bytes = value.getBytes(Charsets.UTF_8); + data.offset(dataIndex).write(bytes); + dataIndex += bytes.length; + } + } + + private final LongDataBuffer offsets; + private final ByteDataBuffer data; +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorBuffers.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorBuffers.java new file mode 100644 index 00000000000..6d0f31044ff --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorBuffers.java @@ -0,0 +1,82 @@ +package org.tensorflow.internal.buffer; + +import static org.tensorflow.internal.c_api.global.tensorflow.TF_TensorByteSize; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_TensorData; + +import java.nio.ByteBuffer; +import java.nio.LongBuffer; +import org.bytedeco.javacpp.Pointer; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; + +public final class TensorBuffers { + + public static ByteDataBuffer toBytes(TF_Tensor nativeTensor) { + Pointer tensorMemory = tensorMemory(nativeTensor); + if (TensorRawDataBufferFactory.canBeUsed()) { + return TensorRawDataBufferFactory.mapTensorToBytes(tensorMemory); + } + return DataBuffers.from(tensorMemory.asByteBuffer()); + } + + public static IntDataBuffer toInts(TF_Tensor nativeTensor) { + Pointer tensorMemory = tensorMemory(nativeTensor); + if (TensorRawDataBufferFactory.canBeUsed()) { + return TensorRawDataBufferFactory.mapTensorToInts(tensorMemory); + } + return DataBuffers.from(tensorMemory.asByteBuffer().asIntBuffer()); + } + + public static LongDataBuffer toLongs(TF_Tensor nativeTensor) { + Pointer tensorMemory = tensorMemory(nativeTensor); + if (TensorRawDataBufferFactory.canBeUsed()) { + return TensorRawDataBufferFactory.mapTensorToLongs(tensorMemory); + } + return DataBuffers.from(tensorMemory.asByteBuffer().asLongBuffer()); + } + + public static FloatDataBuffer toFloats(TF_Tensor nativeTensor) { + Pointer tensorMemory = tensorMemory(nativeTensor); + if (TensorRawDataBufferFactory.canBeUsed()) { + return TensorRawDataBufferFactory.mapTensorToFloats(tensorMemory); + } + return DataBuffers.from(tensorMemory.asByteBuffer().asFloatBuffer()); + } + + public static DoubleDataBuffer toDoubles(TF_Tensor nativeTensor) { + Pointer tensorMemory = tensorMemory(nativeTensor); + if (TensorRawDataBufferFactory.canBeUsed()) { + return TensorRawDataBufferFactory.mapTensorToDoubles(tensorMemory); + } + return DataBuffers.from(tensorMemory.asByteBuffer().asDoubleBuffer()); + } + + public static StringTensorBuffer toStrings(TF_Tensor nativeTensor, long numElements) { + Pointer tensorMemory = tensorMemory(nativeTensor); + if (TensorRawDataBufferFactory.canBeUsed()) { + return TensorRawDataBufferFactory.mapTensorToStrings(tensorMemory, numElements); + } + if (numElements > Integer.MAX_VALUE) { + throw new IllegalArgumentException("Cannot map string tensor of " + numElements + " elements"); + } + ByteBuffer dataBuffer = tensorMemory.asByteBuffer(); + + LongBuffer offsetBuffer = dataBuffer.asLongBuffer(); + offsetBuffer.limit((int)numElements); + LongDataBuffer offsets = DataBuffers.from(offsetBuffer.slice()); + + dataBuffer.position((int)numElements * Long.BYTES); + ByteDataBuffer data = DataBuffers.from(dataBuffer.slice()); + + return new StringTensorBuffer(offsets, data); + } + + private static Pointer tensorMemory(TF_Tensor nativeTensor) { + return TF_TensorData(nativeTensor).capacity(TF_TensorByteSize(nativeTensor)); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorRawDataBufferFactory.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorRawDataBufferFactory.java new file mode 100644 index 00000000000..3dc2c6d6ab0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/buffer/TensorRawDataBufferFactory.java @@ -0,0 +1,42 @@ +package org.tensorflow.internal.buffer; + +import org.bytedeco.javacpp.Pointer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.impl.raw.RawDataBufferFactory; + +class TensorRawDataBufferFactory extends RawDataBufferFactory { + + static ByteDataBuffer mapTensorToBytes(Pointer tensorMemory) { + return mapNativeBytes(tensorMemory.address(), tensorMemory.capacity(), false); + } + + static IntDataBuffer mapTensorToInts(Pointer tensorMemory) { + return mapNativeInts(tensorMemory.address(), tensorMemory.capacity(), false); + } + + static LongDataBuffer mapTensorToLongs(Pointer tensorMemory) { + return mapNativeLongs(tensorMemory.address(), tensorMemory.capacity(), false); + } + + static FloatDataBuffer mapTensorToFloats(Pointer tensorMemory) { + return mapNativeFloats(tensorMemory.address(), tensorMemory.capacity(), false); + } + + static DoubleDataBuffer mapTensorToDoubles(Pointer tensorMemory) { + return mapNativeDoubles(tensorMemory.address(), tensorMemory.capacity(), false); + } + + static StringTensorBuffer mapTensorToStrings(Pointer tensorMemory, long numElements) { + long offsetByteSize = numElements * Long.BYTES; + LongDataBuffer offsets = mapNativeLongs(tensorMemory.address(), numElements, false); + ByteDataBuffer data = mapNativeBytes( + tensorMemory.address() + offsetByteSize, + tensorMemory.capacity() - offsetByteSize, + false); + return new StringTensorBuffer(offsets, data); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Buffer.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Buffer.java rename to tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java index ec6238965d3..b750c53ca53 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Buffer.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Buffer.java @@ -15,14 +15,17 @@ ======================================================================= */ -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.Properties; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteBuffer; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewBuffer; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewBufferFromString; -import static org.tensorflow.c_api.global.tensorflow.*; +import org.bytedeco.javacpp.BytePointer; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.annotation.Properties; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public abstract class AbstractTF_Buffer extends Pointer { protected static class DeleteDeallocator extends TF_Buffer implements Pointer.Deallocator { DeleteDeallocator(TF_Buffer s) { super(s); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Graph.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Graph.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Graph.java rename to tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Graph.java index c0a15a8f492..ffc371e95e7 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Graph.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Graph.java @@ -15,14 +15,15 @@ ======================================================================= */ -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.Properties; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteGraph; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewGraph; -import static org.tensorflow.c_api.global.tensorflow.*; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.annotation.Properties; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public abstract class AbstractTF_Graph extends Pointer { protected static class DeleteDeallocator extends TF_Graph implements Pointer.Deallocator { DeleteDeallocator(TF_Graph s) { super(s); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_ImportGraphDefOptions.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_ImportGraphDefOptions.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_ImportGraphDefOptions.java rename to tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_ImportGraphDefOptions.java index 1179a2c36d2..3dfcc8790a7 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_ImportGraphDefOptions.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_ImportGraphDefOptions.java @@ -15,16 +15,18 @@ ======================================================================= */ -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.Properties; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteImportGraphDefOptions; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewImportGraphDefOptions; -import static org.tensorflow.c_api.global.tensorflow.*; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.annotation.Properties; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public abstract class AbstractTF_ImportGraphDefOptions extends Pointer { - protected static class DeleteDeallocator extends TF_ImportGraphDefOptions implements Pointer.Deallocator { + protected static class DeleteDeallocator extends + TF_ImportGraphDefOptions implements Pointer.Deallocator { DeleteDeallocator(TF_ImportGraphDefOptions s) { super(s); } @Override public void deallocate() { if (!isNull()) TF_DeleteImportGraphDefOptions(this); setNull(); } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Session.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Session.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Session.java rename to tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Session.java index 15aeb076444..776311252d6 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Session.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Session.java @@ -15,18 +15,20 @@ ======================================================================= */ -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.Properties; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteSession; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewSession; -import static org.tensorflow.c_api.global.tensorflow.*; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.annotation.Properties; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public abstract class AbstractTF_Session extends Pointer { protected static class DeleteDeallocator extends TF_Session implements Pointer.Deallocator { DeleteDeallocator(TF_Session s) { super(s); } - @Override public void deallocate() { if (!isNull()) TF_DeleteSession(this, TF_Status.newStatus()); setNull(); } + @Override public void deallocate() { if (!isNull()) TF_DeleteSession(this, TF_Status + .newStatus()); setNull(); } } /** References to prevent deallocation. */ diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_SessionOptions.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_SessionOptions.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_SessionOptions.java rename to tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_SessionOptions.java index 4c89013ec88..e235e86c3ce 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_SessionOptions.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_SessionOptions.java @@ -15,16 +15,18 @@ ======================================================================= */ -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.Properties; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteSessionOptions; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewSessionOptions; -import static org.tensorflow.c_api.global.tensorflow.*; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.annotation.Properties; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public abstract class AbstractTF_SessionOptions extends Pointer { - protected static class DeleteDeallocator extends TF_SessionOptions implements Pointer.Deallocator { + protected static class DeleteDeallocator extends + TF_SessionOptions implements Pointer.Deallocator { DeleteDeallocator(TF_SessionOptions s) { super(s); } @Override public void deallocate() { if (!isNull()) TF_DeleteSessionOptions(this); setNull(); } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Status.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Status.java similarity index 83% rename from tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Status.java rename to tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Status.java index 30d079b7795..ccfb7a7d84c 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Status.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Status.java @@ -15,14 +15,15 @@ ======================================================================= */ -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.Properties; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteStatus; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewStatus; -import static org.tensorflow.c_api.global.tensorflow.*; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.annotation.Properties; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public abstract class AbstractTF_Status extends Pointer { protected static class DeleteDeallocator extends TF_Status implements Pointer.Deallocator { DeleteDeallocator(TF_Status s) { super(s); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Tensor.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Tensor.java similarity index 78% rename from tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Tensor.java rename to tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Tensor.java index dabee8841c0..6a0fae0f431 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/AbstractTF_Tensor.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/AbstractTF_Tensor.java @@ -15,14 +15,17 @@ ======================================================================= */ -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.Properties; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_AllocateTensor; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_DeleteTensor; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_NewTensor; -import static org.tensorflow.c_api.global.tensorflow.*; +import org.bytedeco.javacpp.Pointer; +import org.bytedeco.javacpp.PointerScope; +import org.bytedeco.javacpp.annotation.Properties; -@Properties(inherit = org.tensorflow.c_api.presets.tensorflow.class) +@Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) public abstract class AbstractTF_Tensor extends Pointer { protected static class DeleteDeallocator extends TF_Tensor implements Pointer.Deallocator { DeleteDeallocator(TF_Tensor s) { super(s); } @@ -39,6 +42,11 @@ protected static class DeleteDeallocator extends TF_Tensor implements Pointer.De public AbstractTF_Tensor(Pointer p) { super(p); } + // WARNING: This is a temporary hack to create a `TF_Tensor` object out of the Tensor native handle + public void temporaryHackToSetAddressFromHandle(long tensorNativeHandle) { + this.address = tensorNativeHandle; + } + /** * Calls TF_NewTensor(), and registers a deallocator. * @return TF_Tensor created. Do not call TF_DeleteTensor() on it. diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/presets/tensorflow.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/presets/tensorflow.java similarity index 94% rename from tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/presets/tensorflow.java rename to tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/presets/tensorflow.java index f1b41509736..faddbc55932 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/c_api/presets/tensorflow.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/c_api/presets/tensorflow.java @@ -15,19 +15,16 @@ ======================================================================= */ -package org.tensorflow.c_api.presets; +package org.tensorflow.internal.c_api.presets; import java.util.List; -import org.bytedeco.javacpp.BytePointer; import org.bytedeco.javacpp.ClassProperties; import org.bytedeco.javacpp.LoadEnabled; -import org.bytedeco.javacpp.Loader; import org.bytedeco.javacpp.annotation.Platform; import org.bytedeco.javacpp.annotation.Properties; import org.bytedeco.javacpp.tools.Info; import org.bytedeco.javacpp.tools.InfoMap; import org.bytedeco.javacpp.tools.InfoMapper; -import org.bytedeco.javacpp.tools.Logger; /** * @@ -90,8 +87,8 @@ extension = {"-mkl", "-gpu", "-mkl-gpu"} ) }, - target = "org.tensorflow.c_api", - global = "org.tensorflow.c_api.global.tensorflow") + target = "org.tensorflow.internal.c_api", + global = "org.tensorflow.internal.c_api.global.tensorflow") public class tensorflow implements LoadEnabled, InfoMapper { @Override public void init(ClassProperties properties) { @@ -179,14 +176,14 @@ public class tensorflow implements LoadEnabled, InfoMapper { public void map(InfoMap infoMap) { infoMap.put(new Info("TF_CAPI_EXPORT").cppTypes().annotations()) .put(new Info("TF_Buffer::data").javaText("public native @Const Pointer data(); public native TF_Buffer data(Pointer data);")) - .put(new Info("TF_Status").pointerTypes("TF_Status").base("org.tensorflow.c_api.AbstractTF_Status")) - .put(new Info("TF_Buffer").pointerTypes("TF_Buffer").base("org.tensorflow.c_api.AbstractTF_Buffer")) - .put(new Info("TF_Tensor").pointerTypes("TF_Tensor").base("org.tensorflow.c_api.AbstractTF_Tensor")) - .put(new Info("TF_SessionOptions").pointerTypes("TF_SessionOptions").base("org.tensorflow.c_api.AbstractTF_SessionOptions")) - .put(new Info("TF_Graph").pointerTypes("TF_Graph").base("org.tensorflow.c_api.AbstractTF_Graph")) + .put(new Info("TF_Status").pointerTypes("TF_Status").base("org.tensorflow.internal.c_api.AbstractTF_Status")) + .put(new Info("TF_Buffer").pointerTypes("TF_Buffer").base("org.tensorflow.internal.c_api.AbstractTF_Buffer")) + .put(new Info("TF_Tensor").pointerTypes("TF_Tensor").base("org.tensorflow.internal.c_api.AbstractTF_Tensor")) + .put(new Info("TF_SessionOptions").pointerTypes("TF_SessionOptions").base("org.tensorflow.internal.c_api.AbstractTF_SessionOptions")) + .put(new Info("TF_Graph").pointerTypes("TF_Graph").base("org.tensorflow.internal.c_api.AbstractTF_Graph")) .put(new Info("TF_Graph::graph").javaText("public native @MemberGetter @ByRef Graph graph();")) .put(new Info("TF_Graph::refiner").javaText("public native @MemberGetter @ByRef ShapeRefiner refiner();")) - .put(new Info("TF_ImportGraphDefOptions").pointerTypes("TF_ImportGraphDefOptions").base("org.tensorflow.c_api.AbstractTF_ImportGraphDefOptions")) + .put(new Info("TF_ImportGraphDefOptions").pointerTypes("TF_ImportGraphDefOptions").base("org.tensorflow.internal.c_api.AbstractTF_ImportGraphDefOptions")) .put(new Info("TF_Operation", "TFE_MonitoringCounterCell", "TFE_MonitoringSamplerCell", "TFE_MonitoringCounter0", "TFE_MonitoringCounter1", "TFE_MonitoringCounter2", "TFE_MonitoringIntGaugeCell", "TFE_MonitoringStringGaugeCell", "TFE_MonitoringBoolGaugeCell", @@ -203,7 +200,7 @@ public void map(InfoMap infoMap) { .put(new Info("TFE_Context::context").javaText("@MemberGetter public native @ByRef EagerContext context();")) .put(new Info("TFE_Op::operation").javaText("@MemberGetter public native @ByRef EagerOperation operation();")) .put(new Info("TF_ShapeInferenceContextDimValueKnown", "TFE_NewTensorHandle(const tensorflow::Tensor&, TF_Status*)").skip()) - .put(new Info("TF_Session").pointerTypes("TF_Session").base("org.tensorflow.c_api.AbstractTF_Session")) + .put(new Info("TF_Session").pointerTypes("TF_Session").base("org.tensorflow.internal.c_api.AbstractTF_Session")) .put(new Info("TF_WhileParams").purify()); } } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Scope.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Scope.java index ccbf776cbe8..1562a1ed519 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Scope.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/Scope.java @@ -15,12 +15,11 @@ package org.tensorflow.op; +import java.util.ArrayList; import org.tensorflow.ExecutionEnvironment; import org.tensorflow.Operand; import org.tensorflow.OperationBuilder; -import java.util.ArrayList; - /** * Manages groups of related properties when creating Tensorflow Operations, such as a common name * prefix. @@ -85,7 +84,7 @@ public final class Scope { * @param env The execution environment used by the scope. */ public Scope(ExecutionEnvironment env) { - this(env, new NameScope(), new ArrayList>()); + this(env, new NameScope(), new ArrayList<>()); } /** Returns the execution environment used by this scope. */ diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java index ee4301f1159..74f8edac6db 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Constant.java @@ -23,7 +23,6 @@ import java.nio.IntBuffer; import java.nio.LongBuffer; import java.nio.charset.Charset; - import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.Operation; @@ -32,10 +31,17 @@ import org.tensorflow.op.PrimitiveOp; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.family.TType; /** An operator producing a constant value. */ @Operator -public final class Constant extends PrimitiveOp implements Operand { +public final class Constant extends PrimitiveOp implements Operand { /** * Creates a constant containing a single {@code int} element. @@ -44,8 +50,10 @@ public final class Constant extends PrimitiveOp implements Operand { * @param data The value to put into the new constant. * @return an integer constant */ - public static Constant create(Scope scope, int data) { - return create(scope, data, Integer.class); + public static Constant create(Scope scope, int data) { + try (Tensor value = TInt32.scalarOf(data)) { + return create(scope, value); + } } /** @@ -55,8 +63,10 @@ public static Constant create(Scope scope, int data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, int[] data) { - return create(scope, data, Integer.class); + public static Constant create(Scope scope, int[] data) { + try (Tensor value = TInt32.vectorOf(data)) { + return create(scope, value); + } } /** @@ -66,8 +76,8 @@ public static Constant create(Scope scope, int[] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, int[][] data) { - return create(scope, data, Integer.class); + public static Constant create(Scope scope, int[][] data) { + return create(scope, data, TInt32.DTYPE); } /** @@ -77,8 +87,8 @@ public static Constant create(Scope scope, int[][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, int[][][] data) { - return create(scope, data, Integer.class); + public static Constant create(Scope scope, int[][][] data) { + return create(scope, data, TInt32.DTYPE); } /** @@ -88,8 +98,8 @@ public static Constant create(Scope scope, int[][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, int[][][][] data) { - return create(scope, data, Integer.class); + public static Constant create(Scope scope, int[][][][] data) { + return create(scope, data, TInt32.DTYPE); } /** @@ -99,8 +109,8 @@ public static Constant create(Scope scope, int[][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, int[][][][][] data) { - return create(scope, data, Integer.class); + public static Constant create(Scope scope, int[][][][][] data) { + return create(scope, data, TInt32.DTYPE); } /** @@ -110,12 +120,12 @@ public static Constant create(Scope scope, int[][][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, int[][][][][][] data) { - return create(scope, data, Integer.class); + public static Constant create(Scope scope, int[][][][][][] data) { + return create(scope, data, TInt32.DTYPE); } /** - * Create a {@link DataType#INT32} constant with data from the given buffer. + * Create a {@link TInt32} constant with data from the given buffer. * *

Creates a constant with the given shape by copying elements from the buffer (starting from * its current position) into the tensor. For example, if {@code shape = {2,3} } (which represents @@ -128,9 +138,9 @@ public static Constant create(Scope scope, int[][][][][][] data) { * @return an integer constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public static Constant create(Scope scope, long[] shape, IntBuffer data) { - try (Tensor value = Tensor.create(shape, data)) { - return createWithTensor(scope, value); + public static Constant create(Scope scope, long[] shape, IntBuffer data) { + try (Tensor value = Tensor.create(shape, data)) { + return create(scope, value); } } @@ -141,8 +151,8 @@ public static Constant create(Scope scope, long[] shape, IntBuffer data * @param data The value to put into the new constant. * @return a float constant */ - public static Constant create(Scope scope, float data) { - return create(scope, data, Float.class); + public static Constant create(Scope scope, float data) { + return create(scope, data, TFloat.DTYPE); } /** @@ -152,8 +162,8 @@ public static Constant create(Scope scope, float data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, float[] data) { - return create(scope, data, Float.class); + public static Constant create(Scope scope, float[] data) { + return create(scope, data, TFloat.DTYPE); } /** @@ -163,8 +173,8 @@ public static Constant create(Scope scope, float[] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, float[][] data) { - return create(scope, data, Float.class); + public static Constant create(Scope scope, float[][] data) { + return create(scope, data, TFloat.DTYPE); } /** @@ -174,8 +184,8 @@ public static Constant create(Scope scope, float[][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, float[][][] data) { - return create(scope, data, Float.class); + public static Constant create(Scope scope, float[][][] data) { + return create(scope, data, TFloat.DTYPE); } /** @@ -185,8 +195,8 @@ public static Constant create(Scope scope, float[][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, float[][][][] data) { - return create(scope, data, Float.class); + public static Constant create(Scope scope, float[][][][] data) { + return create(scope, data, TFloat.DTYPE); } /** @@ -196,8 +206,8 @@ public static Constant create(Scope scope, float[][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, float[][][][][] data) { - return create(scope, data, Float.class); + public static Constant create(Scope scope, float[][][][][] data) { + return create(scope, data, TFloat.DTYPE); } /** @@ -207,12 +217,12 @@ public static Constant create(Scope scope, float[][][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, float[][][][][][] data) { - return create(scope, data, Float.class); + public static Constant create(Scope scope, float[][][][][][] data) { + return create(scope, data, TFloat.DTYPE); } /** - * Create a {@link DataType#FLOAT} constant with data from the given buffer. + * Create a {@link TFloat} constant with data from the given buffer. * *

Creates a constant with the given shape by copying elements from the buffer (starting from * its current position) into the tensor. For example, if {@code shape = {2,3} } (which represents @@ -225,9 +235,9 @@ public static Constant create(Scope scope, float[][][][][][] data) { * @return a float constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public static Constant create(Scope scope, long[] shape, FloatBuffer data) { - try (Tensor value = Tensor.create(shape, data)) { - return createWithTensor(scope, value); + public static Constant create(Scope scope, long[] shape, FloatBuffer data) { + try (Tensor value = Tensor.create(shape, data)) { + return create(scope, value); } } @@ -238,8 +248,8 @@ public static Constant create(Scope scope, long[] shape, FloatBuffer data * @param data The value to put into the new constant. * @return a double constant */ - public static Constant create(Scope scope, double data) { - return create(scope, data, Double.class); + public static Constant create(Scope scope, double data) { + return create(scope, data, TDouble.DTYPE); } /** @@ -249,8 +259,8 @@ public static Constant create(Scope scope, double data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, double[] data) { - return create(scope, data, Double.class); + public static Constant create(Scope scope, double[] data) { + return create(scope, data, TDouble.DTYPE); } /** @@ -260,8 +270,8 @@ public static Constant create(Scope scope, double[] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, double[][] data) { - return create(scope, data, Double.class); + public static Constant create(Scope scope, double[][] data) { + return create(scope, data, TDouble.DTYPE); } /** @@ -271,8 +281,8 @@ public static Constant create(Scope scope, double[][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, double[][][] data) { - return create(scope, data, Double.class); + public static Constant create(Scope scope, double[][][] data) { + return create(scope, data, TDouble.DTYPE); } /** @@ -282,8 +292,8 @@ public static Constant create(Scope scope, double[][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, double[][][][] data) { - return create(scope, data, Double.class); + public static Constant create(Scope scope, double[][][][] data) { + return create(scope, data, TDouble.DTYPE); } /** @@ -293,8 +303,8 @@ public static Constant create(Scope scope, double[][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, double[][][][][] data) { - return create(scope, data, Double.class); + public static Constant create(Scope scope, double[][][][][] data) { + return create(scope, data, TDouble.DTYPE); } /** @@ -304,12 +314,12 @@ public static Constant create(Scope scope, double[][][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, double[][][][][][] data) { - return create(scope, data, Double.class); + public static Constant create(Scope scope, double[][][][][][] data) { + return create(scope, data, TDouble.DTYPE); } /** - * Create a {@link DataType#DOUBLE} constant with data from the given buffer. + * Create a {@link TDouble} constant with data from the given buffer. * *

Creates a constant with the given shape by copying elements from the buffer (starting from * its current position) into the tensor. For example, if {@code shape = {2,3} } (which represents @@ -322,9 +332,9 @@ public static Constant create(Scope scope, double[][][][][][] data) { * @return a double constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public static Constant create(Scope scope, long[] shape, DoubleBuffer data) { - try (Tensor value = Tensor.create(shape, data)) { - return createWithTensor(scope, value); + public static Constant create(Scope scope, long[] shape, DoubleBuffer data) { + try (Tensor value = Tensor.create(shape, data)) { + return create(scope, value); } } @@ -335,8 +345,8 @@ public static Constant create(Scope scope, long[] shape, DoubleBuffer da * @param data The value to put into the new constant. * @return a long constant */ - public static Constant create(Scope scope, long data) { - return create(scope, data, Long.class); + public static Constant create(Scope scope, long data) { + return create(scope, data, TInt64.DTYPE); } /** @@ -346,8 +356,8 @@ public static Constant create(Scope scope, long data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, long[] data) { - return create(scope, data, Long.class); + public static Constant create(Scope scope, long[] data) { + return create(scope, data, TInt64.DTYPE); } /** @@ -357,8 +367,8 @@ public static Constant create(Scope scope, long[] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, long[][] data) { - return create(scope, data, Long.class); + public static Constant create(Scope scope, long[][] data) { + return create(scope, data, TInt64.DTYPE); } /** @@ -368,8 +378,8 @@ public static Constant create(Scope scope, long[][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, long[][][] data) { - return create(scope, data, Long.class); + public static Constant create(Scope scope, long[][][] data) { + return create(scope, data, TInt64.DTYPE); } /** @@ -379,8 +389,8 @@ public static Constant create(Scope scope, long[][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, long[][][][] data) { - return create(scope, data, Long.class); + public static Constant create(Scope scope, long[][][][] data) { + return create(scope, data, TInt64.DTYPE); } /** @@ -390,8 +400,8 @@ public static Constant create(Scope scope, long[][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, long[][][][][] data) { - return create(scope, data, Long.class); + public static Constant create(Scope scope, long[][][][][] data) { + return create(scope, data, TInt64.DTYPE); } /** @@ -401,12 +411,12 @@ public static Constant create(Scope scope, long[][][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, long[][][][][][] data) { - return create(scope, data, Long.class); + public static Constant create(Scope scope, long[][][][][][] data) { + return create(scope, data, TInt64.DTYPE); } /** - * Create a {@link DataType#INT64} constant with data from the given buffer. + * Create a {@link TInt64} constant with data from the given buffer. * *

Creates a constant with the given shape by copying elements from the buffer (starting from * its current position) into the tensor. For example, if {@code shape = {2,3} } (which represents @@ -419,9 +429,9 @@ public static Constant create(Scope scope, long[][][][][][] data) { * @return a long constant * @throws IllegalArgumentException If the tensor shape is not compatible with the buffer */ - public static Constant create(Scope scope, long[] shape, LongBuffer data) { - try (Tensor value = Tensor.create(shape, data)) { - return createWithTensor(scope, value); + public static Constant create(Scope scope, long[] shape, LongBuffer data) { + try (Tensor value = Tensor.create(shape, data)) { + return create(scope, value); } } @@ -432,8 +442,8 @@ public static Constant create(Scope scope, long[] shape, LongBuffer data) * @param data The value to put into the new constant. * @return a boolean constant */ - public static Constant create(Scope scope, boolean data) { - return create(scope, data, Boolean.class); + public static Constant create(Scope scope, boolean data) { + return create(scope, data, TBool.DTYPE); } /** @@ -443,8 +453,8 @@ public static Constant create(Scope scope, boolean data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, boolean[] data) { - return create(scope, data, Boolean.class); + public static Constant create(Scope scope, boolean[] data) { + return create(scope, data, TBool.DTYPE); } /** @@ -454,8 +464,8 @@ public static Constant create(Scope scope, boolean[] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, boolean[][] data) { - return create(scope, data, Boolean.class); + public static Constant create(Scope scope, boolean[][] data) { + return create(scope, data, TBool.DTYPE); } /** @@ -465,8 +475,8 @@ public static Constant create(Scope scope, boolean[][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, boolean[][][] data) { - return create(scope, data, Boolean.class); + public static Constant create(Scope scope, boolean[][][] data) { + return create(scope, data, TBool.DTYPE); } /** @@ -476,8 +486,8 @@ public static Constant create(Scope scope, boolean[][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, boolean[][][][] data) { - return create(scope, data, Boolean.class); + public static Constant create(Scope scope, boolean[][][][] data) { + return create(scope, data, TBool.DTYPE); } /** @@ -487,8 +497,8 @@ public static Constant create(Scope scope, boolean[][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, boolean[][][][][] data) { - return create(scope, data, Boolean.class); + public static Constant create(Scope scope, boolean[][][][][] data) { + return create(scope, data, TBool.DTYPE); } /** @@ -498,8 +508,8 @@ public static Constant create(Scope scope, boolean[][][][][] data) { * @param data An array containing the values to put into the new constant. The dimensions of the * new constant will match those of the array. */ - public static Constant create(Scope scope, boolean[][][][][][] data) { - return create(scope, data, Boolean.class); + public static Constant create(Scope scope, boolean[][][][][][] data) { + return create(scope, data, TBool.DTYPE); } /** @@ -509,7 +519,7 @@ public static Constant create(Scope scope, boolean[][][][][][] data) { * @param data The string to put into the new constant. * @return a string constant */ - public static Constant create(Scope scope, String data) { + public static Constant create(Scope scope, String data) { return create(scope, data, UTF_8); } @@ -521,9 +531,9 @@ public static Constant create(Scope scope, String data) { * @param data The string to put into the new constant. * @return a string constant */ - public static Constant create(Scope scope, String data, Charset charset) { - try (Tensor value = Tensor.create(data.getBytes(charset), String.class)) { - return createWithTensor(scope, value); + public static Constant create(Scope scope, String data, Charset charset) { + try (Tensor value = Tensor.create(data.getBytes(charset), TString.DTYPE)) { + return create(scope, value); } } @@ -534,8 +544,8 @@ public static Constant create(Scope scope, String data, Charset charset) * @param data An array containing the values to put into the new constant. String elements are * sequences of bytes from the last array dimension. */ - public static Constant create(Scope scope, byte[] data) { - return create(scope, data, String.class); + public static Constant create(Scope scope, byte[] data) { + return create(scope, data, TString.DTYPE); } /** @@ -545,8 +555,8 @@ public static Constant create(Scope scope, byte[] data) { * @param data An array containing the values to put into the new constant. String elements are * sequences of bytes from the last array dimension. */ - public static Constant create(Scope scope, byte[][] data) { - return create(scope, data, String.class); + public static Constant create(Scope scope, byte[][] data) { + return create(scope, data, TString.DTYPE); } /** @@ -556,8 +566,8 @@ public static Constant create(Scope scope, byte[][] data) { * @param data An array containing the values to put into the new constant. String elements are * sequences of bytes from the last array dimension. */ - public static Constant create(Scope scope, byte[][][] data) { - return create(scope, data, String.class); + public static Constant create(Scope scope, byte[][][] data) { + return create(scope, data, TString.DTYPE); } /** @@ -567,8 +577,8 @@ public static Constant create(Scope scope, byte[][][] data) { * @param data An array containing the values to put into the new constant. String elements are * sequences of bytes from the last array dimension. */ - public static Constant create(Scope scope, byte[][][][] data) { - return create(scope, data, String.class); + public static Constant create(Scope scope, byte[][][][] data) { + return create(scope, data, TString.DTYPE); } /** @@ -578,8 +588,8 @@ public static Constant create(Scope scope, byte[][][][] data) { * @param data An array containing the values to put into the new constant. String elements are * sequences of bytes from the last array dimension. */ - public static Constant create(Scope scope, byte[][][][][] data) { - return create(scope, data, String.class); + public static Constant create(Scope scope, byte[][][][][] data) { + return create(scope, data, TString.DTYPE); } /** @@ -589,8 +599,8 @@ public static Constant create(Scope scope, byte[][][][][] data) { * @param data An array containing the values to put into the new constant. String elements are * sequences of bytes from the last array dimension. */ - public static Constant create(Scope scope, byte[][][][][][] data) { - return create(scope, data, String.class); + public static Constant create(Scope scope, byte[][][][][][] data) { + return create(scope, data, TString.DTYPE); } /** @@ -609,9 +619,9 @@ public static Constant create(Scope scope, byte[][][][][][] data) { * @throws IllegalArgumentException If the tensor datatype or shape is not compatible with the * buffer */ - public static Constant create(Scope scope, Class type, long[] shape, ByteBuffer data) { + public static Constant create(Scope scope, DataType type, long[] shape, ByteBuffer data) { try (Tensor value = Tensor.create(type, shape, data)) { - return createWithTensor(scope, value); + return create(scope, value); } } @@ -623,7 +633,7 @@ public static Constant create(Scope scope, Class type, long[] shape, B * provided. For example: * *

{@code
-   * Constant.create(scope, new int[]{{1, 2}, {3, 4}}, Integer.class); // returns a 2x2 integer matrix
+   * Constant.create(scope, new int[]{{1, 2}, {3, 4}}, TInt32.DTYPE); // returns a 2x2 integer matrix
    * }
* * @param scope is a scope used to add the underlying operation. @@ -631,19 +641,26 @@ public static Constant create(Scope scope, Class type, long[] shape, B * @return a constant of type `type` * @see org.tensorflow.Tensor#create(Object) Tensor.create */ - public static Constant create(Scope scope, Object object, Class type) { + public static Constant create(Scope scope, Object object, DataType type) { try (Tensor value = Tensor.create(object, type)) { - return createWithTensor(scope, value); + return create(scope, value); } } - private static Constant createWithTensor(Scope scope, Tensor value) { - return new Constant( + /** + * Create a constant from a Tensor. + * + * @param scope is a scope used to add the underlying operation. + * @param tensor a Tensor holding the constant value + * @return a constant of the same data type as `tensor` + */ + public static Constant create(Scope scope, Tensor tensor) { + return new Constant<>( scope .env() .opBuilder("Const", scope.makeOpName("Const")) - .setAttr("value", value) - .setAttr("dtype", value.dataType()) + .setAttr("value", tensor) + .setAttr("dtype", tensor.dataType()) .build()); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Gradients.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Gradients.java index ab574066837..47f239bdae2 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Gradients.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Gradients.java @@ -18,7 +18,6 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; - import org.tensorflow.Graph; import org.tensorflow.Operand; import org.tensorflow.Output; @@ -26,6 +25,7 @@ import org.tensorflow.op.Operands; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TType; /** * Adds operations to compute the partial derivatives of sum of {@code y}s w.r.t {@code x}s, @@ -156,7 +156,7 @@ public List> dy() { * @param index The index of the output among the gradients added by this operation */ @SuppressWarnings("unchecked") - public Output dy(int index) { + public Output dy(int index) { return (Output) dy.get(index); } diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Zeros.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Zeros.java index b7c6beb9bcc..5796f595862 100644 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Zeros.java +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/op/core/Zeros.java @@ -15,13 +15,14 @@ package org.tensorflow.op.core; import java.nio.ByteBuffer; - import org.tensorflow.DataType; import org.tensorflow.Operand; import org.tensorflow.Output; import org.tensorflow.op.Op; import org.tensorflow.op.Scope; import org.tensorflow.op.annotation.Operator; +import org.tensorflow.types.family.TNumber; +import org.tensorflow.types.family.TType; /** * An operator creating a constant initialized with zeros of the shape given by `dims`. @@ -34,7 +35,7 @@ * @param constant type */ @Operator -public class Zeros implements Op, Operand { +public class Zeros implements Op, Operand { /** * Creates a zeroed tensor given its type and shape. @@ -45,11 +46,11 @@ public class Zeros implements Op, Operand { * @return a constant tensor initialized with zeros * @throws IllegalArgumentException if the tensor type or shape cannot be initialized with zeros. */ - public static Zeros create(Scope scope, Operand dims, Class type) { + public static Zeros create(Scope scope, Operand dims, DataType type) { Scope childScope = scope.withSubScope("Zeros"); // If scope had an op name set, it will prevail on "Zeros" - int zeroSize = DataType.fromClass(type).byteSize(); + int zeroSize = type.byteSize(); if (zeroSize < 0) { - throw new IllegalArgumentException(type.getSimpleName() + " tensors cannot be initialized with zeros"); + throw new IllegalArgumentException(type.name() + " tensors cannot be initialized with zeros"); } Constant zero = Constant.create(childScope.withName("Zero"), type, new long[]{}, ByteBuffer.allocate(zeroSize)); return new Zeros(Fill.create(childScope, dims, zero)); diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBool.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBool.java new file mode 100644 index 00000000000..cb48c2d876b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TBool.java @@ -0,0 +1,75 @@ +package org.tensorflow.types; + +import org.tensorflow.DataType; +import org.tensorflow.Tensor; +import org.tensorflow.internal.buffer.TensorBuffers; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.layout.BooleanDataLayout; +import org.tensorflow.tools.ndarray.BooleanNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dense.BooleanDenseNdArray; +import org.tensorflow.types.family.TType; + +public interface TBool extends BooleanNdArray, TType { + + DataType DTYPE = DataType.create("BOOL", 10, 1, TBoolImpl::mapTensor); + + static Tensor scalarOf(boolean value) { + Tensor t = ofShape(); + t.data().setBoolean(value); + return t; + } + + static Tensor vectorOf(boolean... values) { + Tensor t = ofShape(values.length); + t.data().write(values); + return t; + } + + static Tensor ofShape(Shape shape) { + return Tensor.allocate(DTYPE, shape); + } + + static Tensor ofShape(long... dimensionSizes) { + return Tensor.allocate(DTYPE, Shape.make(dimensionSizes)); + } + + static Tensor copyOf(NdArray src) { + Tensor t = Tensor.allocate(DTYPE, src.shape()); + src.copyTo(t.data()); + return t; + } +} + +class TBoolImpl extends BooleanDenseNdArray implements TBool { + + static TBool mapTensor(TF_Tensor nativeTensor, Shape shape) { + return new TBoolImpl(DataBuffers.toBooleans(TensorBuffers.toBytes(nativeTensor), ADAPTER), shape); + } + + private TBoolImpl(BooleanDataBuffer buffer, Shape shape) { + super(buffer, shape); + } + + private static BooleanDataLayout ADAPTER = new BooleanDataLayout() { + + @Override + public void writeBoolean(ByteDataBuffer buffer, boolean value, long index) { + buffer.setByte((byte)(value ? 1 : 0), index); + } + + @Override + public boolean readBoolean(ByteDataBuffer buffer, long index) { + return buffer.getByte(index) > 0; + } + + @Override + public int sizeInBytes() { + return TBool.DTYPE.byteSize(); + } + }; +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TDouble.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TDouble.java new file mode 100644 index 00000000000..a2361db8952 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TDouble.java @@ -0,0 +1,54 @@ +package org.tensorflow.types; + +import org.tensorflow.DataType; +import org.tensorflow.Tensor; +import org.tensorflow.internal.buffer.TensorBuffers; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.ndarray.DoubleNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dense.DoubleDenseNdArray; +import org.tensorflow.types.family.TDecimal; + +public interface TDouble extends DoubleNdArray, TDecimal { + + DataType DTYPE = DataType.create("DOUBLE", 2, 8, TDoubleImpl::mapTensor); + + static Tensor scalarOf(double value) { + Tensor t = ofShape(); + t.data().setDouble(value); + return t; + } + + static Tensor vectorOf(double... values) { + Tensor t = ofShape(values.length); + t.data().write(values); + return t; + } + + static Tensor ofShape(Shape shape) { + return Tensor.allocate(DTYPE, shape); + } + + static Tensor ofShape(long... dimensionSizes) { + return Tensor.allocate(DTYPE, Shape.make(dimensionSizes)); + } + + static Tensor copyOf(NdArray src) { + Tensor t = Tensor.allocate(DTYPE, src.shape()); + src.copyTo(t.data()); + return t; + } +} + +class TDoubleImpl extends DoubleDenseNdArray implements TDouble { + + static TDouble mapTensor(TF_Tensor nativeTensor, Shape shape) { + return new TDoubleImpl(TensorBuffers.toDoubles(nativeTensor), shape); + } + + private TDoubleImpl(DoubleDataBuffer buffer, Shape shape) { + super(buffer, shape); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat.java new file mode 100644 index 00000000000..7512a0d4de0 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TFloat.java @@ -0,0 +1,55 @@ +package org.tensorflow.types; + +import org.tensorflow.DataType; +import org.tensorflow.Tensor; +import org.tensorflow.internal.buffer.TensorBuffers; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.ndarray.FloatNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dense.FloatDenseNdArray; +import org.tensorflow.types.family.TDecimal; + +public interface TFloat extends FloatNdArray, TDecimal { + + DataType DTYPE = DataType.create("FLOAT", 1, 4, TFloatImpl::mapTensor); + + static Tensor scalarOf(float value) { + Tensor t = ofShape(); + t.data().setFloat(value); + return t; + } + + static Tensor vectorOf(float... values) { + Tensor t = ofShape(values.length); + t.data().write(values); + return t; + } + + static Tensor ofShape(Shape shape) { + return Tensor.allocate(DTYPE, shape); + } + + static Tensor ofShape(long... dimensionSizes) { + return Tensor.allocate(DTYPE, Shape.make(dimensionSizes)); + } + + static Tensor copyOf(NdArray src) { + Tensor t = Tensor.allocate(DTYPE, src.shape()); + src.copyTo(t.data()); + return t; + } +} + +class TFloatImpl extends FloatDenseNdArray implements TFloat { + + static TFloat mapTensor(TF_Tensor nativeTensor, Shape shape) { + return new TFloatImpl(TensorBuffers.toFloats(nativeTensor), shape); + } + + private TFloatImpl(FloatDataBuffer buffer, Shape shape) { + super(buffer, shape); + } +} + diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt32.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt32.java new file mode 100644 index 00000000000..a40c0ad6e36 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt32.java @@ -0,0 +1,54 @@ +package org.tensorflow.types; + +import org.tensorflow.DataType; +import org.tensorflow.Tensor; +import org.tensorflow.internal.buffer.TensorBuffers; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.ndarray.IntNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dense.IntDenseNdArray; +import org.tensorflow.types.family.TNumber; + +public interface TInt32 extends IntNdArray, TNumber { + + DataType DTYPE = DataType.create("INT32", 3, 4, TInt32Impl::mapTensor); + + static Tensor scalarOf(int value) { + Tensor t = ofShape(); + t.data().setInt(value); + return t; + } + + static Tensor vectorOf(int... values) { + Tensor t = ofShape(values.length); + t.data().write(values); + return t; + } + + static Tensor ofShape(Shape shape) { + return Tensor.allocate(DTYPE, shape); + } + + static Tensor ofShape(long... dimensionSizes) { + return Tensor.allocate(DTYPE, Shape.make(dimensionSizes)); + } + + static Tensor copyOf(NdArray src) { + Tensor t = Tensor.allocate(DTYPE, src.shape()); + src.copyTo(t.data()); + return t; + } +} + +class TInt32Impl extends IntDenseNdArray implements TInt32 { + + static TInt32 mapTensor(TF_Tensor nativeTensor, Shape shape) { + return new TInt32Impl(TensorBuffers.toInts(nativeTensor), shape); + } + + private TInt32Impl(IntDataBuffer buffer, Shape shape) { + super(buffer, shape); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt64.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt64.java new file mode 100644 index 00000000000..a42271ab81b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TInt64.java @@ -0,0 +1,54 @@ +package org.tensorflow.types; + +import org.tensorflow.DataType; +import org.tensorflow.Tensor; +import org.tensorflow.internal.buffer.TensorBuffers; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.ndarray.LongNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dense.LongDenseNdArray; +import org.tensorflow.types.family.TNumber; + +public interface TInt64 extends LongNdArray, TNumber { + + DataType DTYPE = DataType.create("INT64", 9, 8, TInt64Impl::mapTensor); + + static Tensor scalarOf(long value) { + Tensor t = ofShape(); + t.data().setLong(value); + return t; + } + + static Tensor vectorOf(long... values) { + Tensor t = ofShape(values.length); + t.data().write(values); + return t; + } + + static Tensor ofShape(Shape shape) { + return Tensor.allocate(DTYPE, shape); + } + + static Tensor ofShape(long... dimensionSizes) { + return Tensor.allocate(DTYPE, Shape.make(dimensionSizes)); + } + + static Tensor copyOf(NdArray src) { + Tensor t = Tensor.allocate(DTYPE, src.shape()); + src.copyTo(t.data()); + return t; + } +} + +class TInt64Impl extends LongDenseNdArray implements TInt64 { + + static TInt64 mapTensor(TF_Tensor nativeTensor, Shape shape) { + return new TInt64Impl(TensorBuffers.toLongs(nativeTensor), shape); + } + + private TInt64Impl(LongDataBuffer buffer, Shape shape) { + super(buffer, shape); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TString.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TString.java new file mode 100644 index 00000000000..582ae83859d --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TString.java @@ -0,0 +1,69 @@ +package org.tensorflow.types; + +import com.google.common.base.Charsets; +import org.tensorflow.DataType; +import org.tensorflow.Tensor; +import org.tensorflow.internal.buffer.StringTensorBuffer; +import org.tensorflow.internal.buffer.TensorBuffers; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.NdArrays; +import org.tensorflow.tools.ndarray.impl.dense.DenseNdArray; +import org.tensorflow.types.family.TType; + +public interface TString extends NdArray, TType { + + DataType DTYPE = DataType.create("STRING", 7, -1, TStringImpl::mapTensor); + + static Tensor scalarOf(String value) { + return copyOf(NdArrays.ofObjects(String.class, Shape.scalar()).setObject(value)); + } + + static Tensor vectorOf(String... values) { + return copyOf(NdArrays.ofObjects(String.class, Shape.make(values.length)).write(values)); + } + + static Tensor copyOf(NdArray src) { + return TStringImpl.createTensor(src); + } +} + +class TStringImpl extends DenseNdArray implements TString { + + static Tensor createTensor(NdArray src) { + + // First, compute the capacity of the tensor to create + long size = src.size() * 8; // reserve space to store 64-bits offsets + for (NdArray s : src.scalars()) { + byte[] bytes = s.getObject().getBytes(Charsets.UTF_8); + size += bytes.length + varintLength(bytes.length); // add space to store value + length + } + + // Allocate the tensor of the right capacity and init its data from source array + Tensor tensor = Tensor.allocate(TString.DTYPE, src.shape(), size); + StringTensorBuffer buffer = (StringTensorBuffer)(((TStringImpl)tensor.data()).buffer()); + buffer.init(src); + + return tensor; + } + + static TString mapTensor(TF_Tensor nativeTensor, Shape shape) { + return new TStringImpl(TensorBuffers.toStrings(nativeTensor, shape.size()), shape); + } + + private TStringImpl(DataBuffer buffer, Shape shape) { + super(buffer, shape); + } + + private static int varintLength(int length) { + int len = 1; + while (length >= 0x80) { + length >>= 7; + len++; + } + return len; + } +} + diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUInt8.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUInt8.java new file mode 100644 index 00000000000..968c65d69ff --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/TUInt8.java @@ -0,0 +1,54 @@ +package org.tensorflow.types; + +import org.tensorflow.DataType; +import org.tensorflow.Tensor; +import org.tensorflow.internal.buffer.TensorBuffers; +import org.tensorflow.internal.c_api.TF_Tensor; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.ndarray.ByteNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dense.ByteDenseNdArray; +import org.tensorflow.types.family.TNumber; + +public interface TUInt8 extends ByteNdArray, TNumber { + + DataType DTYPE = DataType.create("UINT8", 4, 1, TUInt8Impl::mapTensor); + + static Tensor scalarOf(byte value) { + Tensor t = ofShape(); + t.data().setByte(value); + return t; + } + + static Tensor vectorOf(byte... values) { + Tensor t = ofShape(values.length); + t.data().write(values); + return t; + } + + static Tensor ofShape(Shape shape) { + return Tensor.allocate(DTYPE, shape); + } + + static Tensor ofShape(long... dimensionSizes) { + return Tensor.allocate(DTYPE, Shape.make(dimensionSizes)); + } + + static Tensor copyOf(NdArray src) { + Tensor t = Tensor.allocate(DTYPE, src.shape()); + src.copyTo(t.data()); + return t; + } +} + +class TUInt8Impl extends ByteDenseNdArray implements TUInt8 { + + static TUInt8 mapTensor(TF_Tensor nativeTensor, Shape shape) { + return new TUInt8Impl(TensorBuffers.toBytes(nativeTensor), shape); + } + + private TUInt8Impl(ByteDataBuffer buffer, Shape shape) { + super(buffer, shape); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/UInt8.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/UInt8.java deleted file mode 100644 index 824f7fbe32f..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/UInt8.java +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -package org.tensorflow.types; - -/** Represents an 8-bit unsigned integer. */ -public class UInt8 extends Number { - - private static final long serialVersionUID = 1L; - - // This class is only used for generic parameterization and is not instantiable. Thus, - // it is safe to implement the Number abstract methods with all zeros, as they will - // never be invoked. - - @Override - public double doubleValue() { - return 0.0; - } - - @Override - public float floatValue() { - return 0.0f; - } - - @Override - public int intValue() { - return 0; - } - - @Override - public long longValue() { - return 0L; - } - - private UInt8() {} -} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TDecimal.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TDecimal.java new file mode 100644 index 00000000000..0d94b66c749 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TDecimal.java @@ -0,0 +1,5 @@ +package org.tensorflow.types.family; + +public interface TDecimal extends TNumber { + +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TNumber.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TNumber.java new file mode 100644 index 00000000000..c2704fa8302 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TNumber.java @@ -0,0 +1,5 @@ +package org.tensorflow.types.family; + +public interface TNumber extends TType { + +} diff --git a/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TType.java b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TType.java new file mode 100644 index 00000000000..a194297c2cf --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/types/family/TType.java @@ -0,0 +1,3 @@ +package org.tensorflow.types.family; + +public interface TType {} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationBuilderTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationBuilderTest.java index 0f00a26dba4..7536d0b65a1 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationBuilderTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationBuilderTest.java @@ -20,6 +20,9 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** Unit tests for {@link EagerOperationBuilder} class. */ @RunWith(JUnit4.class) @@ -44,7 +47,7 @@ public void failToBuildOpIfSessionIsClosed() { opBuilder = new EagerOperationBuilder(session, "Empty", "empty"); } try { - opBuilder.setAttr("dtype", DataType.FLOAT); + opBuilder.setAttr("dtype", TFloat.DTYPE); fail(); } catch (IllegalStateException e) { // expected @@ -89,9 +92,9 @@ public void setAttrs() { // types that aren't inferred from the input arguments. try (EagerSession session = EagerSession.create()) { // dtype, tensor attributes. - try (Tensor t = Tensors.create(1)) { + try (Tensor t = Tensors.create(1)) { opBuilder(session, "Const", "DataTypeAndTensor") - .setAttr("dtype", DataType.INT32) + .setAttr("dtype", TInt32.DTYPE) .setAttr("value", t) .build(); } @@ -99,7 +102,7 @@ public void setAttrs() { opBuilder(session, "RandomUniform", "DataTypeAndInt") .addInput(TestUtil.constant(session, "RandomUniformShape", new int[] {1})) .setAttr("seed", 10) - .setAttr("dtype", DataType.FLOAT) + .setAttr("dtype", TFloat.DTYPE) .build(); // list(int), string opBuilder(session, "MaxPool", "IntListAndString") @@ -120,7 +123,7 @@ public void setAttrs() { .build(); // list(shape) opBuilder(session, "FIFOQueue", "queue") - .setAttr("component_types", new DataType[] {DataType.INT32, DataType.INT32}) + .setAttr("component_types", new DataType[] {TInt32.DTYPE, TInt32.DTYPE}) .setAttr("shapes", new Shape[] {Shape.make(2, 2), Shape.make(2, 2, 2)}) .build(); // bool diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationTest.java index 228676f28c3..1bb2cfe3e49 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerOperationTest.java @@ -21,6 +21,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** Unit tests for {@link EagerOperation} class. */ @RunWith(JUnit4.class) @@ -41,15 +43,15 @@ public void failToCreateIfSessionIsClosed() { @Test public void outputDataTypeAndShape() { try (EagerSession session = EagerSession.create(); - Tensor t = Tensors.create(new int[2][3])) { + Tensor t = Tensors.create(new int[2][3])) { EagerOperation op = opBuilder(session, "Const", "OutputAttrs") - .setAttr("dtype", DataType.INT32) + .setAttr("dtype", TInt32.DTYPE) .setAttr("value", t) .build(); - assertEquals(DataType.INT32, op.dtype(0)); - assertEquals(2, op.shape(0)[0]); - assertEquals(3, op.shape(0)[1]); + assertEquals(TInt32.DTYPE, op.dtype(0)); + assertEquals(2, op.shape(0).size(0)); + assertEquals(3, op.shape(0).size(1)); } } @@ -65,16 +67,16 @@ public void outputTensor() { // Validate that we retrieve the right shape and datatype from the tensor // that has been resolved - assertEquals(0, add.shape(0).length); - assertEquals(DataType.INT32, add.dtype(0)); + assertEquals(0, add.shape(0).numDimensions()); + assertEquals(TInt32.DTYPE, add.dtype(0)); } } @Test public void inputAndOutputListLengths() { try (EagerSession session = EagerSession.create()) { - Output c1 = TestUtil.constant(session, "Const1", new float[] {1f, 2f}); - Output c2 = TestUtil.constant(session, "Const2", new float[] {3f, 4f}); + Output c1 = TestUtil.constant(session, "Const1", new float[] {1f, 2f}); + Output c2 = TestUtil.constant(session, "Const2", new float[] {3f, 4f}); EagerOperation acc = opBuilder(session, "AddN", "InputListLength") @@ -115,7 +117,7 @@ public void numOutputs() { opBuilder(session, "UniqueWithCountsV2", "unq") .addInput(TestUtil.constant(session, "Const1", new int[] {1, 2, 1})) .addInput(TestUtil.constant(session, "Axis", new int[] {0})) - .setAttr("out_idx", DataType.INT32) + .setAttr("out_idx", TInt32.DTYPE) .build(); assertEquals(3, op.numOutputs()); } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerSessionTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerSessionTest.java index 5d6cdc06aa3..b9c755e544e 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerSessionTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/EagerSessionTest.java @@ -27,7 +27,6 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationBuilderTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationBuilderTest.java index a0fbe80ed30..0f92c87fde6 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationBuilderTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationBuilderTest.java @@ -23,6 +23,10 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** Unit tests for {@link org.tensorflow.GraphOperationBuilder}. */ @RunWith(JUnit4.class) @@ -34,8 +38,8 @@ public class GraphOperationBuilderTest { public void failWhenMixingOperationsOnDifferentGraphs() { try (Graph g1 = new Graph(); Graph g2 = new Graph()) { - Output c1 = TestUtil.constant(g1, "C1", 3); - Output c2 = TestUtil.constant(g2, "C2", 3); + Output c1 = TestUtil.constant(g1, "C1", 3); + Output c2 = TestUtil.constant(g2, "C2", 3); TestUtil.addN(g1, c1, c1); try { TestUtil.addN(g2, c1, c2); @@ -48,7 +52,7 @@ public void failWhenMixingOperationsOnDifferentGraphs() { @Test public void failOnUseAfterBuild() { try (Graph g = new Graph(); - Tensor t = Tensors.create(1)) { + Tensor t = Tensors.create(1)) { OperationBuilder b = g.opBuilder("Const", "Const").setAttr("dtype", t.dataType()).setAttr("value", t); b.build(); @@ -64,7 +68,7 @@ public void failOnUseAfterBuild() { public void failOnUseAfterGraphClose() { OperationBuilder b = null; try (Graph g = new Graph(); - Tensor t = Tensors.create(1)) { + Tensor t = Tensors.create(1)) { b = g.opBuilder("Const", "Const").setAttr("dtype", t.dataType()).setAttr("value", t); } try { @@ -85,9 +89,9 @@ public void setAttr() { // types that aren't inferred from the input arguments. try (Graph g = new Graph()) { // dtype, tensor attributes. - try (Tensor t = Tensors.create(1)) { + try (Tensor t = Tensors.create(1)) { g.opBuilder("Const", "DataTypeAndTensor") - .setAttr("dtype", DataType.INT32) + .setAttr("dtype", TInt32.DTYPE) .setAttr("value", t) .build() .output(0); @@ -103,7 +107,7 @@ public void setAttr() { g.opBuilder("RandomUniform", "Int") .addInput(TestUtil.constant(g, "RandomUniformShape", new int[] {1})) .setAttr("seed", 10) - .setAttr("dtype", DataType.FLOAT) + .setAttr("dtype", TFloat.DTYPE) .build(); assertTrue(hasNode(g, "Int")); // list(int) @@ -129,23 +133,23 @@ public void setAttrShape() { try (Graph g = new Graph()) { Output n = g.opBuilder("Placeholder", "unknown") - .setAttr("dtype", DataType.FLOAT) + .setAttr("dtype", TFloat.DTYPE) .setAttr("shape", Shape.unknown()) .build() .output(0); assertEquals(-1, n.shape().numDimensions()); - assertEquals(DataType.FLOAT, n.dataType()); + assertEquals(TFloat.DTYPE, n.dataType()); n = g.opBuilder("Placeholder", "batch_of_vectors") - .setAttr("dtype", DataType.FLOAT) + .setAttr("dtype", TFloat.DTYPE) .setAttr("shape", Shape.make(-1, 784)) .build() .output(0); assertEquals(2, n.shape().numDimensions()); assertEquals(-1, n.shape().size(0)); assertEquals(784, n.shape().size(1)); - assertEquals(DataType.FLOAT, n.dataType()); + assertEquals(TFloat.DTYPE, n.dataType()); } } @@ -166,9 +170,9 @@ public void setAttrShapeList() { public void addControlInput() { try (Graph g = new Graph(); Session s = new Session(g); - Tensor yes = Tensors.create(true); - Tensor no = Tensors.create(false)) { - Output placeholder = TestUtil.placeholder(g, "boolean", Boolean.class); + Tensor yes = Tensors.create(true); + Tensor no = Tensors.create(false)) { + Output placeholder = TestUtil.placeholder(g, "boolean", TBool.DTYPE); GraphOperation check = g.opBuilder("Assert", "assert") .addInput(placeholder) @@ -195,13 +199,13 @@ private static void testSetAttrShapeList(Shape[] shapes) { int[][] matrix = new int[][] {{0, 0}, {0, 0}}; Output queue = g.opBuilder("FIFOQueue", "queue") - .setAttr("component_types", new DataType[] {DataType.INT32, DataType.INT32}) + .setAttr("component_types", new DataType[] {TInt32.DTYPE, TInt32.DTYPE}) .setAttr("shapes", shapes) .build() .output(0); assertTrue(hasNode(g, "queue")); - Output c1 = TestUtil.constant(g, "const1", matrix); - Output c2 = TestUtil.constant(g, "const2", new int[][][] {matrix, matrix}); + Output c1 = TestUtil.constant(g, "const1", matrix); + Output c2 = TestUtil.constant(g, "const2", new int[][][] {matrix, matrix}); Operation enqueue = g.opBuilder("QueueEnqueue", "enqueue") .addInput(queue) diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationTest.java index 8fb67b90ce0..f5cbb7a2f5c 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphOperationTest.java @@ -24,10 +24,10 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Set; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.tensorflow.types.TInt32; /** Unit tests for {@link org.tensorflow.GraphOperation}. */ @RunWith(JUnit4.class) @@ -104,9 +104,9 @@ public void operationToString() { @Test public void outputEquality() { try (Graph g = new Graph()) { - Output output = TestUtil.constant(g, "c", 1); - Output output1 = output.op().output(0); - Output output2 = g.operation("c").output(0); + Output output = TestUtil.constant(g, "c", 1); + Output output1 = output.op().output(0); + Output output2 = g.operation("c").output(0); assertEquals(output, output1); assertEquals(output.hashCode(), output1.hashCode()); assertEquals(output, output2); @@ -117,10 +117,10 @@ public void outputEquality() { @Test public void outputCollection() { try (Graph g = new Graph()) { - Output output = TestUtil.constant(g, "c", 1); - Output output1 = output.op().output(0); - Output output2 = g.operation("c").output(0); - Set> ops = new HashSet<>(); + Output output = TestUtil.constant(g, "c", 1); + Output output1 = output.op().output(0); + Output output2 = g.operation("c").output(0); + Set> ops = new HashSet<>(); ops.addAll(Arrays.asList(output, output1, output2)); assertEquals(1, ops.size()); assertTrue(ops.contains(output)); @@ -132,7 +132,7 @@ public void outputCollection() { @Test public void outputToString() { try (Graph g = new Graph()) { - Output output = TestUtil.constant(g, "c", new int[] {1}); + Output output = TestUtil.constant(g, "c", new int[] {1}); assertNotNull(output.toString()); } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphTest.java index f0428a1ae6c..c5024d99375 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/GraphTest.java @@ -25,6 +25,8 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; /** Unit tests for {@link org.tensorflow.Graph}. */ @RunWith(JUnit4.class) @@ -135,25 +137,25 @@ public void addGradientsToGraph() { try (Graph g = new Graph(); Session s = new Session(g)) { - Output x1 = TestUtil.placeholder(g, "x1", Float.class); - Output x2 = TestUtil.placeholder(g, "x2", Float.class); - Output y0 = TestUtil.square(g, "y0", x1); - Output y1 = TestUtil.square(g, "y1", y0); - Output y2 = TestUtil.addN(g, y0, x2); + Output x1 = TestUtil.placeholder(g, "x1", TFloat.DTYPE); + Output x2 = TestUtil.placeholder(g, "x2", TFloat.DTYPE); + Output y0 = TestUtil.square(g, "y0", x1); + Output y1 = TestUtil.square(g, "y1", y0); + Output y2 = TestUtil.addN(g, y0, x2); Output[] grads0 = g.addGradients(y1, toArray(x1)); assertNotNull(grads0); assertEquals(1, grads0.length); - assertEquals(DataType.FLOAT, grads0[0].dataType()); + assertEquals(TFloat.DTYPE, grads0[0].dataType()); Output[] grads1 = g.addGradients(y2, toArray(x1, x2)); assertNotNull(grads1); assertEquals(2, grads1.length); - assertEquals(DataType.FLOAT, grads1[0].dataType()); - assertEquals(DataType.FLOAT, grads1[1].dataType()); + assertEquals(TFloat.DTYPE, grads1[0].dataType()); + assertEquals(TFloat.DTYPE, grads1[1].dataType()); - try (Tensor c1 = Tensors.create(3.0f); - Tensor c2 = Tensors.create(2.0f); + try (Tensor c1 = Tensors.create(3.0f); + Tensor c2 = Tensors.create(2.0f); TestUtil.AutoCloseableList> outputs = new TestUtil.AutoCloseableList<>( s.runner() .feed(x1, c1) @@ -176,16 +178,16 @@ public void addGradientSumsToGraph() { try (Graph g = new Graph(); Session s = new Session(g)) { - Output x = TestUtil.placeholder(g, "x", Float.class); - Output y0 = TestUtil.square(g, "y0", x); - Output y1 = TestUtil.square(g, "y1", y0); + Output x = TestUtil.placeholder(g, "x", TFloat.DTYPE); + Output y0 = TestUtil.square(g, "y0", x); + Output y1 = TestUtil.square(g, "y1", y0); Output[] grad = g.addGradients(null, toArray(y0, y1), toArray(x), null); assertNotNull(grad); assertEquals(1, grad.length); - assertEquals(DataType.FLOAT, grad[0].dataType()); + assertEquals(TFloat.DTYPE, grad[0].dataType()); - try (Tensor c = Tensors.create(3.0f); + try (Tensor c = Tensors.create(3.0f); Tensor output = s.runner() .feed(x, c) .fetch(grad[0]) @@ -202,21 +204,21 @@ public void addGradientsWithInitialValuesToGraph() { try (Graph g = new Graph(); Session s = new Session(g)) { - Output x = TestUtil.placeholder(g, "x", Float.class); - Output y0 = TestUtil.square(g, "y0", x); - Output y1 = TestUtil.square(g, "y1", y0); + Output x = TestUtil.placeholder(g, "x", TFloat.DTYPE); + Output y0 = TestUtil.square(g, "y0", x); + Output y1 = TestUtil.square(g, "y1", y0); Output[] grad0 = g.addGradients(y1, toArray(y0)); assertNotNull(grad0); assertEquals(1, grad0.length); - assertEquals(DataType.FLOAT, grad0[0].dataType()); + assertEquals(TFloat.DTYPE, grad0[0].dataType()); Output[] grad1 = g.addGradients(null, toArray(y0), toArray(x), toArray(grad0[0])); assertNotNull(grad1); assertEquals(1, grad1.length); - assertEquals(DataType.FLOAT, grad1[0].dataType()); + assertEquals(TFloat.DTYPE, grad1[0].dataType()); - try (Tensor c = Tensors.create(3.0f); + try (Tensor c = Tensors.create(3.0f); Tensor output = s.runner() .feed(x, c) .fetch(grad1[0]) @@ -232,8 +234,8 @@ public void addGradientsWithInitialValuesToGraph() { public void validateGradientsNames() { try (Graph g = new Graph()) { - Output x = TestUtil.placeholder(g, "x", Float.class); - Output y0 = TestUtil.square(g, "y0", x); + Output x = TestUtil.placeholder(g, "x", TFloat.DTYPE); + Output y0 = TestUtil.square(g, "y0", x); Output[] grad0 = g.addGradients(null, toArray(y0), toArray(x), null); assertTrue(grad0[0].op().name().startsWith("gradients/")); @@ -260,7 +262,7 @@ public void buildWhileLoopSingleInput() { try (Graph g = new Graph(); Session s = new Session(g)) { - Output input = TestUtil.placeholder(g, "input1", Integer.class); + Output input = TestUtil.placeholder(g, "input1", TInt32.DTYPE); // could write this using lambda after Java 8 Graph.WhileSubgraphBuilder condGraphBuilder = @@ -268,7 +270,7 @@ public void buildWhileLoopSingleInput() { @Override public void buildSubgraph( Graph condGraph, Output[] condInputs, Output[] condOutputs) { - Output sixteen = TestUtil.constant(condGraph, "sixteen", 16); + Output sixteen = TestUtil.constant(condGraph, "sixteen", 16); // condInputs[0] < 16 Output condOutput = condGraph @@ -295,7 +297,7 @@ public void buildSubgraph( Output[] loopOutputs = g.whileLoop(toArray(input), condGraphBuilder, bodyGraphBuilder, "test_loop"); - try (Tensor c = Tensors.create(2); + try (Tensor c = Tensors.create(2); Tensor output = s.runner().feed(input, c).fetch(loopOutputs[0]).run().get(0)) { assertEquals(16, output.intValue()); // ((2^2)^2) @@ -308,8 +310,8 @@ public void buildWhileLoopMultipleInputs() { try (Graph g = new Graph(); Session s = new Session(g)) { - Output input1 = TestUtil.placeholder(g, "input1", Integer.class); - Output input2 = TestUtil.placeholder(g, "input2", Integer.class); + Output input1 = TestUtil.placeholder(g, "input1", TInt32.DTYPE); + Output input2 = TestUtil.placeholder(g, "input2", TInt32.DTYPE); Output[] inputs = toArray(input1, input2); // could write this using lambda after Java 8 @@ -318,7 +320,7 @@ public void buildWhileLoopMultipleInputs() { @Override public void buildSubgraph( Graph condGraph, Output[] condInputs, Output[] condOutputs) { - Output sixteen = TestUtil.constant(condGraph, "sixteen", 16); + Output sixteen = TestUtil.constant(condGraph, "sixteen", 16); Output condOutput = condGraph .opBuilder("Less", "cond") @@ -345,8 +347,8 @@ public void buildSubgraph( Output[] loopOutputs = g.whileLoop(inputs, condGraphBuilder, bodyGraphBuilder, "test_loop"); - try (Tensor c1 = Tensors.create(2); - Tensor c2 = Tensors.create(5); + try (Tensor c1 = Tensors.create(2); + Tensor c2 = Tensors.create(5); TestUtil.AutoCloseableList> outputs = new TestUtil.AutoCloseableList<>( s.runner() diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SavedModelBundleTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SavedModelBundleTest.java index 01391911a20..0e09eb7d4cc 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SavedModelBundleTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SavedModelBundleTest.java @@ -19,10 +19,8 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.File; import java.net.URISyntaxException; import java.nio.file.Paths; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SessionTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SessionTest.java index 7d5980bcded..cb6da43ae4d 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SessionTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/SessionTest.java @@ -23,6 +23,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.tensorflow.types.TInt32; /** Unit tests for {@link org.tensorflow.Session}. */ @RunWith(JUnit4.class) @@ -33,9 +34,9 @@ public void runUsingOperationNames() { try (Graph g = new Graph(); Session s = new Session(g)) { TestUtil.transpose_A_times_X(g, new int[][] {{2}, {3}}); - try (Tensor x = Tensors.create(new int[][] {{5}, {7}}); + try (Tensor x = Tensors.create(new int[][] {{5}, {7}}); TestUtil.AutoCloseableList> outputs = - new TestUtil.AutoCloseableList>(s.runner().feed("X", x).fetch("Y").run())) { + new TestUtil.AutoCloseableList<>(s.runner().feed("X", x).fetch("Y").run())) { assertEquals(1, outputs.size()); final int[][] expected = {{31}}; assertArrayEquals(expected, outputs.get(0).copyTo(new int[1][1])); @@ -48,11 +49,11 @@ public void runUsingOperationHandles() { try (Graph g = new Graph(); Session s = new Session(g)) { TestUtil.transpose_A_times_X(g, new int[][] {{2}, {3}}); - Output feed = g.operation("X").output(0); - Output fetch = g.operation("Y").output(0); - try (Tensor x = Tensors.create(new int[][] {{5}, {7}}); + Output feed = g.operation("X").output(0); + Output fetch = g.operation("Y").output(0); + try (Tensor x = Tensors.create(new int[][] {{5}, {7}}); TestUtil.AutoCloseableList> outputs = - new TestUtil.AutoCloseableList>(s.runner().feed(feed, x).fetch(fetch).run())) { + new TestUtil.AutoCloseableList<>(s.runner().feed(feed, x).fetch(fetch).run())) { assertEquals(1, outputs.size()); final int[][] expected = {{31}}; assertArrayEquals(expected, outputs.get(0).copyTo(new int[1][1])); @@ -76,21 +77,21 @@ public void runUsingColonSeparatedNames() { .build() .output(0); // Fetch using colon separated names. - try (Tensor fetched = - s.runner().fetch("Split:1").run().get(0).expect(Integer.class)) { + try (Tensor fetched = + s.runner().fetch("Split:1").run().get(0).expect(TInt32.DTYPE)) { final int[] expected = {3, 4}; assertArrayEquals(expected, fetched.copyTo(new int[2])); } // Feed using colon separated names. - try (Tensor fed = Tensors.create(new int[] {4, 3, 2, 1}); - Tensor fetched = + try (Tensor fed = Tensors.create(new int[] {4, 3, 2, 1}); + Tensor fetched = s.runner() .feed("Split:0", fed) .feed("Split:1", fed) .fetch("Add") .run() .get(0) - .expect(Integer.class)) { + .expect(TInt32.DTYPE)) { final int[] expected = {8, 6, 4, 2}; assertArrayEquals(expected, fetched.copyTo(new int[4])); } @@ -102,7 +103,7 @@ public void runWithMetadata() { try (Graph g = new Graph(); Session s = new Session(g)) { TestUtil.transpose_A_times_X(g, new int[][] {{2}, {3}}); - try (Tensor x = Tensors.create(new int[][] {{5}, {7}})) { + try (Tensor x = Tensors.create(new int[][] {{5}, {7}})) { Session.Run result = s.runner() .feed("X", x) @@ -110,7 +111,7 @@ public void runWithMetadata() { .setOptions(fullTraceRunOptions()) .runAndFetchMetadata(); // Sanity check on outputs. - TestUtil.AutoCloseableList> outputs = new TestUtil.AutoCloseableList>(result.outputs); + TestUtil.AutoCloseableList> outputs = new TestUtil.AutoCloseableList<>(result.outputs); assertEquals(1, outputs.size()); final int[][] expected = {{31}}; assertArrayEquals(expected, outputs.get(0).copyTo(new int[1][1])); @@ -134,7 +135,7 @@ public void runMultipleOutputs() { TestUtil.constant(g, "c1", 2718); TestUtil.constant(g, "c2", 31415); TestUtil.AutoCloseableList> outputs = - new TestUtil.AutoCloseableList>(s.runner().fetch("c2").fetch("c1").run()); + new TestUtil.AutoCloseableList<>(s.runner().fetch("c2").fetch("c1").run()); assertEquals(2, outputs.size()); assertEquals(31415, outputs.get(0).intValue()); assertEquals(2718, outputs.get(1).intValue()); diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/ShapeTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/ShapeTest.java deleted file mode 100644 index 313c09e1e40..00000000000 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/ShapeTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -package org.tensorflow; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** Unit tests for {@link Shape}. */ -@RunWith(JUnit4.class) -public class ShapeTest { - - @Test - public void unknown() { - assertEquals(-1, Shape.unknown().numDimensions()); - assertEquals("", Shape.unknown().toString()); - } - - @Test - public void scalar() { - assertEquals(0, Shape.scalar().numDimensions()); - assertEquals("[]", Shape.scalar().toString()); - } - - @Test - public void make() { - Shape s = Shape.make(2); - assertEquals(1, s.numDimensions()); - assertEquals(2, s.size(0)); - assertEquals("[2]", s.toString()); - - s = Shape.make(2, 3); - assertEquals(2, s.numDimensions()); - assertEquals(2, s.size(0)); - assertEquals(3, s.size(1)); - assertEquals("[2, 3]", s.toString()); - - s = Shape.make(-1, 2, 3); - assertEquals(3, s.numDimensions()); - assertEquals(-1, s.size(0)); - assertEquals(2, s.size(1)); - assertEquals(3, s.size(2)); - assertEquals("[?, 2, 3]", s.toString()); - } - - @Test - public void nodesInAGraph() { - try (Graph g = new Graph()) { - Output n = TestUtil.placeholder(g, "feed", Float.class); - assertEquals(-1, n.shape().numDimensions()); - - n = TestUtil.constant(g, "scalar", 3); - assertEquals(0, n.shape().numDimensions()); - - n = TestUtil.constant(g, "vector", new float[2]); - assertEquals(1, n.shape().numDimensions()); - assertEquals(2, n.shape().size(0)); - - n = TestUtil.constant(g, "matrix", new float[4][5]); - assertEquals(2, n.shape().numDimensions()); - assertEquals(4, n.shape().size(0)); - assertEquals(5, n.shape().size(1)); - } - } - - @Test - public void equalsWorksCorrectly() { - assertEquals(Shape.scalar(), Shape.scalar()); - assertEquals(Shape.make(1, 2, 3), Shape.make(1, 2, 3)); - - assertNotEquals(Shape.make(1, 2), null); - assertNotEquals(Shape.make(1, 2), new Object()); - assertNotEquals(Shape.make(1, 2, 3), Shape.make(1, 2, 4)); - - assertNotEquals(Shape.unknown(), Shape.unknown()); - assertNotEquals(Shape.make(-1), Shape.make(-1)); - assertNotEquals(Shape.make(1, -1, 3), Shape.make(1, -1, 3)); - } - - @Test - public void hashCodeIsAsExpected() { - assertEquals(Shape.make(1, 2, 3, 4).hashCode(), Shape.make(1, 2, 3, 4).hashCode()); - assertEquals(Shape.scalar().hashCode(), Shape.scalar().hashCode()); - assertEquals(Shape.unknown().hashCode(), Shape.unknown().hashCode()); - - assertNotEquals(Shape.make(1, 2).hashCode(), Shape.make(1, 3).hashCode()); - } -} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorTest.java index 3a75f3cb5c8..b4194df1122 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TensorTest.java @@ -29,11 +29,16 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.nio.LongBuffer; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; /** Unit tests for {@link org.tensorflow.Tensor}. */ @RunWith(JUnit4.class) @@ -51,15 +56,15 @@ public void createWithByteBuffer() { byte[] strings = "test".getBytes(UTF_8); long[] strings_shape = {}; byte[] strings_; // raw TF_STRING - try (Tensor t = Tensors.create(strings)) { - ByteBuffer to = ByteBuffer.allocate(t.numBytes()); + try (Tensor t = Tensors.create(strings)) { + ByteBuffer to = ByteBuffer.allocate((int)t.numBytes()); t.writeTo(to); strings_ = to.array(); } // validate creating a tensor using a byte buffer { - try (Tensor t = Tensor.create(Boolean.class, bools_shape, ByteBuffer.wrap(bools_))) { + try (Tensor t = Tensor.create(TBool.DTYPE, bools_shape, ByteBuffer.wrap(bools_))) { boolean[] actual = t.copyTo(new boolean[bools_.length]); for (int i = 0; i < bools.length; ++i) { assertEquals("" + i, bools[i], actual[i]); @@ -67,8 +72,8 @@ public void createWithByteBuffer() { } // note: the buffer is expected to contain raw TF_STRING (as per C API) - try (Tensor t = - Tensor.create(String.class, strings_shape, ByteBuffer.wrap(strings_))) { + try (Tensor t = + Tensor.create(TString.DTYPE, strings_shape, ByteBuffer.wrap(strings_))) { assertArrayEquals(strings, t.bytesValue()); } } @@ -77,15 +82,15 @@ public void createWithByteBuffer() { { ByteBuffer buf = ByteBuffer.allocateDirect(8 * doubles.length).order(ByteOrder.nativeOrder()); buf.asDoubleBuffer().put(doubles); - try (Tensor t = Tensor.create(Double.class, doubles_shape, buf)) { + try (Tensor t = Tensor.create(TDouble.DTYPE, doubles_shape, buf)) { double[] actual = new double[doubles.length]; assertArrayEquals(doubles, t.copyTo(actual), EPSILON); } } // validate shape checking - try (Tensor t = - Tensor.create(Boolean.class, new long[bools_.length * 2], ByteBuffer.wrap(bools_))) { + try (Tensor t = + Tensor.create(TBool.DTYPE, new long[bools_.length * 2], ByteBuffer.wrap(bools_))) { fail("should have failed on incompatible buffer"); } catch (IllegalArgumentException e) { // expected @@ -104,7 +109,7 @@ public void createFromBufferWithNonNativeByteOrder() { .asDoubleBuffer() .put(doubles); flipBuffer(buf); - try (Tensor t = Tensor.create(new long[] {doubles.length}, buf)) { + try (Tensor t = Tensor.create(new long[] {doubles.length}, buf)) { double[] actual = new double[doubles.length]; assertArrayEquals(doubles, t.copyTo(actual), EPSILON); } @@ -120,19 +125,19 @@ public void createWithTypedBuffer() { // validate creating a tensor using a typed buffer { - try (Tensor t = Tensor.create(shape, DoubleBuffer.wrap(doubles))) { + try (Tensor t = Tensor.create(shape, DoubleBuffer.wrap(doubles))) { double[] actual = new double[doubles.length]; assertArrayEquals(doubles, t.copyTo(actual), EPSILON); } - try (Tensor t = Tensor.create(shape, FloatBuffer.wrap(floats))) { + try (Tensor t = Tensor.create(shape, FloatBuffer.wrap(floats))) { float[] actual = new float[floats.length]; assertArrayEquals(floats, t.copyTo(actual), EPSILON_F); } - try (Tensor t = Tensor.create(shape, IntBuffer.wrap(ints))) { + try (Tensor t = Tensor.create(shape, IntBuffer.wrap(ints))) { int[] actual = new int[ints.length]; assertArrayEquals(ints, t.copyTo(actual)); } - try (Tensor t = Tensor.create(shape, LongBuffer.wrap(longs))) { + try (Tensor t = Tensor.create(shape, LongBuffer.wrap(longs))) { long[] actual = new long[longs.length]; assertArrayEquals(longs, t.copyTo(actual)); } @@ -140,23 +145,23 @@ public void createWithTypedBuffer() { // validate shape-checking { - try (Tensor t = + try (Tensor t = Tensor.create(new long[doubles.length + 1], DoubleBuffer.wrap(doubles))) { fail("should have failed on incompatible buffer"); } catch (IllegalArgumentException e) { // expected } - try (Tensor t = Tensor.create(new long[floats.length + 1], FloatBuffer.wrap(floats))) { + try (Tensor t = Tensor.create(new long[floats.length + 1], FloatBuffer.wrap(floats))) { fail("should have failed on incompatible buffer"); } catch (IllegalArgumentException e) { // expected } - try (Tensor t = Tensor.create(new long[ints.length + 1], IntBuffer.wrap(ints))) { + try (Tensor t = Tensor.create(new long[ints.length + 1], IntBuffer.wrap(ints))) { fail("should have failed on incompatible buffer"); } catch (IllegalArgumentException e) { // expected } - try (Tensor t = Tensor.create(new long[longs.length + 1], LongBuffer.wrap(longs))) { + try (Tensor t = Tensor.create(new long[longs.length + 1], LongBuffer.wrap(longs))) { fail("should have failed on incompatible buffer"); } catch (IllegalArgumentException e) { // expected @@ -172,11 +177,11 @@ public void writeTo() { long[] longs = {1L, 2L, 3L}; boolean[] bools = {true, false, true}; - try (Tensor tints = Tensors.create(ints); - Tensor tfloats = Tensors.create(floats); - Tensor tdoubles = Tensors.create(doubles); - Tensor tlongs = Tensors.create(longs); - Tensor tbools = Tensors.create(bools)) { + try (Tensor tints = Tensors.create(ints); + Tensor tfloats = Tensors.create(floats); + Tensor tdoubles = Tensors.create(doubles); + Tensor tlongs = Tensors.create(longs); + Tensor tbools = Tensors.create(bools)) { // validate that any datatype is readable with ByteBuffer (content, position) { @@ -212,45 +217,45 @@ public void writeTo() { // validate the use of direct buffers { DoubleBuffer buf = - ByteBuffer.allocateDirect(tdoubles.numBytes()) + ByteBuffer.allocateDirect((int)tdoubles.numBytes()) .order(ByteOrder.nativeOrder()) .asDoubleBuffer(); tdoubles.writeTo(buf); assertTrue(buf.isDirect()); - assertEquals(tdoubles.numElements(), buf.position()); + assertEquals(tdoubles.shape().size(), buf.position()); assertEquals(doubles[0], buf.get(0), EPSILON); } // validate typed buffers (content, position) { - FloatBuffer buf = FloatBuffer.allocate(tfloats.numElements()); + FloatBuffer buf = FloatBuffer.allocate((int)tfloats.shape().size()); tfloats.writeTo(buf); - assertEquals(tfloats.numElements(), buf.position()); + assertEquals(tfloats.shape().size(), buf.position()); assertEquals(floats[0], buf.get(0), EPSILON); } { - DoubleBuffer buf = DoubleBuffer.allocate(tdoubles.numElements()); + DoubleBuffer buf = DoubleBuffer.allocate((int)tdoubles.shape().size()); tdoubles.writeTo(buf); - assertEquals(tdoubles.numElements(), buf.position()); + assertEquals(tdoubles.shape().size(), buf.position()); assertEquals(doubles[0], buf.get(0), EPSILON); } { - IntBuffer buf = IntBuffer.allocate(tints.numElements()); + IntBuffer buf = IntBuffer.allocate((int)tints.shape().size()); tints.writeTo(buf); - assertEquals(tints.numElements(), buf.position()); + assertEquals(tints.shape().size(), buf.position()); assertEquals(ints[0], buf.get(0)); } { - LongBuffer buf = LongBuffer.allocate(tlongs.numElements()); + LongBuffer buf = LongBuffer.allocate((int)tlongs.shape().size()); tlongs.writeTo(buf); - assertEquals(tlongs.numElements(), buf.position()); + assertEquals(tlongs.shape().size(), buf.position()); assertEquals(longs[0], buf.get(0)); } // validate byte order conversion { DoubleBuffer foreignBuf = - ByteBuffer.allocate(tdoubles.numBytes()) + ByteBuffer.allocate((int)tdoubles.numBytes()) .order( ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN ? ByteOrder.BIG_ENDIAN @@ -299,46 +304,40 @@ public void writeTo() { @Test public void scalars() { - try (Tensor t = Tensors.create(2.718f)) { - assertEquals(DataType.FLOAT, t.dataType()); - assertEquals(0, t.numDimensions()); - assertEquals(0, t.shape().length); + try (Tensor t = Tensors.create(2.718f)) { + assertEquals(TFloat.DTYPE, t.dataType()); + assertEquals(0, t.shape().numDimensions()); assertEquals(2.718f, t.floatValue(), EPSILON_F); } - try (Tensor t = Tensors.create(3.1415)) { - assertEquals(DataType.DOUBLE, t.dataType()); - assertEquals(0, t.numDimensions()); - assertEquals(0, t.shape().length); + try (Tensor t = Tensors.create(3.1415)) { + assertEquals(TDouble.DTYPE, t.dataType()); + assertEquals(0, t.shape().numDimensions()); assertEquals(3.1415, t.doubleValue(), EPSILON); } - try (Tensor t = Tensors.create(-33)) { - assertEquals(DataType.INT32, t.dataType()); - assertEquals(0, t.numDimensions()); - assertEquals(0, t.shape().length); + try (Tensor t = Tensors.create(-33)) { + assertEquals(TInt32.DTYPE, t.dataType()); + assertEquals(0, t.shape().numDimensions()); assertEquals(-33, t.intValue()); } - try (Tensor t = Tensors.create(8589934592L)) { - assertEquals(DataType.INT64, t.dataType()); - assertEquals(0, t.numDimensions()); - assertEquals(0, t.shape().length); + try (Tensor t = Tensors.create(8589934592L)) { + assertEquals(TInt64.DTYPE, t.dataType()); + assertEquals(0, t.shape().numDimensions()); assertEquals(8589934592L, t.longValue()); } - try (Tensor t = Tensors.create(true)) { - assertEquals(DataType.BOOL, t.dataType()); - assertEquals(0, t.numDimensions()); - assertEquals(0, t.shape().length); + try (Tensor t = Tensors.create(true)) { + assertEquals(TBool.DTYPE, t.dataType()); + assertEquals(0, t.shape().numDimensions()); assertTrue(t.booleanValue()); } final byte[] bytes = {1, 2, 3, 4}; - try (Tensor t = Tensors.create(bytes)) { - assertEquals(DataType.STRING, t.dataType()); - assertEquals(0, t.numDimensions()); - assertEquals(0, t.shape().length); + try (Tensor t = Tensors.create(bytes)) { + assertEquals(TString.DTYPE, t.dataType()); + assertEquals(0, t.shape().numDimensions()); assertArrayEquals(bytes, t.bytesValue()); } } @@ -346,20 +345,21 @@ public void scalars() { @Test public void nDimensional() { double[] vector = {1.414, 2.718, 3.1415}; - try (Tensor t = Tensors.create(vector)) { - assertEquals(DataType.DOUBLE, t.dataType()); - assertEquals(1, t.numDimensions()); - assertArrayEquals(new long[] {3}, t.shape()); + try (Tensor t = Tensors.create(vector)) { + assertEquals(TDouble.DTYPE, t.dataType()); + assertEquals(1, t.shape().numDimensions()); + assertEquals(3, t.shape().size(0)); double[] got = new double[3]; assertArrayEquals(vector, t.copyTo(got), EPSILON); } int[][] matrix = {{1, 2, 3}, {4, 5, 6}}; - try (Tensor t = Tensors.create(matrix)) { - assertEquals(DataType.INT32, t.dataType()); - assertEquals(2, t.numDimensions()); - assertArrayEquals(new long[] {2, 3}, t.shape()); + try (Tensor t = Tensors.create(matrix)) { + assertEquals(TInt32.DTYPE, t.dataType()); + assertEquals(2, t.shape().numDimensions()); + assertEquals(2, t.shape().size(0)); + assertEquals(3, t.shape().size(1)); int[][] got = new int[2][3]; assertArrayEquals(matrix, t.copyTo(got)); @@ -368,10 +368,12 @@ public void nDimensional() { long[][][] threeD = { {{1}, {3}, {5}, {7}, {9}}, {{2}, {4}, {6}, {8}, {0}}, }; - try (Tensor t = Tensors.create(threeD)) { - assertEquals(DataType.INT64, t.dataType()); - assertEquals(3, t.numDimensions()); - assertArrayEquals(new long[] {2, 5, 1}, t.shape()); + try (Tensor t = Tensors.create(threeD)) { + assertEquals(TInt64.DTYPE, t.dataType()); + assertEquals(3, t.shape().numDimensions()); + assertEquals(2, t.shape().size(0)); + assertEquals(5, t.shape().size(1)); + assertEquals(1, t.shape().size(2)); long[][][] got = new long[2][5][1]; assertArrayEquals(threeD, t.copyTo(got)); @@ -382,10 +384,13 @@ public void nDimensional() { {{{false, false, true, true}, {false, true, false, false}}}, {{{false, true, false, true}, {false, true, true, false}}}, }; - try (Tensor t = Tensors.create(fourD)) { - assertEquals(DataType.BOOL, t.dataType()); - assertEquals(4, t.numDimensions()); - assertArrayEquals(new long[] {3, 1, 2, 4}, t.shape()); + try (Tensor t = Tensors.create(fourD)) { + assertEquals(TBool.DTYPE, t.dataType()); + assertEquals(4, t.shape().numDimensions()); + assertEquals(3, t.shape().size(0)); + assertEquals(1, t.shape().size(1)); + assertEquals(2, t.shape().size(2)); + assertEquals(4, t.shape().size(3)); boolean[][][][] got = new boolean[3][1][2][4]; assertArrayEquals(fourD, t.copyTo(got)); @@ -400,10 +405,11 @@ public void testNDimensionalStringTensor() { matrix[i][j] = String.format("(%d, %d) = %d", i, j, i << j).getBytes(UTF_8); } } - try (Tensor t = Tensors.create(matrix)) { - assertEquals(DataType.STRING, t.dataType()); - assertEquals(2, t.numDimensions()); - assertArrayEquals(new long[] {4, 3}, t.shape()); + try (Tensor t = Tensors.create(matrix)) { + assertEquals(TString.DTYPE, t.dataType()); + assertEquals(2, t.shape().numDimensions()); + assertEquals(4, t.shape().size(0)); + assertEquals(3, t.shape().size(1)); byte[][][] got = t.copyTo(new byte[4][3][]); assertEquals(4, got.length); @@ -419,10 +425,10 @@ public void testNDimensionalStringTensor() { @Test public void testUInt8Tensor() { byte[] vector = new byte[] {1, 2, 3, 4}; - try (Tensor t = Tensor.create(vector, UInt8.class)) { - assertEquals(DataType.UINT8, t.dataType()); - assertEquals(1, t.numDimensions()); - assertArrayEquals(new long[] {4}, t.shape()); + try (Tensor t = Tensor.create(vector, TUInt8.DTYPE)) { + assertEquals(TUInt8.DTYPE, t.dataType()); + assertEquals(1, t.shape().numDimensions()); + assertEquals(4, t.shape().size(0)); byte[] got = t.copyTo(new byte[4]); assertArrayEquals(vector, got); @@ -432,7 +438,7 @@ public void testUInt8Tensor() { @Test public void testCreateFromArrayOfBoxed() { Integer[] vector = new Integer[] {1, 2, 3, 4}; - try (Tensor t = Tensor.create(vector, Integer.class)) { + try (Tensor t = Tensor.create(vector, TInt32.DTYPE)) { fail("Tensor.create() should fail because it was given an array of boxed values"); } catch (IllegalArgumentException e) { // The expected exception @@ -456,7 +462,7 @@ public void failCreateOnMismatchedDimensions() { @Test public void failCopyToOnIncompatibleDestination() { - try (final Tensor matrix = Tensors.create(new int[][] {{1, 2}, {3, 4}})) { + try (final Tensor matrix = Tensors.create(new int[][] {{1, 2}, {3, 4}})) { try { matrix.copyTo(new int[2]); fail("should have failed on dimension mismatch"); @@ -482,7 +488,7 @@ public void failCopyToOnIncompatibleDestination() { @Test public void failCopyToOnScalar() { - try (final Tensor scalar = Tensors.create(3)) { + try (final Tensor scalar = Tensors.create(3)) { try { scalar.copyTo(3); fail("copyTo should fail on scalar tensors, suggesting use of primitive accessors instead"); @@ -503,7 +509,7 @@ public void failOnArbitraryObject() { @Test public void failOnZeroDimension() { - try (Tensor t = Tensors.create(new int[3][0][1])) { + try (Tensor t = Tensors.create(new int[3][0][1])) { fail("should fail on creating a Tensor where one of the dimensions is 0"); } catch (IllegalArgumentException e) { // The expected exception. @@ -524,11 +530,11 @@ public void useAfterClose() { @Test public void eagerTensorIsReleasedAfterSessionIsClosed() { - Tensor sum; + Tensor sum; try (EagerSession session = EagerSession.create()) { Output x = TestUtil.constant(session, "Const1", 10); Output y = TestUtil.constant(session, "Const2", 20); - sum = TestUtil.addN(session, x, y).tensor(); + sum = TestUtil.addN(session, x, y).tensor(); assertNotEquals(0L, sum.getNativeHandle()); assertEquals(30, sum.intValue()); } @@ -550,11 +556,11 @@ public void fromHandle() { // An exception is made for this test, where the pitfalls of this is avoided by not calling // close() on both Tensors. final float[][] matrix = {{1, 2, 3}, {4, 5, 6}}; - try (Tensor src = Tensors.create(matrix)) { - Tensor cpy = Tensor.fromHandle(src.getNativeHandle()).expect(Float.class); + try (Tensor src = Tensors.create(matrix)) { + Tensor cpy = Tensor.fromHandle(src.getNativeHandle()).expect(TFloat.DTYPE); assertEquals(src.dataType(), cpy.dataType()); - assertEquals(src.numDimensions(), cpy.numDimensions()); - assertArrayEquals(src.shape(), cpy.shape()); + assertEquals(src.shape().numDimensions(), cpy.shape().numDimensions()); + assertEquals(src.shape(), cpy.shape()); assertArrayEquals(matrix, cpy.copyTo(new float[2][3])); } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TestUtil.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TestUtil.java index 6e24d88a310..6153a35e582 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TestUtil.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/TestUtil.java @@ -18,6 +18,8 @@ import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.family.TType; /** Static utility functions. */ public class TestUtil { @@ -50,28 +52,28 @@ public static GraphOperation constantOp(Graph g, String name, Object value) { } } - public static Output constant(ExecutionEnvironment env, String name, Object value) { + public static Output constant(ExecutionEnvironment env, String name, Object value) { try (Tensor t = Tensor.create(value)) { return env.opBuilder("Const", name) .setAttr("dtype", t.dataType()) .setAttr("value", t) .build() - .output(0); + .output(0); } } - public static Output placeholder(Graph g, String name, Class type) { + public static Output placeholder(Graph g, String name, DataType type) { return g.opBuilder("Placeholder", name) - .setAttr("dtype", DataType.fromClass(type)) + .setAttr("dtype", type) .build() - .output(0); + .output(0); } - public static Output addN(ExecutionEnvironment env, Output... inputs) { + public static Output addN(ExecutionEnvironment env, Output... inputs) { return env.opBuilder("AddN", "AddN").addInputList(inputs).build().output(0); } - public static Output matmul( + public static Output matmul( Graph g, String name, Output a, Output b, boolean transposeA, boolean transposeB) { return g.opBuilder("MatMul", name) .addInput(a) @@ -79,7 +81,7 @@ public static Output matmul( .setAttr("transpose_a", transposeA) .setAttr("transpose_b", transposeB) .build() - .output(0); + .output(0); } public static Operation split(Graph g, String name, int[] values, int numSplit) { @@ -90,16 +92,16 @@ public static Operation split(Graph g, String name, int[] values, int numSplit) .build(); } - public static Output square(Graph g, String name, Output value) { + public static Output square(Graph g, String name, Output value) { return g.opBuilder("Square", name) .addInput(value) .build() - .output(0); + .output(0); } public static void transpose_A_times_X(Graph g, int[][] a) { - Output aa = constant(g, "A", a); - matmul(g, "Y", aa, placeholder(g, "X", Integer.class), true, false); + Output aa = constant(g, "A", a); + matmul(g, "Y", aa, placeholder(g, "X", TInt32.DTYPE), true, false); } /** @@ -149,7 +151,7 @@ private static int flatten(Object array, Object out, int next) { /** * Converts a {@code boolean[]} to a {@code byte[]}. * - *

Suitable for creating tensors of type {@link DataType#BOOL} using {@link + *

Suitable for creating tensors of type {@link org.tensorflow.types.TBool TBool} using {@link * java.nio.ByteBuffer}. */ public static byte[] bool2byte(boolean[] array) { @@ -163,7 +165,7 @@ public static byte[] bool2byte(boolean[] array) { /** * Converts a {@code byte[]} to a {@code boolean[]}. * - *

Suitable for reading tensors of type {@link DataType#BOOL} using {@link + *

Suitable for reading tensors of type {@link org.tensorflow.types.TBool TBool} using {@link * java.nio.ByteBuffer}. */ public static boolean[] byte2bool(byte[] array) { diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/c_api/HelloWorldTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/internal/c_api/HelloWorldTest.java similarity index 89% rename from tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/c_api/HelloWorldTest.java rename to tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/internal/c_api/HelloWorldTest.java index 92b9eac8d75..36a7357ac04 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/c_api/HelloWorldTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/internal/c_api/HelloWorldTest.java @@ -13,10 +13,10 @@ limitations under the License. ==============================================================================*/ -package org.tensorflow.c_api; +package org.tensorflow.internal.c_api; import static org.junit.Assert.assertTrue; -import static org.tensorflow.c_api.global.tensorflow.TF_Version; +import static org.tensorflow.internal.c_api.global.tensorflow.TF_Version; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/OperandsTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/OperandsTest.java index 79bfcc8354f..100fe4fcabc 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/OperandsTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/OperandsTest.java @@ -27,6 +27,7 @@ import org.tensorflow.Operation; import org.tensorflow.Output; import org.tensorflow.TestUtil; +import org.tensorflow.types.TInt32; /** Unit tests for {@link org.tensorflow.op.Operands}. */ @RunWith(JUnit4.class) @@ -36,8 +37,7 @@ public class OperandsTest { public void createOutputArrayFromOperandList() { try (Graph g = new Graph()) { Operation split = TestUtil.split(g, "split", new int[] {0, 1, 2}, 3); - List> list = - Arrays.asList(split.output(0), split.output(2)); + List> list = Arrays.asList(split.output(0), split.output(2)); Output[] array = Operands.asOutputs(list); assertEquals(list.size(), array.length); assertSame(array[0], list.get(0)); diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/PrimitiveOpTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/PrimitiveOpTest.java index e02c38ed221..a9ec8046727 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/PrimitiveOpTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/PrimitiveOpTest.java @@ -28,6 +28,7 @@ import org.tensorflow.Graph; import org.tensorflow.Output; import org.tensorflow.TestUtil; +import org.tensorflow.types.TInt32; /** Unit tests for {@link org.tensorflow.op.PrimitiveOp} */ @RunWith(JUnit4.class) @@ -36,7 +37,7 @@ public class PrimitiveOpTest { @Test public void equalsHashcode() { try (Graph g = new Graph()) { - Output array = TestUtil.constant(g, "array", new int[2]); + Output array = TestUtil.constant(g, "array", new int[2]); PrimitiveOp test1 = new PrimitiveOp(g.opBuilder("Shape", "shape1").addInput(array).build()) {}; diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/ScopeTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/ScopeTest.java index 81918a81ac8..d1de158f9b4 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/ScopeTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/ScopeTest.java @@ -21,18 +21,25 @@ import java.util.HashMap; import java.util.Map; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.tensorflow.DataType; import org.tensorflow.Graph; import org.tensorflow.Output; import org.tensorflow.Session; import org.tensorflow.Tensor; import org.tensorflow.Tensors; -import org.tensorflow.types.UInt8; - -/** Unit tests for {@link org.tensorflow.Scope}. */ +import org.tensorflow.types.TBool; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; +import org.tensorflow.types.family.TType; + +/** Unit tests for {@link org.tensorflow.op.Scope}. */ @RunWith(JUnit4.class) public class ScopeTest { @@ -127,13 +134,13 @@ public void validateNames() { public void basic() { try (Graph g = new Graph()) { Scope s = new Scope(g); - Const c1 = Const.create(s, 42); + Const c1 = Const.create(s, 42); assertEquals("Const", c1.output().op().name()); - Const c2 = Const.create(s, 7); + Const c2 = Const.create(s, 7); assertEquals("Const_1", c2.output().op().name()); - Const c3 = Const.create(s.withName("four"), 4); + Const c3 = Const.create(s.withName("four"), 4); assertEquals("four", c3.output().op().name()); - Const c4 = Const.create(s.withName("four"), 4); + Const c4 = Const.create(s.withName("four"), 4); assertEquals("four_1", c4.output().op().name()); } } @@ -153,11 +160,11 @@ public void composite() { try (Graph g = new Graph(); Session sess = new Session(g)) { Scope s = new Scope(g); - Output data = + Output data = Const.create(s.withName("data"), new int[] {600, 470, 170, 430, 300}).output(); // Create a composite op with a customized name - Variance var1 = Variance.create(s.withName("example"), data, Integer.class); + Variance var1 = Variance.create(s.withName("example"), data, TInt32.DTYPE); assertEquals("example/variance", var1.output().op().name()); // Confirm internally added ops have the right names. @@ -166,7 +173,7 @@ public void composite() { // assertNotNull(g.operation("example/zero")); // Same composite op with a default name - Variance var2 = Variance.create(s, data, Integer.class); + Variance var2 = Variance.create(s, data, TInt32.DTYPE); assertEquals("variance/variance", var2.output().op().name()); // Confirm internally added ops have the right names. @@ -175,45 +182,45 @@ public void composite() { // assertNotNull(g.operation("variance/zero")); // Verify correct results as well. - Tensor result = - sess.runner().fetch(var1.output()).run().get(0).expect(Integer.class); + Tensor result = + sess.runner().fetch(var1.output()).run().get(0).expect(TInt32.DTYPE); assertEquals(21704, result.intValue()); - result = sess.runner().fetch(var2.output()).run().get(0).expect(Integer.class); + result = sess.runner().fetch(var2.output()).run().get(0).expect(TInt32.DTYPE); assertEquals(21704, result.intValue()); } } // "handwritten" sample operator classes - private static final class Const { + private static final class Const { private final Output output; - static Const create(Scope s, int v) { + static Const create(Scope s, int v) { return create(s, Tensors.create(v)); } - static Const create(Scope s, int[] v) { + static Const create(Scope s, int[] v) { return create(s, Tensors.create(v)); } - static Const create(Scope s, Tensor value) { - return new Const( + static Const create(Scope s, Tensor value) { + return new Const<>( s.env() .opBuilder("Const", s.makeOpName("Const")) .setAttr("dtype", value.dataType()) .setAttr("value", value) .build() - .output(0)); + .output(0)); } - static Const create(Scope s, Object v, Class type) { + static Const create(Scope s, Object v, DataType type) { try (Tensor value = Tensor.create(v, type)) { - return new Const( + return new Const<>( s.env() .opBuilder("Const", s.makeOpName("Const")) .setAttr("dtype", value.dataType()) .setAttr("value", value) .build() - .output(0)); + .output(0)); } } @@ -226,17 +233,17 @@ Output output() { } } - private static final class Mean { + private static final class Mean { private final Output output; - static Mean create(Scope s, Output input, Output reductionIndices) { - return new Mean( + static Mean create(Scope s, Output input, Output reductionIndices) { + return new Mean<>( s.env() .opBuilder("Mean", s.makeOpName("Mean")) .addInput(input) .addInput(reductionIndices) .build() - .output(0)); + .output(0)); } Mean(Output o) { @@ -248,17 +255,17 @@ Output output() { } } - private static final class SquaredDifference { + private static final class SquaredDifference { private final Output output; - static SquaredDifference create(Scope s, Output x, Output y) { - return new SquaredDifference( + static SquaredDifference create(Scope s, Output x, Output y) { + return new SquaredDifference<>( s.env() .opBuilder("SquaredDifference", s.makeOpName("SquaredDifference")) .addInput(x) .addInput(y) .build() - .output(0)); + .output(0)); } SquaredDifference(Output o) { @@ -274,28 +281,28 @@ Output output() { * Returns the zero value of type described by {@code c}, or null if the type (e.g., string) is * not numeric and therefore has no zero value. * - * @param c The class describing the TensorFlow type of interest. + * @param type The TensorFlow type of interest. */ - public static Object zeroValue(Class c) { - return zeros.get(c); + public static Object zeroValue(DataType type) { + return zeros.get(type); } - private static final Map, Object> zeros = new HashMap<>(); + private static final Map, Object> zeros = new HashMap<>(); static { - zeros.put(Float.class, 0.0f); - zeros.put(Double.class, 0.0); - zeros.put(Integer.class, 0); - zeros.put(UInt8.class, (byte) 0); - zeros.put(Long.class, 0L); - zeros.put(Boolean.class, false); - zeros.put(String.class, null); // no zero value + zeros.put(TFloat.DTYPE, 0.0f); + zeros.put(TDouble.DTYPE, 0.0); + zeros.put(TInt32.DTYPE, 0); + zeros.put(TUInt8.DTYPE, (byte) 0); + zeros.put(TInt64.DTYPE, 0L); + zeros.put(TBool.DTYPE, false); + zeros.put(TString.DTYPE, null); // no zero value } - private static final class Variance { + private static final class Variance { private final Output output; - static Variance create(Scope base, Output x, Class type) { + static Variance create(Scope base, Output x, DataType type) { Scope s = base.withSubScope("variance"); Output zero = Const.create(base, zeroValue(type), type).output(); Output sqdiff = @@ -303,7 +310,7 @@ static Variance create(Scope base, Output x, Class type) { s.withName("squared_deviation"), x, Mean.create(s, x, zero).output()) .output(); - return new Variance(Mean.create(s.withName("variance"), sqdiff, zero).output()); + return new Variance<>(Mean.create(s.withName("variance"), sqdiff, zero).output()); } Variance(Output o) { diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ConstantTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ConstantTest.java index 7d3b26de8dc..ad040cb726b 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ConstantTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ConstantTest.java @@ -27,7 +27,6 @@ import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.nio.LongBuffer; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -35,6 +34,12 @@ import org.tensorflow.Session; import org.tensorflow.Tensor; import org.tensorflow.op.Scope; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; @RunWith(JUnit4.class) public class ConstantTest { @@ -47,8 +52,8 @@ public void createInt() { try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, value); - try (Tensor result = sess.runner().fetch(op).run().get(0).expect(Integer.class)) { + Constant op = Constant.create(scope, value); + try (Tensor result = sess.runner().fetch(op).run().get(0).expect(TInt32.DTYPE)) { assertEquals(value, result.intValue()); } } @@ -62,70 +67,70 @@ public void createIntBuffer() { try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, shape, IntBuffer.wrap(ints)); + Constant op = Constant.create(scope, shape, IntBuffer.wrap(ints)); try (Tensor result = sess.runner().fetch(op).run().get(0)) { int[] actual = new int[ints.length]; - assertArrayEquals(ints, result.expect(Integer.class).copyTo(actual)); + assertArrayEquals(ints, result.expect(TInt32.DTYPE).copyTo(actual)); } } } @Test - public void createFloat() { + public void createTFloat() { float value = 1; try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, value); + Constant op = Constant.create(scope, value); try (Tensor result = sess.runner().fetch(op).run().get(0)) { - assertEquals(value, result.expect(Float.class).floatValue(), 0.0f); + assertEquals(value, result.expect(TFloat.DTYPE).floatValue(), 0.0f); } } } @Test - public void createFloatBuffer() { + public void createTFloatBuffer() { float[] floats = {1, 2, 3, 4}; long[] shape = {4}; try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, shape, FloatBuffer.wrap(floats)); + Constant op = Constant.create(scope, shape, FloatBuffer.wrap(floats)); try (Tensor result = sess.runner().fetch(op).run().get(0)) { float[] actual = new float[floats.length]; - assertArrayEquals(floats, result.expect(Float.class).copyTo(actual), EPSILON); + assertArrayEquals(floats, result.expect(TFloat.DTYPE).copyTo(actual), EPSILON); } } } @Test - public void createDouble() { + public void createTDouble() { double value = 1; try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, value); + Constant op = Constant.create(scope, value); try (Tensor result = sess.runner().fetch(op).run().get(0)) { - assertEquals(value, result.expect(Double.class).doubleValue(), 0.0); + assertEquals(value, result.expect(TDouble.DTYPE).doubleValue(), 0.0); } } } @Test - public void createDoubleBuffer() { + public void createTDoubleBuffer() { double[] doubles = {1, 2, 3, 4}; long[] shape = {4}; try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, shape, DoubleBuffer.wrap(doubles)); + Constant op = Constant.create(scope, shape, DoubleBuffer.wrap(doubles)); try (Tensor result = sess.runner().fetch(op).run().get(0)) { double[] actual = new double[doubles.length]; - assertArrayEquals(doubles, result.expect(Double.class).copyTo(actual), EPSILON); + assertArrayEquals(doubles, result.expect(TDouble.DTYPE).copyTo(actual), EPSILON); } } } @@ -137,9 +142,9 @@ public void createLong() { try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, value); + Constant op = Constant.create(scope, value); try (Tensor result = sess.runner().fetch(op).run().get(0)) { - assertEquals(value, result.expect(Long.class).longValue()); + assertEquals(value, result.expect(TInt64.DTYPE).longValue()); } } } @@ -152,10 +157,10 @@ public void createLongBuffer() { try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, shape, LongBuffer.wrap(longs)); + Constant op = Constant.create(scope, shape, LongBuffer.wrap(longs)); try (Tensor result = sess.runner().fetch(op).run().get(0)) { long[] actual = new long[longs.length]; - assertArrayEquals(longs, result.expect(Long.class).copyTo(actual)); + assertArrayEquals(longs, result.expect(TInt64.DTYPE).copyTo(actual)); } } } @@ -167,9 +172,9 @@ public void createBoolean() { try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, value); + Constant op = Constant.create(scope, value); try (Tensor result = sess.runner().fetch(op).run().get(0)) { - assertEquals(value, result.expect(Boolean.class).booleanValue()); + assertEquals(value, result.expect(TBool.DTYPE).booleanValue()); } } } @@ -197,9 +202,9 @@ public void createStringBuffer() throws IOException { try (Graph g = new Graph(); Session sess = new Session(g)) { Scope scope = new Scope(g); - Constant op = Constant.create(scope, String.class, shape, ByteBuffer.wrap(content)); + Constant op = Constant.create(scope, TString.DTYPE, shape, ByteBuffer.wrap(content)); try (Tensor result = sess.runner().fetch(op).run().get(0)) { - assertArrayEquals(data, result.expect(String.class).bytesValue()); + assertArrayEquals(data, result.expect(TString.DTYPE).bytesValue()); } } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GeneratedOperationsTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GeneratedOperationsTest.java index daafd6b9503..be3a7ba0cf2 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GeneratedOperationsTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GeneratedOperationsTest.java @@ -25,8 +25,9 @@ import org.tensorflow.Operand; import org.tensorflow.Session; import org.tensorflow.Tensor; -import org.tensorflow.Shape; import org.tensorflow.op.Ops; +import org.tensorflow.tools.Shape; +import org.tensorflow.types.TInt32; @RunWith(JUnit4.class) public final class GeneratedOperationsTest { @@ -36,8 +37,8 @@ public void tensorInputTensorOutput() { try (Graph g = new Graph(); Session sess = new Session(g)) { Ops ops = Ops.create(g); - Operand x = ops.math().add(ops.constant(1), ops.constant(2)); - try (Tensor result = sess.runner().fetch(x).run().get(0).expect(Integer.class)) { + Operand x = ops.math().add(ops.constant(1), ops.constant(2)); + try (Tensor result = sess.runner().fetch(x).run().get(0).expect(TInt32.DTYPE)) { assertEquals(3, result.intValue()); } } @@ -48,12 +49,12 @@ public void testListInputTensorOutput() { try (Graph g = new Graph(); Session sess = new Session(g)) { Ops ops = Ops.create(g); - ArrayList> inputs = new ArrayList>(); + ArrayList> inputs = new ArrayList<>(); inputs.add(ops.constant(1)); inputs.add(ops.constant(2)); inputs.add(ops.constant(3)); - Operand x = ops.math().addN(inputs); - try (Tensor result = sess.runner().fetch(x).run().get(0).expect(Integer.class)) { + Operand x = ops.math().addN(inputs); + try (Tensor result = sess.runner().fetch(x).run().get(0).expect(TInt32.DTYPE)) { assertEquals(6, result.intValue()); } } @@ -71,14 +72,14 @@ public void testControlDependencies() { try (Graph g = new Graph(); Session sess = new Session(g)) { Ops ops = Ops.create(g); - Operand variable = ops.variable(Shape.scalar(), Integer.class); + Operand variable = ops.variable(Shape.scalar(), TInt32.DTYPE); Operand initVariable = ops.assign(variable, ops.constant(0)); - ArrayList> controls = new ArrayList>(); + ArrayList> controls = new ArrayList<>(); controls.add(ops.assign(variable, ops.constant(3))); - Operand x = + Operand x = ops.withControlDependencies(controls).math().add(variable, ops.constant(0)); sess.runner().addTarget(initVariable).run(); - try (Tensor result = sess.runner().fetch(x).run().get(0).expect(Integer.class); ) { + try (Tensor result = sess.runner().fetch(x).run().get(0).expect(TInt32.DTYPE)) { assertEquals(3, result.intValue()); } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GradientsTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GradientsTest.java index 3f49790b291..3fb333eac87 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GradientsTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/GradientsTest.java @@ -30,6 +30,7 @@ import org.tensorflow.Tensors; import org.tensorflow.TestUtil; import org.tensorflow.op.Scope; +import org.tensorflow.types.TFloat; @RunWith(JUnit4.class) public class GradientsTest { @@ -40,9 +41,9 @@ public void createGradients() { Session sess = new Session(g)) { Scope scope = new Scope(g); - Output x = TestUtil.placeholder(g, "x1", Float.class); - Output y0 = TestUtil.square(g, "y0", x); - Output y1 = TestUtil.square(g, "y1", y0); + Output x = TestUtil.placeholder(g, "x1", TFloat.DTYPE); + Output y0 = TestUtil.square(g, "y0", x); + Output y1 = TestUtil.square(g, "y1", y0); Gradients grads = Gradients.create(scope, y1, Arrays.asList(x, y0)); @@ -50,7 +51,7 @@ public void createGradients() { assertNotNull(grads.dy()); assertEquals(2, grads.dy().size()); - try (Tensor c = Tensors.create(3.0f); + try (Tensor c = Tensors.create(3.0f); TestUtil.AutoCloseableList> outputs = new TestUtil.AutoCloseableList<>( sess.runner().feed(x, c).fetch(grads.dy(0)).fetch(grads.dy(1)).run())) { @@ -67,9 +68,9 @@ public void createGradientsWithSum() { Session sess = new Session(g)) { Scope scope = new Scope(g); - Output x = TestUtil.placeholder(g, "x1", Float.class); - Output y0 = TestUtil.square(g, "y0", x); - Output y1 = TestUtil.square(g, "y1", y0); + Output x = TestUtil.placeholder(g, "x1", TFloat.DTYPE); + Output y0 = TestUtil.square(g, "y0", x); + Output y1 = TestUtil.square(g, "y1", y0); Gradients grads = Gradients.create(scope, Arrays.asList(y0, y1), Arrays.asList(x)); @@ -77,7 +78,7 @@ public void createGradientsWithSum() { assertNotNull(grads.dy()); assertEquals(1, grads.dy().size()); - try (Tensor c = Tensors.create(3.0f); + try (Tensor c = Tensors.create(3.0f); TestUtil.AutoCloseableList> outputs = new TestUtil.AutoCloseableList<>(sess.runner().feed(x, c).fetch(grads.dy(0)).run())) { @@ -92,9 +93,9 @@ public void createGradientsWithInitialValues() { Session sess = new Session(g)) { Scope scope = new Scope(g); - Output x = TestUtil.placeholder(g, "x1", Float.class); - Output y0 = TestUtil.square(g, "y0", x); - Output y1 = TestUtil.square(g, "y1", y0); + Output x = TestUtil.placeholder(g, "x1", TFloat.DTYPE); + Output y0 = TestUtil.square(g, "y0", x); + Output y1 = TestUtil.square(g, "y1", y0); Gradients grads0 = Gradients.create(scope, y1, Arrays.asList(y0)); Gradients grads1 = Gradients.create(scope, y0, Arrays.asList(x), Gradients.dx(grads0.dy())); @@ -103,7 +104,7 @@ public void createGradientsWithInitialValues() { assertNotNull(grads1.dy()); assertEquals(1, grads1.dy().size()); - try (Tensor c = Tensors.create(3.0f); + try (Tensor c = Tensors.create(3.0f); TestUtil.AutoCloseableList> outputs = new TestUtil.AutoCloseableList<>( sess.runner().feed(x, c).fetch(grads1.dy(0)).run())) { @@ -118,8 +119,8 @@ public void validateGradientsNames() { try (Graph g = new Graph()) { Scope scope = new Scope(g).withSubScope("sub"); - Output x = TestUtil.placeholder(g, "x1", Float.class); - Output y = TestUtil.square(g, "y", x); + Output x = TestUtil.placeholder(g, "x1", TFloat.DTYPE); + Output y = TestUtil.square(g, "y", x); Gradients grad0 = Gradients.create(scope, y, Arrays.asList(x)); assertTrue(grad0.dy(0).op().name().startsWith("sub/Gradients/")); diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ZerosTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ZerosTest.java index cf3910b594f..6126842e53e 100644 --- a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ZerosTest.java +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/op/core/ZerosTest.java @@ -19,7 +19,6 @@ import static org.junit.Assert.assertFalse; import java.util.List; - import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -27,7 +26,13 @@ import org.tensorflow.Session; import org.tensorflow.Tensor; import org.tensorflow.op.Scope; -import org.tensorflow.types.UInt8; +import org.tensorflow.types.TBool; +import org.tensorflow.types.TDouble; +import org.tensorflow.types.TFloat; +import org.tensorflow.types.TInt32; +import org.tensorflow.types.TInt64; +import org.tensorflow.types.TString; +import org.tensorflow.types.TUInt8; @RunWith(JUnit4.class) public class ZerosTest { @@ -39,9 +44,9 @@ public void createIntZeros() { Session sess = new Session(g)) { Scope scope = new Scope(g); long[] shape = {2, 2}; - Zeros op = Zeros.create(scope, Constant.create(scope, shape), Integer.class); + Zeros op = Zeros.create(scope, Constant.create(scope, shape), TInt32.DTYPE); try (Tensor result = sess.runner().fetch(op).run().get(0)) { - int[][] actual = result.expect(Integer.class).copyTo(new int[(int)shape[0]][(int)shape[1]]); + int[][] actual = result.expect(TInt32.DTYPE).copyTo(new int[(int)shape[0]][(int)shape[1]]); for (int i = 0; i < actual.length; ++i) { for (int j = 0; j < actual[i].length; ++j) { assertEquals(0, actual[i][j]); @@ -57,9 +62,9 @@ public void createFloatZeros() { Session sess = new Session(g)) { Scope scope = new Scope(g); long[] shape = {2, 2}; - Zeros op = Zeros.create(scope, Constant.create(scope, shape), Float.class); + Zeros op = Zeros.create(scope, Constant.create(scope, shape), TFloat.DTYPE); try (Tensor result = sess.runner().fetch(op.asOutput()).run().get(0)) { - float[][] actual = result.expect(Float.class).copyTo(new float[(int)shape[0]][(int)shape[1]]); + float[][] actual = result.expect(TFloat.DTYPE).copyTo(new float[(int)shape[0]][(int)shape[1]]); for (int i = 0; i < actual.length; ++i) { for (int j = 0; j < actual[i].length; ++j) { assertEquals(0.0f, actual[i][j], EPSILON); @@ -75,9 +80,9 @@ public void createDoubleZeros() { Session sess = new Session(g)) { Scope scope = new Scope(g); long[] shape = {2, 2}; - Zeros op = Zeros.create(scope, Constant.create(scope, shape), Double.class); + Zeros op = Zeros.create(scope, Constant.create(scope, shape), TDouble.DTYPE); try (Tensor result = sess.runner().fetch(op.asOutput()).run().get(0)) { - double[][] actual = result.expect(Double.class).copyTo(new double[(int)shape[0]][(int)shape[1]]); + double[][] actual = result.expect(TDouble.DTYPE).copyTo(new double[(int)shape[0]][(int)shape[1]]); for (int i = 0; i < actual.length; ++i) { for (int j = 0; j < actual[i].length; ++j) { assertEquals(0.0, actual[i][j], EPSILON); @@ -93,9 +98,9 @@ public void createLongZeros() { Session sess = new Session(g)) { Scope scope = new Scope(g); long[] shape = {2, 2}; - Zeros op = Zeros.create(scope, Constant.create(scope, shape), Long.class); + Zeros op = Zeros.create(scope, Constant.create(scope, shape), TInt64.DTYPE); try (Tensor result = sess.runner().fetch(op.asOutput()).run().get(0)) { - long[][] actual = result.expect(Long.class).copyTo(new long[(int)shape[0]][(int)shape[1]]); + long[][] actual = result.expect(TInt64.DTYPE).copyTo(new long[(int)shape[0]][(int)shape[1]]); for (int i = 0; i < actual.length; ++i) { for (int j = 0; j < actual[i].length; ++j) { assertEquals(0L, actual[i][j]); @@ -111,9 +116,9 @@ public void createBooleanZeros() { Session sess = new Session(g)) { Scope scope = new Scope(g); long[] shape = {2, 2}; - Zeros op = Zeros.create(scope, Constant.create(scope, shape), Boolean.class); + Zeros op = Zeros.create(scope, Constant.create(scope, shape), TBool.DTYPE); try (Tensor result = sess.runner().fetch(op.asOutput()).run().get(0)) { - boolean[][] actual = result.expect(Boolean.class).copyTo(new boolean[(int)shape[0]][(int)shape[1]]); + boolean[][] actual = result.expect(TBool.DTYPE).copyTo(new boolean[(int)shape[0]][(int)shape[1]]); for (int i = 0; i < actual.length; ++i) { for (int j = 0; j < actual[i].length; ++j) { assertFalse(actual[i][j]); @@ -129,9 +134,9 @@ public void createUInt8Zeros() { Session sess = new Session(g)) { Scope scope = new Scope(g); long[] shape = {2, 2}; - Zeros op = Zeros.create(scope, Constant.create(scope, shape), UInt8.class); + Zeros op = Zeros.create(scope, Constant.create(scope, shape), TUInt8.DTYPE); try (Tensor result = sess.runner().fetch(op.asOutput()).run().get(0)) { - byte[][] actual = result.expect(UInt8.class).copyTo(new byte[(int)shape[0]][(int)shape[1]]); + byte[][] actual = result.expect(TUInt8.DTYPE).copyTo(new byte[(int)shape[0]][(int)shape[1]]); result.copyTo(actual); for (int i = 0; i < actual.length; ++i) { for (int j = 0; j < actual[i].length; ++j) { @@ -148,7 +153,7 @@ public void cannotCreateStringZeros() { Session sess = new Session(g)) { Scope scope = new Scope(g); long[] shape = {2, 2}; - Zeros.create(scope, Constant.create(scope, shape), String.class); + Zeros.create(scope, Constant.create(scope, shape), TString.DTYPE); } } @@ -158,7 +163,7 @@ public void operationsComposingZerosAreCorrectlyNamed() { Session sess = new Session(g)) { Scope scope = new Scope(g); long[] shape = {2, 2}; - Zeros zeros = Zeros.create(scope.withSubScope("test"), Constant.create(scope, shape), Float.class); + Zeros zeros = Zeros.create(scope.withSubScope("test"), Constant.create(scope, shape), TFloat.DTYPE); List> results = sess.runner().addTarget("test/Zeros/Zero").addTarget("test/Zeros/Fill").run(); } } diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/NumericTypesTestBase.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/NumericTypesTestBase.java new file mode 100644 index 00000000000..8d58ee1294b --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/NumericTypesTestBase.java @@ -0,0 +1,95 @@ +package org.tensorflow.types; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.tensorflow.EagerSession; +import org.tensorflow.Tensor; +import org.tensorflow.op.Ops; +import org.tensorflow.op.core.Constant; +import org.tensorflow.op.math.Sub; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.ndarray.IntNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.NdArrays; +import org.tensorflow.tools.ndarray.index.Indices; +import org.tensorflow.types.family.TNumber; + +abstract class NumericTypesTestBase, U> { + + private static final float EPSILON_F = 1e-7f; + + @Test + public void initializeTensorsWithZeros() { + // Allocate a tensor of 32-bits integer of the shape (2, 3, 2) + Tensor tensor = allocateTensor(Shape.make(2, 3, 2)); + NdArray tensorData = tensor.data(); + + assertEquals(3, tensorData.rank()); + assertEquals(12, tensorData.size()); + + try (EagerSession session = EagerSession.create()) { + Ops tf = Ops.create(session); + + // Initialize tensor memory with zeros and take a snapshot + tensorData.scalars().forEach(scalar -> scalar.setObject(valueOf(0))); + Constant x = tf.constant(tensor); + + // Initialize the same tensor memory with ones and take a snapshot + tensorData.scalars().forEach(scalar -> scalar.setObject(valueOf(1))); + Constant y = tf.constant(tensor); + + // Subtract y from x and validate the result + Sub sub = tf.math.sub(x, y); + sub.data().scalars().forEach(scalar -> + assertEquals(valueOf(-1), scalar.getObject()) + ); + } + } + + @Test + public void genericTest() { + IntNdArray heapData = NdArrays.vectorOf(0, 1, 2, 3); + + // Creates a 2x2 matrix + try (Tensor tensor = TInt32.ofShape(2, 2)) { + IntNdArray tensorData = tensor.data(); + + // Copy first 2 values of the vector to the first row of the matrix + tensorData.set(heapData.slice(Indices.range(0, 2)), 0); + + // Copy values at an odd position in the vector as the second row of the matrix + tensorData.set(heapData.slice(Indices.odd()), 1); + + assertEquals(0, tensorData.getInt(0, 0)); + assertEquals(1, tensorData.getInt(0, 1)); + assertEquals(1, tensorData.getInt(1, 0)); + assertEquals(3, tensorData.getInt(1, 1)); + + // Read rows of the tensor in reverse order + IntNdArray reversedTensorData = tensorData.slice(Indices.all(), Indices.flip()); + + assertEquals(1, reversedTensorData.getInt(0, 0)); + assertEquals(0, reversedTensorData.getInt(0, 1)); + assertEquals(3, reversedTensorData.getInt(1, 0)); + assertEquals(1, reversedTensorData.getInt(1, 1)); + + try (EagerSession session = EagerSession.create()) { + Ops tf = Ops.create(session); + + // Compute the power of the tensor by itself + Constant x = tf.constant(tensor); + IntNdArray result = tf.math.pow(x, x).data(); + + // Validate result by computing the same operation in Java + tensorData.scalars().forEachIndexed((coords, s) -> + assertEquals(Math.pow(s.getInt(), s.getInt()), result.getInt(coords), 1e-7f) + ); + } + } + } + + abstract Tensor allocateTensor(Shape shape); + + abstract U valueOf(Integer value); +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TDoubleTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TDoubleTest.java new file mode 100644 index 00000000000..9455aae7e7c --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TDoubleTest.java @@ -0,0 +1,17 @@ +package org.tensorflow.types; + +import org.tensorflow.Tensor; +import org.tensorflow.tools.Shape; + +public class TDoubleTest extends NumericTypesTestBase { + + @Override + Tensor allocateTensor(Shape shape) { + return TDouble.ofShape(shape); + } + + @Override + Double valueOf(Integer value) { + return value.doubleValue(); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TFloatTest.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TFloatTest.java new file mode 100644 index 00000000000..c335e55b509 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TFloatTest.java @@ -0,0 +1,17 @@ +package org.tensorflow.types; + +import org.tensorflow.Tensor; +import org.tensorflow.tools.Shape; + +public class TFloatTest extends NumericTypesTestBase { + + @Override + Tensor allocateTensor(Shape shape) { + return TFloat.ofShape(shape); + } + + @Override + Float valueOf(Integer value) { + return value.floatValue(); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TInt32Test.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TInt32Test.java new file mode 100644 index 00000000000..a15c053ad62 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TInt32Test.java @@ -0,0 +1,17 @@ +package org.tensorflow.types; + +import org.tensorflow.Tensor; +import org.tensorflow.tools.Shape; + +public class TInt32Test extends NumericTypesTestBase { + + @Override + Tensor allocateTensor(Shape shape) { + return TInt32.ofShape(shape); + } + + @Override + Integer valueOf(Integer value) { + return value; + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TInt64Test.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TInt64Test.java new file mode 100644 index 00000000000..af877cb3035 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TInt64Test.java @@ -0,0 +1,17 @@ +package org.tensorflow.types; + +import org.tensorflow.Tensor; +import org.tensorflow.tools.Shape; + +public class TInt64Test extends NumericTypesTestBase { + + @Override + Tensor allocateTensor(Shape shape) { + return TInt64.ofShape(shape); + } + + @Override + Long valueOf(Integer value) { + return value.longValue(); + } +} diff --git a/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TUInt8Test.java b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TUInt8Test.java new file mode 100644 index 00000000000..14b3d4ef1b7 --- /dev/null +++ b/tensorflow-core/tensorflow-core-api/src/test/java/org/tensorflow/types/TUInt8Test.java @@ -0,0 +1,17 @@ +package org.tensorflow.types; + +import org.tensorflow.Tensor; +import org.tensorflow.tools.Shape; + +public class TUInt8Test extends NumericTypesTestBase { + + @Override + Tensor allocateTensor(Shape shape) { + return TUInt8.ofShape(shape); + } + + @Override + Byte valueOf(Integer value) { + return value.byteValue(); + } +} diff --git a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/processor/operator/OperatorProcessor.java b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/processor/operator/OperatorProcessor.java index 693c74e8d35..82e46721194 100644 --- a/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/processor/operator/OperatorProcessor.java +++ b/tensorflow-core/tensorflow-core-generator/src/main/java/org/tensorflow/processor/operator/OperatorProcessor.java @@ -1,19 +1,17 @@ -/* - Copyright 2019 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ======================================================================= - */ +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ package org.tensorflow.processor.operator; @@ -55,11 +53,11 @@ import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.ParameterSpec; -import com.squareup.javapoet.TypeName; import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.WildcardTypeName; +import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeSpec; import com.squareup.javapoet.TypeVariableName; +import com.squareup.javapoet.WildcardTypeName; /** * A compile-time Processor that aggregates classes annotated with {@link @@ -161,6 +159,7 @@ public Set getSupportedAnnotationTypes() { private static final TypeName T_SCOPE = ClassName.get("org.tensorflow.op", "Scope"); private static final TypeName T_EXEC_ENV = ClassName.get("org.tensorflow", "ExecutionEnvironment"); + private static final TypeName T_EAGER_SESSION = ClassName.get("org.tensorflow", "EagerSession"); private static final TypeName T_STRING = ClassName.get(String.class); // Operand private static final TypeName T_OPERAND = @@ -361,13 +360,13 @@ private static TypeSpec buildTopClass( + " Operand four = ops.constant(4);\n" + " // Most builders are found within a group, and accept\n" + " // Operand types as operands\n" - + " Operand nine = ops.math().add(four, ops.constant(5));\n" + + " Operand nine = ops.math.add(four, ops.constant(5));\n" + " // Multi-result operations however offer methods to\n" + " // select a particular result for use.\n" + " Operand result = \n" - + " ops.math().add(ops.array().unique(s, a).y(), b);\n" + + " ops.math.add(ops.unique(s, a).y(), b);\n" + " // Optional attributes\n" - + " ops.math().matMul(a, b, MatMul.transposeA(true));\n" + + " ops.linalg.matMul(a, b, MatMul.transposeA(true));\n" + " // Naming operators\n" + " ops.withName(\"foo\").constant(5); // name \"foo\"\n" + " // Names can exist in a hierarchy\n" @@ -448,7 +447,18 @@ private static TypeSpec buildTopClass( .addParameter(T_EXEC_ENV, "env") .returns(T_OPS) .addStatement("return new Ops(new $T(env))", T_SCOPE) - .addJavadoc("Creates an API for building operations in the provided environment\n") + .addJavadoc( + "Creates an API for building operations in the provided execution environment\n") + .build()); + + opsBuilder.addMethod( + MethodSpec.methodBuilder("create") + .addModifiers(Modifier.PUBLIC, Modifier.STATIC) + .returns(T_OPS) + .addStatement("return new Ops(new $T($T.getDefault()))", T_SCOPE, T_EAGER_SESSION) + .addJavadoc( + "Creates an API for building operations in the default eager execution environment\n\n" + + "

Invoking this method is equivalent to {@code Ops.create(EagerSession.getDefault())}.\n") .build()); return opsBuilder.build(); diff --git a/tensorflow-tools/README.md b/tensorflow-tools/README.md new file mode 100644 index 00000000000..98e553b498f --- /dev/null +++ b/tensorflow-tools/README.md @@ -0,0 +1,134 @@ +# TensorFlow Tools + +## Introduction + +TensorFlow Tools is a utility library used by TensorFlow to accomplish tasks that are not easily +achievable using a standard JDK. As opposed to other artifacts in this repository, this library does +not depend on TensorFlow runtime itself and can be imported by any other projects running on a JVM +that wants to make use of those tools. For example, an instance of `NdArray` could easily be passed +from one library to another for sharing data. + +To import TensorFlow Tools in your project, simply add the following dependency: +```xml + + org.tensorflow + tensorflow-tools + 0.1.0-SNAPSHOT + +``` + +## Usage + +Note: For convenience, the helper interface `StaticApi` is providing access to most of the important +features of this library in a more readable fashion. It is suggested to import static helpers of +this interface in every class working with TensorFlow Tools as follow. +```java +import static org.tensorflow.tools.StaticApi.*; +``` +All examples of this README page are based on this import statement. + +### Data Buffers + +Instances of `DataBuffer` map contiguous segments of memory with 64-bits indexing and supports +generic parametrization while still allowing direct access to primitive types. Such segments +could be standard Java arrays, JDK NIO buffers or native memory. In addition, it can serialize and +deserialize data of any type (and not only primitive types, as with `java.util.nio`). + +```java +// Allocate a buffer of 4K int values +IntDataBuffer bufferA = bufferOfInts(4096L); +assertEquals(4096L, bufferA.size()); + +// Write an int array at the beginning of the buffer +bufferA.write(new int[] { 1, 2, 3 }); +assertEquals(3, bufferA.getInt(2)); + +// Slice buffer after its first value +IntDataBuffer bufferB = bufferA.offset(1); +assertEquals(4095L, bufferB.size()); +assertEquals(2, bufferB.getInt(0)); + +// Resize a buffer to 10 elements +IntDataBuffer bufferC = bufferA.narrow(10); +assertEquals(10L, bufferB.size()); +assertEquals(2, bufferB.getInt(0)); +``` + +### ND Arrays + +Instances of `NdArray` are used to view memory segments stored in a `DataBuffer` as a +multidimensional arrays and to provide an API for traversing, reading, writing and slicing +their data. The goal of these tools is to replace the usage of standard multidimensional Java arrays +(e.g. `new int[][][]`) since those results in slow performances, from the non-contiguous +storage of their data and the multiple dereferences required to access their values. + +```java +// Allocating a 3D matrix of 2x3x2 +IntNdArray matrix3d = ndArrayOfInts(shape(2, 3, 2)); +assertEquals(3, matrix3d.rank()); + +// Initializing 3D matrix data with vectors from the first dimension (index 0) +matrix3d.elements(0).forEach(matrix -> { + assertEquals(2, matrix.rank()); + assertEquals(shapeOf(3, 2), matrix.shape()); + matrix + .set(vectorOf(1, 2), 0) + .set(vectorOf(3, 4), 1) + .set(vectorOf(5, 6), 2); +}); + +// Visit all scalars of 3D matrix, printing their coordinates and value +matrix3d.scalars().forEachIdx((coords, scalar) -> + System.out.println("Scalar at " + Arrays.toString(coords) + " has value " + scalar.getInt()) +); + +// Retrieving the second vector of the first matrix +IntNdArray vector = matrix3d.get(0, 1); +assertEquals(1, vector.rank()); + +// Rewriting the values of the vector using a primitive array +vector.write(new int[] { 7, 8 }); +assertEquals(7, matrix3d.getInt(0, 1, 0)); +assertEquals(8, matrix3d.getInt(0, 1, 1)); + +// Slicing the 3D matrix so we only keep the second element of the second dimension +IntNdArray slice = matrix3d.slice(all(), at(1)); +assertEquals(2, slice.rank()); +assertEquals(shapeOf(2, 2), slice.shape()); +assertEquals(7, slice.getInt(0, 0)); // (0, 1, 0) in the original matrix +assertEquals(3, slice.getInt(1, 0)); // (1, 1, 0) in the original matrix +``` + +## Integration with TensorFlow + +TensorFlow tools are independent of the TensorFlow runtime library, making it a good choice for +manipulating multi-dimensional data structures from anywhere. As an example, here +is how it is actually done by the [TensorFlow Core API](https://github.com/tensorflow/java/tree/master/tensorflow-core/tensorflow-core-api): + +```java +// Allocate a tensor of 32-bits integer of the shape (2, 3, 2) +Tensor tensor = TInt32.ofShape(2, 3, 2); + +// Access tensor memory directly +IntNdArray tensorData = tensor.data(); +assertEquals(3, tensorData.rank()); +assertEquals(12, tensorData.size()); + +try (EagerSession session = EagerSession.create()) { + Ops tf = Ops.create(session); + + // Initialize tensor memory with zeros and take a snapshot + tensorData.scalars().forEach(scalar -> scalar.setInt(0)); + Constant x = tf.constant(tensor); + + // Initialize the same tensor memory with ones and take a snapshot + tensorData.scalars().forEach(scalar -> scalar.setInt(1)); + Constant y = tf.constant(tensor); + + // Subtract y from x and validate the result + Sub sub = tf.math.sub(x, y); + sub.data().scalars().forEach(scalar -> + assertEquals(-1, scalar.getInt()) + ); +} +``` \ No newline at end of file diff --git a/tensorflow-tools/pom.xml b/tensorflow-tools/pom.xml new file mode 100644 index 00000000000..9f8d64a8b6b --- /dev/null +++ b/tensorflow-tools/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + + org.tensorflow + tensorflow-java + 0.1.0-SNAPSHOT + + tensorflow-tools + jar + + TensorFlow Utility Library + + Library of utilities that do not depend on the TensorFlow runtime and can be used by other + projects outside the TensorFlow organization. + + + + + junit + junit + test + + + org.openjdk.jmh + jmh-core + test + + + org.openjdk.jmh + jmh-generator-annprocess + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + 1 + false + -Xmx2G -XX:MaxPermSize=256m + false + + **/*Test.java + + + + + + + diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/Shape.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/Shape.java new file mode 100644 index 00000000000..201d052bf23 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/Shape.java @@ -0,0 +1,142 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools; + +import java.util.Arrays; + +public final class Shape { + + public static long UNKNOWN_SIZE = -1L; + + /** Create a Shape representing an unknown number of dimensions. */ + public static Shape unknown() { + return new Shape(null); + } + + /** Create a Shape representing a scalar value. */ + public static Shape scalar() { + return new Shape(new long[0]); + } + + /** + * Create a Shape representing an N-dimensional value. + * + *

Creates a Shape representing an N-dimensional value (N being at least 1), with the provided + * size for each dimension. A -1 indicates that the size of the corresponding dimension is + * unknown. For example: + * + *

{@code
+   * // A 2-element vector.
+   * Shape vector = Shape.create(2);
+   *
+   * // A 2x3 matrix.
+   * Shape matrix = Shape.create(2, 3);
+   *
+   * // A matrix with 4 columns but an unknown number of rows.
+   * // This is typically used to indicate the shape of tensors that represent
+   * // a variable-sized batch of values. The Shape below might represent a
+   * // variable-sized batch of 4-element vectors.
+   * Shape batch = Shape.create(-1, 4);
+   * }
+ */ + public static Shape make(long... dimensionSizes) { + if (dimensionSizes == null || dimensionSizes.length == 0) { + return scalar(); + } + return new Shape(dimensionSizes); + } + + public long size() { + if (size == null) { + size = computeSize(dimensionSizes); + } + return size; + } + + public long size(int i) { + return dimensionSizes != null ? dimensionSizes[i] : UNKNOWN_SIZE; + } + + public int numDimensions() { + return dimensionSizes != null ? dimensionSizes.length : -1; + } + + public boolean hasUnknownDimension() { + if (dimensionSizes == null) { + return true; + } + for (long dimSize : dimensionSizes) { + if (dimSize == UNKNOWN_SIZE) { + return true; + } + } + return false; + } + + public long[] asArray() { + return dimensionSizes; + } + + @Override + public int hashCode() { + return dimensionSizes != null ? Arrays.hashCode(dimensionSizes) : super.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + // Shapes are equivalent if all of their dimensions are equals + if (obj instanceof Shape) { + Shape otherShape = (Shape)obj; + if (otherShape.hasUnknownDimension()) { + return false; + } + return Arrays.equals(dimensionSizes, otherShape.dimensionSizes); + } + return false; + } + + /** Succinct description of the shape meant for debugging. */ + @Override + public String toString() { + return Arrays.toString(dimensionSizes); + } + + private Shape(long[] dimensionSizes) { + this.dimensionSizes = dimensionSizes; + } + + private final long[] dimensionSizes; + private Long size; + + private static long computeSize(long[] dimensionSizes) { + if (dimensionSizes == null) { + return UNKNOWN_SIZE; + } + long computedSize = 1L; + for (long dimensionSize : dimensionSizes) { + if (dimensionSize == UNKNOWN_SIZE) { + return UNKNOWN_SIZE; + } + computedSize *= dimensionSize; + } + return computedSize; + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/StaticApi.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/StaticApi.java new file mode 100644 index 00000000000..6941ebc6ad9 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/StaticApi.java @@ -0,0 +1,727 @@ +package org.tensorflow.tools; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.ndarray.BooleanNdArray; +import org.tensorflow.tools.ndarray.ByteNdArray; +import org.tensorflow.tools.ndarray.DoubleNdArray; +import org.tensorflow.tools.ndarray.FloatNdArray; +import org.tensorflow.tools.ndarray.IllegalRankException; +import org.tensorflow.tools.ndarray.IntNdArray; +import org.tensorflow.tools.ndarray.LongNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.NdArrays; +import org.tensorflow.tools.ndarray.ShortNdArray; +import org.tensorflow.tools.ndarray.index.Index; +import org.tensorflow.tools.ndarray.index.Indices; + +/** + * Helper class for instantiating NIO utility objects. + */ +public interface StaticApi { + + /** + * Creates a buffer of objects of type {@code clazz} that can store up to {@code size} values + * + * @param clazz the type of object stored in this buffer + * @param size size of the buffer to allocate + * @return a new buffer + */ + static DataBuffer bufferOfObjects(Class clazz, long size) { + return DataBuffers.ofObjects(clazz, size); + } + + /** + * Creates a buffer of bytes that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + static ByteDataBuffer bufferOfBytes(long size) { + return DataBuffers.ofBytes(size); + } + + /** + * Creates a buffer of shorts that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + static ShortDataBuffer bufferOfShorts(long size) { + return DataBuffers.ofShorts(size); + } + + /** + * Creates a buffer of ints that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + static IntDataBuffer bufferOfInts(long size) { + return DataBuffers.ofInts(size); + } + + /** + * Creates a buffer of longs that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + static LongDataBuffer bufferOfLongs(long size) { + return DataBuffers.ofLongs(size); + } + + /** + * Creates a buffer of floats that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + static FloatDataBuffer bufferOfFloats(long size) { + return DataBuffers.ofFloats(size); + } + + /** + * Creates a buffer of doubles that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + static DoubleDataBuffer bufferOfDoubles(long size) { + return DataBuffers.ofDoubles(size); + } + + /** + * Creates a buffer of booleans that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + static BooleanDataBuffer bufferOfBooleans(long size) { + return DataBuffers.ofBooleans(size); + } + + /** + * Create a buffer from an array of floats into a data buffer. + * + * @param array array of floats + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static FloatDataBuffer bufferOfFloats(float[] array, boolean readOnly, boolean makeCopy) { + return DataBuffers.from(array, readOnly, makeCopy); + } + + /** + * Create a buffer from an array of bytes into a data buffer. + * + * @param array array of bytes + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static ByteDataBuffer bufferOfBytes(byte[] array, boolean readOnly, boolean makeCopy) { + return DataBuffers.from(array, readOnly, makeCopy); + } + + /** + * Create a buffer from an array of longs into a data buffer. + * + * @param array array of longs + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static LongDataBuffer bufferOfLongs(long[] array, boolean readOnly, boolean makeCopy) { + return DataBuffers.from(array, readOnly, makeCopy); + } + + /** + * Create a buffer from an array of ints into a data buffer. + * + * @param array array of ints + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static IntDataBuffer bufferOfInts(int[] array, boolean readOnly, boolean makeCopy) { + return DataBuffers.from(array, readOnly, makeCopy); + } + + /** + * Create a buffer from an array of shorts into a data buffer. + * + * @param array array of shorts + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static ShortDataBuffer bufferOfShorts(short[] array, boolean readOnly, boolean makeCopy) { + return DataBuffers.from(array, readOnly, makeCopy); + } + + /** + * Create a buffer from an array of doubles into a data buffer. + * + * @param array array of doubles + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static DoubleDataBuffer bufferOfDoubles(double[] array, boolean readOnly, boolean makeCopy) { + return DataBuffers.from(array, readOnly, makeCopy); + } + + /** + * Create a buffer from an array of booleans into a data buffer. + * + * @param array array of booleans + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static BooleanDataBuffer bufferOfBooleans(boolean[] array, boolean readOnly, boolean makeCopy) { + return DataBuffers.from(array, readOnly, makeCopy); + } + + /** + * Create a buffer from an array of objects into a data buffer. + * + * @param array array of objects + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static DataBuffer bufferOfObjects(T[] array, boolean readOnly, boolean makeCopy) { + return DataBuffers.from(array, readOnly, makeCopy); + } + + /** + * Creates an N-dimensional array of the given shape. + * + *

All values are initialized to zeros. + * + * @param clazz class of the data to be stored in this array + * @param shape shape of the array + * @return new N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + static NdArray ndArrayOfObjects(Class clazz, Shape shape) { + return NdArrays.ofObjects(clazz, shape); + } + + /** + * Creates a byte N-dimensional array of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new byte N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + static ByteNdArray ndArrayOfBytes(Shape shape) { + return NdArrays.ofBytes(shape); + } + + /** + * Creates a short N-dimensional array of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new short N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + static ShortNdArray ndArrayOfShorts(Shape shape) { + return NdArrays.ofShorts(shape); + } + + /** + * Creates an int N-dimensional array of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new int N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + static IntNdArray ndArrayOfInts(Shape shape) { + return NdArrays.ofInts(shape); + } + + /** + * Creates a long N-dimensional array of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new long N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + static LongNdArray ndArrayOfLongs(Shape shape) { + return NdArrays.ofLongs(shape); + } + + /** + * Creates a float N-dimensional array of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new float N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + static FloatNdArray ndArrayOfFloats(Shape shape) { + return NdArrays.ofFloats(shape); + } + + /** + * Creates a double N-dimensional array of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new double N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + static DoubleNdArray ndArrayOfDoubles(Shape shape) { + return NdArrays.ofDoubles(shape); + } + + /** + * Creates a boolean N-dimensional array of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new boolean N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + static BooleanNdArray ndArrayOfBooleans(Shape shape) { + return NdArrays.ofBooleans(shape); + } + + /** + * Wraps a buffer in an N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + static NdArray ndArrayOf(DataBuffer buffer, Shape shape) { + return NdArrays.wrap(buffer, shape); + } + + /** + * Wraps a byte buffer in an N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new byte N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + static ByteNdArray ndArrayOf(ByteDataBuffer buffer, Shape shape) { + return NdArrays.wrap(buffer, shape); + } + + /** + * Wraps a short buffer in an N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new short N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + static ShortNdArray ndArrayOf(ShortDataBuffer buffer, Shape shape) { + return NdArrays.wrap(buffer, shape); + } + + /** + * Wraps an int buffer in an N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new int N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + static IntNdArray ndArrayOf(IntDataBuffer buffer, Shape shape) { + return NdArrays.wrap(buffer, shape); + } + + /** + * Wraps a long buffer in an N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new long N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + static LongNdArray ndArrayOf(LongDataBuffer buffer, Shape shape) { + return NdArrays.wrap(buffer, shape); + } + + /** + * Wraps a float buffer in an N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new float N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + static FloatNdArray ndArrayOf(FloatDataBuffer buffer, Shape shape) { + return NdArrays.wrap(buffer, shape); + } + + /** + * Wraps a double buffer in an N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new double N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + static DoubleNdArray ndArrayOf(DoubleDataBuffer buffer, Shape shape) { + return NdArrays.wrap(buffer, shape); + } + + /** + * Wraps a boolean buffer in an N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new boolean N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + static BooleanNdArray ndArrayOf(BooleanDataBuffer buffer, Shape shape) { + return NdArrays.wrap(buffer, shape); + } + + /** + * Creates scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new scalar + */ + static NdArray scalarOfObject(T value) { + return NdArrays.scalarOfObject(value); + } + + /** + * Creates byte scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new byte scalar + */ + static ByteNdArray scalarOf(byte value) { + return NdArrays.scalarOf(value); + } + + /** + * Creates short scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new short scalar + */ + static ShortNdArray scalarOf(short value) { + return NdArrays.scalarOf(value); + } + + /** + * Creates int scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new int scalar + */ + static IntNdArray scalarOf(int value) { + return NdArrays.scalarOf(value); + } + + /** + * Creates long scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new long scalar + */ + static LongNdArray scalarOf(long value) { + return NdArrays.scalarOf(value); + } + + /** + * Creates float scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new float scalar + */ + static FloatNdArray scalarOf(float value) { + return NdArrays.scalarOf(value); + } + + /** + * Creates double scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new double scalar + */ + static DoubleNdArray scalarOf(double value) { + return NdArrays.scalarOf(value); + } + + /** + * Creates boolean scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new boolean scalar + */ + static BooleanNdArray scalarOf(boolean value) { + return NdArrays.scalarOf(value); + } + + /** + * Creates a vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new vector + * @throws IllegalArgumentException if values is null + */ + static NdArray vectorOfObjects(T... values) { + return NdArrays.vectorOfObjects(values); + } + + /** + * Creates a byte vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new byte vector + * @throws IllegalArgumentException if values is null + */ + static ByteNdArray vectorOf(byte... values) { + return NdArrays.vectorOf(values); + } + + /** + * Creates a short vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new short vector + * @throws IllegalArgumentException if values is null + */ + static ShortNdArray vectorOf(short... values) { + return NdArrays.vectorOf(values); + } + + /** + * Creates an int vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new int vector + * @throws IllegalArgumentException if values is null + */ + static IntNdArray vectorOf(int... values) { + return NdArrays.vectorOf(values); + } + + /** + * Creates a long vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new long vector + * @throws IllegalArgumentException if values is null + */ + static LongNdArray vectorOf(long... values) { + return NdArrays.vectorOf(values); + } + + /** + * Creates a float vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new float vector + * @throws IllegalArgumentException if values is null + */ + static FloatNdArray vectorOf(float... values) { + return NdArrays.vectorOf(values); + } + + /** + * Creates a double vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new double vector + * @throws IllegalArgumentException if values is null + */ + static DoubleNdArray vectorOf(double... values) { + return NdArrays.vectorOf(values); + } + + /** + * Creates a boolean vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new boolean vector + * @throws IllegalArgumentException if values is null + */ + static BooleanNdArray vectorOf(boolean... values) { + return NdArrays.vectorOf(values); + } + + /** + * Create a Shape representing an N-dimensional value. + * + * @param dimensionSize size of each dimension in the shape, {@link Shape#UNKNOWN_SIZE} if unknown + * @see Shape#make(long...) + */ + static Shape shapeOf(long... dimensionSize) { + return Shape.make(dimensionSize); + } + + /** + * A coordinate that selects a specific element on a given dimension. + * + * @param coord coordinate of the element on the indexed axis + * @return index + * @see Indices#at(long) + */ + static Index at(long coord) { + return Indices.at(coord); + } + + /** + * A coordinate that selects a specific element on a given dimension. + * + * @param coord scalar indicating the coordinate of the element on the indexed axis + * @return index + * @throws IllegalRankException if {@code coord} is not a scalar (rank 0) + * @see Indices#at(NdArray) + */ + static Index at(NdArray coord) { + return Indices.at(coord); + } + + /** + * An index that returns all elements of a dimension in the original order. + * + * @return index + * @see Indices#all() + */ + static Index all() { + return Indices.all(); + } + + /** + * An index that returns only specific elements on a given dimension. + * + * @param coords coordinate of the elements in the sequence + * @return index + * @see Indices#seq(long...) + */ + static Index seq(long... coords) { + return Indices.seq(coords); + } + + /** + * An index that returns only specific elements on a given dimension. + * + * @param coords vector of coordinates of the elements in the sequence + * @return index + * @throws IllegalRankException if {@code coord} is not a vector (rank 1) + * @see Indices#seq(NdArray) + */ + static Index seq(NdArray coords) { + return Indices.seq(coords); + } + + /** + * An index that returns only specific elements on a given dimension. + * + * @return index + * @see Indices#even() + */ + static Index even() { + return Indices.even(); + } + + /** + * An index that returns only elements found at an odd position in the + * original dimension. + * + * @return index + * @see Indices#odd() + */ + static Index odd() { + return Indices.odd(); + } + + /** + * An index that skips a fixed amount of coordinates between each values returned. + * + * @param stepLength the number of elements between each steps + * @return index + * @see Indices#step(long) + */ + static Index step(long stepLength) { + return Indices.step(stepLength); + } + + /** + * An index that returns only elements on a given dimension starting at a + * specific coordinate. + * + * @param start coordinate of the first element of the sequence + * @return index + * @see Indices#from(long) + */ + static Index from(long start) { + return Indices.from(start); + } + + /** + * An index that returns only elements on a given dimension up to a + * specific coordinate. + * + * @param end coordinate of the last element of the sequence (exclusive) + * @return index + * @see Indices#to(long) + */ + static Index to(long end) { + return Indices.to(end); + } + + /** + * An index that returns only elements on a given dimension between two coordinates. + * + * @param start coordinate of the first element of the sequence + * @param end coordinate of the last element of the sequence (exclusive) + * @return index + * @see Indices#range(long, long) + */ + static Index range(long start, long end) { + return Indices.range(start, end); + } + + /** + * An index that returns only elements on a given dimension between two coordinates. + * + * @return index + * @see Indices#flip() + */ + static Index flip() { + return Indices.flip(); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/BooleanDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/BooleanDataBuffer.java new file mode 100644 index 00000000000..177178bebfb --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/BooleanDataBuffer.java @@ -0,0 +1,153 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** + * A {@link DataBuffer} of booleans. + */ +public interface BooleanDataBuffer extends DataBuffer { + + /** + * Reads the boolean at the given index. + * + * @param index the index from which the float will be read + * @return the boolean at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + boolean getBoolean(long index); + + /** + * Writes the given boolean into this buffer at the given index. + * + * @param value the boolean to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + BooleanDataBuffer setBoolean(boolean value, long index); + + /** + * Bulk get method, using boolean arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code dst.length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default BooleanDataBuffer read(boolean[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using boolean arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from this buffer into the given array + * starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + BooleanDataBuffer read(boolean[] dst, int offset, int length); + + /** + * Bulk put method, using boolean arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code src.length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default BooleanDataBuffer write(boolean[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using boolean arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from the given array into this buffer, + * starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + BooleanDataBuffer write(boolean[] src, int offset, int length); + + @Override + default Boolean getObject(long index) { + return getBoolean(index); + } + + @Override + default BooleanDataBuffer setObject(Boolean value, long index) { + return setBoolean(value, index); + } + + @Override + BooleanDataBuffer copyTo(DataBuffer dst, long size); + + @Override + BooleanDataBuffer offset(long index); + + @Override + BooleanDataBuffer narrow(long size); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/ByteDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/ByteDataBuffer.java new file mode 100644 index 00000000000..56bd35b9954 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/ByteDataBuffer.java @@ -0,0 +1,153 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** + * A {@link DataBuffer} of bytes. + */ +public interface ByteDataBuffer extends DataBuffer { + + /** + * Reads the byte at the given index. + * + * @param index the index from which the float will be read + * @return the byte at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + byte getByte(long index); + + /** + * Writes the given byte into this buffer at the given index. + * + * @param value the byte to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + ByteDataBuffer setByte(byte value, long index); + + /** + * Bulk get method, using byte arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code dst.length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default ByteDataBuffer read(byte[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using byte arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from this buffer into the given array + * starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + ByteDataBuffer read(byte[] dst, int offset, int length); + + /** + * Bulk put method, using byte arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code src.length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default ByteDataBuffer write(byte[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using byte arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from the given array into this buffer, + * starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + ByteDataBuffer write(byte[] src, int offset, int length); + + @Override + default Byte getObject(long index) { + return getByte(index); + } + + @Override + default ByteDataBuffer setObject(Byte value, long index) { + return setByte(value, index); + } + + @Override + ByteDataBuffer copyTo(DataBuffer dst, long size); + + @Override + ByteDataBuffer offset(long index); + + @Override + ByteDataBuffer narrow(long size); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/DataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/DataBuffer.java new file mode 100644 index 00000000000..5e2b89bae7b --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/DataBuffer.java @@ -0,0 +1,137 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.buffer; + +import java.nio.ReadOnlyBufferException; + +/** + * A container of data of a specific type. + * + *

Instances of {@code DataBuffer} map native or heap memory segments to a linear view that + * supports: + *

    + *
  • 64-bits indexing, allowing to work with buffer larger than 231 bytes
  • + *
  • Storage of object of any types and not only primitives
  • + *
  • Generic types allows to work directly with boxed types as well, which does not require + * explicit buffer types as with the standard JDK buffers. + *
+ * It is important to note that there is no guarantee the memory managed by a {@code DataBuffer} + * is linear, specially when dealing with non-primitive types or large buffers. + * + * @param type of data stored in this buffer + */ +public interface DataBuffer { + + /** + * Size of the buffer, in elements. + *

+ * For exemple, in case of a byte buffer, this value is equal to the number of bytes this buffer + * can hold. For an integer buffer, it is equal to the number of integers, therefore the size + * in bytes of this buffer is {@code size() * Integer.BYTES}. + * + * @return the buffer size + */ + long size(); + + /** + * Tells whether or not this buffer is backed by an accessible array. + * + * @return true if, and only if, this buffer is read-only + */ + boolean isReadOnly(); + + /** + * Reads the value at the given index. + * + * Important: Usage of this method should be limited to buffers of non-primitive types or + * when the data type is not deterministically known by the caller. In any other case, prefer + * the usage of its primitive variant which will significantly improve performances + * (e.g. {@code IntDataBuffer.getInt(idx)} + * + * @param index the index from which the float will be read + * @return the value at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + T getObject(long index); + + /** + * Writes the given value into this buffer at the given index. + * + * Important: Usage of this method should be limited to buffers of non-primitive types or + * when the data type is not deterministically known by the caller. In any other case, prefer + * the usage of its primitive variant which will significantly improve performances + * (e.g. {@code IntDataBuffer.setInt(idx)} + * + * @param value the value to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + DataBuffer setObject(T value, long index); + + /** + * Copy data of this buffer in the given buffer. + *

+ * If there are more values to copy than the destination buffer size, i.e. + * {@code size > dst.size()}, then no values are transferred and a + * BufferOverflowException is thrown. On the other hand, if there are more values to copy that + * the source buffer size, i.e. {@code > src.size()}, then a BufferUnderfloatException is thrown. + *

+ * Otherwise, this method copies {@code n = size} values from this buffer into + * the destination buffer. + * + * @param dst the destination buffer into which values are copied; must not be this buffer + * @param size number of values to copy to the destination buffer + * @return this buffer + * @throws IllegalArgumentException if the destination buffer is this buffer + * @throws ReadOnlyBufferException if the destination buffer is read-only + * @throws java.nio.BufferOverflowException if there is not enough space in destination buffer + * @throws java.nio.BufferUnderflowException if there are not enough values in the source buffer + */ + DataBuffer copyTo(DataBuffer dst, long size); + + /** + * Creates a new buffer whose content is a shared subsequence of this buffer's content, starting + * at the given index. + *

+ * The index must not be greater than this buffer size. Changes to this buffer's content will + * be visible in the new buffer and vice versa. The new buffer will be read-only if, and only if, + * this buffer is read-only. + * + * @param index index of the first value of the new buffer created, must not be greater than + * {@code size()} + * @return the new buffer + * @throws IllegalArgumentException if index do not pass validation checks + */ + DataBuffer offset(long index); + + /** + * Creates a new buffer whose content is a shared subsequence of this buffer's content, whose + * size is set to the given value. + *

+ * The new size must not be greater than this buffer size. Changes to this buffer's + * content will be visible in the new buffer and vice versa. The new buffer will be read-only if, + * and only if, this buffer is read-only. + * + * @param size size of this new buffer, must not be greater than {@code size()} + * @return the new buffer + * @throws IllegalArgumentException if size value do not pass validation checks + */ + DataBuffer narrow(long size); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/DataBuffers.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/DataBuffers.java new file mode 100644 index 00000000000..6363548b89a --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/DataBuffers.java @@ -0,0 +1,556 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import java.lang.reflect.Array; +import java.nio.ByteBuffer; +import java.nio.DoubleBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; +import java.nio.ShortBuffer; +import java.util.Arrays; +import java.util.BitSet; +import org.tensorflow.tools.buffer.impl.Validator; +import org.tensorflow.tools.buffer.impl.adapter.DataBufferAdapterFactory; +import org.tensorflow.tools.buffer.impl.misc.MiscDataBufferFactory; +import org.tensorflow.tools.buffer.impl.nio.NioDataBufferFactory; +import org.tensorflow.tools.buffer.impl.raw.RawDataBufferFactory; +import org.tensorflow.tools.buffer.layout.BooleanDataLayout; +import org.tensorflow.tools.buffer.layout.DataLayout; +import org.tensorflow.tools.buffer.layout.DoubleDataLayout; +import org.tensorflow.tools.buffer.layout.FloatDataLayout; +import org.tensorflow.tools.buffer.layout.IntDataLayout; +import org.tensorflow.tools.buffer.layout.LongDataLayout; +import org.tensorflow.tools.buffer.layout.ShortDataLayout; + +/** + * Helper class for creating {@code DataBuffer} instances. + */ +public final class DataBuffers { + + /** + * Creates a buffer of bytes that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static ByteDataBuffer ofBytes(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new byte[(int)size], false); + } + return NioDataBufferFactory.create(ByteBuffer.allocate((int)size)); + } + + /** + * Creates a buffer of longs that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static LongDataBuffer ofLongs(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new long[(int)size], false); + } + return NioDataBufferFactory.create(LongBuffer.allocate((int)size)); + } + + /** + * Creates a buffer of integers that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static IntDataBuffer ofInts(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new int[(int)size], false); + } + return NioDataBufferFactory.create(IntBuffer.allocate((int)size)); + } + + /** + * Creates a buffer of shorts that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static ShortDataBuffer ofShorts(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new short[(int)size], false); + } + return NioDataBufferFactory.create(ShortBuffer.allocate((int)size)); + } + + /** + * Creates a buffer of doubles that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static DoubleDataBuffer ofDoubles(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new double[(int)size], false); + } + return NioDataBufferFactory.create(DoubleBuffer.allocate((int)size)); + } + + /** + * Creates a buffer of floats that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static FloatDataBuffer ofFloats(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new float[(int)size], false); + } + return NioDataBufferFactory.create(FloatBuffer.allocate((int)size)); + } + + /** + * Creates a buffer of booleans that can store up to {@code size} values + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static BooleanDataBuffer ofBooleans(long size) { + Validator.createArgs(size, MAX_32BITS); + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(new boolean[(int)size], false); + } + return MiscDataBufferFactory.create(new BitSet((int)size), size, false); + } + + /** + * Creates a buffer of references to objects of type {@code clazz` that can store up to `size} + * values. + * + * @param type the type of object stored in this buffer + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static DataBuffer ofObjects(Class type, long size) { + Validator.createArgs(size, MAX_32BITS); + @SuppressWarnings("unchecked") + T[] array = (T[])Array.newInstance(type, (int)size); + return MiscDataBufferFactory.create(array, false); + } + + /** + * Creates a virtual buffer of longs that can store up to {@code size} values. + * + *

The provided layout is used to create the long values to/from bytes, allowing custom + * representation of a long. + * + * @param size size of the buffer to allocate + * @param layout an object converting buffer data to longs + * @return a new buffer + */ + public static LongDataBuffer ofLongs(long size, LongDataLayout layout) { + Validator.createArgs(size, MAX_32BITS); + return toLongs(ofBytes(size * layout.sizeInBytes()), layout); + } + + /** + * Creates a virtual buffer of integers that can store up to {@code size} values. + * + *

The provided layout is used to create the integer values to/from bytes, allowing custom + * representation of an integer. + * + * @param size size of the buffer to allocate + * @param layout an object converting buffer data to integers + * @return a new buffer + */ + public static IntDataBuffer ofInts(long size, IntDataLayout layout) { + Validator.createArgs(size, MAX_32BITS); + return toInts(ofBytes(size * layout.sizeInBytes()), layout); + } + + /** + * Creates a virtual buffer of shorts that can store up to {@code size} values. + * + *

The provided layout is used to create the short values to/from bytes, allowing custom + * representation of a short. + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static ShortDataBuffer ofShorts(long size, ShortDataLayout layout) { + Validator.createArgs(size, MAX_32BITS); + return toShorts(ofBytes(size * layout.sizeInBytes()), layout); + } + + /** + * Creates a virtual buffer of doubles that can store up to {@code size} values. + * + *

The provided layout is used to create the double values to/from bytes, allowing custom + * representation of a double. + * + * @param size size of the buffer to allocate + * @param layout an object converting buffer data to doubles + * @return a new buffer + */ + public static DoubleDataBuffer ofDoubles(long size, DoubleDataLayout layout) { + Validator.createArgs(size, MAX_32BITS); + return toDoubles(ofBytes(size * layout.sizeInBytes()), layout); + } + + /** + * Creates a virtual buffer of floats that can store up to {@code size} values. + * + *

The provided layout is used to create the float values to/from bytes, allowing custom + * representation of a float. + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static FloatDataBuffer ofFloats(long size, FloatDataLayout layout) { + Validator.createArgs(size, MAX_32BITS); + return toFloats(ofBytes(size * layout.sizeInBytes()), layout); + } + + /** + * Creates a virtual buffer of booleans that can store up to {@code size} values. + * + *

The provided layout is used to create the boolean values to/from bytes, allowing custom + * representation of a boolean. + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static BooleanDataBuffer ofBooleans(long size, BooleanDataLayout layout) { + Validator.createArgs(size, MAX_32BITS); + return toBooleans(ofBytes(size * layout.sizeInBytes()), layout); + } + + /** + * Creates a virtual buffer that can store up to {@code size} values. + * + *

The provided layout is used to create the values to/from bytes, allowing custom + * representation of this buffer type. + * + * @param size size of the buffer to allocate + * @return a new buffer + */ + public static DataBuffer ofObjects(long size, DataLayout layout) { + Validator.createArgs(size, MAX_32BITS); + return toObjects(ofBytes(size * layout.sizeInBytes()), layout); + } + + /** + * Adapt a physical buffer to a virtual buffer of longs. + * + *

The provided layout is used to create the long values to/from bytes, allowing custom + * representation of a long integer. + * + * @param buffer the buffer to adapt + * @param layout an object converting buffer data to integers + * @return a new buffer + */ + public static LongDataBuffer toLongs(ByteDataBuffer buffer, LongDataLayout layout) { + return DataBufferAdapterFactory.create(buffer, layout); + } + + /** + * Adapt a physical buffer to a virtual buffer of integers. + * + *

The provided layout is used to create the integer values to/from bytes, allowing custom + * representation of a integer. + * + * @param buffer the buffer to adapt + * @param layout an object converting buffer data to integers + * @return a new buffer + */ + public static IntDataBuffer toInts(ByteDataBuffer buffer, IntDataLayout layout) { + return DataBufferAdapterFactory.create(buffer, layout); + } + + /** + * Adapt a physical buffer to a virtual buffer of shorts. + * + *

The provided layout is used to create the short values to/from bytes, allowing custom + * representation of a short. + * + * @param buffer the buffer to adapt + * @param layout an object converting buffer data to shorts + * @return a new buffer + */ + public static ShortDataBuffer toShorts(ByteDataBuffer buffer, ShortDataLayout layout) { + return DataBufferAdapterFactory.create(buffer, layout); + } + + /** + * Adapt a physical buffer to a virtual buffer of doubles. + * + *

The provided layout is used to create the double values to/from bytes, allowing custom + * representation of a double. + * + * @param buffer the buffer to adapt + * @param layout an object converting buffer data to doubles + * @return a new buffer + */ + public static DoubleDataBuffer toDoubles(ByteDataBuffer buffer, DoubleDataLayout layout) { + return DataBufferAdapterFactory.create(buffer, layout); + } + + /** + * Adapt a physical buffer to a virtual buffer of floats. + * + *

The provided layout is used to create the float values to/from bytes, allowing custom + * representation of a float. + * + * @param buffer the buffer to adapt + * @param layout an object converting buffer data to floats + * @return a new buffer + */ + public static FloatDataBuffer toFloats(ByteDataBuffer buffer, FloatDataLayout layout) { + return DataBufferAdapterFactory.create(buffer, layout); + } + + /** + * Adapt a physical buffer to a virtual buffer of booleans. + * + *

The provided layout is used to create the boolean values to/from bytes, allowing custom + * representation of a boolean. + * + * @param buffer the buffer to adapt + * @param layout an object converting buffer data to booleans + * @return a new buffer + */ + public static BooleanDataBuffer toBooleans(ByteDataBuffer buffer, BooleanDataLayout layout) { + return DataBufferAdapterFactory.create(buffer, layout); + } + + /** + * Adapt a physical buffer to a virtual buffer. + * + *

The provided layout is used to create the values to/from bytes, allowing custom + * representation of this buffer type. + * + * @param buffer the buffer to adapt + * @param layout an object converting buffer data to booleans + * @return a new buffer + */ + public static DataBuffer toObjects(ByteDataBuffer buffer, DataLayout layout) { + return DataBufferAdapterFactory.create(buffer, layout); + } + + /** + * Create a buffer from an array of floats into a data buffer. + * + * @param array array of floats + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static FloatDataBuffer from(float[] array, boolean readOnly, boolean makeCopy) { + float[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + FloatBuffer buf = FloatBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of bytes into a data buffer. + * + * @param array array of bytes + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static ByteDataBuffer from(byte[] array, boolean readOnly, boolean makeCopy) { + byte[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + ByteBuffer buf = ByteBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of longs into a data buffer. + * + * @param array array of longs + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static LongDataBuffer from(long[] array, boolean readOnly, boolean makeCopy) { + long[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + LongBuffer buf = LongBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of ints into a data buffer. + * + * @param array array of ints + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static IntDataBuffer from(int[] array, boolean readOnly, boolean makeCopy) { + int[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + IntBuffer buf = IntBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of shorts into a data buffer. + * + * @param array array of shorts + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static ShortDataBuffer from(short[] array, boolean readOnly, boolean makeCopy) { + short[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + ShortBuffer buf = ShortBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of doubles into a data buffer. + * + * @param array array of doubles + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static DoubleDataBuffer from(double[] array, boolean readOnly, boolean makeCopy) { + double[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + DoubleBuffer buf = DoubleBuffer.wrap(bufferArray); + return NioDataBufferFactory.create(readOnly ? buf.asReadOnlyBuffer() : buf); + } + + /** + * Create a buffer from an array of booleans into a data buffer. + * + * @param array array of booleans + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static BooleanDataBuffer from(boolean[] array, boolean readOnly, boolean makeCopy) { + boolean[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + if (RawDataBufferFactory.canBeUsed()) { + return RawDataBufferFactory.create(bufferArray, readOnly); + } + return MiscDataBufferFactory.create(bufferArray, readOnly); + } + + /** + * Create a buffer from an array of objects into a data buffer. + * + * @param array array of objects + * @param readOnly true if the buffer created must be read-only + * @param makeCopy true if the array must be copied, false will wrap the provided array + * @return a new buffer + */ + public static DataBuffer from(T[] array, boolean readOnly, boolean makeCopy) { + T[] bufferArray = makeCopy ? Arrays.copyOf(array, array.length) : array; + return MiscDataBufferFactory.create(bufferArray, readOnly); + } + + /** + * Wraps a JDK NIO {@link ByteBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static ByteDataBuffer from(ByteBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link IntBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static IntDataBuffer from(IntBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link ShortBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static ShortDataBuffer from(ShortBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link LongBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static LongDataBuffer from(LongBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link FloatBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static FloatDataBuffer from(FloatBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /** + * Wraps a JDK NIO {@link DoubleBuffer} into a data buffer. + * + * @param buf buffer to wrap + * @return a new buffer + */ + public static DoubleDataBuffer from(DoubleBuffer buf) { + return NioDataBufferFactory.create(buf.duplicate()); + } + + /* + * The maximum size for a buffer of this type, i.e. the maximum number of bytes it can store. + *

+ * As the maximum size may vary depending on the JVM implementation and on the platform, this + * property returns a value that is safe for most of them. + */ + static long MAX_32BITS = Integer.MAX_VALUE - 10; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/DoubleDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/DoubleDataBuffer.java new file mode 100644 index 00000000000..143f3c5f18d --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/DoubleDataBuffer.java @@ -0,0 +1,153 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** + * A {@link DataBuffer} of doubles. + */ +public interface DoubleDataBuffer extends DataBuffer { + + /** + * Reads the double at the given index. + * + * @param index the index from which the float will be read + * @return the double at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + double getDouble(long index); + + /** + * Writes the given double into this buffer at the given index. + * + * @param value the double to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + DoubleDataBuffer setDouble(double value, long index); + + /** + * Bulk get method, using double arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code dst.length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default DoubleDataBuffer read(double[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using double arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from this buffer into the given array + * starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + DoubleDataBuffer read(double[] dst, int offset, int length); + + /** + * Bulk put method, using double arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code src.length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default DoubleDataBuffer write(double[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using double arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from the given array into this buffer, + * starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + DoubleDataBuffer write(double[] src, int offset, int length); + + @Override + default Double getObject(long index) { + return getDouble(index); + } + + @Override + default DoubleDataBuffer setObject(Double value, long index) { + return setDouble(value, index); + } + + @Override + DoubleDataBuffer copyTo(DataBuffer dst, long size); + + @Override + DoubleDataBuffer offset(long index); + + @Override + DoubleDataBuffer narrow(long size); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/FloatDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/FloatDataBuffer.java new file mode 100644 index 00000000000..2cfdf2dafcb --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/FloatDataBuffer.java @@ -0,0 +1,153 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** + * A {@link DataBuffer} of floats. + */ +public interface FloatDataBuffer extends DataBuffer { + + /** + * Reads the float at the given index. + * + * @param index the index from which the float will be read + * @return the float at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + float getFloat(long index); + + /** + * Writes the given float into this buffer at the given index. + * + * @param value the float to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + FloatDataBuffer setFloat(float value, long index); + + /** + * Bulk get method, using float arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code dst.length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default FloatDataBuffer read(float[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using float arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from this buffer into the given array + * starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + FloatDataBuffer read(float[] dst, int offset, int length); + + /** + * Bulk put method, using float arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code src.length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default FloatDataBuffer write(float[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using float arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from the given array into this buffer, + * starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + FloatDataBuffer write(float[] src, int offset, int length); + + @Override + default Float getObject(long index) { + return getFloat(index); + } + + @Override + default FloatDataBuffer setObject(Float value, long index) { + return setFloat(value, index); + } + + @Override + FloatDataBuffer copyTo(DataBuffer dst, long size); + + @Override + FloatDataBuffer offset(long index); + + @Override + FloatDataBuffer narrow(long size); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/IntDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/IntDataBuffer.java new file mode 100644 index 00000000000..728a6be686b --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/IntDataBuffer.java @@ -0,0 +1,153 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** + * A {@link DataBuffer} of ints. + */ +public interface IntDataBuffer extends DataBuffer { + + /** + * Reads the int at the given index. + * + * @param index the index from which the float will be read + * @return the int at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + int getInt(long index); + + /** + * Writes the given int into this buffer at the given index. + * + * @param value the int to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + IntDataBuffer setInt(int value, long index); + + /** + * Bulk get method, using int arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code dst.length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default IntDataBuffer read(int[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using int arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from this buffer into the given array + * starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + IntDataBuffer read(int[] dst, int offset, int length); + + /** + * Bulk put method, using int arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code src.length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default IntDataBuffer write(int[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using int arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from the given array into this buffer, + * starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + IntDataBuffer write(int[] src, int offset, int length); + + @Override + default Integer getObject(long index) { + return getInt(index); + } + + @Override + default IntDataBuffer setObject(Integer value, long index) { + return setInt(value, index); + } + + @Override + IntDataBuffer copyTo(DataBuffer dst, long size); + + @Override + IntDataBuffer offset(long index); + + @Override + IntDataBuffer narrow(long size); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/LongDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/LongDataBuffer.java new file mode 100644 index 00000000000..06047ff49c6 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/LongDataBuffer.java @@ -0,0 +1,153 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** + * A {@link DataBuffer} of longs. + */ +public interface LongDataBuffer extends DataBuffer { + + /** + * Reads the long at the given index. + * + * @param index the index from which the float will be read + * @return the long at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + long getLong(long index); + + /** + * Writes the given long into this buffer at the given index. + * + * @param value the long to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + LongDataBuffer setLong(long value, long index); + + /** + * Bulk get method, using long arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code dst.length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default LongDataBuffer read(long[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using long arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from this buffer into the given array + * starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + LongDataBuffer read(long[] dst, int offset, int length); + + /** + * Bulk put method, using long arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code src.length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default LongDataBuffer write(long[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using long arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from the given array into this buffer, + * starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + LongDataBuffer write(long[] src, int offset, int length); + + @Override + default Long getObject(long index) { + return getLong(index); + } + + @Override + default LongDataBuffer setObject(Long value, long index) { + return setLong(value, index); + } + + @Override + LongDataBuffer copyTo(DataBuffer dst, long size); + + @Override + LongDataBuffer offset(long index); + + @Override + LongDataBuffer narrow(long size); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/ShortDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/ShortDataBuffer.java new file mode 100644 index 00000000000..3730aed5fcf --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/ShortDataBuffer.java @@ -0,0 +1,153 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; + +/** + * A {@link DataBuffer} of shorts. + */ +public interface ShortDataBuffer extends DataBuffer { + + /** + * Reads the short at the given index. + * + * @param index the index from which the float will be read + * @return the short at the given index + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + */ + short getShort(long index); + + /** + * Writes the given short into this buffer at the given index. + * + * @param value the short to be written + * @param index the index at which the value will be written + * @return this buffer + * @throws IndexOutOfBoundsException if index is negative or not smaller than the buffer size + * @throws ReadOnlyBufferException if this buffer is read-only + */ + ShortDataBuffer setShort(short value, long index); + + /** + * Bulk get method, using short arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code dst.length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = dst.length} values from this buffer into the given + * array. + * + * @param dst the array into which values are to be written + * @return this buffer + * @throws BufferUnderflowException if there are not enough values to copy from this buffer + */ + default ShortDataBuffer read(short[] dst) { + return read(dst, 0, dst.length); + } + + /** + * Bulk get method, using short arrays. + *

+ * This method transfers values from this buffer into the given destination array. If there are + * fewer values in the buffer than are required to satisfy the request, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferUnderflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from this buffer into the given array + * starting at the given offset. + * + * @param dst the array into which values are to be written + * @param offset the offset within the array of the first value to be written; must be + * non-negative and no larger than {@code dst.length} + * @param length the maximum number of values to be written to the given array; must be + * non-negative and no larger than {@code dst.length - offset} + * @return this buffer + * @throws BufferUnderflowException if there are fewer than length values remaining in this buffer + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + */ + ShortDataBuffer read(short[] dst, int offset, int length); + + /** + * Bulk put method, using short arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code src.length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = src.length} values from the given array. + * + * @param src the source array from which values are to be read + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws ReadOnlyBufferException if this buffer is read-only + */ + default ShortDataBuffer write(short[] src) { + return write(src, 0, src.length); + } + + /** + * Bulk put method, using short arrays. + *

+ * This method transfers the values in the given source array into this buffer. If there are + * more values in the source array than in this buffer, that is, if + * {@code length > size()}, then no values are transferred and a + * BufferOverflowException is thrown. + *

+ * Otherwise, this method copies {@code n = length} values from the given array into this buffer, + * starting at the given offset. + * + * @param src the source array from which values are to be read + * @param offset the offset within the array of the first value to be read; must be non-negative + * and no larger than {@code src.length} + * @param length the number of values to be read from the given array; must be non-negative and no + * larger than {@code src.length - offset} + * @return this buffer + * @throws BufferOverflowException if there is insufficient space in this buffer for the values in + * the source array + * @throws IndexOutOfBoundsException if the preconditions on the offset and length parameters do + * not hold + * @throws ReadOnlyBufferException if this buffer is read-only + */ + ShortDataBuffer write(short[] src, int offset, int length); + + @Override + default Short getObject(long index) { + return getShort(index); + } + + @Override + default ShortDataBuffer setObject(Short value, long index) { + return setShort(value, index); + } + + @Override + ShortDataBuffer copyTo(DataBuffer dst, long size); + + @Override + ShortDataBuffer offset(long index); + + @Override + ShortDataBuffer narrow(long size); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/AbstractDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/AbstractDataBuffer.java new file mode 100644 index 00000000000..c3be19f2bfe --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/AbstractDataBuffer.java @@ -0,0 +1,28 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl; + +import org.tensorflow.tools.buffer.DataBuffer; + +public abstract class AbstractDataBuffer implements DataBuffer { + + protected void slowCopyTo(DataBuffer dst, long size) { + for (long idx = 0; idx < size; ++idx) { + dst.setObject(getObject(idx), idx); + } + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/Validator.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/Validator.java new file mode 100644 index 00000000000..91def63b829 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/Validator.java @@ -0,0 +1,117 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.nio.ReadOnlyBufferException; +import org.tensorflow.tools.buffer.DataBuffer; + +public class Validator { + + public static void createArgs(long size, long maxSize) { + if (size < 0) { + throw new IllegalArgumentException("Size must be non-negative"); + } + if (size > maxSize) { + throw new IllegalArgumentException("Buffer size must be no greater than maximum size allowed (" + maxSize + ")"); + } + } + + public static void getArgs(DataBuffer buffer, long index) { + if (index < 0) { + throw new IndexOutOfBoundsException("Index must be non-negative"); + } + if (index >= buffer.size()) { + throw new IndexOutOfBoundsException("Index must be smaller than the buffer size"); + } + } + + public static void setArgs(DataBuffer buffer, long index) { + if (index < 0) { + throw new IndexOutOfBoundsException("Index must be non-negative"); + } + if (index >= buffer.size()) { + throw new IndexOutOfBoundsException("Index must be smaller than the buffer size"); + } + if (buffer.isReadOnly()) { + throw new ReadOnlyBufferException(); + } + } + + public static void copyToArgs(DataBuffer src, DataBuffer dst, long size) { + if (dst == src) { + throw new IllegalArgumentException("Source cannot be the same buffer as destination"); + } + if (size > dst.size()) { + throw new BufferOverflowException(); + } + if (size > src.size()) { + throw new BufferUnderflowException(); + } + if (dst.isReadOnly()) { + throw new ReadOnlyBufferException(); + } + } + + public static void readArgs(DataBuffer buffer, int arrayLength, int offset, int length) { + if (length > buffer.size()) { + throw new BufferUnderflowException(); + } + arrayArgs(arrayLength, offset, length); + } + + public static void writeArgs(DataBuffer buffer, int arrayLength, int offset, int length) { + if (length > buffer.size()) { + throw new BufferOverflowException(); + } + if (buffer.isReadOnly()) { + throw new ReadOnlyBufferException(); + } + arrayArgs(arrayLength, offset, length); + } + + public static void offsetArgs(DataBuffer buffer, long index) { + if (index < 0 || index > buffer.size()) { + throw new IllegalArgumentException(); + } + } + + public static void narrowArgs(DataBuffer buffer, long size) { + if (size < 0) { + throw new IllegalArgumentException("Size must be non-negative"); + } + if (size > buffer.size()) { + throw new IllegalArgumentException("Cannot narrow a buffer of size " + buffer.size() + " to " + size); + } + } + + private static void arrayArgs(int arrayLength, int offset, int length) { + if (offset < 0) { + throw new IndexOutOfBoundsException("Offset must be non-negative"); + } + if (offset > arrayLength) { + throw new IndexOutOfBoundsException("Offset must be no larger than array length"); + } + if (length < 0) { + throw new IndexOutOfBoundsException("Length must be non-negative"); + } + if (length > arrayLength - offset) { + throw new IndexOutOfBoundsException("Length must be no larger than array length minus the offset"); + } + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/AbstractDataBufferAdapter.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/AbstractDataBufferAdapter.java new file mode 100644 index 00000000000..2646278463a --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/AbstractDataBufferAdapter.java @@ -0,0 +1,57 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.impl.AbstractDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; +import org.tensorflow.tools.buffer.layout.DataLayout; + +@SuppressWarnings("unchecked") +abstract class AbstractDataBufferAdapter> extends AbstractDataBuffer { + + @Override + public long size() { + return buffer.size() / layout.sizeInBytes(); + } + + @Override + public boolean isReadOnly() { + return buffer.isReadOnly(); + } + + @Override + public T getObject(long index) { + Validator.getArgs(this, index); + return layout.readValue(buffer, index * layout.sizeInBytes()); + } + + @Override + public B setObject(T value, long index) { + Validator.setArgs(this, index); + layout.writeValue(buffer, value, index * layout.sizeInBytes()); + return (B)this; + } + + @Override + public B copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + slowCopyTo(dst, size); // FIXME anyway to speed up this? + return (B)this; + } + + AbstractDataBufferAdapter(ByteDataBuffer buffer, DataLayout layout) { + this.buffer = buffer; + this.layout = layout; + } + + DataLayout layout() { + return layout; + } + + ByteDataBuffer buffer() { + return buffer; + } + + private final ByteDataBuffer buffer; + private final DataLayout layout; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/BooleanDataBufferAdapter.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/BooleanDataBufferAdapter.java new file mode 100644 index 00000000000..aab90407173 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/BooleanDataBufferAdapter.java @@ -0,0 +1,58 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; +import org.tensorflow.tools.buffer.layout.BooleanDataLayout; + +class BooleanDataBufferAdapter extends AbstractDataBufferAdapter + implements BooleanDataBuffer { + + @Override + public boolean getBoolean(long index) { + Validator.getArgs(this, index); + return layout.readBoolean(buffer(), index * layout.sizeInBytes()); + } + + @Override + public BooleanDataBuffer setBoolean(boolean value, long index) { + Validator.setArgs(this, index); + layout.writeBoolean(buffer(), value, index * layout.sizeInBytes()); + return this; + } + + @Override + public BooleanDataBuffer read(boolean[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readBoolean(buffer(), i * layout.sizeInBytes()); + } + return this; + } + + @Override + public BooleanDataBuffer write(boolean[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeBoolean(buffer(), src[j], i * layout.sizeInBytes()); + } + return this; + } + + @Override + public BooleanDataBuffer offset(long index) { + return new BooleanDataBufferAdapter(buffer().offset(index * layout.sizeInBytes()), layout); + } + + @Override + public BooleanDataBuffer narrow(long size) { + return new BooleanDataBufferAdapter(buffer().narrow(size * layout.sizeInBytes()), layout); + } + + BooleanDataBufferAdapter(ByteDataBuffer physicalBuffer, BooleanDataLayout layout) { + super(physicalBuffer, layout); + this.layout = layout; + } + + private BooleanDataLayout layout; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/DataBufferAdapter.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/DataBufferAdapter.java new file mode 100644 index 00000000000..7a3c07c02c5 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/DataBufferAdapter.java @@ -0,0 +1,23 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.layout.DataLayout; + +@SuppressWarnings("unchecked") +class DataBufferAdapter extends AbstractDataBufferAdapter> { + + @Override + public DataBuffer offset(long index) { + return new DataBufferAdapter<>(buffer().offset(index * layout().sizeInBytes()), layout()); + } + + @Override + public DataBuffer narrow(long size) { + return new DataBufferAdapter<>(buffer().narrow(size * layout().sizeInBytes()), layout()); + } + + DataBufferAdapter(ByteDataBuffer physicalBuffer, DataLayout layout) { + super(physicalBuffer, layout); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/DataBufferAdapterFactory.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/DataBufferAdapterFactory.java new file mode 100644 index 00000000000..0b7128311d1 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/DataBufferAdapterFactory.java @@ -0,0 +1,48 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.buffer.layout.BooleanDataLayout; +import org.tensorflow.tools.buffer.layout.DataLayout; +import org.tensorflow.tools.buffer.layout.DoubleDataLayout; +import org.tensorflow.tools.buffer.layout.FloatDataLayout; +import org.tensorflow.tools.buffer.layout.IntDataLayout; +import org.tensorflow.tools.buffer.layout.LongDataLayout; +import org.tensorflow.tools.buffer.layout.ShortDataLayout; + +public class DataBufferAdapterFactory { + + public static BooleanDataBuffer create(ByteDataBuffer buffer, BooleanDataLayout layout) { + return new BooleanDataBufferAdapter(buffer, layout); + } + + public static DoubleDataBuffer create(ByteDataBuffer buffer, DoubleDataLayout layout) { + return new DoubleDataBufferAdapter(buffer, layout); + } + + public static FloatDataBuffer create(ByteDataBuffer buffer, FloatDataLayout layout) { + return new FloatDataBufferAdapter(buffer, layout); + } + + public static IntDataBuffer create(ByteDataBuffer buffer, IntDataLayout layout) { + return new IntDataBufferAdapter(buffer, layout); + } + + public static LongDataBuffer create(ByteDataBuffer buffer, LongDataLayout layout) { + return new LongDataBufferAdapter(buffer, layout); + } + + public static ShortDataBuffer create(ByteDataBuffer buffer, ShortDataLayout layout) { + return new ShortDataBufferAdapter(buffer, layout); + } + + public static DataBuffer create(ByteDataBuffer buffer, DataLayout layout) { + return new DataBufferAdapter<>(buffer, layout); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/DoubleDataBufferAdapter.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/DoubleDataBufferAdapter.java new file mode 100644 index 00000000000..b3742a4226c --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/DoubleDataBufferAdapter.java @@ -0,0 +1,58 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; +import org.tensorflow.tools.buffer.layout.DoubleDataLayout; + +class DoubleDataBufferAdapter extends AbstractDataBufferAdapter + implements DoubleDataBuffer { + + @Override + public double getDouble(long index) { + Validator.getArgs(this, index); + return layout.readDouble(buffer(), index * layout.sizeInBytes()); + } + + @Override + public DoubleDataBuffer setDouble(double value, long index) { + Validator.setArgs(this, index); + layout.writeDouble(buffer(), value, index * layout.sizeInBytes()); + return this; + } + + @Override + public DoubleDataBuffer read(double[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readDouble(buffer(), i * layout.sizeInBytes()); + } + return this; + } + + @Override + public DoubleDataBuffer write(double[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeDouble(buffer(), src[j], i * layout.sizeInBytes()); + } + return this; + } + + @Override + public DoubleDataBuffer offset(long index) { + return new DoubleDataBufferAdapter(buffer().offset(index * layout.sizeInBytes()), layout); + } + + @Override + public DoubleDataBuffer narrow(long size) { + return new DoubleDataBufferAdapter(buffer().narrow(size * layout.sizeInBytes()), layout); + } + + DoubleDataBufferAdapter(ByteDataBuffer physicalBuffer, DoubleDataLayout layout) { + super(physicalBuffer, layout); + this.layout = layout; + } + + private DoubleDataLayout layout; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/FloatDataBufferAdapter.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/FloatDataBufferAdapter.java new file mode 100644 index 00000000000..9eda9ce2b60 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/FloatDataBufferAdapter.java @@ -0,0 +1,58 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; +import org.tensorflow.tools.buffer.layout.FloatDataLayout; + +class FloatDataBufferAdapter extends AbstractDataBufferAdapter + implements FloatDataBuffer { + + @Override + public float getFloat(long index) { + Validator.getArgs(this, index); + return layout.readFloat(buffer(), index * layout.sizeInBytes()); + } + + @Override + public FloatDataBuffer setFloat(float value, long index) { + Validator.setArgs(this, index); + layout.writeFloat(buffer(), value, index * layout.sizeInBytes()); + return this; + } + + @Override + public FloatDataBuffer read(float[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readFloat(buffer(), i * layout.sizeInBytes()); + } + return this; + } + + @Override + public FloatDataBuffer write(float[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeFloat(buffer(), src[j], i * layout.sizeInBytes()); + } + return this; + } + + @Override + public FloatDataBuffer offset(long index) { + return new FloatDataBufferAdapter(buffer().offset(index * layout.sizeInBytes()), layout); + } + + @Override + public FloatDataBuffer narrow(long size) { + return new FloatDataBufferAdapter(buffer().narrow(size * layout.sizeInBytes()), layout); + } + + FloatDataBufferAdapter(ByteDataBuffer physicalBuffer, FloatDataLayout layout) { + super(physicalBuffer, layout); + this.layout = layout; + } + + private FloatDataLayout layout; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/IntDataBufferAdapter.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/IntDataBufferAdapter.java new file mode 100644 index 00000000000..5aac5fc1ac2 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/IntDataBufferAdapter.java @@ -0,0 +1,58 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; +import org.tensorflow.tools.buffer.layout.IntDataLayout; + +class IntDataBufferAdapter extends AbstractDataBufferAdapter + implements IntDataBuffer { + + @Override + public int getInt(long index) { + Validator.getArgs(this, index); + return layout.readInt(buffer(), index * layout.sizeInBytes()); + } + + @Override + public IntDataBuffer setInt(int value, long index) { + Validator.setArgs(this, index); + layout.writeInt(buffer(), value, index * layout.sizeInBytes()); + return this; + } + + @Override + public IntDataBuffer read(int[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readInt(buffer(), i * layout.sizeInBytes()); + } + return this; + } + + @Override + public IntDataBuffer write(int[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeInt(buffer(), src[j], i * layout.sizeInBytes()); + } + return this; + } + + @Override + public IntDataBuffer offset(long index) { + return new IntDataBufferAdapter(buffer().offset(index * layout.sizeInBytes()), layout); + } + + @Override + public IntDataBuffer narrow(long size) { + return new IntDataBufferAdapter(buffer().narrow(size * layout.sizeInBytes()), layout); + } + + IntDataBufferAdapter(ByteDataBuffer physicalBuffer, IntDataLayout layout) { + super(physicalBuffer, layout); + this.layout = layout; + } + + private IntDataLayout layout; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/LongDataBufferAdapter.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/LongDataBufferAdapter.java new file mode 100644 index 00000000000..dc079aa3da3 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/LongDataBufferAdapter.java @@ -0,0 +1,58 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; +import org.tensorflow.tools.buffer.layout.LongDataLayout; + +class LongDataBufferAdapter extends AbstractDataBufferAdapter + implements LongDataBuffer { + + @Override + public long getLong(long index) { + Validator.getArgs(this, index); + return layout.readLong(buffer(), index * layout.sizeInBytes()); + } + + @Override + public LongDataBuffer setLong(long value, long index) { + Validator.setArgs(this, index); + layout.writeLong(buffer(), value, index * layout.sizeInBytes()); + return this; + } + + @Override + public LongDataBuffer read(long[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readLong(buffer(), i * layout.sizeInBytes()); + } + return this; + } + + @Override + public LongDataBuffer write(long[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeLong(buffer(), src[j], i * layout.sizeInBytes()); + } + return this; + } + + @Override + public LongDataBuffer offset(long index) { + return new LongDataBufferAdapter(buffer().offset(index * layout.sizeInBytes()), layout); + } + + @Override + public LongDataBuffer narrow(long size) { + return new LongDataBufferAdapter(buffer().narrow(size * layout.sizeInBytes()), layout); + } + + LongDataBufferAdapter(ByteDataBuffer physicalBuffer, LongDataLayout layout) { + super(physicalBuffer, layout); + this.layout = layout; + } + + private LongDataLayout layout; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/ShortDataBufferAdapter.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/ShortDataBufferAdapter.java new file mode 100644 index 00000000000..9d793c9bf20 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/adapter/ShortDataBufferAdapter.java @@ -0,0 +1,58 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; +import org.tensorflow.tools.buffer.layout.ShortDataLayout; + +class ShortDataBufferAdapter extends AbstractDataBufferAdapter + implements ShortDataBuffer { + + @Override + public short getShort(long index) { + Validator.getArgs(this, index); + return layout.readShort(buffer(), index * layout.sizeInBytes()); + } + + @Override + public ShortDataBuffer setShort(short value, long index) { + Validator.setArgs(this, index); + layout.writeShort(buffer(), value, index * layout.sizeInBytes()); + return this; + } + + @Override + public ShortDataBuffer read(short[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + dst[j] = layout.readShort(buffer(), i * layout.sizeInBytes()); + } + return this; + } + + @Override + public ShortDataBuffer write(short[] src, int offset, int length) { + Validator.writeArgs(this, src.length, offset, length); + for (int i = 0, j = offset; i < length; ++i, ++j) { + layout.writeShort(buffer(), src[j], i * layout.sizeInBytes()); + } + return this; + } + + @Override + public ShortDataBuffer offset(long index) { + return new ShortDataBufferAdapter(buffer().offset(index * layout.sizeInBytes()), layout); + } + + @Override + public ShortDataBuffer narrow(long size) { + return new ShortDataBufferAdapter(buffer().narrow(size * layout.sizeInBytes()), layout); + } + + ShortDataBufferAdapter(ByteDataBuffer physicalBuffer, ShortDataLayout layout) { + super(physicalBuffer, layout); + this.layout = layout; + } + + private ShortDataLayout layout; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/ArrayDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/ArrayDataBuffer.java new file mode 100644 index 00000000000..fbcb8ce6e64 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/ArrayDataBuffer.java @@ -0,0 +1,87 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.misc; + +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.impl.AbstractDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +class ArrayDataBuffer extends AbstractDataBuffer { + + @Override + public long size() { + return length; + } + + @Override + public boolean isReadOnly() { + return readOnly; + } + + @Override + public T getObject(long index) { + Validator.getArgs(this, index); + return values[(int)index + offset]; + } + + @Override + public DataBuffer setObject(T value, long index) { + Validator.setArgs(this, index); + values[(int)index + offset] = value; + return this; + } + + @Override + public DataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof ArrayDataBuffer) { + ArrayDataBuffer dstBuffer = (ArrayDataBuffer)dst; + System.arraycopy(values, offset, dstBuffer.values, dstBuffer.offset, (int)size); + } else { + slowCopyTo(dst, size); + } + return this; + } + + @Override + public DataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new ArrayDataBuffer<>(values, readOnly, offset + (int)index, length - (int)index); + } + + @Override + public DataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new ArrayDataBuffer<>(values, readOnly, offset, (int)size); + } + + ArrayDataBuffer(T[] values, boolean readOnly) { + this(values, readOnly, 0, values.length); + } + + private ArrayDataBuffer(T[] values, boolean readOnly, int offset, int length) { + this.values = values; + this.readOnly = readOnly; + this.offset = offset; + this.length = length; + } + + private final T[] values; + private final boolean readOnly; + private final int offset; + private final int length; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/BitSetDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/BitSetDataBuffer.java new file mode 100644 index 00000000000..f6e8e4f9bee --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/BitSetDataBuffer.java @@ -0,0 +1,86 @@ +package org.tensorflow.tools.buffer.impl.misc; + +import java.util.BitSet; +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.impl.AbstractDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +class BitSetDataBuffer extends AbstractDataBuffer implements BooleanDataBuffer { + + @Override + public long size() { + return numBits; + } + + @Override + public boolean isReadOnly() { + return readOnly; + } + + @Override + public boolean getBoolean(long index) { + Validator.getArgs(this, index); + return bitSet.get((int)index + offset); + } + + @Override + public BooleanDataBuffer setBoolean(boolean value, long index) { + Validator.setArgs(this, index); + bitSet.set((int)index + offset, value); + return this; + } + + @Override + public BooleanDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + slowCopyTo(dst, size); + return this; + } + + @Override + public BooleanDataBuffer read(boolean[] dst, int offset, int length) { + Validator.readArgs(this, dst.length, offset, length); + for (int i = this.offset, j = offset; i < this.offset + length; ++i, ++j) { + dst[j] = bitSet.get(i); + } + return this; + } + + @Override + public BooleanDataBuffer write(boolean[] src, int offset, int length) { + Validator.readArgs(this, src.length, offset, length); + for (int i = this.offset, j = offset; i < this.offset + length; ++i, ++j) { + bitSet.set(i, src[j]); + } + return this; + } + + @Override + public BooleanDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new BitSetDataBuffer(bitSet, numBits - index, readOnly, offset + (int)index); + } + + @Override + public BooleanDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new BitSetDataBuffer(bitSet, size, readOnly, offset); + } + + BitSetDataBuffer(BitSet bitSet, long numBits, boolean readOnly) { + this(bitSet, numBits, readOnly, 0); + } + + private BitSetDataBuffer(BitSet bitSet, long numBits, boolean readOnly, int offset) { + this.bitSet = bitSet; + this.numBits = numBits; + this.readOnly = readOnly; + this.offset = offset; + } + + private final BitSet bitSet; + private final long numBits; + private final boolean readOnly; + private final int offset; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/BooleanArrayDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/BooleanArrayDataBuffer.java new file mode 100644 index 00000000000..3a9274572a6 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/BooleanArrayDataBuffer.java @@ -0,0 +1,101 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.misc; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.impl.AbstractDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +class BooleanArrayDataBuffer extends AbstractDataBuffer implements + BooleanDataBuffer { + + @Override + public long size() { + return length; + } + + @Override + public boolean isReadOnly() { + return readOnly; + } + + @Override + public boolean getBoolean(long index) { + Validator.getArgs(this, index); + return values[(int)index + offset]; + } + + @Override + public BooleanDataBuffer setBoolean(boolean value, long index) { + Validator.setArgs(this, index); + values[(int)index + offset] = value; + return this; + } + + @Override + public BooleanDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof BooleanArrayDataBuffer) { + BooleanArrayDataBuffer dstBuffer = (BooleanArrayDataBuffer)dst; + System.arraycopy(values, offset, dstBuffer.values, dstBuffer.offset, length); + } else { + slowCopyTo(dst, size); + } + return this; + } + + @Override + public BooleanDataBuffer read(boolean[] dst, int offset, int length) { + System.arraycopy(values, this.offset, dst, offset, length); + return this; + } + + @Override + public BooleanDataBuffer write(boolean[] src, int offset, int length) { + System.arraycopy(src, offset, values, this.offset, length); + return null; + } + + @Override + public BooleanDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new BooleanArrayDataBuffer(values, readOnly, offset + (int)index, length - (int)index); + } + + @Override + public BooleanDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new BooleanArrayDataBuffer(values, readOnly, offset, (int)size); + } + + BooleanArrayDataBuffer(boolean[] values, boolean readOnly) { + this(values, readOnly, 0, values.length); + } + + private BooleanArrayDataBuffer(boolean[] values, boolean readOnly, int offset, int length) { + this.values = values; + this.readOnly = readOnly; + this.offset = offset; + this.length = length; + } + + private final boolean[] values; + private final boolean readOnly; + private final int offset; + private final int length; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/MiscDataBufferFactory.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/MiscDataBufferFactory.java new file mode 100644 index 00000000000..4c9b4900f40 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/misc/MiscDataBufferFactory.java @@ -0,0 +1,23 @@ +package org.tensorflow.tools.buffer.impl.misc; + +import java.util.BitSet; +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; + +/** + * Factory of miscellaneous data buffers + */ +public class MiscDataBufferFactory { + + public static BooleanDataBuffer create(BitSet bitSet, long numBits, boolean readOnly) { + return new BitSetDataBuffer(bitSet, numBits, readOnly); + } + + public static BooleanDataBuffer create(boolean[] array, boolean readOnly) { + return new BooleanArrayDataBuffer(array, readOnly); + } + + public static DataBuffer create(T[] array, boolean readOnly) { + return new ArrayDataBuffer<>(array, readOnly); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/AbstractNioDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/AbstractNioDataBuffer.java new file mode 100644 index 00000000000..e751737f1ab --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/AbstractNioDataBuffer.java @@ -0,0 +1,49 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.Buffer; +import org.tensorflow.tools.buffer.impl.AbstractDataBuffer; + +/** + * Base class for all JDK-based data buffers. + * + * @param type of elements (or values) stored in this buffer + */ +abstract class AbstractNioDataBuffer extends AbstractDataBuffer { + + /** + * The maximum size for a buffer of this type, i.e. the maximum number of bytes it can store. + *

+ * As the maximum size may vary depending on the JVM implementation and on the platform, this + * property returns a value that is safe for most of them. + */ + public static long MAX_SIZE = Integer.MAX_VALUE - 10; + + @Override + public long size() { + return buf().capacity(); + } + + @Override + public boolean isReadOnly() { + return buf().isReadOnly(); + } + + abstract Buffer buf(); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/ByteNioDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/ByteNioDataBuffer.java new file mode 100644 index 00000000000..454b3e4c80f --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/ByteNioDataBuffer.java @@ -0,0 +1,89 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.ByteBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +/** + * A buffer of bytes using a JDK {@link ByteBuffer} for storage. + */ +final class ByteNioDataBuffer extends AbstractNioDataBuffer + implements ByteDataBuffer { + + @Override + public byte getByte(long index) { + return buf.get((int)index); + } + + @Override + public ByteDataBuffer setByte(byte value, long index) { + buf.put((int)index, value); + return this; + } + + @Override + public ByteDataBuffer read(byte[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public ByteDataBuffer write(byte[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public ByteDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof ByteNioDataBuffer) { + ByteBuffer dstBuf = ((ByteNioDataBuffer)dst).buf.duplicate(); + ByteBuffer srcBuf = (ByteBuffer)buf.duplicate().limit((int)size); + dstBuf.put(srcBuf); + } else { + slowCopyTo(dst, size); + } + return this; + } + + @Override + public ByteDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new ByteNioDataBuffer(((ByteBuffer)buf.duplicate().position((int)index)).slice()); + } + + @Override + public ByteDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new ByteNioDataBuffer(((ByteBuffer)buf.duplicate().limit((int)size)).slice()); + } + + @Override + ByteBuffer buf() { + return buf; + } + + ByteNioDataBuffer(ByteBuffer buf) { + this.buf = buf; + } + + private ByteBuffer buf; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/DoubleNioDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/DoubleNioDataBuffer.java new file mode 100644 index 00000000000..2ae708224d6 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/DoubleNioDataBuffer.java @@ -0,0 +1,89 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.DoubleBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +/** + * A buffer of bytes using a JDK {@link DoubleBuffer} for storage. + */ +final class DoubleNioDataBuffer extends AbstractNioDataBuffer + implements DoubleDataBuffer { + + @Override + public double getDouble(long index) { + return buf.get((int)index); + } + + @Override + public DoubleDataBuffer setDouble(double value, long index) { + buf.put((int)index, value); + return this; + } + + @Override + public DoubleDataBuffer read(double[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public DoubleDataBuffer write(double[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public DoubleDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof DoubleNioDataBuffer) { + DoubleBuffer dstBuf = ((DoubleNioDataBuffer)dst).buf.duplicate(); + DoubleBuffer srcBuf = (DoubleBuffer)buf.duplicate().limit((int)size); + dstBuf.put(srcBuf); + } else { + slowCopyTo(dst, size); + } + return this; + } + + @Override + public DoubleDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new DoubleNioDataBuffer(((DoubleBuffer)buf.duplicate().position((int)index)).slice()); + } + + @Override + public DoubleDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new DoubleNioDataBuffer(((DoubleBuffer)buf.duplicate().limit((int)size)).slice()); + } + + @Override + DoubleBuffer buf() { + return buf; + } + + DoubleNioDataBuffer(DoubleBuffer buf) { + this.buf = buf; + } + + private DoubleBuffer buf; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/FloatNioDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/FloatNioDataBuffer.java new file mode 100644 index 00000000000..71e9ca338f6 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/FloatNioDataBuffer.java @@ -0,0 +1,89 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.FloatBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +/** + * A buffer of bytes using a JDK {@link FloatBuffer} for storage. + */ +final class FloatNioDataBuffer extends AbstractNioDataBuffer + implements FloatDataBuffer { + + @Override + public float getFloat(long index) { + return buf.get((int)index); + } + + @Override + public FloatDataBuffer setFloat(float value, long index) { + buf.put((int)index, value); + return this; + } + + @Override + public FloatDataBuffer read(float[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public FloatDataBuffer write(float[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public FloatDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof FloatNioDataBuffer) { + FloatBuffer dstBuf = ((FloatNioDataBuffer)dst).buf.duplicate(); + FloatBuffer srcBuf = (FloatBuffer)buf.duplicate().limit((int)size); + dstBuf.put(srcBuf); + } else { + slowCopyTo(dst, size); + } + return this; + } + + @Override + public FloatDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new FloatNioDataBuffer(((FloatBuffer)buf.duplicate().position((int)index)).slice()); + } + + @Override + public FloatDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new FloatNioDataBuffer(((FloatBuffer)buf.duplicate().limit((int)size)).slice()); + } + + @Override + FloatBuffer buf() { + return buf; + } + + FloatNioDataBuffer(FloatBuffer buf) { + this.buf = buf; + } + + private FloatBuffer buf; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/IntNioDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/IntNioDataBuffer.java new file mode 100644 index 00000000000..31b465381d4 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/IntNioDataBuffer.java @@ -0,0 +1,89 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.IntBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +/** + * A buffer of bytes using a JDK {@link IntBuffer} for storage. + */ +final class IntNioDataBuffer extends AbstractNioDataBuffer + implements IntDataBuffer { + + @Override + public int getInt(long index) { + return buf.get((int)index); + } + + @Override + public IntDataBuffer setInt(int value, long index) { + buf.put((int)index, value); + return this; + } + + @Override + public IntDataBuffer read(int[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public IntDataBuffer write(int[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public IntDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof IntNioDataBuffer) { + IntBuffer dstBuf = ((IntNioDataBuffer)dst).buf.duplicate(); + IntBuffer srcBuf = (IntBuffer)buf.duplicate().limit((int)size); + dstBuf.put(srcBuf); + } else { + slowCopyTo(dst, size); + } + return this; + } + + @Override + public IntDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new IntNioDataBuffer(((IntBuffer)buf.duplicate().position((int)index)).slice()); + } + + @Override + public IntDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new IntNioDataBuffer(((IntBuffer)buf.duplicate().limit((int)size)).slice()); + } + + @Override + IntBuffer buf() { + return buf; + } + + IntNioDataBuffer(IntBuffer buf) { + this.buf = buf; + } + + private IntBuffer buf; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/LongNioDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/LongNioDataBuffer.java new file mode 100644 index 00000000000..6f6da502542 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/LongNioDataBuffer.java @@ -0,0 +1,89 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.LongBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +/** + * A buffer of bytes using a JDK {@link LongBuffer} for storage. + */ +final class LongNioDataBuffer extends AbstractNioDataBuffer + implements LongDataBuffer { + + @Override + public long getLong(long index) { + return buf.get((int)index); + } + + @Override + public LongDataBuffer setLong(long value, long index) { + buf.put((int)index, value); + return this; + } + + @Override + public LongDataBuffer read(long[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public LongDataBuffer write(long[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public LongDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof LongNioDataBuffer) { + LongBuffer dstBuf = ((LongNioDataBuffer)dst).buf.duplicate(); + LongBuffer srcBuf = (LongBuffer)buf.duplicate().limit((int)size); + dstBuf.put(srcBuf); + } else { + slowCopyTo(dst, size); + } + return this; + } + + @Override + public LongDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new LongNioDataBuffer(((LongBuffer)buf.duplicate().position((int)index)).slice()); + } + + @Override + public LongDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new LongNioDataBuffer(((LongBuffer)buf.duplicate().limit((int)size)).slice()); + } + + @Override + LongBuffer buf() { + return buf; + } + + LongNioDataBuffer(LongBuffer buf) { + this.buf = buf; + } + + private LongBuffer buf; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/NioDataBufferFactory.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/NioDataBufferFactory.java new file mode 100644 index 00000000000..ee8376f194c --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/NioDataBufferFactory.java @@ -0,0 +1,44 @@ +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.ByteBuffer; +import java.nio.DoubleBuffer; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.LongBuffer; +import java.nio.ShortBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; + +/** + * Factory of JDK NIO-based data buffers + */ +public class NioDataBufferFactory { + + public static ByteDataBuffer create(ByteBuffer buffer) { + return new ByteNioDataBuffer(buffer); + } + + public static DoubleDataBuffer create(DoubleBuffer buffer) { + return new DoubleNioDataBuffer(buffer); + } + + public static FloatDataBuffer create(FloatBuffer buffer) { + return new FloatNioDataBuffer(buffer); + } + + public static IntDataBuffer create(IntBuffer buffer) { + return new IntNioDataBuffer(buffer); + } + + public static LongDataBuffer create(LongBuffer buffer) { + return new LongNioDataBuffer(buffer); + } + + public static ShortDataBuffer create(ShortBuffer buffer) { + return new ShortNioDataBuffer(buffer); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/ShortNioDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/ShortNioDataBuffer.java new file mode 100644 index 00000000000..6a6d7c2b607 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/nio/ShortNioDataBuffer.java @@ -0,0 +1,89 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.ShortBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +/** + * A buffer of bytes using a JDK {@link ShortBuffer} for storage. + */ +final class ShortNioDataBuffer extends AbstractNioDataBuffer + implements ShortDataBuffer { + + @Override + public short getShort(long index) { + return buf.get((int)index); + } + + @Override + public ShortDataBuffer setShort(short value, long index) { + buf.put((int)index, value); + return this; + } + + @Override + public ShortDataBuffer read(short[] dst, int offset, int length) { + buf.duplicate().get(dst, offset, length); + return this; + } + + @Override + public ShortDataBuffer write(short[] src, int offset, int length) { + buf.duplicate().put(src, offset, length); + return this; + } + + @Override + public ShortDataBuffer copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof ShortNioDataBuffer) { + ShortBuffer dstBuf = ((ShortNioDataBuffer)dst).buf.duplicate(); + ShortBuffer srcBuf = (ShortBuffer)buf.duplicate().limit((int)size); + dstBuf.put(srcBuf); + } else { + slowCopyTo(dst, size); + } + return this; + } + + @Override + public ShortDataBuffer offset(long index) { + Validator.offsetArgs(this, index); + return new ShortNioDataBuffer(((ShortBuffer)buf.duplicate().position((int)index)).slice()); + } + + @Override + public ShortDataBuffer narrow(long size) { + Validator.narrowArgs(this, size); + return new ShortNioDataBuffer(((ShortBuffer)buf.duplicate().limit((int)size)).slice()); + } + + @Override + ShortBuffer buf() { + return buf; + } + + ShortNioDataBuffer(ShortBuffer buf) { + this.buf = buf; + } + + private ShortBuffer buf; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/AbstractRawDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/AbstractRawDataBuffer.java new file mode 100644 index 00000000000..f3bc9a4732b --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/AbstractRawDataBuffer.java @@ -0,0 +1,76 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.impl.AbstractDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +@SuppressWarnings("unchecked") +abstract class AbstractRawDataBuffer> extends AbstractDataBuffer { + + public long size() { + return memory.size(); + } + + @Override + public boolean isReadOnly() { + return readOnly; + } + + public B read(Object dst, int dstLength) { + Validator.readArgs(this, dstLength, 0, dstLength); + memory.copyTo(UnsafeMemoryHandle.fromArray(dst, dstLength), dstLength); + return (B)this; + } + + public B read(Object dst, int dstLength, int offset, int length) { + Validator.readArgs(this, dstLength, offset, length); + memory.copyTo(UnsafeMemoryHandle.fromArray(dst, dstLength).offset(offset), length); + return (B)this; + } + + public B write(Object src, int srcLength) { + Validator.writeArgs(this, srcLength, 0, srcLength); + UnsafeMemoryHandle.fromArray(src, srcLength).copyTo(memory, srcLength); + return (B)this; + } + + public B write(Object src, int srcLength, int offset, int length) { + Validator.writeArgs(this, srcLength, offset, length); + UnsafeMemoryHandle.fromArray(src, srcLength).offset(offset).copyTo(memory, length); + return (B)this; + } + + @Override + public B copyTo(DataBuffer dst, long size) { + Validator.copyToArgs(this, dst, size); + if (dst instanceof AbstractRawDataBuffer) { + AbstractRawDataBuffer unsafeDst = (AbstractRawDataBuffer)dst; + memory.copyTo(unsafeDst.memory, size); + } else { + slowCopyTo(dst, size); + } + return (B)this; + } + + @Override + public B offset(long index) { + Validator.offsetArgs(this, index); + return instantiate(memory.offset(index)); + } + + @Override + public B narrow(long size) { + Validator.narrowArgs(this, size); + return instantiate(memory.narrow(size)); + } + + protected final UnsafeMemoryHandle memory; + protected final boolean readOnly; + + protected abstract B instantiate(UnsafeMemoryHandle region); + + AbstractRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + this.memory = memory; + this.readOnly = readOnly; + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/BooleanRawDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/BooleanRawDataBuffer.java new file mode 100644 index 00000000000..5c77cab830f --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/BooleanRawDataBuffer.java @@ -0,0 +1,50 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +final class BooleanRawDataBuffer extends AbstractRawDataBuffer + implements BooleanDataBuffer { + + @Override + public boolean getBoolean(long index) { + Validator.getArgs(this, index); + return memory.getBoolean(index); + } + + @Override + public BooleanDataBuffer setBoolean(boolean value, long index) { + Validator.setArgs(this, index); + memory.setBoolean(value, index); + return this; + } + + @Override + public BooleanDataBuffer read(boolean[] dst) { + return read(dst, dst.length); + } + + @Override + public BooleanDataBuffer read(boolean[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public BooleanDataBuffer write(boolean[] src) { + return write(src, src.length); + } + + @Override + public BooleanDataBuffer write(boolean[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + protected BooleanDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new BooleanRawDataBuffer(memory, readOnly); + } + + BooleanRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/ByteRawDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/ByteRawDataBuffer.java new file mode 100644 index 00000000000..7db87abdefc --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/ByteRawDataBuffer.java @@ -0,0 +1,50 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +final class ByteRawDataBuffer extends AbstractRawDataBuffer + implements ByteDataBuffer { + + @Override + public byte getByte(long index) { + Validator.getArgs(this, index); + return memory.getByte(index); + } + + @Override + public ByteDataBuffer setByte(byte value, long index) { + Validator.setArgs(this, index); + memory.setByte(value, index); + return this; + } + + @Override + public ByteDataBuffer read(byte[] dst) { + return read(dst, dst.length); + } + + @Override + public ByteDataBuffer read(byte[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public ByteDataBuffer write(byte[] src) { + return write(src, src.length); + } + + @Override + public ByteDataBuffer write(byte[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + protected ByteDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new ByteRawDataBuffer(memory, readOnly); + } + + ByteRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/DoubleRawDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/DoubleRawDataBuffer.java new file mode 100644 index 00000000000..f75ed44ff4a --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/DoubleRawDataBuffer.java @@ -0,0 +1,50 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +final class DoubleRawDataBuffer extends AbstractRawDataBuffer + implements DoubleDataBuffer { + + @Override + public double getDouble(long index) { + Validator.getArgs(this, index); + return memory.getDouble(index); + } + + @Override + public DoubleDataBuffer setDouble(double value, long index) { + Validator.setArgs(this, index); + memory.setDouble(value, index); + return this; + } + + @Override + public DoubleDataBuffer read(double[] dst) { + return read(dst, dst.length); + } + + @Override + public DoubleDataBuffer read(double[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public DoubleDataBuffer write(double[] src) { + return write(src, src.length); + } + + @Override + public DoubleDataBuffer write(double[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + protected DoubleDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new DoubleRawDataBuffer(memory, readOnly); + } + + DoubleRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/FloatRawDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/FloatRawDataBuffer.java new file mode 100644 index 00000000000..2c9e5c43a0d --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/FloatRawDataBuffer.java @@ -0,0 +1,50 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +final class FloatRawDataBuffer extends AbstractRawDataBuffer + implements FloatDataBuffer { + + @Override + public float getFloat(long index) { + Validator.getArgs(this, index); + return memory.getFloat(index); + } + + @Override + public FloatDataBuffer setFloat(float value, long index) { + Validator.setArgs(this, index); + memory.setFloat(value, index); + return this; + } + + @Override + public FloatDataBuffer read(float[] dst) { + return read(dst, dst.length); + } + + @Override + public FloatDataBuffer read(float[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public FloatDataBuffer write(float[] src) { + return write(src, src.length); + } + + @Override + public FloatDataBuffer write(float[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + protected FloatDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new FloatRawDataBuffer(memory, readOnly); + } + + FloatRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/IntRawDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/IntRawDataBuffer.java new file mode 100644 index 00000000000..5d819d3d7d7 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/IntRawDataBuffer.java @@ -0,0 +1,50 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +final class IntRawDataBuffer extends AbstractRawDataBuffer + implements IntDataBuffer { + + @Override + public int getInt(long index) { + Validator.getArgs(this, index); + return memory.getInt(index); + } + + @Override + public IntDataBuffer setInt(int value, long index) { + Validator.setArgs(this, index); + memory.setInt(value, index); + return this; + } + + @Override + public IntDataBuffer read(int[] dst) { + return read(dst, dst.length); + } + + @Override + public IntDataBuffer read(int[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public IntDataBuffer write(int[] src) { + return write(src, src.length); + } + + @Override + public IntDataBuffer write(int[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + protected IntDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new IntRawDataBuffer(memory, readOnly); + } + + IntRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/LongRawDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/LongRawDataBuffer.java new file mode 100644 index 00000000000..f65e648d1b7 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/LongRawDataBuffer.java @@ -0,0 +1,50 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +final class LongRawDataBuffer extends AbstractRawDataBuffer + implements LongDataBuffer { + + @Override + public long getLong(long index) { + Validator.getArgs(this, index); + return memory.getLong(index); + } + + @Override + public LongDataBuffer setLong(long value, long index) { + Validator.setArgs(this, index); + memory.setLong(value, index); + return this; + } + + @Override + public LongDataBuffer read(long[] dst) { + return read(dst, dst.length); + } + + @Override + public LongDataBuffer read(long[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public LongDataBuffer write(long[] src) { + return write(src, src.length); + } + + @Override + public LongDataBuffer write(long[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + protected LongDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new LongRawDataBuffer(memory, readOnly); + } + + LongRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/RawDataBufferFactory.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/RawDataBufferFactory.java new file mode 100644 index 00000000000..39a21d01289 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/RawDataBufferFactory.java @@ -0,0 +1,131 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +/** + * Factory of raw data buffers + */ +public class RawDataBufferFactory { + + public static boolean canBeUsed() { + return UnsafeReference.isAvailable(); + } + + public static BooleanDataBuffer create(boolean[] array, boolean readOnly) { + return new BooleanRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static ByteDataBuffer create(byte[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new ByteRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static DoubleDataBuffer create(double[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new DoubleRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static FloatDataBuffer create(float[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new FloatRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static IntDataBuffer create(int[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new IntRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static LongDataBuffer create(long[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new LongRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + public static ShortDataBuffer create(short[] array, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + return new ShortRawDataBuffer(UnsafeMemoryHandle.fromArray(array, array.length), readOnly); + } + + protected static BooleanDataBuffer mapNativeBooleans(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new BooleanRawDataBuffer(UnsafeMemoryHandle.fromAddress(address, size, Byte.BYTES), readOnly); + } + + protected static ByteDataBuffer mapNativeBytes(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new ByteRawDataBuffer(UnsafeMemoryHandle.fromAddress(address, size, Byte.BYTES), readOnly); + } + + protected static DoubleDataBuffer mapNativeDoubles(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new DoubleRawDataBuffer(UnsafeMemoryHandle.fromAddress(address, size, Double.BYTES), readOnly); + } + + protected static FloatDataBuffer mapNativeFloats(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new FloatRawDataBuffer(UnsafeMemoryHandle.fromAddress(address, size, Float.BYTES), readOnly); + } + + protected static IntDataBuffer mapNativeInts(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new IntRawDataBuffer(UnsafeMemoryHandle.fromAddress(address, size, Integer.BYTES), readOnly); + } + + protected static LongDataBuffer mapNativeLongs(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new LongRawDataBuffer(UnsafeMemoryHandle.fromAddress(address, size, Long.BYTES), readOnly); + } + + protected static ShortDataBuffer mapNativeShorts(long address, long size, boolean readOnly) { + if (!canBeUsed()) { + throw new IllegalStateException("Raw data buffers are not available"); + } + Validator.createArgs(size, MAX_64BITS); + return new ShortRawDataBuffer(UnsafeMemoryHandle.fromAddress(address, size, Short.BYTES), readOnly); + } + + /* + * The maximum size for a buffer of this type, i.e. the maximum number of bytes it can store. + *

+ * As the maximum size may vary depending on the JVM implementation and on the platform, this + * property returns a value that is safe for most of them. + */ + static long MAX_32BITS = Integer.MAX_VALUE - 10; + static long MAX_64BITS = Long.MAX_VALUE - 10; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/ShortRawDataBuffer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/ShortRawDataBuffer.java new file mode 100644 index 00000000000..d41f56cb556 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/ShortRawDataBuffer.java @@ -0,0 +1,50 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.buffer.impl.Validator; + +final class ShortRawDataBuffer extends AbstractRawDataBuffer + implements ShortDataBuffer { + + @Override + public short getShort(long index) { + Validator.getArgs(this, index); + return memory.getShort(index); + } + + @Override + public ShortDataBuffer setShort(short value, long index) { + Validator.setArgs(this, index); + memory.setShort(value, index); + return this; + } + + @Override + public ShortDataBuffer read(short[] dst) { + return read(dst, dst.length); + } + + @Override + public ShortDataBuffer read(short[] dst, int offset, int length) { + return read(dst, dst.length, offset, length); + } + + @Override + public ShortDataBuffer write(short[] src) { + return write(src, src.length); + } + + @Override + public ShortDataBuffer write(short[] src, int offset, int length) { + return write(src, src.length, offset, length); + } + + @Override + protected ShortDataBuffer instantiate(UnsafeMemoryHandle memory) { + return new ShortRawDataBuffer(memory, readOnly); + } + + ShortRawDataBuffer(UnsafeMemoryHandle memory, boolean readOnly) { + super(memory, readOnly); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/UnsafeMemoryHandle.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/UnsafeMemoryHandle.java new file mode 100644 index 00000000000..9312f4147b6 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/UnsafeMemoryHandle.java @@ -0,0 +1,107 @@ +package org.tensorflow.tools.buffer.impl.raw; + +final class UnsafeMemoryHandle { + + static UnsafeMemoryHandle fromArray(Object array, int length) { + long byteOffset = UnsafeReference.UNSAFE.arrayBaseOffset(array.getClass()); + long scale = UnsafeReference.UNSAFE.arrayIndexScale(array.getClass()); + return new UnsafeMemoryHandle(array, byteOffset, length * scale, scale); + } + + static UnsafeMemoryHandle fromAddress(long address, long byteSize, long scale) { + return new UnsafeMemoryHandle(null, address, byteSize, scale); + } + + long size() { + return byteSize / scale; + } + + byte getByte(long index) { + return UnsafeReference.UNSAFE.getByte(object, align(index)); + } + + void setByte(byte value, long index) { + UnsafeReference.UNSAFE.putByte(object, align(index), value); + } + + boolean getBoolean(long index) { + return UnsafeReference.UNSAFE.getBoolean(object, align(index)); + } + + void setBoolean(boolean value, long index) { + UnsafeReference.UNSAFE.putBoolean(object, align(index), value); + } + + short getShort(long index) { + return UnsafeReference.UNSAFE.getShort(object, align(index)); + } + + void setShort(short value, long index) { + UnsafeReference.UNSAFE.putShort(object, align(index), value); + } + + int getInt(long index) { + return UnsafeReference.UNSAFE.getInt(object, align(index)); + } + + void setInt(int value, long index) { + UnsafeReference.UNSAFE.putInt(object, align(index), value); + } + + float getFloat(long index) { + return UnsafeReference.UNSAFE.getFloat(object, align(index)); + } + + void setFloat(float value, long index) { + UnsafeReference.UNSAFE.putFloat(object, align(index), value); + } + + double getDouble(long index) { + return UnsafeReference.UNSAFE.getDouble(object, align(index)); + } + + void setDouble(double value, long index) { + UnsafeReference.UNSAFE.putDouble(object, align(index), value); + } + + long getLong(long index) { + return UnsafeReference.UNSAFE.getLong(object, align(index)); + } + + void setLong(long value, long index) { + UnsafeReference.UNSAFE.putLong(object, align(index), value); + } + + void copyTo(UnsafeMemoryHandle memory, long length) { + UnsafeReference.UNSAFE.copyMemory(object, byteOffset, memory.object, memory.byteOffset, length * scale); + } + + UnsafeMemoryHandle offset(long index) { + long offset = scale(index); + return new UnsafeMemoryHandle(object, this.byteOffset + offset, byteSize - offset, scale); + } + + UnsafeMemoryHandle narrow(long size) { + return new UnsafeMemoryHandle(object, byteOffset, scale(size), scale); + } + + private final Object object; + private final long byteOffset; + private final long byteSize; + private final long scale; + + private UnsafeMemoryHandle(Object object, long byteOffset, long byteSize, long scale) { + this.object = object; + this.byteOffset = byteOffset; + this.byteSize = byteSize; + this.scale = scale; + } + + private long align(long index) { + return byteOffset + index * scale; + } + + private long scale(long value) { + return value * scale; + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/UnsafeReference.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/UnsafeReference.java new file mode 100644 index 00000000000..d07c449e100 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/impl/raw/UnsafeReference.java @@ -0,0 +1,47 @@ +package org.tensorflow.tools.buffer.impl.raw; + +import java.lang.reflect.Field; +import sun.misc.Unsafe; + +final class UnsafeReference { + + static boolean isAvailable() { + return UNSAFE != null; + } + + static final Unsafe UNSAFE; + + static { + Unsafe unsafe = null; + try { + Class clazz = Class.forName("sun.misc.Unsafe"); + Field theUnsafe = clazz.getDeclaredField("theUnsafe"); + theUnsafe.setAccessible(true); + Object instance = theUnsafe.get(null); + if (instance.getClass() == clazz) { + // Validate that this Unsafe instance exposes all methods we need + clazz.getDeclaredMethod("getByte", Object.class, long.class); + clazz.getDeclaredMethod("putByte", Object.class, long.class, byte.class); + clazz.getDeclaredMethod("getShort", Object.class, long.class); + clazz.getDeclaredMethod("putShort", Object.class, long.class, short.class); + clazz.getDeclaredMethod("getInt", Object.class, long.class); + clazz.getDeclaredMethod("putInt", Object.class, long.class, int.class); + clazz.getDeclaredMethod("getLong", Object.class, long.class); + clazz.getDeclaredMethod("putLong", Object.class, long.class, long.class); + clazz.getDeclaredMethod("getFloat", Object.class, long.class); + clazz.getDeclaredMethod("putFloat", Object.class, long.class, float.class); + clazz.getDeclaredMethod("getDouble", Object.class, long.class); + clazz.getDeclaredMethod("putDouble", Object.class, long.class, double.class); + clazz.getDeclaredMethod("getBoolean", Object.class, long.class); + clazz.getDeclaredMethod("putBoolean", Object.class, long.class, boolean.class); + clazz.getDeclaredMethod("copyMemory", Object.class, long.class, Object.class, long.class, long.class); + clazz.getDeclaredMethod("arrayBaseOffset", Class.class); + clazz.getDeclaredMethod("arrayIndexScale", Class.class); + unsafe = (Unsafe) instance; + } + } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException | SecurityException | IllegalAccessException | ClassCastException ex) { + // Do nothing, keep unsafe as null + } + UNSAFE = unsafe; + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/BooleanDataLayout.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/BooleanDataLayout.java new file mode 100644 index 00000000000..88c8d7ae798 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/BooleanDataLayout.java @@ -0,0 +1,36 @@ +package org.tensorflow.tools.buffer.layout; + +import org.tensorflow.tools.buffer.ByteDataBuffer; + +/** + * Converts a boolean to/from bytes + */ +public interface BooleanDataLayout extends DataLayout { + + /** + * Writes a boolean as bytes to the given buffer at its current position. + * @param buffer buffer that receives the value as bytes + * @param value value + * @param index byte index of the value to write + */ + void writeBoolean(ByteDataBuffer buffer, boolean value, long index); + + /** + * Reads a boolean as bytes from the given buffer at its current position. + * + * @param buffer buffer that supplies the value as bytes + * @param index byte index of the value to read + * @return value + */ + boolean readBoolean(ByteDataBuffer buffer, long index); + + @Override + default void writeValue(ByteDataBuffer buffer, Boolean value, long index) { + writeBoolean(buffer, value, index); + } + + @Override + default Boolean readValue(ByteDataBuffer buffer, long index) { + return readBoolean(buffer, index); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/DataLayout.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/DataLayout.java new file mode 100644 index 00000000000..7c0c742a44c --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/DataLayout.java @@ -0,0 +1,34 @@ +package org.tensorflow.tools.buffer.layout; + +import org.tensorflow.tools.buffer.ByteDataBuffer; + +/** + * Converts a value of a given type to/from bytes + * + * @param value type + */ +public interface DataLayout { + + /** + * Writes a value as bytes to the given buffer at its current position. + * + * @param buffer buffer that receives the value as bytes + * @param value value + * @param index index of the value to write + */ + void writeValue(ByteDataBuffer buffer, T value, long index); + + /** + * Reads a value as bytes from the given buffer at its current position. + * + * @param buffer buffer that supplies the value as bytes + * @param index index of the value to read + * @return value + */ + T readValue(ByteDataBuffer buffer, long index); + + /** + * Returns the number of bytes required to represent a single value + */ + int sizeInBytes(); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/DoubleDataLayout.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/DoubleDataLayout.java new file mode 100644 index 00000000000..9f37c266f2b --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/DoubleDataLayout.java @@ -0,0 +1,36 @@ +package org.tensorflow.tools.buffer.layout; + +import org.tensorflow.tools.buffer.ByteDataBuffer; + +/** + * Converts a double to/from bytes + */ +public interface DoubleDataLayout extends DataLayout { + + /** + * Writes a double as bytes to the given buffer at its current position. + * @param buffer buffer that receives the value as bytes + * @param value value + * @param index byte index of the value to write + */ + void writeDouble(ByteDataBuffer buffer, double value, long index); + + /** + * Reads a double as bytes from the given buffer at its current position. + * + * @param buffer buffer that supplies the value as bytes + * @param index byte index of the value to read + * @return value + */ + double readDouble(ByteDataBuffer buffer, long index); + + @Override + default void writeValue(ByteDataBuffer buffer, Double value, long index) { + writeDouble(buffer, value, index); + } + + @Override + default Double readValue(ByteDataBuffer buffer, long index) { + return readDouble(buffer, index); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/FloatDataLayout.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/FloatDataLayout.java new file mode 100644 index 00000000000..2d4f5454186 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/FloatDataLayout.java @@ -0,0 +1,36 @@ +package org.tensorflow.tools.buffer.layout; + +import org.tensorflow.tools.buffer.ByteDataBuffer; + +/** + * Converts a float to/from bytes + */ +public interface FloatDataLayout extends DataLayout { + + /** + * Writes a float as bytes to the given buffer at its current position. + * @param buffer buffer that receives the value as bytes + * @param value value + * @param index byte index of the value to write + */ + void writeFloat(ByteDataBuffer buffer, float value, long index); + + /** + * Reads a float as bytes from the given buffer at its current position. + * + * @param buffer buffer that supplies the value as bytes + * @param index byte index of the value to read + * @return value + */ + float readFloat(ByteDataBuffer buffer, long index); + + @Override + default void writeValue(ByteDataBuffer buffer, Float value, long index) { + writeFloat(buffer, value, index); + } + + @Override + default Float readValue(ByteDataBuffer buffer, long index) { + return readFloat(buffer, index); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/IntDataLayout.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/IntDataLayout.java new file mode 100644 index 00000000000..278d4747b62 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/IntDataLayout.java @@ -0,0 +1,36 @@ +package org.tensorflow.tools.buffer.layout; + +import org.tensorflow.tools.buffer.ByteDataBuffer; + +/** + * Converts a int to/from bytes + */ +public interface IntDataLayout extends DataLayout { + + /** + * Writes a int as bytes to the given buffer at its current position. + * @param buffer buffer that receives the value as bytes + * @param value value + * @param index byte index of the value to write + */ + void writeInt(ByteDataBuffer buffer, int value, long index); + + /** + * Reads a int as bytes from the given buffer at its current position. + * + * @param buffer buffer that supplies the value as bytes + * @param index byte index of the value to read + * @return value + */ + int readInt(ByteDataBuffer buffer, long index); + + @Override + default void writeValue(ByteDataBuffer buffer, Integer value, long index) { + writeInt(buffer, value, index); + } + + @Override + default Integer readValue(ByteDataBuffer buffer, long index) { + return readInt(buffer, index); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/LongDataLayout.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/LongDataLayout.java new file mode 100644 index 00000000000..eaca14c9239 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/LongDataLayout.java @@ -0,0 +1,36 @@ +package org.tensorflow.tools.buffer.layout; + +import org.tensorflow.tools.buffer.ByteDataBuffer; + +/** + * Converts a long to/from bytes + */ +public interface LongDataLayout extends DataLayout { + + /** + * Writes a long as bytes to the given buffer at its current position. + * @param buffer buffer that receives the value as bytes + * @param value value + * @param index byte index of the value to write + */ + void writeLong(ByteDataBuffer buffer, long value, long index); + + /** + * Reads a long as bytes from the given buffer at its current position. + * + * @param buffer buffer that supplies the value as bytes + * @param index byte index of the value to read + * @return value + */ + long readLong(ByteDataBuffer buffer, long index); + + @Override + default void writeValue(ByteDataBuffer buffer, Long value, long index) { + writeLong(buffer, value, index); + } + + @Override + default Long readValue(ByteDataBuffer buffer, long index) { + return readLong(buffer, index); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/ShortDataLayout.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/ShortDataLayout.java new file mode 100644 index 00000000000..b8573177f4a --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/buffer/layout/ShortDataLayout.java @@ -0,0 +1,36 @@ +package org.tensorflow.tools.buffer.layout; + +import org.tensorflow.tools.buffer.ByteDataBuffer; + +/** + * Converts a short to/from bytes + */ +public interface ShortDataLayout extends DataLayout { + + /** + * Writes a short as bytes to the given buffer at its current position. + * @param buffer buffer that receives the value as bytes + * @param value value + * @param index byte index of the value to write + */ + void writeShort(ByteDataBuffer buffer, short value, long index); + + /** + * Reads a short as bytes from the given buffer at its current position. + * + * @param buffer buffer that supplies the value as bytes + * @param index byte index of the value to read + * @return value + */ + short readShort(ByteDataBuffer buffer, long index); + + @Override + default void writeValue(ByteDataBuffer buffer, Short value, long index) { + writeShort(buffer, value, index); + } + + @Override + default Short readValue(ByteDataBuffer buffer, long index) { + return readShort(buffer, index); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/BooleanNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/BooleanNdArray.java new file mode 100644 index 00000000000..bba08ffdeb5 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/BooleanNdArray.java @@ -0,0 +1,179 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.ndarray.index.Index; + +/** + * An {@link NdArray} of booleans. + */ +public interface BooleanNdArray extends NdArray { + + /** + * Returns the boolean value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  BooleanNdArray matrix = NdArrays.ofBooleans(shape(2, 2));  // matrix rank = 2
+   *  matrix.getBoolean(0, 1);  // succeeds, returns false
+   *  matrix.getBoolean(0);  // throws IllegalRankException
+   *
+   *  BooleanNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.getBoolean();  // succeeds, returns false
+   * }
+ * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + boolean getBoolean(long... coordinates); + + /** + * Assigns the boolean value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  BooleanNdArray matrix = NdArrays.ofBooleans(shape(2, 2));  // matrix rank = 2
+   *  matrix.setBoolean(true, 0, 1);  // succeeds
+   *  matrix.setBoolean(true, 0);  // throws IllegalRankException
+   *
+   *  BooleanNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.setBoolean(true);  // succeeds
+   * }
+ * + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + BooleanNdArray setBoolean(boolean value, long... coordinates); + + /** + * Reads the content of this N-dimensional array into the destination boolean array. + * + *

The size of the destination array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + */ + default BooleanNdArray read(boolean[] dst) { + return read(dst, 0); + } + + /** + * Reads the content of this N-dimensional array into the destination boolean array. + * + *

{@code dst.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @param offset the index of the first boolean to write in the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + * @throws IndexOutOfBoundsException if offset is greater than dst length or is negative + */ + BooleanNdArray read(boolean[] dst, int offset); + + /** + * Writes the content of this N-dimensional array from the source boolean array. + * + *

The size of the source array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + */ + default BooleanNdArray write(boolean[] src) { + return write(src, 0); + } + + /** + * Writes the content of this N-dimensional array from the source boolean array. + * + *

{@code src.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @param offset the index of the first boolean to read from the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + * @throws IndexOutOfBoundsException if offset is greater than src length or is negative + */ + BooleanNdArray write(boolean[] src, int offset); + + @Override + BooleanNdArray slice(Index... indices); + + @Override + BooleanNdArray get(long... coordinates); + + @Override + BooleanNdArray set(NdArray src, long... coordinates); + + @Override + default Boolean getObject(long... coordinates) { + return getBoolean(coordinates); + } + + @Override + default BooleanNdArray setObject(Boolean value, long... coordinates) { + return setBoolean(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + BooleanNdArray copyTo(NdArray dst); + + @Override + BooleanNdArray read(DataBuffer dst); + + BooleanNdArray read(BooleanDataBuffer dst); + + @Override + BooleanNdArray write(DataBuffer src); + + BooleanNdArray write(BooleanDataBuffer src); + + @Override + BooleanNdArray read(Boolean[] dst); + + @Override + BooleanNdArray read(Boolean[] dst, int offset); + + @Override + BooleanNdArray write(Boolean[] src); + + @Override + BooleanNdArray write(Boolean[] src, int offset); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/ByteNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/ByteNdArray.java new file mode 100644 index 00000000000..4d9e35bfaef --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/ByteNdArray.java @@ -0,0 +1,179 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.ndarray.index.Index; + +/** + * An {@link NdArray} of bytes. + */ +public interface ByteNdArray extends NdArray { + + /** + * Returns the byte value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  ByteNdArray matrix = NdArrays.ofBytes(shape(2, 2));  // matrix rank = 2
+   *  matrix.getByte(0, 1);  // succeeds, returns 0
+   *  matrix.getByte(0);  // throws IllegalRankException
+   *
+   *  ByteNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.getByte();  // succeeds, returns 0
+   * }
+ * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + byte getByte(long... coordinates); + + /** + * Assigns the byte value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  ByteNdArray matrix = NdArrays.ofBytes(shape(2, 2));  // matrix rank = 2
+   *  matrix.setByte(10, 0, 1);  // succeeds
+   *  matrix.setByte(10, 0);  // throws IllegalRankException
+   *
+   *  ByteNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.setByte(10);  // succeeds
+   * }
+ * + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + ByteNdArray setByte(byte value, long... coordinates); + + /** + * Reads the content of this N-dimensional array into the destination byte array. + * + *

The size of the destination array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + */ + default ByteNdArray read(byte[] dst) { + return read(dst, 0); + } + + /** + * Reads the content of this N-dimensional array into the destination byte array. + * + *

{@code dst.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @param offset the index of the first byte to write in the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + * @throws IndexOutOfBoundsException if offset is greater than dst length or is negative + */ + ByteNdArray read(byte[] dst, int offset); + + /** + * Writes the content of this N-dimensional array from the source byte array. + * + *

The size of the source array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + */ + default ByteNdArray write(byte[] src) { + return write(src, 0); + } + + /** + * Writes the content of this N-dimensional array from the source byte array. + * + *

{@code src.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @param offset the index of the first byte to read from the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + * @throws IndexOutOfBoundsException if offset is greater than src length or is negative + */ + ByteNdArray write(byte[] src, int offset); + + @Override + ByteNdArray slice(Index... indices); + + @Override + ByteNdArray get(long... coordinates); + + @Override + ByteNdArray set(NdArray src, long... coordinates); + + @Override + default Byte getObject(long... coordinates) { + return getByte(coordinates); + } + + @Override + default ByteNdArray setObject(Byte value, long... coordinates) { + return setByte(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + ByteNdArray copyTo(NdArray dst); + + @Override + ByteNdArray read(DataBuffer dst); + + ByteNdArray read(ByteDataBuffer dst); + + @Override + ByteNdArray write(DataBuffer src); + + ByteNdArray write(ByteDataBuffer src); + + @Override + ByteNdArray read(Byte[] dst); + + @Override + ByteNdArray read(Byte[] dst, int offset); + + @Override + ByteNdArray write(Byte[] src); + + @Override + ByteNdArray write(Byte[] src, int offset); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/DoubleNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/DoubleNdArray.java new file mode 100644 index 00000000000..772440fe8cf --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/DoubleNdArray.java @@ -0,0 +1,179 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.ndarray.index.Index; + +/** + * An {@link NdArray} of doubles. + */ +public interface DoubleNdArray extends NdArray { + + /** + * Returns the double value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  DoubleNdArray matrix = NdArrays.ofDoubles(shape(2, 2));  // matrix rank = 2
+   *  matrix.getDouble(0, 1);  // succeeds, returns 0.0
+   *  matrix.getDouble(0);  // throws IllegalRankException
+   *
+   *  DoubleNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.getDouble();  // succeeds, returns 0.0
+   * }
+ * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + double getDouble(long... coordinates); + + /** + * Assigns the double value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  DoubleNdArray matrix = NdArrays.ofDoubles(shape(2, 2));  // matrix rank = 2
+   *  matrix.setDouble(10.0, 0, 1);  // succeeds
+   *  matrix.setDouble(10.0, 0);  // throws IllegalRankException
+   *
+   *  DoubleNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.setDouble(10.0);  // succeeds
+   * }
+ * + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + DoubleNdArray setDouble(double value, long... coordinates); + + /** + * Reads the content of this N-dimensional array into the destination double array. + * + *

The size of the destination array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + */ + default DoubleNdArray read(double[] dst) { + return read(dst, 0); + } + + /** + * Reads the content of this N-dimensional array into the destination double array. + * + *

{@code dst.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @param offset the index of the first double to write in the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + * @throws IndexOutOfBoundsException if offset is greater than dst length or is negative + */ + DoubleNdArray read(double[] dst, int offset); + + /** + * Writes the content of this N-dimensional array from the source double array. + * + *

The size of the source array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + */ + default DoubleNdArray write(double[] src) { + return write(src, 0); + } + + /** + * Writes the content of this N-dimensional array from the source double array. + * + *

{@code src.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @param offset the index of the first double to read from the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + * @throws IndexOutOfBoundsException if offset is greater than src length or is negative + */ + DoubleNdArray write(double[] src, int offset); + + @Override + DoubleNdArray slice(Index... indices); + + @Override + DoubleNdArray get(long... coordinates); + + @Override + DoubleNdArray set(NdArray src, long... coordinates); + + @Override + default Double getObject(long... coordinates) { + return getDouble(coordinates); + } + + @Override + default DoubleNdArray setObject(Double value, long... coordinates) { + return setDouble(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + DoubleNdArray copyTo(NdArray dst); + + @Override + DoubleNdArray read(DataBuffer dst); + + DoubleNdArray read(DoubleDataBuffer dst); + + @Override + DoubleNdArray write(DataBuffer src); + + DoubleNdArray write(DoubleDataBuffer src); + + @Override + DoubleNdArray read(Double[] dst); + + @Override + DoubleNdArray read(Double[] dst, int offset); + + @Override + DoubleNdArray write(Double[] src); + + @Override + DoubleNdArray write(Double[] src, int offset); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/FloatNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/FloatNdArray.java new file mode 100644 index 00000000000..8c5dc2d4164 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/FloatNdArray.java @@ -0,0 +1,179 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.ndarray.index.Index; + +/** + * An {@link NdArray} of floats. + */ +public interface FloatNdArray extends NdArray { + + /** + * Returns the float value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2));  // matrix rank = 2
+   *  matrix.getFloat(0, 1);  // succeeds, returns 0.0f
+   *  matrix.getFloat(0);  // throws IllegalRankException
+   *
+   *  FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.getFloat();  // succeeds, returns 0.0f
+   * }
+ * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + float getFloat(long... coordinates); + + /** + * Assigns the float value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  FloatNdArray matrix = NdArrays.ofFloats(shape(2, 2));  // matrix rank = 2
+   *  matrix.setFloat(10.0f, 0, 1);  // succeeds
+   *  matrix.setFloat(10.0f, 0);  // throws IllegalRankException
+   *
+   *  FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.setFloat(10.0f);  // succeeds
+   * }
+ * + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + FloatNdArray setFloat(float value, long... coordinates); + + /** + * Reads the content of this N-dimensional array into the destination float array. + * + *

The size of the destination array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + */ + default FloatNdArray read(float[] dst) { + return read(dst, 0); + } + + /** + * Reads the content of this N-dimensional array into the destination float array. + * + *

{@code dst.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @param offset the index of the first float to write in the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + * @throws IndexOutOfBoundsException if offset is greater than dst length or is negative + */ + FloatNdArray read(float[] dst, int offset); + + /** + * Writes the content of this N-dimensional array from the source float array. + * + *

The size of the source array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + */ + default FloatNdArray write(float[] src) { + return write(src, 0); + } + + /** + * Writes the content of this N-dimensional array from the source float array. + * + *

{@code src.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @param offset the index of the first float to read from the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + * @throws IndexOutOfBoundsException if offset is greater than src length or is negative + */ + FloatNdArray write(float[] src, int offset); + + @Override + FloatNdArray slice(Index... coordinates); + + @Override + FloatNdArray get(long... coordinates); + + @Override + FloatNdArray set(NdArray src, long... coordinates); + + @Override + default Float getObject(long... coordinates) { + return getFloat(coordinates); + } + + @Override + default FloatNdArray setObject(Float value, long... coordinates) { + return setFloat(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + FloatNdArray copyTo(NdArray dst); + + @Override + FloatNdArray read(DataBuffer dst); + + FloatNdArray read(FloatDataBuffer dst); + + @Override + FloatNdArray write(DataBuffer src); + + FloatNdArray write(FloatDataBuffer src); + + @Override + FloatNdArray read(Float[] dst); + + @Override + FloatNdArray read(Float[] dst, int offset); + + @Override + FloatNdArray write(Float[] src); + + @Override + FloatNdArray write(Float[] src, int offset); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/IllegalRankException.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/IllegalRankException.java new file mode 100644 index 00000000000..21c9b43c2c4 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/IllegalRankException.java @@ -0,0 +1,24 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +public class IllegalRankException extends IllegalArgumentException { + + public IllegalRankException(String message) { + super(message); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/IntNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/IntNdArray.java new file mode 100644 index 00000000000..7158996664d --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/IntNdArray.java @@ -0,0 +1,179 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.ndarray.index.Index; + +/** + * An {@link NdArray} of integers. + */ +public interface IntNdArray extends NdArray { + + /** + * Returns the integer value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  IntNdArray matrix = NdArrays.ofInts(shape(2, 2));  // matrix rank = 2
+   *  matrix.getInt(0, 1);  // succeeds, returns 0
+   *  matrix.getInt(0);  // throws IllegalRankException
+   *
+   *  IntNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.getInt();  // succeeds, returns 0
+   * }
+ * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + int getInt(long... coordinates); + + /** + * Assigns the integer value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  IntNdArray matrix = NdArrays.ofInts(shape(2, 2));  // matrix rank = 2
+   *  matrix.setInt(10, 0, 1);  // succeeds
+   *  matrix.setInt(10, 0);  // throws IllegalRankException
+   *
+   *  IntNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.setInt(10);  // succeeds
+   * }
+ * + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + IntNdArray setInt(int value, long... coordinates); + + /** + * Reads the content of this N-dimensional array into the destination int array. + * + *

The size of the destination array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + */ + default IntNdArray read(int[] dst) { + return read(dst, 0); + } + + /** + * Reads the content of this N-dimensional array into the destination int array. + * + *

{@code dst.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @param offset the index of the first integer to write in the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + * @throws IndexOutOfBoundsException if offset is greater than dst length or is negative + */ + IntNdArray read(int[] dst, int offset); + + /** + * Writes the content of this N-dimensional array from the source int array. + * + *

The size of the source array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + */ + default IntNdArray write(int[] src) { + return write(src, 0); + } + + /** + * Writes the content of this N-dimensional array from the source int array. + * + *

{@code src.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @param offset the index of the first integer to read from the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + * @throws IndexOutOfBoundsException if offset is greater than src length or is negative + */ + IntNdArray write(int[] src, int offset); + + @Override + IntNdArray slice(Index... indices); + + @Override + IntNdArray get(long... coordinates); + + @Override + IntNdArray set(NdArray src, long... coordinates); + + @Override + default Integer getObject(long... coordinates) { + return getInt(coordinates); + } + + @Override + default IntNdArray setObject(Integer value, long... coordinates) { + return setInt(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + IntNdArray copyTo(NdArray dst); + + @Override + IntNdArray read(DataBuffer dst); + + IntNdArray read(IntDataBuffer dst); + + @Override + IntNdArray write(DataBuffer src); + + IntNdArray write(IntDataBuffer src); + + @Override + IntNdArray read(Integer[] dst); + + @Override + IntNdArray read(Integer[] dst, int offset); + + @Override + IntNdArray write(Integer[] src); + + @Override + IntNdArray write(Integer[] src, int offset); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/LongNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/LongNdArray.java new file mode 100644 index 00000000000..bd5c7a17128 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/LongNdArray.java @@ -0,0 +1,179 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.ndarray.index.Index; + +/** + * An {@link NdArray} of longs. + */ +public interface LongNdArray extends NdArray { + + /** + * Returns the long value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  LongNdArray matrix = NdArrays.ofLongs(shape(2, 2));  // matrix rank = 2
+   *  matrix.getLong(0, 1);  // succeeds, returns 0L
+   *  matrix.getLong(0);  // throws IllegalRankException
+   *
+   *  LongNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.getLong();  // succeeds, returns 0L
+   * }
+ * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + long getLong(long... coordinates); + + /** + * Assigns the long value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  LongNdArray matrix = NdArrays.ofLongs(shape(2, 2));  // matrix rank = 2
+   *  matrix.setLong(10L, 0, 1);  // succeeds
+   *  matrix.setLong(10L, 0);  // throws IllegalRankException
+   *
+   *  LongNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.setLong(10L);  // succeeds
+   * }
+ * + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + LongNdArray setLong(long value, long... coordinates); + + /** + * Reads the content of this N-dimensional array into the destination long array. + * + *

The size of the destination array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + */ + default LongNdArray read(long[] dst) { + return read(dst, 0); + } + + /** + * Reads the content of this N-dimensional array into the destination long array. + * + *

{@code dst.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @param offset the index of the first long to write in the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + * @throws IndexOutOfBoundsException if offset is greater than dst length or is negative + */ + LongNdArray read(long[] dst, int offset); + + /** + * Writes the content of this N-dimensional array from the source long array. + * + *

The size of the source array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + */ + default LongNdArray write(long[] src) { + return write(src, 0); + } + + /** + * Writes the content of this N-dimensional array from the source long array. + * + *

{@code src.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @param offset the index of the first long to read from the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + * @throws IndexOutOfBoundsException if offset is greater than src length or is negative + */ + LongNdArray write(long[] src, int offset); + + @Override + LongNdArray slice(Index... indices); + + @Override + LongNdArray get(long... coordinates); + + @Override + LongNdArray set(NdArray src, long... coordinates); + + @Override + default Long getObject(long... coordinates) { + return getLong(coordinates); + } + + @Override + default LongNdArray setObject(Long value, long... coordinates) { + return setLong(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + LongNdArray copyTo(NdArray dst); + + @Override + LongNdArray read(DataBuffer dst); + + LongNdArray read(LongDataBuffer dst); + + @Override + LongNdArray write(DataBuffer src); + + LongNdArray write(LongDataBuffer src); + + @Override + LongNdArray read(Long[] dst); + + @Override + LongNdArray read(Long[] dst, int offset); + + @Override + LongNdArray write(Long[] src); + + @Override + LongNdArray write(Long[] src, int offset); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/NdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/NdArray.java new file mode 100644 index 00000000000..7c5664a56f8 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/NdArray.java @@ -0,0 +1,356 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.ndarray.index.Index; + +/** + * A data structure of N-dimensions. + * + *

The `NdArray` interface creates an abstraction between the physical storage of a data record, + * which can be linear or segmented, and its logical representation. In general, they achieve + * better performances than standard multi-dimensional arrays in Java by mapping directly linear + * data segments in memory. + * + *

Like {@link DataBuffer}, {@code NdArray} instances support 64-bits indexing so they can be + * used to map very large data records. They also support special coordinates that allow traversing + * their values in any direction or to select only a subset of them. + * + *

Example of usage: + *

{@code
+ *    import static org.tensorflow.nio.StaticApi.*;
+ *
+ *    // Creates a 2x3x2 matrix (of rank 3)
+ *    FloatNdArray matrix3d = ndArrayOfFloats(shape(2, 3, 2));
+ *
+ *    // Initialize sub-matrices data with vectors
+ *    matrix.set(vector(1.0f, 2.0f), 0, 0)
+ *          .set(vector(3.0f, 4.0f), 0, 1)
+ *          .set(vector(5.0f, 6.0f), 0, 2)
+ *          .set(vector(7.0f, 8.0f), 1, 0)
+ *          .set(vector(9.0f, 10.0f), 1, 1)
+ *          .set(vector(11.0f, 12.0f), 1, 2);
+ *
+ *    // Access the second 3x2 matrix (of rank 2)
+ *    FloatNdArray matrix = matrix3d.get(1);
+ *
+ *    // Access directly the float value at (1, 0) from the second matrix
+ *    assertEquals(9.0f, matrix.getFloat(1, 0));
+ * }
+ * + * @param the type of values to be mapped + */ +public interface NdArray { + + /** + * @return the shape of this N-dimensional array + */ + Shape shape(); + + /** + * @return the rank of this N-dimensional array + */ + default int rank() { + return shape().numDimensions(); + } + + /** + * Computes and returns the total size of this N-dimensional array, in number of values. + * + *

For example, given a 3x3x2 matrix, the return value will be 18. + * @return total size of this nd array + */ + default long size() { + return shape().size(); + } + + /** + * Visit all elements of a given dimension. + * + *

Logically, the N-dimensional array can be flatten in a single vector, where the scalars of + * the {@code (n - 1)}th element precedes those of the {@code (n)}th element, for a total of + * {@link #size()} values. + * + *

For example, given a {@code n x m} matrix on the {@code [x, y]} axes, values are iterated in + * the following order: + *

+   * x0y0, x0y1, ..., x0ym-1, x1y0, x1y1, ..., xn-1ym-1
+   * 
+ * + *

The returned cursor is used to visit each elements, either by calling + * {@link NdArraySequence#forEach(Consumer)} or {@link NdArraySequence#forEachIndexed(BiConsumer)}. + *

{@code
+   *    // Iterate matrix for initializing each of its vectors
+   *    matrixOfFloats.elements(0).forEach(v -> {
+   *      v.set(vector(1.0f, 2.0f, 3.0f));
+   *    });
+   *
+   *    // Iterate a vector for reading each of its scalar
+   *    vectorOfFloats.scalars().forEachIdx((coords, s) -> {
+   *      System.out.println("Value " + s.getFloat() + " found at " + coords);
+   *    });
+   * }
+ * + * @return a new cursor to visit all elements at the requested dimension + */ + NdArraySequence> elements(int dimensionIdx); + + /** + * Visit all scalars of this array. + * + *

This is equivalent to call {@code elements(shape().numDimensions() - 1)} + * + * @return a new cursor to visit all scalars of this array + */ + NdArraySequence> scalars(); + + /** + * Creates a multi-dimensional view (or slice) of this array by mapping one or more dimensions + * to the given index selectors. + * + *

Slices allow to traverse an N-dimensional array in any of its axis and/or to filter only + * elements of interest. For example, for a given matrix on the {@code [x, y]} axes, it is + * possible to iterate elements at {@code y=0} for all {@code x}. + * + *

Any changes applied to the returned slice affect the data of this array as well, as there + * is no copy involved. + * + *

Example of usage: + *

{@code
+   *    FloatNdArray matrix3d = ndArrayOfFloats(shape(3, 2, 4));  // with [x, y, z] axes
+   *
+   *    // Iterates elements on the x axis by preserving only the 3rd value on the z axis,
+   *    // (i.e. [x, y, 2])
+   *    matrix3d.slice(all(), all(), at(2)).elements(0).forEach(m -> {
+   *      assertEquals(shape(2), m); // y=2, z=0 (scalar)
+   *    });
+   *
+   *    // Creates a slice that contains only the last element of the y axis and elements with an
+   *    // odd `z` coordinate.
+   *    FloatNdArray slice = matrix3d.slice(all(), at(1), odd());
+   *    assertEquals(shape(3, 2), slice.shape());  // x=3, y=0 (scalar), z=2 (odd coordinates)
+   *
+   *    // Iterates backward the elements on the x axis
+   *    matrix3d.slice(flip()).elements(0).forEach(m -> {
+   *      assertEquals(shape(2, 4), m);  // y=2, z=4
+   *    });
+   * }
+ * + * @param indices index selectors per dimensions, starting from dimension 0 of this array. + * @return the element resulting of the index selection + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + */ + NdArray slice(Index... indices); + + /** + * Returns the N-dimensional element of this array at the given coordinates. + * + *

Elements of any of the dimensions of this array can be retrieved. For example, if the number + * of coordinates is equal to the number of dimensions of this array, then a rank-0 (scalar) array + * is returned, which value can then be obtained by calling `array.getObject()`. + * + *

Any changes applied to the returned elements affect the data of this array as well, as there + * is no copy involved. + * + *

Note that invoking this method is an equivalent and more efficient way to slice this array + * on single scalar, i.e. {@code array.get(x, y, z)} is equal to + * {@code array.slice(at(x), at(y), at(z))} + * + * @param coordinates coordinates of the element to access, none will return this array + * @return the element at this index + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + */ + NdArray get(long... coordinates); + + /** + * Assigns the value of the N-dimensional element found at the given coordinates. + * + *

The number of coordinates provided can be anywhere between 0 and rank - 1. For example: + *

{@code
+   *  FloatNdArray matrix = ndArrayOfFloats(shape(2, 2));  // matrix rank = 2
+   *  matrix.set(vector(10.0f, 20.0f), 0);  // success
+   *  matrix.set(scalar(10.0f), 1, 0); // success
+   * }
+ * + * @param coordinates coordinates of the element to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + */ + NdArray set(NdArray src, long... coordinates); + + /** + * Returns the value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  FloatNdArray matrix = ndArrayOfFloats(shape(2, 2));  // matrix rank = 2
+   *  matrix.getObject(0, 1);  // succeeds, returns 0.0f
+   *  matrix.getObject(0);  // throws IllegalRankException
+   *
+   *  FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.getObject();  // succeeds, returns 0.0f
+   * }
+ * + * Note: if this array stores values of a primitive type, prefer the usage of the specialized + * method in the subclass for that type. For example, {@code floatArray.getFloat(0); }. + * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + T getObject(long... coordinates); + + /** + * Assigns the value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  FloatNdArray matrix = ndArrayOfFloats(shape(2, 2));  // matrix rank = 2
+   *  matrix.setObject(10.0f, 0, 1);  // succeeds
+   *  matrix.setObject(10.0f, 0);  // throws IllegalRankException
+   *
+   *  FloatNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.setObject(10.0f);  // succeeds
+   * }
+ * + * Note: if this array stores values of a primitive type, prefer the usage of the specialized + * method in the subclass for that type. For example, {@code floatArray.setFloat(10.0f, 0); } + * + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their + * respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar + * element + */ + NdArray setObject(T value, long... coordinates); + + /** + * Copy the content of this array to the destination array. + * + *

The {@link #shape()} of the destination array must be equal to the shape of this array, or + * an exception is thrown. After the copy, the content of both arrays can be altered + * independently, without affecting each other. + * + * @param dst array to receive a copy of the content of this array + * @return this array + * @throws IllegalArgumentException if the shape of {@code dst} is not equal to the shape of this + * array + */ + NdArray copyTo(NdArray dst); + + /** + * Read the content of this N-dimensional array into the destination buffer. + * + *

The size of the buffer must be equal or greater to the {@link #size()} of this + * array, or an exception is thrown. After the copy, content of the buffer and of the array can be + * altered independently, without affecting each other. + * + * @param dst the destination buffer + * @return this array + * @throws java.nio.BufferOverflowException if the buffer cannot hold the content of this array + * @see DataBuffer#size() + */ + NdArray read(DataBuffer dst); + + /** + * Write the content of this N-dimensional array from the source buffer. + * + *

The size of the buffer must be equal or greater to the {@link #size()} of this + * array, or an exception is thrown. After the copy, content of the buffer and of the array can be + * altered independently, without affecting each other. + * + * @param src the source buffer + * @return this array + * @throws java.nio.BufferUnderflowException if the buffer has not enough remaining data to write + * into this array + * @see DataBuffer#size() + */ + NdArray write(DataBuffer src); + + /** + * Reads the content of this N-dimensional array into the destination array. + * + *

The size of the destination array must be equal or greater to the {@link #size()} of this + * array, or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of + * this array + */ + NdArray read(T[] dst); + + /** + * Reads the content of this N-dimensional array into the destination array. + * + *

{@code dst.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @param offset the index of the first element to write in the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of + * this array + * @throws IllegalArgumentException if offset is greater than dst length or is negative + */ + NdArray read(T[] dst, int offset); + + /** + * Writes the content of this N-dimensional array from the source array. + * + *

The size of the source array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size + * of this array + */ + NdArray write(T[] src); + + /** + * Writes the content of this N-dimensional array from the source array. + * + *

{@code src.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @param offset the index of the first byte to read from the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size + * of this array + * @throws IllegalArgumentException if offset is greater than src length or is negative + */ + NdArray write(T[] src, int offset); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/NdArraySequence.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/NdArraySequence.java new file mode 100644 index 00000000000..ba88cc3660d --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/NdArraySequence.java @@ -0,0 +1,21 @@ +package org.tensorflow.tools.ndarray; + +import java.util.function.BiConsumer; + +/** + * Iterates through a sequence of elements of an N-dimensional array. + * + * @param data type of the array being iterated + */ +public interface NdArraySequence> extends Iterable { + + /** + * Visit each elements of this iteration and their respective coordinates. + * + *

Important: the consumer method should not keep a reference to the coordinates + * as they might be mutable and reused during the iteration to improve performance. + * + * @param consumer method to invoke for each elements + */ + void forEachIndexed(BiConsumer consumer); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/NdArrays.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/NdArrays.java new file mode 100644 index 00000000000..7922c0d0cf7 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/NdArrays.java @@ -0,0 +1,468 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.ndarray.impl.dense.BooleanDenseNdArray; +import org.tensorflow.tools.ndarray.impl.dense.ByteDenseNdArray; +import org.tensorflow.tools.ndarray.impl.dense.DenseNdArray; +import org.tensorflow.tools.ndarray.impl.dense.DoubleDenseNdArray; +import org.tensorflow.tools.ndarray.impl.dense.FloatDenseNdArray; +import org.tensorflow.tools.ndarray.impl.dense.IntDenseNdArray; +import org.tensorflow.tools.ndarray.impl.dense.LongDenseNdArray; +import org.tensorflow.tools.ndarray.impl.dense.ShortDenseNdArray; + +/** + * Helper class for instantiating {@link NdArray} objects. + */ +public final class NdArrays { + + // BYTE ARRAYS + + /** + * Creates byte scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new byte scalar + */ + public static ByteNdArray scalarOf(byte value) { + return ofBytes(Shape.scalar()).setByte(value); + } + + /** + * Creates a byte vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new byte vector + * @throws IllegalArgumentException if values is null + */ + public static ByteNdArray vectorOf(byte... values) { + if (values == null) { + throw new IllegalArgumentException("Values cannot be null"); + } + return ofBytes(Shape.make(values.length)).write(values); + } + + /** + * Creates an N-dimensional array of bytes of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new byte N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static ByteNdArray ofBytes(Shape shape) { + if (shape == null) { + throw new IllegalArgumentException("Shape cannot be null"); + } + return wrap(DataBuffers.ofBytes(shape.size()), shape); + } + + /** + * Wraps a buffer in a byte N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new byte N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + public static ByteNdArray wrap(ByteDataBuffer buffer, Shape shape) { + return ByteDenseNdArray.create(buffer, shape); + } + + // LONG ARRAYS + + /** + * Creates long scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new long scalar + */ + public static LongNdArray scalarOf(long value) { + return ofLongs(Shape.scalar()).setLong(value); + } + + /** + * Creates a long vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new long vector + * @throws IllegalArgumentException if values is null + */ + public static LongNdArray vectorOf(long... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return ofLongs(Shape.make(values.length)).write(values); + } + + /** + * Creates an N-dimensional array of longs of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new long N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static LongNdArray ofLongs(Shape shape) { + return wrap(DataBuffers.ofLongs(shape.size()), shape); + } + + /** + * Wraps a buffer in a long N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new long N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + public static LongNdArray wrap(LongDataBuffer buffer, Shape shape) { + return LongDenseNdArray.create(buffer, shape); + } + + // INT ARRAYS + + /** + * Creates long scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new long scalar + */ + public static IntNdArray scalarOf(int value) { + return ofInts(Shape.scalar()).setInt(value); + } + + /** + * Creates a int vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new int vector + * @throws IllegalArgumentException if values is null + */ + public static IntNdArray vectorOf(int... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return ofInts(Shape.make(values.length)).write(values); + } + + /** + * Creates an N-dimensional array of ints of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new int N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static IntNdArray ofInts(Shape shape) { + return wrap(DataBuffers.ofInts(shape.size()), shape); + } + + /** + * Wraps a buffer in an int N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new int N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + public static IntNdArray wrap(IntDataBuffer buffer, Shape shape) { + return IntDenseNdArray.create(buffer, shape); + } + + // SHORT ARRAYS + + /** + * Creates short scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new short scalar + */ + public static ShortNdArray scalarOf(short value) { + return ofShorts(Shape.scalar()).setShort(value); + } + + /** + * Creates a short vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new short vector + * @throws IllegalArgumentException if values is null + */ + public static ShortNdArray vectorOf(short... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return ofShorts(Shape.make(values.length)).write(values); + } + + /** + * Creates an N-dimensional array of shorts of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new short N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static ShortNdArray ofShorts(Shape shape) { + return wrap(DataBuffers.ofShorts(shape.size()), shape); + } + + /** + * Wraps a buffer in a short N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new short N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + public static ShortNdArray wrap(ShortDataBuffer buffer, Shape shape) { + return ShortDenseNdArray.create(buffer, shape); + } + + // FLOAT ARRAYS + + /** + * Creates float scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new float scalar + */ + public static FloatNdArray scalarOf(float value) { + return ofFloats(Shape.scalar()).setFloat(value); + } + + /** + * Creates a float vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new float vector + * @throws IllegalArgumentException if values is null + */ + public static FloatNdArray vectorOf(float... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return ofFloats(Shape.make(values.length)).write(values); + } + + /** + * Creates an N-dimensional array of floats of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new float N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static FloatNdArray ofFloats(Shape shape) { + return wrap(DataBuffers.ofFloats(shape.size()), shape); + } + + /** + * Wraps a buffer in a float N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new float N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + public static FloatNdArray wrap(FloatDataBuffer buffer, Shape shape) { + return FloatDenseNdArray.create(buffer, shape); + } + + // DOUBLE ARRAYS + + /** + * Creates double scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new double scalar + */ + public static DoubleNdArray scalarOf(double value) { + return ofDoubles(Shape.scalar()).setDouble(value); + } + + /** + * Creates a double vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new double vector + * @throws IllegalArgumentException if values is null + */ + public static DoubleNdArray vectorOf(double... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return ofDoubles(Shape.make(values.length)).write(values); + } + + /** + * Creates an N-dimensional array of doubles of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new double N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static DoubleNdArray ofDoubles(Shape shape) { + return wrap(DataBuffers.ofDoubles(shape.size()), shape); + } + + /** + * Wraps a buffer in a double N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new double N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + public static DoubleNdArray wrap(DoubleDataBuffer buffer, Shape shape) { + return DoubleDenseNdArray.create(buffer, shape); + } + + // BOOLEAN ARRAYS + + /** + * Creates boolean scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new boolean scalar + */ + public static BooleanNdArray scalarOf(boolean value) { + return ofBooleans(Shape.scalar()).setBoolean(value); + } + + /** + * Creates a boolean vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new boolean vector + * @throws IllegalArgumentException if values is null + */ + public static BooleanNdArray vectorOf(boolean... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return ofBooleans(Shape.make(values.length)).write(values); + } + + /** + * Creates an N-dimensional array of booleans of the given shape. + * + *

All values are initialized to zeros. + * + * @param shape shape of the array + * @return new boolean N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static BooleanNdArray ofBooleans(Shape shape) { + return wrap(DataBuffers.ofBooleans(shape.size()), shape); + } + + /** + * Wraps a buffer in a boolean N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new boolean N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + public static BooleanNdArray wrap(BooleanDataBuffer buffer, Shape shape) { + return BooleanDenseNdArray.create(buffer, shape); + } + + // OBJECT ARRAYS + + /** + * Creates scalar (rank 0) initialized with the given value. + * + * @param value scalar value + * @return new scalar + */ + @SuppressWarnings("unchecked") + public static NdArray scalarOfObject(T value) { + if (value == null) { + throw new IllegalArgumentException(); + } + return ofObjects((Class)value.getClass(), Shape.scalar()).setObject(value); + } + + /** + * Creates a vector (rank 1) initialized with the given values. + * + * @param values vector values + * @return new vector + * @throws IllegalArgumentException if values is null + */ + @SuppressWarnings("unchecked") + public static NdArray vectorOfObjects(T... values) { + if (values == null) { + throw new IllegalArgumentException(); + } + return ofObjects((Class)values[0].getClass(), Shape.make(values.length)).write(values); + } + + /** + * Creates an N-dimensional array of the given shape. + * + *

All values are initialized to zeros. + * + * @param clazz class of the data to be stored in this array + * @param shape shape of the array + * @return new N-dimensional array + * @throws IllegalArgumentException if shape is null or has unknown dimensions + */ + public static NdArray ofObjects(Class clazz, Shape shape) { + return wrap(DataBuffers.ofObjects(clazz, shape.size()), shape); + } + + /** + * Wraps a buffer in an N-dimensional array of a given shape. + * + * @param buffer buffer to wrap + * @param shape shape of the array + * @return new N-dimensional array + * @throws IllegalArgumentException if shape is null, has unknown dimensions or has size bigger + * in the buffer size + */ + public static NdArray wrap(DataBuffer buffer, Shape shape) { + return DenseNdArray.wrap(buffer, shape); + } +} + diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/ShortNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/ShortNdArray.java new file mode 100644 index 00000000000..2a8b6c160aa --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/ShortNdArray.java @@ -0,0 +1,179 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.ndarray.index.Index; + +/** + * An {@link NdArray} of shorts. + */ +public interface ShortNdArray extends NdArray { + + /** + * Returns the short value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2));  // matrix rank = 2
+   *  matrix.getShort(0, 1);  // succeeds, returns 0.0f
+   *  matrix.getShort(0);  // throws IllegalRankException
+   *
+   *  ShortNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.getShort();  // succeeds, returns 0.0f
+   * }
+ * + * @param coordinates coordinates of the scalar to resolve + * @return value of that scalar + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + short getShort(long... coordinates); + + /** + * Assigns the short value of the scalar found at the given coordinates. + * + *

To access the scalar element, the number of coordinates provided must be equal to the number + * of dimensions of this array (i.e. its rank). For example: + *

{@code
+   *  ShortNdArray matrix = NdArrays.ofShorts(shape(2, 2));  // matrix rank = 2
+   *  matrix.setShort(10.0f, 0, 1);  // succeeds
+   *  matrix.setShort(10.0f, 0);  // throws IllegalRankException
+   *
+   *  ShortNdArray scalar = matrix.get(0, 1);  // scalar rank = 0
+   *  scalar.setShort(10.0f);  // succeeds
+   * }
+ * + * @param coordinates coordinates of the scalar to assign + * @return this array + * @throws IndexOutOfBoundsException if some coordinates are outside the limits of their respective dimension + * @throws IllegalRankException if number of coordinates is not sufficient to access a scalar element + */ + ShortNdArray setShort(short value, long... coordinates); + + /** + * Reads the content of this N-dimensional array into the destination short array. + * + *

The size of the destination array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + */ + default ShortNdArray read(short[] dst) { + return read(dst, 0); + } + + /** + * Reads the content of this N-dimensional array into the destination short array. + * + *

{@code dst.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param dst the destination array + * @param offset the index of the first short to write in the destination array + * @return this array + * @throws java.nio.BufferOverflowException if the destination array cannot hold the content of this array + * @throws IndexOutOfBoundsException if offset is greater than dst length or is negative + */ + ShortNdArray read(short[] dst, int offset); + + /** + * Writes the content of this N-dimensional array from the source short array. + * + *

The size of the source array must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + */ + default ShortNdArray write(short[] src) { + return write(src, 0); + } + + /** + * Writes the content of this N-dimensional array from the source short array. + * + *

{@code src.length - offset} must be equal or greater to the {@link #size()} of this array, + * or an exception is thrown. After the copy, content of the both arrays can be altered + * independently, without affecting each other. + * + * @param src the source array + * @param offset the index of the first short to read from the source array + * @return this array + * @throws java.nio.BufferUnderflowException if the size of the source array is less than the size of this array + * @throws IndexOutOfBoundsException if offset is greater than src length or is negative + */ + ShortNdArray write(short[] src, int offset); + + @Override + ShortNdArray slice(Index... coordinates); + + @Override + ShortNdArray get(long... coordinates); + + @Override + ShortNdArray set(NdArray src, long... coordinates); + + @Override + default Short getObject(long... coordinates) { + return getShort(coordinates); + } + + @Override + default ShortNdArray setObject(Short value, long... coordinates) { + return setShort(value, coordinates); + } + + @Override + NdArraySequence elements(int dimensionIdx); + + @Override + NdArraySequence scalars(); + + @Override + ShortNdArray copyTo(NdArray dst); + + @Override + ShortNdArray read(DataBuffer dst); + + ShortNdArray read(ShortDataBuffer dst); + + @Override + ShortNdArray write(DataBuffer src); + + ShortNdArray write(ShortDataBuffer src); + + @Override + ShortNdArray read(Short[] dst); + + @Override + ShortNdArray read(Short[] dst, int offset); + + @Override + ShortNdArray write(Short[] src); + + @Override + ShortNdArray write(Short[] src, int offset); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/AbstractNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/AbstractNdArray.java new file mode 100644 index 00000000000..90534a037d4 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/AbstractNdArray.java @@ -0,0 +1,83 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.NdArraySequence; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.tools.ndarray.impl.sequence.ElementSequence; + +@SuppressWarnings("unchecked") +public abstract class AbstractNdArray> implements NdArray { + + public abstract U slice(long position, DimensionalSpace dimensions); + + public DimensionalSpace dimensions() { + return dimensions; + } + + @Override + public Shape shape() { + return dimensions.shape(); + } + + @Override + public NdArraySequence elements(int dimensionIdx) { + if (dimensionIdx >= shape().numDimensions()) { + throw new IllegalArgumentException("Cannot iterate elements in dimension '" + dimensionIdx + + "' of array with shape " + shape()); + } + return ElementSequence.create(this, dimensionIdx); + } + + @Override + public NdArraySequence scalars() { + return ElementSequence.create(this, shape().numDimensions() - 1); // negative if this array is a scalar + } + + @Override + public U read(T[] dst) { + return (U)read(DataBuffers.from(dst, false, false)); + } + + @Override + public U read(T[] dst, int offset) { + return (U)read(DataBuffers.from(dst, false, false).offset(offset)); + } + + @Override + public U write(T[] src) { + return (U)write(DataBuffers.from(src, true, false)); + } + + @Override + public U write(T[] src, int offset) { + return (U)write(DataBuffers.from(src, true, false).offset(offset)); + } + + protected AbstractNdArray(DimensionalSpace dimensions) { + this.dimensions = dimensions; + } + + protected void slowCopyTo(NdArray array) { + scalars().forEachIndexed((coords, e) -> array.setObject(e.getObject(), coords)); + } + + private DimensionalSpace dimensions; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/Validator.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/Validator.java new file mode 100644 index 00000000000..67172350b0c --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/Validator.java @@ -0,0 +1,69 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.ndarray.NdArray; + +public class Validator { + + public static void getArrayArgs(NdArray ndArray, int arrayLength, int arrayOffset) { + copyArrayArgs(arrayLength, arrayOffset); + if (arrayLength - arrayOffset < ndArray.size()) { + throw new BufferOverflowException(); + } + } + + public static void putArrayArgs(NdArray ndArray, int arrayLength, int arrayOffset) { + copyArrayArgs(arrayLength, arrayOffset); + if (arrayLength - arrayOffset < ndArray.size()) { + throw new BufferUnderflowException(); + } + } + + public static void copyToNdArrayArgs(NdArray ndArray, NdArray otherNdArray) { + if (!ndArray.shape().equals(otherNdArray.shape())) { + throw new IllegalArgumentException("Can only copy to arrays of the same shape (" + + ndArray.shape() + " != " + otherNdArray.shape() + ")"); + } + } + + public static void readToBufferArgs(NdArray ndArray, DataBuffer dst) { + if (dst.size() < ndArray.size()) { + throw new BufferOverflowException(); + } + } + + public static void writeFromBufferArgs(NdArray ndArray, DataBuffer src) { + if (src.size() < ndArray.size()) { + throw new BufferUnderflowException(); + } + } + + private static void copyArrayArgs(int arrayLength, int arrayOffset) { + if (arrayOffset < 0) { + throw new IndexOutOfBoundsException("Offset must be non-negative"); + } + if (arrayOffset > arrayLength) { + throw new IndexOutOfBoundsException("Offset must be no larger than array length"); + } + } + + protected Validator() {} +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/AbstractDenseNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/AbstractDenseNdArray.java new file mode 100644 index 00000000000..1cb28aad411 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/AbstractDenseNdArray.java @@ -0,0 +1,113 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.ndarray.IllegalRankException; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.AbstractNdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.tools.ndarray.impl.dimension.RelativeDimensionalSpace; +import org.tensorflow.tools.ndarray.index.Index; + +@SuppressWarnings("unchecked") +public abstract class AbstractDenseNdArray> extends AbstractNdArray { + + @Override + public U slice(long position, DimensionalSpace dimensions) { + return instantiate(buffer().offset(position), dimensions); + } + + @Override + public U slice(Index... indices) { + if (indices == null) { + throw new IllegalArgumentException("Slicing requires at least one index"); + } + RelativeDimensionalSpace sliceDimensions = dimensions().mapTo(indices); + return slice(sliceDimensions.position(), sliceDimensions); + } + + @Override + public U get(long... coords) { + return slice(positionOf(coords, false), dimensions().from(coords.length)); + } + + @Override + public T getObject(long... coords) { + return buffer().getObject(positionOf(coords, true)); + } + + @Override + public U set(NdArray src, long... coordinates) { + src.copyTo((coordinates == null || coordinates.length == 0) ? this : get(coordinates)); + return (U)this; + } + + @Override + public U setObject(T value, long... coords) { + buffer().setObject(value, positionOf(coords, true)); + return (U)this; + } + + @Override + public U read(DataBuffer dst) { + Validator.readToBufferArgs(this, dst); + DataTransfer.execute(buffer(), dimensions(), dst, DataTransfer::ofValue); + return (U)this; + } + + @Override + public U write(DataBuffer src) { + Validator.writeFromBufferArgs(this, src); + DataTransfer.execute(src, buffer(), dimensions(), DataTransfer::ofValue); + return (U)this; + } + + protected AbstractDenseNdArray(DimensionalSpace dimensions) { + super(dimensions); + } + + abstract protected DataBuffer buffer(); + + abstract U instantiate(DataBuffer buffer, DimensionalSpace dimensions); + + long positionOf(long[] coords, boolean isValue) { + if (coords == null || coords.length == 0) { + return 0; + } + if (coords.length > dimensions().numDimensions()) { + throw new IndexOutOfBoundsException(); + } + if (isValue && coords.length != dimensions().numDimensions()) { + throw new IllegalRankException("Not a scalar value"); + } + return dimensions().positionOf(coords); + } + + @Override + protected void slowCopyTo(NdArray array) { + if (array instanceof AbstractDenseNdArray) { + AbstractDenseNdArray dst = (AbstractDenseNdArray)array; + long offset = 0L; + for (NdArray s : scalars()) { + dst.buffer().setObject(s.getObject(), offset++); + } + } else { + super.slowCopyTo(array); + } + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/BooleanDenseNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/BooleanDenseNdArray.java new file mode 100644 index 00000000000..990353eafd0 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/BooleanDenseNdArray.java @@ -0,0 +1,104 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.BooleanNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public class BooleanDenseNdArray extends AbstractDenseNdArray + implements BooleanNdArray { + + public static BooleanNdArray create(BooleanDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new BooleanDenseNdArray(buffer, shape); + } + + @Override + public boolean getBoolean(long... indices) { + return buffer.getBoolean(positionOf(indices, true)); + } + + @Override + public BooleanNdArray setBoolean(boolean value, long... indices) { + buffer.setBoolean(value, positionOf(indices, true)); + return this; + } + + @Override + public BooleanNdArray read(boolean[] dst, int offset) { + Validator.getArrayArgs(this, dst.length, offset); + return read(DataBuffers.from(dst, false, false).offset(offset)); + } + + @Override + public BooleanNdArray write(boolean[] src, int offset) { + Validator.putArrayArgs(this, src.length, offset); + return write(DataBuffers.from(src, true, false).offset(offset)); + } + + @Override + public BooleanNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof BooleanDenseNdArray) { + BooleanDenseNdArray booleanDst = (BooleanDenseNdArray)dst; + DataTransfer.execute(buffer, dimensions(), booleanDst.buffer, booleanDst.dimensions(), DataTransfer::ofBoolean); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public BooleanNdArray read(BooleanDataBuffer dst) { + Validator.readToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofBoolean); + return this; + } + + @Override + public BooleanNdArray write(BooleanDataBuffer src) { + Validator.writeFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofBoolean); + return this; + } + + protected BooleanDenseNdArray(BooleanDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + BooleanDenseNdArray instantiate(DataBuffer buffer, DimensionalSpace dimensions) { + return new BooleanDenseNdArray((BooleanDataBuffer)buffer, dimensions); + } + + @Override + protected BooleanDataBuffer buffer() { + return buffer; + } + + private final BooleanDataBuffer buffer; + + private BooleanDenseNdArray(BooleanDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} \ No newline at end of file diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/ByteDenseNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/ByteDenseNdArray.java new file mode 100644 index 00000000000..e00628d95df --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/ByteDenseNdArray.java @@ -0,0 +1,104 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.ByteNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public class ByteDenseNdArray extends AbstractDenseNdArray + implements ByteNdArray { + + public static ByteNdArray create(ByteDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new ByteDenseNdArray(buffer, shape); + } + + @Override + public byte getByte(long... indices) { + return buffer.getByte(positionOf(indices, true)); + } + + @Override + public ByteNdArray setByte(byte value, long... indices) { + buffer.setByte(value, positionOf(indices, true)); + return this; + } + + @Override + public ByteNdArray read(byte[] dst, int offset) { + Validator.getArrayArgs(this, dst.length, offset); + return read(DataBuffers.from(dst, false, false).offset(offset)); + } + + @Override + public ByteNdArray write(byte[] src, int offset) { + Validator.putArrayArgs(this, src.length, offset); + return write(DataBuffers.from(src, true, false).offset(offset)); + } + + @Override + public ByteNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof ByteDenseNdArray) { + ByteDenseNdArray byteDst = (ByteDenseNdArray)dst; + DataTransfer.execute(buffer, dimensions(), byteDst.buffer, byteDst.dimensions(), DataTransfer::ofByte); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public ByteNdArray read(ByteDataBuffer dst) { + Validator.readToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofByte); + return this; + } + + @Override + public ByteNdArray write(ByteDataBuffer src) { + Validator.writeFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofByte); + return this; + } + + protected ByteDenseNdArray(ByteDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + ByteDenseNdArray instantiate(DataBuffer buffer, DimensionalSpace dimensions) { + return new ByteDenseNdArray((ByteDataBuffer)buffer, dimensions); + } + + @Override + protected ByteDataBuffer buffer() { + return buffer; + } + + private final ByteDataBuffer buffer; + + private ByteDenseNdArray(ByteDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} \ No newline at end of file diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/DataTransfer.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/DataTransfer.java new file mode 100644 index 00000000000..abd63b20ea7 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/DataTransfer.java @@ -0,0 +1,119 @@ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; +import org.tensorflow.tools.ndarray.impl.sequence.PositionIterator; + +final class DataTransfer { + + @FunctionalInterface + interface OfValue> { + void copy(B srcBuffer, long srcIndex, B dstBuffer, long dstIndex); + } + + static > void ofValue(B srcBuf, long srcIdx, B dstBuf, long dstIdx) { + dstBuf.setObject(srcBuf.getObject(srcIdx), dstIdx); + } + + static void ofByte(ByteDataBuffer srcBuf, long srcIdx, ByteDataBuffer dstBuf, long dstIdx) { + dstBuf.setByte(srcBuf.getByte(srcIdx), dstIdx); + } + + static void ofInt(IntDataBuffer srcBuf, long srcIdx, IntDataBuffer dstBuf, long dstIdx) { + dstBuf.setInt(srcBuf.getInt(srcIdx), dstIdx); + } + + static void ofLong(LongDataBuffer srcBuf, long srcIdx, LongDataBuffer dstBuf, long dstIdx) { + dstBuf.setLong(srcBuf.getLong(srcIdx), dstIdx); + } + + static void ofDouble(DoubleDataBuffer srcBuf, long srcIdx, DoubleDataBuffer dstBuf, long dstIdx) { + dstBuf.setDouble(srcBuf.getDouble(srcIdx), dstIdx); + } + + static void ofFloat(FloatDataBuffer srcBuf, long srcIdx, FloatDataBuffer dstBuf, long dstIdx) { + dstBuf.setFloat(srcBuf.getFloat(srcIdx), dstIdx); + } + + static void ofShort(ShortDataBuffer srcBuf, long srcIdx, ShortDataBuffer dstBuf, long dstIdx) { + dstBuf.setShort(srcBuf.getShort(srcIdx), dstIdx); + } + + static void ofBoolean(BooleanDataBuffer srcBuf, long srcIdx, BooleanDataBuffer dstBuf, long dstIdx) { + dstBuf.setBoolean(srcBuf.getBoolean(srcIdx), dstIdx); + } + + static > void execute(B srcBuffer, DimensionalSpace srcDimensions, B dstBuffer, DimensionalSpace dstDimensions, OfValue valueTransfer) { + if (srcDimensions.isSegmented() || dstDimensions.isSegmented()) { + int segmentationIdx = Math.max(srcDimensions.segmentationIdx(), dstDimensions.segmentationIdx()); + copyByElement( + srcBuffer, + PositionIterator.create(srcDimensions, segmentationIdx), + dstBuffer, + PositionIterator.create(dstDimensions, segmentationIdx), + srcDimensions.get(segmentationIdx).elementSize(), + valueTransfer + ); + } else { + srcBuffer.copyTo(dstBuffer, srcDimensions.get(0).totalSize()); + } + } + + static > void execute(B srcBuffer, B dstBuffer, DimensionalSpace dstDimensions, OfValue valueTransfer) { + if (dstDimensions.isSegmented()) { + long elementSize = dstDimensions.get(dstDimensions.segmentationIdx()).elementSize(); + copyByElement( + srcBuffer, + PositionIterator.sequence(elementSize, srcBuffer.size()), + dstBuffer, + PositionIterator.create(dstDimensions, dstDimensions.segmentationIdx()), + elementSize, + valueTransfer + ); + } else { + srcBuffer.copyTo(dstBuffer, dstDimensions.get(0).totalSize()); + } + } + + static > void execute(B srcBuffer, DimensionalSpace srcDimensions, B dstBuffer, OfValue valueTransfer) { + if (srcDimensions.isSegmented()) { + long elementSize = srcDimensions.get(srcDimensions.segmentationIdx()).elementSize(); + copyByElement( + srcBuffer, + PositionIterator.create(srcDimensions, srcDimensions.segmentationIdx()), + dstBuffer, + PositionIterator.sequence(elementSize, dstBuffer.size()), + elementSize, + valueTransfer + ); + } else { + srcBuffer.copyTo(dstBuffer, srcDimensions.get(0).totalSize()); + } + } + + private static > void copyByElement( + B srcBuffer, + PositionIterator srcIterator, + B dstBuffer, + PositionIterator dstIterator, + long elementSize, + OfValue valueTransfer + ) { + if (elementSize == 1) { + while (srcIterator.hasNext()) { + valueTransfer.copy(srcBuffer, srcIterator.nextLong(), dstBuffer, dstIterator.nextLong()); + } + } else { + while (srcIterator.hasNext()) { + srcBuffer.offset(srcIterator.nextLong()).copyTo(dstBuffer.offset(dstIterator.nextLong()), elementSize); + } + } + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/DenseNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/DenseNdArray.java new file mode 100644 index 00000000000..04ef0d3904f --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/DenseNdArray.java @@ -0,0 +1,63 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public class DenseNdArray extends AbstractDenseNdArray> { + + public static NdArray wrap(DataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new DenseNdArray<>(buffer, shape); + } + + @Override + public NdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof DenseNdArray) { + DenseNdArray denseDst = (DenseNdArray)dst; + DataTransfer.execute(buffer, dimensions(), denseDst.buffer, denseDst.dimensions(), DataTransfer::ofValue); + } else { + slowCopyTo(dst); + } + return this; + } + + protected DenseNdArray(DataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + DenseNdArray instantiate(DataBuffer buffer, DimensionalSpace dimensions) { + return new DenseNdArray<>(buffer, dimensions); + } + + @Override + protected DataBuffer buffer() { + return buffer; + } + + private final DataBuffer buffer; + + private DenseNdArray(DataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} \ No newline at end of file diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/DoubleDenseNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/DoubleDenseNdArray.java new file mode 100644 index 00000000000..63b58b309af --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/DoubleDenseNdArray.java @@ -0,0 +1,104 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.ndarray.DoubleNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public class DoubleDenseNdArray extends AbstractDenseNdArray + implements DoubleNdArray { + + public static DoubleNdArray create(DoubleDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new DoubleDenseNdArray(buffer, shape); + } + + @Override + public double getDouble(long... indices) { + return buffer.getDouble(positionOf(indices, true)); + } + + @Override + public DoubleNdArray setDouble(double value, long... indices) { + buffer.setDouble(value, positionOf(indices, true)); + return this; + } + + @Override + public DoubleNdArray read(double[] dst, int offset) { + Validator.getArrayArgs(this, dst.length, offset); + return read(DataBuffers.from(dst, false, false).offset(offset)); + } + + @Override + public DoubleNdArray write(double[] src, int offset) { + Validator.putArrayArgs(this, src.length, offset); + return write(DataBuffers.from(src, true, false).offset(offset)); + } + + @Override + public DoubleNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof DoubleDenseNdArray) { + DoubleDenseNdArray doubleDst = (DoubleDenseNdArray)dst; + DataTransfer.execute(buffer, dimensions(), doubleDst.buffer, doubleDst.dimensions(), DataTransfer::ofDouble); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public DoubleNdArray read(DoubleDataBuffer dst) { + Validator.readToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofDouble); + return this; + } + + @Override + public DoubleNdArray write(DoubleDataBuffer src) { + Validator.writeFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofDouble); + return this; + } + + protected DoubleDenseNdArray(DoubleDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + DoubleDenseNdArray instantiate(DataBuffer buffer, DimensionalSpace dimensions) { + return new DoubleDenseNdArray((DoubleDataBuffer)buffer, dimensions); + } + + @Override + protected DoubleDataBuffer buffer() { + return buffer; + } + + private final DoubleDataBuffer buffer; + + private DoubleDenseNdArray(DoubleDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} \ No newline at end of file diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/FloatDenseNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/FloatDenseNdArray.java new file mode 100644 index 00000000000..d37502f2b92 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/FloatDenseNdArray.java @@ -0,0 +1,104 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.ndarray.FloatNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public class FloatDenseNdArray extends AbstractDenseNdArray + implements FloatNdArray { + + public static FloatNdArray create(FloatDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new FloatDenseNdArray(buffer, shape); + } + + @Override + public float getFloat(long... indices) { + return buffer.getFloat(positionOf(indices, true)); + } + + @Override + public FloatNdArray setFloat(float value, long... indices) { + buffer.setFloat(value, positionOf(indices, true)); + return this; + } + + @Override + public FloatNdArray read(float[] dst, int offset) { + Validator.getArrayArgs(this, dst.length, offset); + return read(DataBuffers.from(dst, false, false).offset(offset)); + } + + @Override + public FloatNdArray write(float[] src, int offset) { + Validator.putArrayArgs(this, src.length, offset); + return write(DataBuffers.from(src, true, false).offset(offset)); + } + + @Override + public FloatNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof FloatDenseNdArray) { + FloatDenseNdArray floatDst = (FloatDenseNdArray)dst; + DataTransfer.execute(buffer, dimensions(), floatDst.buffer, floatDst.dimensions(), DataTransfer::ofFloat); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public FloatNdArray read(FloatDataBuffer dst) { + Validator.readToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofFloat); + return this; + } + + @Override + public FloatNdArray write(FloatDataBuffer src) { + Validator.writeFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofFloat); + return this; + } + + protected FloatDenseNdArray(FloatDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + FloatDenseNdArray instantiate(DataBuffer buffer, DimensionalSpace dimensions) { + return new FloatDenseNdArray((FloatDataBuffer) buffer, dimensions); + } + + @Override + public FloatDataBuffer buffer() { + return buffer; + } + + private final FloatDataBuffer buffer; + + private FloatDenseNdArray(FloatDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/IntDenseNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/IntDenseNdArray.java new file mode 100644 index 00000000000..bb7682a174c --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/IntDenseNdArray.java @@ -0,0 +1,104 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.ndarray.IntNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public class IntDenseNdArray extends AbstractDenseNdArray + implements IntNdArray { + + public static IntNdArray create(IntDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new IntDenseNdArray(buffer, shape); + } + + @Override + public int getInt(long... indices) { + return buffer.getInt(positionOf(indices, true)); + } + + @Override + public IntNdArray setInt(int value, long... indices) { + buffer.setInt(value, positionOf(indices, true)); + return this; + } + + @Override + public IntNdArray read(int[] dst, int offset) { + Validator.getArrayArgs(this, dst.length, offset); + return read(DataBuffers.from(dst, false, false).offset(offset)); + } + + @Override + public IntNdArray write(int[] src, int offset) { + Validator.putArrayArgs(this, src.length, offset); + return write(DataBuffers.from(src, true, false).offset(offset)); + } + + @Override + public IntNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof IntDenseNdArray) { + IntDenseNdArray intDst = (IntDenseNdArray)dst; + DataTransfer.execute(buffer, dimensions(), intDst.buffer, intDst.dimensions(), DataTransfer::ofInt); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public IntNdArray read(IntDataBuffer dst) { + Validator.readToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofInt); + return this; + } + + @Override + public IntNdArray write(IntDataBuffer src) { + Validator.writeFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofInt); + return this; + } + + protected IntDenseNdArray(IntDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + IntDenseNdArray instantiate(DataBuffer buffer, DimensionalSpace dimensions) { + return new IntDenseNdArray((IntDataBuffer)buffer, dimensions); + } + + @Override + protected IntDataBuffer buffer() { + return buffer; + } + + private final IntDataBuffer buffer; + + private IntDenseNdArray(IntDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} \ No newline at end of file diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/LongDenseNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/LongDenseNdArray.java new file mode 100644 index 00000000000..d702d092b66 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/LongDenseNdArray.java @@ -0,0 +1,104 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.ndarray.LongNdArray; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public class LongDenseNdArray extends AbstractDenseNdArray + implements LongNdArray { + + public static LongNdArray create(LongDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new LongDenseNdArray(buffer, shape); + } + + @Override + public long getLong(long... indices) { + return buffer.getLong(positionOf(indices, true)); + } + + @Override + public LongNdArray setLong(long value, long... indices) { + buffer.setLong(value, positionOf(indices, true)); + return this; + } + + @Override + public LongNdArray read(long[] dst, int offset) { + Validator.getArrayArgs(this, dst.length, offset); + return read(DataBuffers.from(dst, false, false).offset(offset)); + } + + @Override + public LongNdArray write(long[] src, int offset) { + Validator.putArrayArgs(this, src.length, offset); + return write(DataBuffers.from(src, true, false).offset(offset)); + } + + @Override + public LongNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof LongDenseNdArray) { + LongDenseNdArray longDst = (LongDenseNdArray)dst; + DataTransfer.execute(buffer, dimensions(), longDst.buffer, longDst.dimensions(), DataTransfer::ofLong); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public LongNdArray read(LongDataBuffer dst) { + Validator.readToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofLong); + return this; + } + + @Override + public LongNdArray write(LongDataBuffer src) { + Validator.writeFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofLong); + return this; + } + + protected LongDenseNdArray(LongDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + LongDenseNdArray instantiate(DataBuffer buffer, DimensionalSpace dimensions) { + return new LongDenseNdArray((LongDataBuffer)buffer, dimensions); + } + + @Override + protected LongDataBuffer buffer() { + return buffer; + } + + private final LongDataBuffer buffer; + + private LongDenseNdArray(LongDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} \ No newline at end of file diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/ShortDenseNdArray.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/ShortDenseNdArray.java new file mode 100644 index 00000000000..c38e02904ee --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/ShortDenseNdArray.java @@ -0,0 +1,104 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.ShortNdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public class ShortDenseNdArray extends AbstractDenseNdArray + implements ShortNdArray { + + public static ShortNdArray create(ShortDataBuffer buffer, Shape shape) { + Validator.denseShape(buffer, shape); + return new ShortDenseNdArray(buffer, shape); + } + + @Override + public short getShort(long... indices) { + return buffer.getShort(positionOf(indices, true)); + } + + @Override + public ShortNdArray setShort(short value, long... indices) { + buffer.setShort(value, positionOf(indices, true)); + return this; + } + + @Override + public ShortNdArray read(short[] dst, int offset) { + Validator.getArrayArgs(this, dst.length, offset); + return read(DataBuffers.from(dst, false, false).offset(offset)); + } + + @Override + public ShortNdArray write(short[] src, int offset) { + Validator.putArrayArgs(this, src.length, offset); + return write(DataBuffers.from(src, true, false).offset(offset)); + } + + @Override + public ShortNdArray copyTo(NdArray dst) { + Validator.copyToNdArrayArgs(this, dst); + if (dst instanceof ShortDenseNdArray) { + ShortDenseNdArray shortDst = (ShortDenseNdArray)dst; + DataTransfer.execute(buffer, dimensions(), shortDst.buffer, shortDst.dimensions(), DataTransfer::ofShort); + } else { + slowCopyTo(dst); + } + return this; + } + + @Override + public ShortNdArray read(ShortDataBuffer dst) { + Validator.readToBufferArgs(this, dst); + DataTransfer.execute(buffer, dimensions(), dst, DataTransfer::ofShort); + return this; + } + + @Override + public ShortNdArray write(ShortDataBuffer src) { + Validator.writeFromBufferArgs(this, src); + DataTransfer.execute(src, buffer, dimensions(), DataTransfer::ofShort); + return this; + } + + protected ShortDenseNdArray(ShortDataBuffer buffer, Shape shape) { + this(buffer, DimensionalSpace.create(shape)); + } + + @Override + ShortDenseNdArray instantiate(DataBuffer buffer, DimensionalSpace dimensions) { + return new ShortDenseNdArray((ShortDataBuffer)buffer, dimensions); + } + + @Override + protected ShortDataBuffer buffer() { + return buffer; + } + + private final ShortDataBuffer buffer; + + private ShortDenseNdArray(ShortDataBuffer buffer, DimensionalSpace dimensions) { + super(dimensions); + this.buffer = buffer; + } +} \ No newline at end of file diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/Validator.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/Validator.java new file mode 100644 index 00000000000..b46364c158d --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dense/Validator.java @@ -0,0 +1,37 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; + +final class Validator extends org.tensorflow.tools.ndarray.impl.Validator { + + static void denseShape(DataBuffer buffer, Shape shape) { + if (shape == null) { + throw new IllegalArgumentException("Shape cannot be null"); + } + if (shape.hasUnknownDimension()) { + throw new IllegalArgumentException("Dense arrays cannot have unknown dimension(s)"); + } + if (buffer.size() < shape.size()) { + throw new IllegalArgumentException("Buffer size is smaller than the shape size"); + }; + } + + private Validator() {} +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/AbstractDimension.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/AbstractDimension.java new file mode 100644 index 00000000000..dffad75e341 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/AbstractDimension.java @@ -0,0 +1,45 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dimension; + +abstract class AbstractDimension implements Dimension { + + /** + * Dimensions are known to be equal if they have the same number of elements + */ + @Override + public int hashCode() { + final int prime = 17; + long numElements = numElements(); + return 31 * prime + (int)(numElements ^ (numElements >>> 32)); + } + + /** + * Dimensions are known to be equal if they have the same number of elements + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof Dimension) { + Dimension otherDimension = (Dimension) obj; + return numElements() == otherDimension.numElements(); + } + return false; + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/Axis.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/Axis.java new file mode 100644 index 00000000000..e6eb2d6a5c4 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/Axis.java @@ -0,0 +1,56 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dimension; + +final class Axis extends AbstractDimension { + + @Override + public long numElements() { + return numElements; + } + + @Override + public long positionOf(long coord) { + if (coord >= numElements) { + throw new IndexOutOfBoundsException(); + } + return elementSize * coord; + } + + @Override + public boolean isSegmented() { + return false; // all axis are continuous + } + + @Override + public long elementSize() { + return elementSize; + } + + @Override + public String toString() { + return String.valueOf(numElements); + } + + Axis(long numElements, long elementSize) { + this.numElements = numElements; + this.elementSize = elementSize; + } + + private final long numElements; + private final long elementSize; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/Dimension.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/Dimension.java new file mode 100644 index 00000000000..1b0fcaae675 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/Dimension.java @@ -0,0 +1,38 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dimension; + +import org.tensorflow.tools.ndarray.index.Index; + +public interface Dimension { + + default Dimension withIndex(Index index) { + return new IndexedDimension(index, this); + } + + long numElements(); + + long elementSize(); + + default long totalSize() { + return numElements() * elementSize(); + } + + long positionOf(long coord); + + boolean isSegmented(); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/DimensionalSpace.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/DimensionalSpace.java new file mode 100644 index 00000000000..9b4aa2f26f0 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/DimensionalSpace.java @@ -0,0 +1,169 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.ndarray.impl.dimension; + +import java.util.Arrays; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.ndarray.index.Index; + +public class DimensionalSpace { + + public static DimensionalSpace create(Shape shape) { + Dimension[] dimensions = new Dimension[shape.numDimensions()]; + + // Start from the last dimension, where all elements are continuous + for (int i = dimensions.length - 1, elementSize = 1; i >= 0; --i) { + dimensions[i] = new Axis(shape.size(i), elementSize); + elementSize *= dimensions[i].numElements(); + } + return new DimensionalSpace(dimensions, shape); + } + + public RelativeDimensionalSpace mapTo(Index[] indices) { + if (dimensions == null || indices.length > dimensions.length) { + throw new ArrayIndexOutOfBoundsException(); + } + int dimIdx = 0; + int newDimIdx = 0; + int segmentationIdx = -1; + long initialOffset = 0; + + Dimension[] newDimensions = new Dimension[dimensions.length]; + while (dimIdx < indices.length) { + + if (indices[dimIdx].isPoint()) { + // When an index targets a single point in a given dimension, calculate the offset of this + // point and cumulate the offset of any subsequent point as well + long offset = 0; + do { + offset += indices[dimIdx].mapCoordinate(0, dimensions[dimIdx]); + } while (++dimIdx < indices.length && indices[dimIdx].isPoint()); + + // If this is the first index, then the offset is the position of the whole dimension + // space within the original one. If not, then we apply the offset to the last vectorial + // dimension + if (newDimIdx == 0) { + initialOffset = offset; + } else { + long reducedSize = dimensions[dimIdx - 1].elementSize(); + newDimensions[newDimIdx - 1] = new ReducedDimension(newDimensions[newDimIdx - 1], offset, reducedSize); + segmentationIdx = newDimIdx - 1; + } + + } else { + // Map any other index to the appropriate dimension of this space + Dimension newDimension = indices[dimIdx].apply(dimensions[dimIdx++]); + newDimensions[newDimIdx] = newDimension; + if (newDimension.isSegmented()) { + segmentationIdx = newDimIdx; + } + ++newDimIdx; + } + } + + // When the number of indices provided is smaller than the number of dimensions in this space, + // we copy the remaining dimensions directly to the new space as well. + for (; dimIdx < dimensions.length; ++dimIdx, ++newDimIdx) { + Dimension dim = dimensions[dimIdx]; + newDimensions[newDimIdx] = dim; + if (dim.isSegmented()) { + segmentationIdx = newDimIdx; + } + } + return new RelativeDimensionalSpace(Arrays.copyOf(newDimensions, newDimIdx), segmentationIdx, initialOffset); + } + + public DimensionalSpace from(int dimensionStart) { + if (dimensionStart > dimensions.length) { + throw new IndexOutOfBoundsException(); + } + Dimension[] newDimensions = Arrays.copyOfRange(dimensions, dimensionStart, dimensions.length); + if (segmentationIdx > dimensionStart) { + return new DimensionalSpace(newDimensions, segmentationIdx - dimensionStart); + } + return new DimensionalSpace(newDimensions); + } + + public Shape shape() { + if (shape == null) { + shape = shape(dimensions); + } + return shape; + } + + public int numDimensions() { + return dimensions.length; + } + + public long numElements(int i) { + return dimensions[i].numElements(); + } + + public Dimension get(int i) { + return dimensions[i]; + } + + public boolean isSegmented() { + return segmentationIdx >= 0; + } + + public int segmentationIdx() { + return segmentationIdx; + } + + public long positionOf(long[] coords) { + long position = 0L; + for (int i = 0; i < coords.length; ++i) { + position += dimensions[i].positionOf(coords[i]); + } + return position; + } + + /** Succinct description of the shape meant for debugging. */ + @Override + public String toString() { + return Arrays.toString(dimensions); + } + + DimensionalSpace(Dimension[] dimensions, int segmentationIdx) { + this.dimensions = dimensions; + this.segmentationIdx = segmentationIdx; + } + + private DimensionalSpace(Dimension[] dimensions) { + this(dimensions, -1); + } + + private DimensionalSpace(Dimension[] dimensions, Shape shape) { + this(dimensions); + this.shape = shape; + } + + private final Dimension[] dimensions; + private final int segmentationIdx; + private Shape shape; + + private static Shape shape(Dimension[] dimensions) { + long[] shapeDimSizes = new long[dimensions.length]; + int i = 0; + for (Dimension dimension : dimensions) { + shapeDimSizes[i++] = dimension.numElements(); + } + return Shape.make(shapeDimSizes); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/IndexedDimension.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/IndexedDimension.java new file mode 100644 index 00000000000..7858addc7cb --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/IndexedDimension.java @@ -0,0 +1,61 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dimension; + +import org.tensorflow.tools.ndarray.index.Index; + +final class IndexedDimension extends AbstractDimension { + + @Override + public long numElements() { + return numElements; + } + + @Override + public long positionOf(long coord) { + if (coord >= numElements()) { + throw new IndexOutOfBoundsException(); + } + return originalDimension.positionOf(index.mapCoordinate(coord, originalDimension)); + } + + @Override + public boolean isSegmented() { + // TODO for now we consider all indexed dimensions as segmented but might depend on the actual index + return true; + } + + @Override + public long elementSize() { + return originalDimension.elementSize(); // indices do not change the size of a inner element + } + + @Override + public String toString() { + return String.valueOf(numElements()); + } + + IndexedDimension(Index index, Dimension originalDimension) { + this.index = index; + this.originalDimension = originalDimension; + this.numElements = index.numElements(originalDimension); + } + + private final Index index; + private final Dimension originalDimension; + private final long numElements; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/ReducedDimension.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/ReducedDimension.java new file mode 100644 index 00000000000..4f45fc5f36e --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/ReducedDimension.java @@ -0,0 +1,55 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dimension; + +final class ReducedDimension extends AbstractDimension { + + @Override + public long numElements() { + return originalDimension.numElements(); + } + + @Override + public long positionOf(long coord) { + return originalDimension.positionOf(coord) + offset; + } + + @Override + public boolean isSegmented() { + return true; + } + + @Override + public long elementSize() { + return elementSize; + } + + @Override + public String toString() { + return String.valueOf(numElements()); + } + + ReducedDimension(Dimension originalDimension, long offset, long elementSize) { + this.originalDimension = originalDimension; + this.offset = offset; + this.elementSize = elementSize; + } + + private final Dimension originalDimension; + private final long offset; + private final long elementSize; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/RelativeDimensionalSpace.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/RelativeDimensionalSpace.java new file mode 100644 index 00000000000..f2496b3efc8 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/dimension/RelativeDimensionalSpace.java @@ -0,0 +1,32 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ + +package org.tensorflow.tools.ndarray.impl.dimension; + +public class RelativeDimensionalSpace extends DimensionalSpace { + + public long position() { + return position; + } + + RelativeDimensionalSpace(Dimension[] dimensions, int segmentationIdx, long position) { + super(dimensions, segmentationIdx); + this.position = position; + } + + private long position; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/ElementSequence.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/ElementSequence.java new file mode 100644 index 00000000000..9c42cab1318 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/ElementSequence.java @@ -0,0 +1,52 @@ +package org.tensorflow.tools.ndarray.impl.sequence; + +import java.util.Iterator; +import java.util.function.BiConsumer; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.NdArraySequence; +import org.tensorflow.tools.ndarray.impl.AbstractNdArray; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public class ElementSequence> implements NdArraySequence { + + public static > NdArraySequence create(AbstractNdArray ndArray, int dimensionIdx) { + if (ndArray.rank() == 0 && dimensionIdx < 0) { + return new SingleElementSequence<>(ndArray); + } + return new ElementSequence<>(ndArray, dimensionIdx); + } + + @Override + public Iterator iterator() { + DimensionalSpace elementDimensions = ndArray.dimensions().from(dimensionIdx + 1); + PositionIterator positionIterator = PositionIterator.create(ndArray.dimensions(), dimensionIdx); + return new Iterator() { + + @Override + public boolean hasNext() { + return positionIterator.hasNext(); + } + + @Override + public U next() { + return ndArray.slice(positionIterator.next(), elementDimensions); + } + }; + } + + @Override + public void forEachIndexed(BiConsumer consumer) { + DimensionalSpace elementDimensions = ndArray.dimensions().from(dimensionIdx + 1); + PositionIterator.createIndexed(ndArray.dimensions(), dimensionIdx).forEachIndexed((long[] coords, long position) -> + consumer.accept(coords, ndArray.slice(position, elementDimensions)) + ); + } + + private ElementSequence(AbstractNdArray ndArray, int dimensionIdx) { + this.ndArray = ndArray; + this.dimensionIdx = dimensionIdx; + } + + private final AbstractNdArray ndArray; + private final int dimensionIdx; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/IndexedPositionIterator.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/IndexedPositionIterator.java new file mode 100644 index 00000000000..784fc1d0f77 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/IndexedPositionIterator.java @@ -0,0 +1,11 @@ +package org.tensorflow.tools.ndarray.impl.sequence; + +public interface IndexedPositionIterator extends PositionIterator { + + @FunctionalInterface + interface CoordsLongConsumer { + void consume(long[] coords, long position); + } + + void forEachIndexed(CoordsLongConsumer consumer); +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/IndexedSequentialPositionIterator.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/IndexedSequentialPositionIterator.java new file mode 100644 index 00000000000..c25bf588ca4 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/IndexedSequentialPositionIterator.java @@ -0,0 +1,23 @@ +package org.tensorflow.tools.ndarray.impl.sequence; + +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +class IndexedSequentialPositionIterator extends SequentialPositionIterator implements IndexedPositionIterator { + + @Override + public void forEachIndexed(CoordsLongConsumer consumer) { + while (hasNext()) { + consumer.consume(coords, nextLong()); + NdPositionIterator.increment(coords, dimensions); + } + } + + IndexedSequentialPositionIterator(DimensionalSpace dimensions, int dimensionIdx) { + super(dimensions, dimensionIdx); + this.dimensions = dimensions; + this.coords = new long[dimensionIdx + 1]; + } + + private final DimensionalSpace dimensions; + private final long[] coords; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/NdPositionIterator.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/NdPositionIterator.java new file mode 100644 index 00000000000..e52b7bcee4f --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/NdPositionIterator.java @@ -0,0 +1,49 @@ +package org.tensorflow.tools.ndarray.impl.sequence; + +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +class NdPositionIterator implements IndexedPositionIterator { + + @Override + public boolean hasNext() { + return coords != null; + } + + @Override + public long nextLong() { + long position = dimensions.positionOf(coords); + increment(); + return position; + } + + @Override + public void forEachIndexed(CoordsLongConsumer consumer) { + while (hasNext()) { + consumer.consume(coords, dimensions.positionOf(coords)); + increment(); + } + } + + private void increment() { + if (!increment(coords, dimensions)) { + coords = null; + } + } + + static boolean increment(long[] coords, DimensionalSpace dimensions) { + for (int i = coords.length - 1; i >= 0; --i) { + if ((coords[i] = (coords[i] + 1) % dimensions.get(i).numElements()) > 0) { + return true; + } + } + return false; + } + + NdPositionIterator(DimensionalSpace dimensions, int dimensionIdx) { + this.dimensions = dimensions; + this.coords = new long[dimensionIdx + 1]; + } + + private final DimensionalSpace dimensions; + private long[] coords; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/PositionIterator.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/PositionIterator.java new file mode 100644 index 00000000000..e1cf74d9674 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/PositionIterator.java @@ -0,0 +1,25 @@ +package org.tensorflow.tools.ndarray.impl.sequence; + +import java.util.PrimitiveIterator; +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +public interface PositionIterator extends PrimitiveIterator.OfLong { + + static PositionIterator create(DimensionalSpace dimensions, int dimensionIdx) { + if (dimensions.isSegmented()) { + return new NdPositionIterator(dimensions, dimensionIdx); + } + return new SequentialPositionIterator(dimensions, dimensionIdx); + } + + static IndexedPositionIterator createIndexed(DimensionalSpace dimensions, int dimensionIdx) { + if (dimensions.isSegmented()) { + return new NdPositionIterator(dimensions, dimensionIdx); + } + return new IndexedSequentialPositionIterator(dimensions, dimensionIdx); + } + + static PositionIterator sequence(long stride, long end) { + return new SequentialPositionIterator(stride, end); + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/SequentialPositionIterator.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/SequentialPositionIterator.java new file mode 100644 index 00000000000..fa83eb0073f --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/SequentialPositionIterator.java @@ -0,0 +1,34 @@ +package org.tensorflow.tools.ndarray.impl.sequence; + +import org.tensorflow.tools.ndarray.impl.dimension.DimensionalSpace; + +class SequentialPositionIterator implements PositionIterator { + + @Override + public boolean hasNext() { + return index < end; + } + + @Override + public long nextLong() { + return stride * index++; + } + + SequentialPositionIterator(DimensionalSpace dimensions, int dimensionIdx) { + long size = 1; + for (int i = 0; i <= dimensionIdx; ++i) { + size *= dimensions.get(i).numElements(); + } + this.stride = dimensions.get(dimensionIdx).elementSize(); + this.end = size; + } + + SequentialPositionIterator(long stride, long end) { + this.stride = stride; + this.end = end; + } + + private final long stride; + private final long end; + private long index; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/SingleElementSequence.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/SingleElementSequence.java new file mode 100644 index 00000000000..f0269fcc332 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/impl/sequence/SingleElementSequence.java @@ -0,0 +1,43 @@ +package org.tensorflow.tools.ndarray.impl.sequence; + +import java.util.Iterator; +import java.util.function.BiConsumer; +import org.tensorflow.tools.ndarray.IllegalRankException; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.NdArraySequence; +import org.tensorflow.tools.ndarray.impl.AbstractNdArray; + +class SingleElementSequence> implements NdArraySequence { + + @Override + public Iterator iterator() { + return new Iterator() { + + @Override + public boolean hasNext() { + return element != null; + } + + @Override + public U next() { + U ret = element; + element = null; + return ret; + } + + @SuppressWarnings("unchecked") + private U element = (U)ndArray; + }; + } + + @Override + public void forEachIndexed(BiConsumer consumer) { + throw new IllegalRankException("Single element has no coordinates to iterate on, use forEach()"); + } + + SingleElementSequence(AbstractNdArray ndArray) { + this.ndArray = ndArray; + } + + private final AbstractNdArray ndArray; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/All.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/All.java new file mode 100644 index 00000000000..59cca626b41 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/All.java @@ -0,0 +1,42 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class All implements Index { + + static final All INSTANCE = new All(); + + @Override + public long numElements(Dimension dim) { + return dim.numElements(); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return coordinate; + } + + @Override + public Dimension apply(Dimension dim) { + return dim; + } + + private All() { + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/At.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/At.java new file mode 100644 index 00000000000..eacae938e46 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/At.java @@ -0,0 +1,48 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class At implements Index { + + @Override + public long numElements(Dimension dim) { + return 1; + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return dim.positionOf(coord); // TODO validate coordinate is 0? + } + + @Override + public Dimension apply(Dimension dim) { + throw new IllegalStateException(); // FIXME? + } + + @Override + public boolean isPoint() { + return true; + } + + At(long coord) { + this.coord = coord; + } + + private final long coord; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Even.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Even.java new file mode 100644 index 00000000000..43b69e90496 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Even.java @@ -0,0 +1,37 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class Even implements Index { + + static final Even INSTANCE = new Even(); + + @Override + public long numElements(Dimension dim) { + return (dim.numElements() >> 1) + (dim.numElements() % 2); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return coordinate << 1; + } + + private Even() { + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Flip.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Flip.java new file mode 100644 index 00000000000..26ec8b461a5 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Flip.java @@ -0,0 +1,34 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class Flip implements Index { + + static final Flip INSTANCE = new Flip(); + + @Override + public long numElements(Dimension dim) { + return dim.numElements(); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return dim.numElements() - coordinate - 1; + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/From.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/From.java new file mode 100644 index 00000000000..1cc6d0a985a --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/From.java @@ -0,0 +1,38 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class From implements Index { + + @Override + public long numElements(Dimension dim) { + return dim.numElements() - start; + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return start + coordinate; + } + + From(long start) { + this.start = start; + } + + private final long start; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Index.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Index.java new file mode 100644 index 00000000000..02a0f8fd1f1 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Index.java @@ -0,0 +1,77 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +/** + * An index used for slicing a view out of an N-dimensional array. + * + *

A slice, i.e. a reduced view, of an N-dimensional array is obtain by calling + * {@link NdArray#slice(Index...)}, given a list of indices + * that select which elements on a given dimension should be included/excluded + * from that view. + */ +public interface Index { + + /** + * Returns the number of elements that can be retrieved using this index on the + * given dimension. + * + *

An index that maps one-by-one all elements of the dimensions will return a value + * equal to {@code dim.numElements()}, while an index that only maps a subset of these + * will return a smaller value. + * + * @param dim the indexed dimension + * @return number of elements accessible + */ + long numElements(Dimension dim); + + /** + * Transforms an element coordinate to a new coordinate by applying this index to the + * given dimension. + * + *

For example, if the coordinate is 0 and this index flips the {@code n} elements on this + * dimension, then the returned value will be {@code n-1}. + * + * @param coordinate coordinate to transform + * @param dim dimension the indexed dimension + * @return transformed coordinate + */ + long mapCoordinate(long coordinate, Dimension dim); + + /** + * Applies this index to the given dimension. + * + *

When accessing the elements from the returned dimension, this index will automatically + * apply and may transform the original position. + * + * @param dim dimension to apply this index to + * @return an indexed dimension + */ + default Dimension apply(Dimension dim) { + return dim.withIndex(this); + } + + /** + * Returns true if this index is a single point, reducing the number of dimensions by one + */ + default boolean isPoint() { + return false; + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Indices.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Indices.java new file mode 100644 index 00000000000..1de2e886688 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Indices.java @@ -0,0 +1,204 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.IllegalRankException; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.NdArrays; + +/** + * Helper class for instantiating {@link Index} objects. + */ +public final class Indices { + + /** + * A coordinate that selects a specific element on a given dimension. + * + *

When this index is applied to a given dimension, the dimension is resolved as a + * single element and therefore is excluded from the computation of the rank. + * + *

For example, given a 3D matrix on the axis [x, y, z], if + * {@code matrix.slice(all(), at(0), at(0)}, then the rank of the returned slice is 1 and its + * number of elements is {@code x.numElements()} + * + * @param coord coordinate of the element on the indexed axis + * @return index + */ + public static Index at(long coord) { + return new At(coord); + } + + /** + * A coordinate that selects a specific element on a given dimension. + * + *

This is equivalent to call {@link #at(long)} but where the value of the coordinate is + * provided by an N-dimensional array. + * + * @param coord scalar indicating the coordinate of the element on the indexed axis + * @return index + * @throws IllegalRankException if {@code coord} is not a scalar (rank 0) + */ + public static Index at(NdArray coord) { + if (coord.rank() > 0) { + throw new IllegalRankException("Only scalars are accepted as a value index"); + } + return new At(coord.getObject().longValue()); + } + + /** + * An index that returns all elements of a dimension in the original order. + * + *

Applying this index to a given dimension will return the original dimension + * directly. + * + *

For example, given a vector with {@code n} elements, {@code all()} returns + * x0, x1, ..., xn-1 + * + * @return index + */ + public static Index all() { + return All.INSTANCE; + } + + /** + * An index that returns only specific elements on a given dimension. + * + *

For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > 10}, + * {@code seq(8, 0, 3)} returns x8, x0, x3 + * + * @param coords coordinates of the elements in the sequence + * @return index + */ + public static Index seq(long... coords) { + if (coords == null) { + throw new IllegalArgumentException(); + } + return new Sequence(NdArrays.wrap(DataBuffers.from(coords, true, false), Shape.make(coords.length))); + } + + /** + * An index that returns only specific elements on a given dimension. + * + *

This is equivalent to {@link #seq(long...)} but where the coordinates of the elements in + * the sequence are provided by an N-dimensional array. + * + * @param coords vector of coordinates of the elements in the sequence + * @return index + * @throws IllegalRankException if {@code coords} is not a vector (rank 1) + */ + public static Index seq(NdArray coords) { + if (coords.rank() != 1) { + throw new IllegalRankException("Only vectors are accepted as an element index"); + } + return new Sequence(coords); + } + + /** + * An index that returns only elements found at an even position in the + * original dimension. + * + *

For example, given a vector with {@code n} elements on the {@code x} axis, and n is even, + * {@code even()} returns x0, x2, ..., xn-2 + * + * @return index + */ + public static Index even() { + return Even.INSTANCE; + } + + /** + * An index that returns only elements found at an odd position in the + * original dimension. + * + *

For example, given a vector with {@code n} elements on the {@code x} axis, and n is even, + * {@code odd()} returns x1, x3, ..., xn-1 + * + * @return index + */ + public static Index odd() { + return Odd.INSTANCE; + } + + /** + * An index that skips a fixed amount of coordinates between each values returned. + * + *

For example, given a vector with {@code n} elements on the {@code x} axis, + * {@code step(k)} returns x0, xk, xk*2, ... + * + * @param stepLength the number of elements between each steps + * @return index + */ + public static Index step(long stepLength) { + return new Step(stepLength); + } + + /** + * An index that returns only elements on a given dimension starting at a + * specific coordinate. + * + *

For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > k}, + * {@code from(k)} returns xk, xk+1, ..., xn-1 + * + * @param start coordinate of the first element of the sequence + * @return index + */ + public static Index from(long start) { + return new From(start); + } + + /** + * An index that returns only elements on a given dimension up to a + * specific coordinate. + * + *

For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > k}, + * {@code to(k)} returns x0, x1, ..., xk + * + * @param end coordinate of the last element of the sequence (exclusive) + * @return index + */ + public static Index to(long end) { + return new To(end); + } + + /** + * An index that returns only elements on a given dimension between two coordinates. + * + *

For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > k > j}, + * {@code range(j, k)} returns xj, xj+1, ..., xk + * + * @param start coordinate of the first element of the sequence + * @param end coordinate of the last element of the sequence (exclusive) + * @return index + */ + public static Index range(long start, long end) { + return new Range(start, end); + } + + /** + * An index that returns only elements on a given dimension between two coordinates. + * + *

For example, given a vector with {@code n} elements on the {@code x} axis, and {@code n > k > j}, + * {@code range(j, k)} returns xj, xj+1, ..., xk + * + * @return index + */ + public static Index flip() { + return Flip.INSTANCE; + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Odd.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Odd.java new file mode 100644 index 00000000000..665c72a663d --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Odd.java @@ -0,0 +1,37 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class Odd implements Index { + + static final Odd INSTANCE = new Odd(); + + @Override + public long numElements(Dimension dim) { + return dim.numElements() >> 1; + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return (coordinate << 1) + 1; + } + + private Odd() { + } +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Range.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Range.java new file mode 100644 index 00000000000..ffce5791e27 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Range.java @@ -0,0 +1,40 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class Range implements Index { + + @Override + public long numElements(Dimension dim) { + return end - start; + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return start + coordinate; + } + + Range(long start, long end) { + this.start = start; + this.end = end; + } + + private final long start; + private final long end; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Sequence.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Sequence.java new file mode 100644 index 00000000000..c7518ccf3a8 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Sequence.java @@ -0,0 +1,39 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class Sequence implements Index { + + @Override + public long numElements(Dimension dim) { + return coords.size(); + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return coords.getObject(coordinate).longValue(); + } + + Sequence(NdArray coords) { + this.coords = coords; + } + + private final NdArray coords; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Step.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Step.java new file mode 100644 index 00000000000..da7160863ae --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/Step.java @@ -0,0 +1,38 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class Step implements Index { + + @Override + public long numElements(Dimension dim) { + return (dim.numElements() / stepLength) + 1; // FIXME always include element 0? + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return coordinate * stepLength; + } + + Step(long stepLength) { + this.stepLength = stepLength; + } + + private final long stepLength; +} diff --git a/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/To.java b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/To.java new file mode 100644 index 00000000000..6705d1a6948 --- /dev/null +++ b/tensorflow-tools/src/main/java/org/tensorflow/tools/ndarray/index/To.java @@ -0,0 +1,38 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.index; + +import org.tensorflow.tools.ndarray.impl.dimension.Dimension; + +final class To implements Index { + + @Override + public long numElements(Dimension dim) { + return end; + } + + @Override + public long mapCoordinate(long coordinate, Dimension dim) { + return coordinate; + } + + To(long end) { + this.end = end; + } + + private final long end; +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ShapeTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ShapeTest.java new file mode 100644 index 00000000000..8e8ac0297d2 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ShapeTest.java @@ -0,0 +1,75 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.fail; + +import org.junit.Test; + +public class ShapeTest { + + @Test + public void allKnownDimensions() { + Shape shape = Shape.make(5, 4, 5); + assertEquals(3, shape.numDimensions()); + assertEquals(5, shape.size(0)); + assertEquals(4, shape.size(1)); + assertEquals(5, shape.size(2)); + assertEquals(100, shape.size()); + assertArrayEquals(new long[] {5, 4, 5}, shape.asArray()); + try { + shape.size(3); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + shape.size(-1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } + + @Test + public void hashCodeEquals() { + Shape shape1 = Shape.make(5, 4, 5); + Shape shape2 = Shape.make(5, 4, 5); + Shape shape3 = Shape.make(5, 4, 5, 6); + Shape shape4 = Shape.make(5, 4, 1); + + assertEquals(shape1, shape2); + assertEquals(shape1.hashCode(), shape2.hashCode()); + assertNotEquals(shape1, shape3); + assertNotEquals(shape1.hashCode(), shape3.hashCode()); + assertNotEquals(shape1, shape4); + assertNotEquals(shape1.hashCode(), shape4.hashCode()); + + Shape scalar1 = Shape.make(); + Shape scalar2 = Shape.make(); + assertEquals(scalar1, scalar2); + assertNotEquals(scalar1, shape1); + + Shape unknown1 = Shape.make(-1, 4, 5); + Shape unknown2 = Shape.make(-1, 4, 5); + assertNotEquals(unknown1, unknown2); + assertNotEquals(unknown1, shape1); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/benchmark/NdArrayBenchmark.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/benchmark/NdArrayBenchmark.java new file mode 100644 index 00000000000..25214cfdf66 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/benchmark/NdArrayBenchmark.java @@ -0,0 +1,146 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.benchmark; + +import static org.tensorflow.tools.ndarray.index.Indices.all; +import static org.tensorflow.tools.ndarray.index.Indices.at; + +import java.awt.image.BufferedImage; +import java.awt.image.Raster; +import java.io.IOException; +import javax.imageio.ImageIO; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.runner.RunnerException; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.ndarray.FloatNdArray; +import org.tensorflow.tools.ndarray.NdArrays; + +@Fork(value = 1, jvmArgs = {"-Xms4G", "-Xmx4G"}) +@BenchmarkMode(Mode.AverageTime) +@Warmup(iterations = 3) +@Measurement(iterations = 5) +@State(Scope.Benchmark) +public class NdArrayBenchmark { + + static final String TEST_IMAGE = "castle.jpg"; + static final int BATCH_SIZE = 60; + + private FloatNdArray pixels; + private FloatNdArray channels; + private FloatNdArray batches; + private FloatNdArray firstBatch; + + @Setup + public void setUp() throws IOException { + BufferedImage image = ImageIO.read(getClass().getClassLoader().getResourceAsStream(TEST_IMAGE)); + + int numPixels = image.getWidth() * image.getHeight(); + pixels = NdArrays.ofFloats(Shape.make(numPixels, 3)); + channels = NdArrays.ofFloats(Shape.make(3, numPixels)); + + Raster imageData = image.getData(); + float[] pixel = new float[3]; + for (int y = 0, pixelIdx = 0; y < image.getHeight(); ++y) { + for (int x = 0; x < image.getWidth(); ++x, ++pixelIdx) { + imageData.getPixel(x, y, pixel); + pixels.get(pixelIdx).write(pixel); + channels.slice(all(), at(pixelIdx)).write(pixel); + } + } + batches = NdArrays.ofFloats(Shape.make(BATCH_SIZE, 3, numPixels)); + firstBatch = batches.get(0); + } + + @Benchmark + @Measurement(batchSize = 2049 * 1537) + public void getElementAtIndex() { + pixels.get(0); + } + + @Benchmark + @Measurement(batchSize = 2049 * 1537) + public void slicing() { + batches.slice(at(0), all(), at(0)); + } + + @Benchmark + public void iteratingAllPixels() { + pixels.elements(0).forEach(pixel -> {}); + } + + @Benchmark + @Measurement(batchSize = BATCH_SIZE) + public void writeFirstBatchChannels() { + firstBatch.set(channels); + } + + @Benchmark + public void writeAllBatchChannels() { + batches.elements(0).forEach(batch -> + batch.set(channels) + ); + } + + @Benchmark + @Measurement(batchSize = 2049 * 1537) + public void writeOnePixelBySlicing() { + batches.slice(at(0), all(), at(0)).set(pixels.get(0)); + } + + @Benchmark + public void writeAllPixelsBySlicing() { + batches.elements(0).forEach(batch -> + pixels.elements(0).forEachIndexed((coords, pixel) -> + batch.slice(all(), at(coords[0])).set(pixel) + ) + ); + } + + @Benchmark + @Measurement(batchSize = 2049 * 1537) + public void writeOnePixelsByIndex() { + batches + .setFloat(pixels.getFloat(0, 0), 0, 0, 0) + .setFloat(pixels.getFloat(0, 1), 0, 1, 0) + .setFloat(pixels.getFloat(0, 2), 0, 2, 0); + } + + @Benchmark + public void writeAllPixelsByIndex() { + batches.elements(0).forEach(batch -> + pixels.elements(0).forEachIndexed((coords, pixel) -> { + long pixelIndex = coords[0]; + batch + .setFloat(pixel.getFloat(0), 0, pixelIndex) + .setFloat(pixel.getFloat(1), 1, pixelIndex) + .setFloat(pixel.getFloat(2), 2, pixelIndex); + }) + ); + } + + public static void main(String[] args) throws IOException, RunnerException { + org.openjdk.jmh.Main.main(args); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/BooleanDataBufferTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/BooleanDataBufferTestBase.java new file mode 100644 index 00000000000..45f3e5798dc --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/BooleanDataBufferTestBase.java @@ -0,0 +1,64 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertFalse; + +import java.util.Arrays; +import org.junit.Test; + +public abstract class BooleanDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract BooleanDataBuffer allocate(long size); + + @Override + protected Boolean valueOf(Long val) { + return val != 0; + } + + @Test + public void writeAndReadFromArray() { + BooleanDataBuffer buffer = allocate(10L); + boolean[] values = new boolean[]{true, false, false, true, false}; + + buffer.write(values); + assertTrue(buffer.getObject(0)); + assertFalse(buffer.getObject(1)); + + buffer.offset(5).write(values); + assertTrue(buffer.getObject(5)); + + boolean[] read = new boolean[5]; + buffer.read(read); + assertArrayEquals(values, read); + + buffer.write(values, 2, 3); + assertFalse(buffer.getObject(0)); + assertTrue(buffer.getObject(1)); + assertFalse(buffer.getObject(2)); + + Arrays.fill(read, false); + buffer.read(read, 1, 2); + assertFalse(read[0]); + assertFalse(read[1]); + assertTrue(read[2]); + assertFalse(read[3]); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/ByteDataBufferTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/ByteDataBufferTestBase.java new file mode 100644 index 00000000000..b922c528223 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/ByteDataBufferTestBase.java @@ -0,0 +1,63 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import org.junit.Test; + +public abstract class ByteDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract ByteDataBuffer allocate(long size); + + @Override + protected Byte valueOf(Long val) { + return val.byteValue(); + } + + @Test + public void writeAndReadFromArray() { + ByteDataBuffer buffer = allocate(10L); + byte[] oneToFive = new byte[]{ 1, 2, 3, 4, 5 }; + + buffer.write(oneToFive); + assertEquals(2, buffer.getByte(1)); + + buffer.offset(5).write(oneToFive); + assertEquals(2, buffer.getByte(1)); + assertEquals(2, buffer.getByte(6)); + + byte[] read = new byte[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read); + + buffer.write(oneToFive, 2, 2); + assertEquals(3, buffer.getByte(0)); + assertEquals(4, buffer.getByte(1)); + assertEquals(3, buffer.getByte(2)); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0, read[0]); + assertEquals(3, read[1]); + assertEquals(4, read[2]); + assertEquals(0, read[3]); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/DataBufferTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/DataBufferTestBase.java new file mode 100644 index 00000000000..97574d6b574 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/DataBufferTestBase.java @@ -0,0 +1,158 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.junit.Test; + +public abstract class DataBufferTestBase { + + protected final boolean enableLargeBufferTests = System.getProperty("testLargeBuffers") != null; + + protected long maxSize() { + return DataBuffers.MAX_32BITS; + } + + protected abstract DataBuffer allocate(long size); + + protected abstract T valueOf(Long val); + + @Test + public void bufferSize() { + DataBuffer buffer = allocate(10L); + assertEquals(10L, buffer.size()); + + buffer = allocate(0L); + assertEquals(0L, buffer.size()); + + if (enableLargeBufferTests) { + buffer = allocate(maxSize()); + assertEquals(maxSize(), buffer.size()); + } + } + + @Test + public void offsetAndNarrow() { + DataBuffer buffer = allocate(10L); + buffer.setObject(valueOf(100L), 6); + assertEquals(10L, buffer.size()); + assertEquals(valueOf(100L), buffer.getObject(6)); + + DataBuffer subBuffer = buffer.offset(3L); + assertEquals(7L, subBuffer.size()); + assertEquals(valueOf(100L), subBuffer.getObject(3)); + + subBuffer = subBuffer.narrow(2L); + assertEquals(2L, subBuffer.size()); + try { + subBuffer.getObject(3); + fail(); + } catch (IndexOutOfBoundsException e) { + //as expected + } + try { + buffer.offset(-1L); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + buffer.offset(11L); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + buffer.narrow(-1L); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + buffer.narrow(11L); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } + + @Test + public void putAndGet() { + DataBuffer buffer = allocate(10L); + + buffer.setObject(valueOf(5L), 5L); + assertEquals(valueOf(5L), buffer.getObject(5L)); + try { + buffer.setObject(valueOf(10L), 10L); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + buffer.getObject(10L); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + buffer.setObject(valueOf(-1L), -1L); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + buffer.getObject(-1L); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } + + @Test + public void copyToBuffer() { + DataBuffer srcBuffer = allocate(25L); + srcBuffer.setObject(valueOf(5L), 5L); + srcBuffer.setObject(valueOf(10L), 10L); + srcBuffer.setObject(valueOf(15L), 15L); + srcBuffer.setObject(valueOf(20L), 20L); + try { + srcBuffer.copyTo(srcBuffer, srcBuffer.size()); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + DataBuffer dstBuffer = allocate(30L); + srcBuffer.copyTo(dstBuffer, srcBuffer.size()); + assertEquals(valueOf(5L), dstBuffer.getObject(5L)); + try { + srcBuffer.copyTo(dstBuffer, dstBuffer.size()); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + dstBuffer.copyTo(srcBuffer, dstBuffer.size()); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/DoubleDataBufferTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/DoubleDataBufferTestBase.java new file mode 100644 index 00000000000..715f8d6329b --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/DoubleDataBufferTestBase.java @@ -0,0 +1,63 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import org.junit.Test; + +public abstract class DoubleDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract DoubleDataBuffer allocate(long size); + + @Override + protected Double valueOf(Long val) { + return val.doubleValue(); + } + + @Test + public void writeAndReadFromArray() { + DoubleDataBuffer buffer = allocate(10L); + double[] oneToFive = new double[]{ 1.0, 2.0, 3.0, 4.0, 5.0 }; + + buffer.write(oneToFive); + assertEquals(2.0, buffer.getDouble(1), 0.0); + + buffer.offset(5).write(oneToFive); + assertEquals(2.0, buffer.getDouble(1), 0.0); + assertEquals(2.0, buffer.getDouble(6), 0.0); + + double[] read = new double[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read, 0.0); + + buffer.write(oneToFive, 2, 2); + assertEquals(3.0, buffer.getDouble(0), 0.0); + assertEquals(4.0, buffer.getDouble(1), 0.0); + assertEquals(3.0, buffer.getDouble(2), 0.0); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0.0, read[0], 0.0); + assertEquals(3.0, read[1], 0.0); + assertEquals(4.0, read[2], 0.0); + assertEquals(0.0, read[3], 0.0); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/FloatDataBufferTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/FloatDataBufferTestBase.java new file mode 100644 index 00000000000..3c60eb92a2a --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/FloatDataBufferTestBase.java @@ -0,0 +1,63 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import org.junit.Test; + +public abstract class FloatDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract FloatDataBuffer allocate(long size); + + @Override + protected Float valueOf(Long val) { + return val.floatValue(); + } + + @Test + public void writeAndReadFromArray() { + FloatDataBuffer buffer = allocate(10L); + float[] oneToFive = new float[]{ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f }; + + buffer.write(oneToFive); + assertEquals(2.0f, buffer.getFloat(1), 0.0f); + + buffer.offset(5).write(oneToFive); + assertEquals(2.0f, buffer.getFloat(1), 0.0f); + assertEquals(2.0f, buffer.getFloat(6), 0.0f); + + float[] read = new float[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read, 0.0f); + + buffer.write(oneToFive, 2, 2); + assertEquals(3.0f, buffer.getFloat(0), 0.0f); + assertEquals(4.0f, buffer.getFloat(1), 0.0f); + assertEquals(3.0f, buffer.getFloat(2), 0.0f); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0.0f, read[0], 0.0f); + assertEquals(3.0f, read[1], 0.0f); + assertEquals(4.0f, read[2], 0.0f); + assertEquals(0.0f, read[3], 0.0f); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/IntDataBufferTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/IntDataBufferTestBase.java new file mode 100644 index 00000000000..fd4badc6c9c --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/IntDataBufferTestBase.java @@ -0,0 +1,63 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import org.junit.Test; + +public abstract class IntDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract IntDataBuffer allocate(long size); + + @Override + protected Integer valueOf(Long val) { + return val.intValue(); + } + + @Test + public void writeAndReadFromArray() { + IntDataBuffer buffer = allocate(10L); + int[] oneToFive = new int[]{ 1, 2, 3, 4, 5 }; + + buffer.write(oneToFive); + assertEquals(2, buffer.getInt(1)); + + buffer.offset(5).write(oneToFive); + assertEquals(2, buffer.getInt(1)); + assertEquals(2, buffer.getInt(6)); + + int[] read = new int[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read); + + buffer.write(oneToFive, 2, 2); + assertEquals(3, buffer.getInt(0)); + assertEquals(4, buffer.getInt(1)); + assertEquals(3, buffer.getInt(2)); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0, read[0]); + assertEquals(3, read[1]); + assertEquals(4, read[2]); + assertEquals(0, read[3]); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/LongDataBufferTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/LongDataBufferTestBase.java new file mode 100644 index 00000000000..9228861957b --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/LongDataBufferTestBase.java @@ -0,0 +1,63 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import org.junit.Test; + +public abstract class LongDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract LongDataBuffer allocate(long size); + + @Override + protected Long valueOf(Long val) { + return val; + } + + @Test + public void writeAndReadFromArray() { + LongDataBuffer buffer = allocate(10L); + long[] oneToFive = new long[]{ 1L, 2L, 3L, 4L, 5L }; + + buffer.write(oneToFive); + assertEquals(2, buffer.getLong(1)); + + buffer.offset(5).write(oneToFive); + assertEquals(2L, buffer.getLong(1)); + assertEquals(2L, buffer.getLong(6)); + + long[] read = new long[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read); + + buffer.write(oneToFive, 2, 2); + assertEquals(3L, buffer.getLong(0)); + assertEquals(4L, buffer.getLong(1)); + assertEquals(3L, buffer.getLong(2)); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0L, read[0]); + assertEquals(3L, read[1]); + assertEquals(4L, read[2]); + assertEquals(0L, read[3]); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/ShortDataBufferTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/ShortDataBufferTestBase.java new file mode 100644 index 00000000000..845e4aa7108 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/ShortDataBufferTestBase.java @@ -0,0 +1,63 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; +import org.junit.Test; + +public abstract class ShortDataBufferTestBase extends DataBufferTestBase { + + @Override + protected abstract ShortDataBuffer allocate(long size); + + @Override + protected Short valueOf(Long val) { + return val.shortValue(); + } + + @Test + public void writeAndReadFromArray() { + ShortDataBuffer buffer = allocate(10L); + short[] oneToFive = new short[]{ 1, 2, 3, 4, 5 }; + + buffer.write(oneToFive); + assertEquals(2, buffer.getShort(1)); + + buffer.offset(5).write(oneToFive); + assertEquals(2, buffer.getShort(1), 0); + assertEquals(2, buffer.getShort(6), 0); + + short[] read = new short[5]; + buffer.read(read); + assertArrayEquals(oneToFive, read); + + buffer.write(oneToFive, 2, 2); + assertEquals(3, buffer.getShort(0)); + assertEquals(4, buffer.getShort(1)); + assertEquals(3, buffer.getShort(2)); + + Arrays.fill(read, valueOf(0L)); + buffer.read(read, 1, 2); + assertEquals(0, read[0]); + assertEquals(3, read[1]); + assertEquals(4, read[2]); + assertEquals(0, read[3]); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/BigIntegerDataBufferAdapterTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/BigIntegerDataBufferAdapterTest.java new file mode 100644 index 00000000000..fbb500c5c4e --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/BigIntegerDataBufferAdapterTest.java @@ -0,0 +1,50 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import java.math.BigInteger; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBufferTestBase; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.layout.DataLayout; + +public class BigIntegerDataBufferAdapterTest extends DataBufferTestBase { + + @Override + protected DataBuffer allocate(long size) { + return DataBuffers.ofObjects(size, new TestBigIntegerLayout()); + } + + @Override + protected long maxSize() { + return super.maxSize() / 3; + } + + @Override + protected BigInteger valueOf(Long val) { + return BigInteger.valueOf(val); + } + + private static class TestBigIntegerLayout implements DataLayout { + + @Override + public void writeValue(ByteDataBuffer buffer, BigInteger value, long index) { + byte[] bytes = value.toByteArray(); + buffer.setObject(bytes.length > 2 ? bytes[2] : 0, index); + buffer.setObject(bytes.length > 1 ? bytes[1] : 0, index + 1); + buffer.setObject(bytes[0], index + 2); + } + + @Override + public BigInteger readValue(ByteDataBuffer buffer, long index) { + byte byte2 = buffer.getObject(index); + byte byte1 = buffer.getObject(index + 1); + byte byte0 = buffer.getObject(index + 2); + return new BigInteger(new byte[] { byte2, byte1, byte0 }); + } + + @Override + public int sizeInBytes() { + return 3; + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/BooleanDataBufferAdapterTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/BooleanDataBufferAdapterTest.java new file mode 100644 index 00000000000..b023b39992b --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/BooleanDataBufferAdapterTest.java @@ -0,0 +1,33 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.BooleanDataBufferTestBase; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.layout.BooleanDataLayout; + +public class BooleanDataBufferAdapterTest extends BooleanDataBufferTestBase { + + @Override + protected BooleanDataBuffer allocate(long size) { + return DataBuffers.ofBooleans(size, new TestBooleanLayout()); + } + + private static class TestBooleanLayout implements BooleanDataLayout { + + @Override + public void writeBoolean(ByteDataBuffer buffer, boolean value, long index) { + buffer.setObject((byte)(value ? 1 : 0), index); + } + + @Override + public boolean readBoolean(ByteDataBuffer buffer, long index) { + return buffer.getObject(index) > 0; + } + + @Override + public int sizeInBytes() { + return 1; + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/DoubleDataBufferAdapterTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/DoubleDataBufferAdapterTest.java new file mode 100644 index 00000000000..d1586b26d59 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/DoubleDataBufferAdapterTest.java @@ -0,0 +1,44 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBufferTestBase; +import org.tensorflow.tools.buffer.layout.DoubleDataLayout; + +public class DoubleDataBufferAdapterTest extends DoubleDataBufferTestBase { + + @Override + protected DoubleDataBuffer allocate(long size) { + return DataBuffers.ofDoubles(size, new TestDoubleLayout()); + } + + @Override + protected long maxSize() { + return super.maxSize() / 3; + } + + private static class TestDoubleLayout implements DoubleDataLayout { + + @Override + public void writeDouble(ByteDataBuffer buffer, double value, long index) { + long bits = Double.doubleToLongBits(value); + buffer.setObject((byte)((bits >> 56) & 0xFF), index); + buffer.setObject((byte)((bits >> 48) & 0xFF), index + 1); + buffer.setObject((byte)((bits >> 40) & 0xFF), index + 2); + } + + @Override + public double readDouble(ByteDataBuffer buffer, long index) { + long byte7 = buffer.getObject(index); + long byte6 = buffer.getObject(index + 1); + long byte5 = buffer.getObject(index + 2); + return Double.longBitsToDouble(((byte7 & 0xFF) << 56) | ((byte6 & 0xFF) << 48) | ((byte5 & 0xFF) << 40)); + } + + @Override + public int sizeInBytes() { + return 3; + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/FloatDataBufferAdapterTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/FloatDataBufferAdapterTest.java new file mode 100644 index 00000000000..fa86481fb2c --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/FloatDataBufferAdapterTest.java @@ -0,0 +1,41 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBufferTestBase; +import org.tensorflow.tools.buffer.layout.FloatDataLayout; + +public class FloatDataBufferAdapterTest extends FloatDataBufferTestBase { + + @Override + protected long maxSize() { + return super.maxSize() / 2; + } + + private static class TestFloat16Layout implements FloatDataLayout { + + @Override + public void writeFloat(ByteDataBuffer buffer, float value, long index) { + int bits = Float.floatToIntBits(value); + buffer.setObject((byte)((bits >> 24) & 0xFF), index); + buffer.setObject((byte)((bits >> 16) & 0xFF), index + 1); + } + + @Override + public float readFloat(ByteDataBuffer buffer, long index) { + int byte3 = buffer.getObject(index); + int byte2 = buffer.getObject(index + 1); + return Float.intBitsToFloat(((byte3 & 0xFF) << 24) | ((byte2 & 0xFF) << 16)); + } + + @Override + public int sizeInBytes() { + return 2; + } + } + + public FloatDataBuffer allocate(long size) { + return DataBuffers.ofFloats(size, new TestFloat16Layout()); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/IntDataBufferAdapterTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/IntDataBufferAdapterTest.java new file mode 100644 index 00000000000..f18bf989c27 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/IntDataBufferAdapterTest.java @@ -0,0 +1,41 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.IntDataBufferTestBase; +import org.tensorflow.tools.buffer.layout.IntDataLayout; + +public class IntDataBufferAdapterTest extends IntDataBufferTestBase { + + @Override + protected IntDataBuffer allocate(long size) { + return DataBuffers.ofInts(size, new TestIntLayout()); + } + + @Override + protected long maxSize() { + return super.maxSize() / 2; + } + + private static class TestIntLayout implements IntDataLayout { + + @Override + public void writeInt(ByteDataBuffer buffer, int value, long index) { + buffer.setObject((byte)(((value & 0x80000000) >> 24) | ((value & 0x7F) >> 7)), index); + buffer.setObject((byte)(value), index + 1); + } + + @Override + public int readInt(ByteDataBuffer buffer, long index) { + int msb = buffer.getObject(index); + int lsb = buffer.getObject(index + 1); + return ((msb & 0x80) << 24) | ((msb & 0x7F) << 7) | lsb; + } + + @Override + public int sizeInBytes() { + return 2; + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/LongDataBufferAdapterTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/LongDataBufferAdapterTest.java new file mode 100644 index 00000000000..93b4ba06fe8 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/LongDataBufferAdapterTest.java @@ -0,0 +1,43 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.LongDataBufferTestBase; +import org.tensorflow.tools.buffer.layout.LongDataLayout; + +public class LongDataBufferAdapterTest extends LongDataBufferTestBase { + + @Override + protected LongDataBuffer allocate(long size) { + return DataBuffers.ofLongs(size, new TestLongLayout()); + } + + @Override + protected long maxSize() { + return super.maxSize() / 3; + } + + private static class TestLongLayout implements LongDataLayout { + + @Override + public void writeLong(ByteDataBuffer buffer, long value, long index) { + buffer.setObject((byte)(((value >> 56) & 0x80) | ((value >> 16) & 0x7F)), index); + buffer.setObject((byte)((value >> 8) & 0xFF), index + 1); + buffer.setObject((byte)(value & 0xFF), index + 2); + } + + @Override + public long readLong(ByteDataBuffer buffer, long index) { + long msb = buffer.getObject(index); + long midb = buffer.getObject(index + 1); + long lsb = buffer.getObject(index + 2); + return ((msb & 0x80) << 56) | ((msb & 0x7F) << 16) | ((midb & 0xFF) << 8) | (lsb & 0xFF); + } + + @Override + public int sizeInBytes() { + return 3; + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/ShortDataBufferAdapterTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/ShortDataBufferAdapterTest.java new file mode 100644 index 00000000000..e321527bc09 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/adapter/ShortDataBufferAdapterTest.java @@ -0,0 +1,33 @@ +package org.tensorflow.tools.buffer.impl.adapter; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBufferTestBase; +import org.tensorflow.tools.buffer.layout.ShortDataLayout; + +public class ShortDataBufferAdapterTest extends ShortDataBufferTestBase { + + private static class TestShort8Layout implements ShortDataLayout { + + @Override + public void writeShort(ByteDataBuffer buffer, short value, long index) { + buffer.setObject((byte)(((value & 0x8000) >> 8) | (value & 0x7F)), index); + } + + @Override + public short readShort(ByteDataBuffer buffer, long index) { + int b = buffer.getObject(index); + return (short)(((b & 0x80) << 8) | (b & 0x7F)); + } + + @Override + public int sizeInBytes() { + return 1; + } + } + + public ShortDataBuffer allocate(long size) { + return DataBuffers.ofShorts(size, new TestShort8Layout()); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/misc/ArrayDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/misc/ArrayDataBufferTest.java new file mode 100644 index 00000000000..b08e5aaa38d --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/misc/ArrayDataBufferTest.java @@ -0,0 +1,34 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.misc; + +import java.math.BigDecimal; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBufferTestBase; + +public class ArrayDataBufferTest extends DataBufferTestBase { + + @Override + protected DataBuffer allocate(long size) { + return new ArrayDataBuffer<>(new BigDecimal[(int)size], false); + } + + @Override + protected BigDecimal valueOf(Long val) { + return BigDecimal.valueOf(val); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/misc/BitSetDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/misc/BitSetDataBufferTest.java new file mode 100644 index 00000000000..dd39659e1bb --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/misc/BitSetDataBufferTest.java @@ -0,0 +1,34 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.misc; + +import java.util.BitSet; +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.BooleanDataBufferTestBase; + +public class BitSetDataBufferTest extends BooleanDataBufferTestBase { + + @Override + protected BooleanDataBuffer allocate(long size) { + return new BitSetDataBuffer(new BitSet((int)size), size, false); + } + + @Override + protected Boolean valueOf(Long val) { + return val != 0; + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/misc/StringArrayDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/misc/StringArrayDataBufferTest.java new file mode 100644 index 00000000000..6bb30244d98 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/misc/StringArrayDataBufferTest.java @@ -0,0 +1,33 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.misc; + +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBufferTestBase; + +public class StringArrayDataBufferTest extends DataBufferTestBase { + + @Override + protected DataBuffer allocate(long size) { + return new ArrayDataBuffer<>(new String[(int)size], false); + } + + @Override + protected String valueOf(Long val) { + return val.toString(); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/ByteNioDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/ByteNioDataBufferTest.java new file mode 100644 index 00000000000..4e9046cb789 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/ByteNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.ByteBuffer; +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.ByteDataBufferTestBase; + +public class ByteNioDataBufferTest extends ByteDataBufferTestBase { + + @Override + protected ByteDataBuffer allocate(long size) { + return new ByteNioDataBuffer(ByteBuffer.allocate((int)size)); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/DoubleNioDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/DoubleNioDataBufferTest.java new file mode 100644 index 00000000000..321338973d1 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/DoubleNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.DoubleBuffer; +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBufferTestBase; + +public class DoubleNioDataBufferTest extends DoubleDataBufferTestBase { + + @Override + protected DoubleDataBuffer allocate(long size) { + return new DoubleNioDataBuffer(DoubleBuffer.allocate((int)size)); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/FloatNioDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/FloatNioDataBufferTest.java new file mode 100644 index 00000000000..5f7437ed8e7 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/FloatNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.FloatBuffer; +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBufferTestBase; + +public class FloatNioDataBufferTest extends FloatDataBufferTestBase { + + @Override + protected FloatDataBuffer allocate(long size) { + return new FloatNioDataBuffer(FloatBuffer.allocate((int)size)); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/IntNioDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/IntNioDataBufferTest.java new file mode 100644 index 00000000000..06a1fe7656c --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/IntNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.IntBuffer; +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.IntDataBufferTestBase; + +public class IntNioDataBufferTest extends IntDataBufferTestBase { + + @Override + protected IntDataBuffer allocate(long size) { + return new IntNioDataBuffer(IntBuffer.allocate((int)size)); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/LongNioDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/LongNioDataBufferTest.java new file mode 100644 index 00000000000..2da9d5424c1 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/LongNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.LongBuffer; +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.LongDataBufferTestBase; + +public class LongNioDataBufferTest extends LongDataBufferTestBase { + + @Override + protected LongDataBuffer allocate(long size) { + return new LongNioDataBuffer(LongBuffer.allocate((int)size)); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/ShortNioDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/ShortNioDataBufferTest.java new file mode 100644 index 00000000000..b4cd444ea85 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/nio/ShortNioDataBufferTest.java @@ -0,0 +1,29 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.nio; + +import java.nio.ShortBuffer; +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBufferTestBase; + +public class ShortNioDataBufferTest extends ShortDataBufferTestBase { + + @Override + protected ShortDataBuffer allocate(long size) { + return new ShortNioDataBuffer(ShortBuffer.allocate((int)size)); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/BooleanRawDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/BooleanRawDataBufferTest.java new file mode 100644 index 00000000000..75f9ae8fcdf --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/BooleanRawDataBufferTest.java @@ -0,0 +1,28 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.BooleanDataBuffer; +import org.tensorflow.tools.buffer.BooleanDataBufferTestBase; + +public class BooleanRawDataBufferTest extends BooleanDataBufferTestBase { + + @Override + protected BooleanDataBuffer allocate(long size) { + return new BooleanRawDataBuffer(UnsafeMemoryHandle.fromArray(new boolean[(int)size], (int)size), false); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/ByteRawDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/ByteRawDataBufferTest.java new file mode 100644 index 00000000000..0c9076b10e3 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/ByteRawDataBufferTest.java @@ -0,0 +1,28 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.ByteDataBuffer; +import org.tensorflow.tools.buffer.ByteDataBufferTestBase; + +public class ByteRawDataBufferTest extends ByteDataBufferTestBase { + + @Override + protected ByteDataBuffer allocate(long size) { + return new ByteRawDataBuffer(UnsafeMemoryHandle.fromArray(new byte[(int)size], (int)size), false); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/DoubleRawDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/DoubleRawDataBufferTest.java new file mode 100644 index 00000000000..ce6d8fe5526 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/DoubleRawDataBufferTest.java @@ -0,0 +1,28 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.DoubleDataBuffer; +import org.tensorflow.tools.buffer.DoubleDataBufferTestBase; + +public class DoubleRawDataBufferTest extends DoubleDataBufferTestBase { + + @Override + protected DoubleDataBuffer allocate(long size) { + return new DoubleRawDataBuffer(UnsafeMemoryHandle.fromArray(new double[(int)size], (int)size), false); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/FloatRawDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/FloatRawDataBufferTest.java new file mode 100644 index 00000000000..8a6728f5e98 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/FloatRawDataBufferTest.java @@ -0,0 +1,28 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.FloatDataBuffer; +import org.tensorflow.tools.buffer.FloatDataBufferTestBase; + +public class FloatRawDataBufferTest extends FloatDataBufferTestBase { + + @Override + protected FloatDataBuffer allocate(long size) { + return new FloatRawDataBuffer(UnsafeMemoryHandle.fromArray(new float[(int)size], (int)size), false); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/IntRawDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/IntRawDataBufferTest.java new file mode 100644 index 00000000000..1743c74ed2b --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/IntRawDataBufferTest.java @@ -0,0 +1,28 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.IntDataBuffer; +import org.tensorflow.tools.buffer.IntDataBufferTestBase; + +public class IntRawDataBufferTest extends IntDataBufferTestBase { + + @Override + protected IntDataBuffer allocate(long size) { + return new IntRawDataBuffer(UnsafeMemoryHandle.fromArray(new int[(int)size], (int)size), false); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/LongRawDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/LongRawDataBufferTest.java new file mode 100644 index 00000000000..126a1654736 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/LongRawDataBufferTest.java @@ -0,0 +1,28 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.LongDataBuffer; +import org.tensorflow.tools.buffer.LongDataBufferTestBase; + +public class LongRawDataBufferTest extends LongDataBufferTestBase { + + @Override + protected LongDataBuffer allocate(long size) { + return new LongRawDataBuffer(UnsafeMemoryHandle.fromArray(new long[(int)size], (int)size), false); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/ShortRawDataBufferTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/ShortRawDataBufferTest.java new file mode 100644 index 00000000000..0201f925cb0 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/buffer/impl/raw/ShortRawDataBufferTest.java @@ -0,0 +1,28 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.buffer.impl.raw; + +import org.tensorflow.tools.buffer.ShortDataBuffer; +import org.tensorflow.tools.buffer.ShortDataBufferTestBase; + +public class ShortRawDataBufferTest extends ShortDataBufferTestBase { + + @Override + protected ShortDataBuffer allocate(long size) { + return new ShortRawDataBuffer(UnsafeMemoryHandle.fromArray(new short[(int)size], (int)size), false); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/BooleanNdArrayTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/BooleanNdArrayTestBase.java new file mode 100644 index 00000000000..c2f64fcb23e --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/BooleanNdArrayTestBase.java @@ -0,0 +1,137 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.fail; +import static org.tensorflow.tools.ndarray.NdArrays.vectorOf; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.junit.Test; +import org.tensorflow.tools.Shape; + +public abstract class BooleanNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract BooleanNdArray allocate(Shape shape); + + @Override + protected Boolean valueOf(Long val) { + return val > 0; + } + + @Test + public void iteratePrimitiveElements() { + BooleanNdArray matrix3d = allocate(Shape.make(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> { + scalar.setBoolean(coords[2] > 0); + }); + + assertFalse(matrix3d.getBoolean(0, 0, 0)); + assertTrue(matrix3d.getBoolean(0, 0, 1)); + assertTrue(matrix3d.getBoolean(0, 0, 4)); + assertTrue(matrix3d.getBoolean(0, 1, 2)); + + matrix3d.elements(1).forEach(vector -> { + vector.set(vectorOf(true, false, true, false, true)); + }); + + assertTrue(matrix3d.getBoolean(0, 0, 0)); + assertFalse(matrix3d.getBoolean(0, 0, 1)); + assertTrue(matrix3d.getBoolean(0, 0, 4)); + assertTrue(matrix3d.getBoolean(0, 1, 2)); + } + + @Test + public void writeAndReadWithPrimitiveArrays() { + boolean[] values = new boolean[] { true, true, false, false, true, true, false, true, false, false, true, false, true, false, true, true }; + + BooleanNdArray matrix = allocate(Shape.make(3, 4)); + matrix.write(values); + assertTrue(matrix.getBoolean(0, 0)); + assertFalse(matrix.getBoolean(0, 3)); + assertTrue(matrix.getBoolean(1, 0)); + assertFalse(matrix.getBoolean(2, 3)); + + matrix.write(values, 4); + assertTrue(matrix.getBoolean(0, 0)); + assertTrue(matrix.getBoolean(0, 3)); + assertFalse(matrix.getBoolean(1, 0)); + assertTrue(matrix.getBoolean(2, 3)); + + matrix.setBoolean(true, 1, 0); + matrix.read(values, 2); + assertTrue(values[2]); + assertTrue(values[5]); + + matrix.read(values); + assertTrue(values[0]); + assertTrue(values[3]); + + try { + matrix.write(new boolean[] { true, true, true, true }); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, values.length); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.write(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(new boolean[4]); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, values.length); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/ByteNdArrayTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/ByteNdArrayTestBase.java new file mode 100644 index 00000000000..9fed8019559 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/ByteNdArrayTestBase.java @@ -0,0 +1,142 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.junit.Test; +import org.tensorflow.tools.Shape; + +public abstract class ByteNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract ByteNdArray allocate(Shape shape); + + @Override + protected Byte valueOf(Long val) { + return val.byteValue(); + } + + @Test + public void iteratePrimitiveElements() { + ByteNdArray matrix3d = allocate(Shape.make(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> { + scalar.setByte((byte)coords[2]); + }); + + assertEquals(0, matrix3d.getByte(0, 0, 0)); + assertEquals(1, matrix3d.getByte(0, 0, 1)); + assertEquals(4, matrix3d.getByte(0, 0, 4)); + assertEquals(2, matrix3d.getByte(0, 1, 2)); + + matrix3d.elements(1).forEach(vector -> { + vector.set(NdArrays.vectorOf((byte)5, (byte)6, (byte)7, (byte)8, (byte)9)); + }); + + assertEquals(5, matrix3d.getByte(0, 0, 0)); + assertEquals(6, matrix3d.getByte(0, 0, 1)); + assertEquals(9, matrix3d.getByte(0, 0, 4)); + assertEquals(7, matrix3d.getByte(0, 1, 2)); + } + + @Test + public void writeAndReadWithPrimitiveArrays() { + byte[] values = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; + + ByteNdArray matrix = allocate(Shape.make(3, 4)); + matrix.write(values); + assertEquals(0, matrix.getByte(0, 0)); + assertEquals(3, matrix.getByte(0, 3)); + assertEquals(4, matrix.getByte(1, 0)); + assertEquals(11, matrix.getByte(2, 3)); + + matrix.write(values, 4); + assertEquals(4, matrix.getByte(0, 0)); + assertEquals(7, matrix.getByte(0, 3)); + assertEquals(8, matrix.getByte(1, 0)); + assertEquals(15, matrix.getByte(2, 3)); + + matrix.setByte((byte)100, 1, 0); + matrix.read(values, 2); + assertEquals(4, values[2]); + assertEquals(7, values[5]); + assertEquals(100, values[6]); + assertEquals(15, values[13]); + assertEquals(15, values[15]); + + matrix.read(values); + assertEquals(4, values[0]); + assertEquals(7, values[3]); + assertEquals(100, values[4]); + assertEquals(15, values[11]); + assertEquals(15, values[13]); + assertEquals(15, values[15]); + + try { + matrix.write(new byte[] { 1, 2, 3, 4 }); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, values.length); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.write(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(new byte[4]); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, values.length); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/DoubleNdArrayTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/DoubleNdArrayTestBase.java new file mode 100644 index 00000000000..629417bd3e4 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/DoubleNdArrayTestBase.java @@ -0,0 +1,142 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.junit.Test; +import org.tensorflow.tools.Shape; + +public abstract class DoubleNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract DoubleNdArray allocate(Shape shape); + + @Override + protected Double valueOf(Long val) { + return val.doubleValue(); + } + + @Test + public void iteratePrimitiveElements() { + DoubleNdArray matrix3d = allocate(Shape.make(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> { + scalar.setDouble((double)coords[2]); + }); + + assertEquals(0.0, matrix3d.getDouble(0, 0, 0), 0.0); + assertEquals(1.0, matrix3d.getDouble(0, 0, 1), 0.0); + assertEquals(4.0, matrix3d.getDouble(0, 0, 4), 0.0); + assertEquals(2.0, matrix3d.getDouble(0, 1, 2), 0.0); + + matrix3d.elements(1).forEach(vector -> { + vector.set(NdArrays.vectorOf(5.0, 6.0, 7.0, 8.0, 9.0)); + }); + + assertEquals(5, matrix3d.getDouble(0, 0, 0), 0.0); + assertEquals(6, matrix3d.getDouble(0, 0, 1), 0.0); + assertEquals(9, matrix3d.getDouble(0, 0, 4), 0.0); + assertEquals(7, matrix3d.getDouble(0, 1, 2), 0.0); + } + + @Test + public void writeAndReadWithPrimitiveArrays() { + double[] values = new double[] { 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5 }; + + DoubleNdArray matrix = allocate(Shape.make(3, 4)); + matrix.write(values); + assertEquals(0.0, matrix.getDouble(0, 0), 0.0); + assertEquals(0.3, matrix.getDouble(0, 3), 0.0); + assertEquals(0.4, matrix.getDouble(1, 0), 0.0); + assertEquals(1.1, matrix.getDouble(2, 3), 0.0); + + matrix.write(values, 4); + assertEquals(0.4, matrix.getDouble(0, 0), 0.0); + assertEquals(0.7, matrix.getDouble(0, 3), 0.0); + assertEquals(0.8, matrix.getDouble(1, 0), 0.0); + assertEquals(1.5, matrix.getDouble(2, 3), 0.0); + + matrix.setDouble(100.5, 1, 0); + matrix.read(values, 2); + assertEquals(0.4, values[2], 0); + assertEquals(0.7, values[5], 0); + assertEquals(100.5, values[6], 0); + assertEquals(1.5, values[13], 0); + assertEquals(1.5, values[15], 0); + + matrix.read(values); + assertEquals(0.4, values[0], 0); + assertEquals(0.7, values[3], 0); + assertEquals(100.5, values[4], 0); + assertEquals(1.5, values[11], 0); + assertEquals(1.5, values[13], 0); + assertEquals(1.5, values[15], 0); + + try { + matrix.write(new double[] { 0.1, 0.2, 0.3, 0.4 }); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, values.length); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.write(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(new double[4]); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, values.length); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/FloatNdArrayTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/FloatNdArrayTestBase.java new file mode 100644 index 00000000000..aadf6102cd7 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/FloatNdArrayTestBase.java @@ -0,0 +1,142 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.junit.Test; +import org.tensorflow.tools.Shape; + +public abstract class FloatNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract FloatNdArray allocate(Shape shape); + + @Override + protected Float valueOf(Long val) { + return val.floatValue(); + } + + @Test + public void iteratePrimitiveElements() { + FloatNdArray matrix3d = allocate(Shape.make(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> { + scalar.setFloat((float)coords[2]); + }); + + assertEquals(0.0f, matrix3d.getFloat(0, 0, 0), 0.0f); + assertEquals(1.0f, matrix3d.getFloat(0, 0, 1), 0.0f); + assertEquals(4.0f, matrix3d.getFloat(0, 0, 4), 0.0f); + assertEquals(2.0f, matrix3d.getFloat(0, 1, 2), 0.0f); + + matrix3d.elements(1).forEach(vector -> { + vector.set(NdArrays.vectorOf(5.0f, 6.0f, 7.0f, 8.0f, 9.0f)); + }); + + assertEquals(5, matrix3d.getFloat(0, 0, 0), 0.0f); + assertEquals(6, matrix3d.getFloat(0, 0, 1), 0.0f); + assertEquals(9, matrix3d.getFloat(0, 0, 4), 0.0f); + assertEquals(7, matrix3d.getFloat(0, 1, 2), 0.0f); + } + + @Test + public void writeAndReadWithPrimitiveArrays() { + float[] values = new float[] { 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f }; + + FloatNdArray matrix = allocate(Shape.make(3, 4)); + matrix.write(values); + assertEquals(0.0f, matrix.getFloat(0, 0), 0.0f); + assertEquals(0.3f, matrix.getFloat(0, 3), 0.0f); + assertEquals(0.4f, matrix.getFloat(1, 0), 0.0f); + assertEquals(1.1f, matrix.getFloat(2, 3), 0.0f); + + matrix.write(values, 4); + assertEquals(0.4f, matrix.getFloat(0, 0), 0.0f); + assertEquals(0.7f, matrix.getFloat(0, 3), 0.0f); + assertEquals(0.8f, matrix.getFloat(1, 0), 0.0f); + assertEquals(1.5f, matrix.getFloat(2, 3), 0.0f); + + matrix.setFloat(100.5f, 1, 0); + matrix.read(values, 2); + assertEquals(0.4f, values[2], 0); + assertEquals(0.7f, values[5], 0); + assertEquals(100.5f, values[6], 0); + assertEquals(1.5f, values[13], 0); + assertEquals(1.5f, values[15], 0); + + matrix.read(values); + assertEquals(0.4f, values[0], 0); + assertEquals(0.7f, values[3], 0); + assertEquals(100.5f, values[4], 0); + assertEquals(1.5f, values[11], 0); + assertEquals(1.5f, values[13], 0); + assertEquals(1.5f, values[15], 0); + + try { + matrix.write(new float[] { 0.1f, 0.2f, 0.3f, 0.4f }); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, values.length); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.write(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(new float[4]); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, values.length); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/IntNdArrayTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/IntNdArrayTestBase.java new file mode 100644 index 00000000000..8aba532e957 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/IntNdArrayTestBase.java @@ -0,0 +1,142 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.junit.Test; +import org.tensorflow.tools.Shape; + +public abstract class IntNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract IntNdArray allocate(Shape shape); + + @Override + protected Integer valueOf(Long val) { + return val.intValue(); + } + + @Test + public void iteratePrimitiveElements() { + IntNdArray matrix3d = allocate(Shape.make(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> { + scalar.setInt((int)coords[2]); + }); + + assertEquals(0, matrix3d.getInt(0, 0, 0)); + assertEquals(1, matrix3d.getInt(0, 0, 1)); + assertEquals(4, matrix3d.getInt(0, 0, 4)); + assertEquals(2, matrix3d.getInt(0, 1, 2)); + + matrix3d.elements(1).forEach(vector -> { + vector.set(NdArrays.vectorOf(5, 6, 7, 8, 9)); + }); + + assertEquals(5, matrix3d.getInt(0, 0, 0)); + assertEquals(6, matrix3d.getInt(0, 0, 1)); + assertEquals(9, matrix3d.getInt(0, 0, 4)); + assertEquals(7, matrix3d.getInt(0, 1, 2)); + } + + @Test + public void writeAndReadWithPrimitiveArrays() { + int[] values = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; + + IntNdArray matrix = allocate(Shape.make(3, 4)); + matrix.write(values); + assertEquals(0, matrix.getInt(0, 0)); + assertEquals(3, matrix.getInt(0, 3)); + assertEquals(4, matrix.getInt(1, 0)); + assertEquals(11, matrix.getInt(2, 3)); + + matrix.write(values, 4); + assertEquals(4, matrix.getInt(0, 0)); + assertEquals(7, matrix.getInt(0, 3)); + assertEquals(8, matrix.getInt(1, 0)); + assertEquals(15, matrix.getInt(2, 3)); + + matrix.setInt(100, 1, 0); + matrix.read(values, 2); + assertEquals(4, values[2]); + assertEquals(7, values[5]); + assertEquals(100, values[6]); + assertEquals(15, values[13]); + assertEquals(15, values[15]); + + matrix.read(values); + assertEquals(4, values[0]); + assertEquals(7, values[3]); + assertEquals(100, values[4]); + assertEquals(15, values[11]); + assertEquals(15, values[13]); + assertEquals(15, values[15]); + + try { + matrix.write(new int[] { 1, 2, 3, 4 }); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, values.length); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.write(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(new int[4]); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, values.length); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/LongNdArrayTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/LongNdArrayTestBase.java new file mode 100644 index 00000000000..b08d361ff11 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/LongNdArrayTestBase.java @@ -0,0 +1,119 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.junit.Test; +import org.tensorflow.tools.Shape; + +public abstract class LongNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract LongNdArray allocate(Shape shape); + + @Override + protected Long valueOf(Long val) { + return val; + } + + @Test + public void writeAndReadWithPrimitiveArrays() { + long[] values = new long[] { 0L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L }; + + LongNdArray matrix = allocate(Shape.make(3, 4)); + matrix.write(values); + assertEquals(0L, matrix.getLong(0, 0)); + assertEquals(3L, matrix.getLong(0, 3)); + assertEquals(4L, matrix.getLong(1, 0)); + assertEquals(11L, matrix.getLong(2, 3)); + + matrix.write(values, 4); + assertEquals(4L, matrix.getLong(0, 0)); + assertEquals(7L, matrix.getLong(0, 3)); + assertEquals(8L, matrix.getLong(1, 0)); + assertEquals(15L, matrix.getLong(2, 3)); + + matrix.setLong(100L, 1, 0); + matrix.read(values, 2); + assertEquals(4L, values[2]); + assertEquals(7L, values[5]); + assertEquals(100L, values[6]); + assertEquals(15L, values[13]); + assertEquals(15L, values[15]); + + matrix.read(values); + assertEquals(4L, values[0]); + assertEquals(7L, values[3]); + assertEquals(100L, values[4]); + assertEquals(15L, values[11]); + assertEquals(15L, values[13]); + assertEquals(15L, values[15]); + + try { + matrix.write(new long[] { 1, 2, 3, 4 }); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, values.length); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.write(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(new long[4]); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, values.length); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/NdArrayTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/NdArrayTestBase.java new file mode 100644 index 00000000000..043c49e4aa8 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/NdArrayTestBase.java @@ -0,0 +1,384 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; +import static org.tensorflow.tools.ndarray.NdArrays.vectorOfObjects; +import static org.tensorflow.tools.ndarray.index.Indices.all; +import static org.tensorflow.tools.ndarray.index.Indices.at; +import static org.tensorflow.tools.ndarray.index.Indices.even; +import static org.tensorflow.tools.ndarray.index.Indices.flip; +import static org.tensorflow.tools.ndarray.index.Indices.from; +import static org.tensorflow.tools.ndarray.index.Indices.odd; +import static org.tensorflow.tools.ndarray.index.Indices.range; +import static org.tensorflow.tools.ndarray.index.Indices.seq; +import static org.tensorflow.tools.ndarray.index.Indices.to; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import java.util.stream.LongStream; +import org.junit.Test; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; + +public abstract class NdArrayTestBase { + + protected abstract NdArray allocate(Shape shape); + + protected abstract DataBuffer allocateBuffer(long size); + + protected abstract T valueOf(Long val); + + protected T zeroOrNull() { + return valueOf(0L); + } + + @Test + public void shapeAndSizes() { + Shape scalarShape = Shape.scalar(); + NdArray scalar = allocate(scalarShape); + assertEquals(scalarShape, scalar.shape()); + assertEquals(0, scalar.rank()); + assertEquals(scalarShape, Shape.make()); + + Shape vectorShape = Shape.make(10); + NdArray vector = allocate(vectorShape); + assertEquals(vectorShape, vector.shape()); + assertEquals(1, vector.rank()); + } + + @Test + public void setAndGetValues() { + NdArray matrix = allocate(Shape.make(5, 4)); + assertEquals(zeroOrNull(), matrix.getObject(3, 3)); + + matrix.setObject(valueOf(10L), 3, 3); + assertEquals(valueOf(10L), matrix.getObject(3, 3)); + try { + matrix.setObject(valueOf(10L), 3, 4); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.setObject(valueOf(10L), -1, 3); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.getObject(3); + fail(); + } catch (IllegalRankException e) { + // as expected + } + try { + matrix.setObject(valueOf(10L), 3); + fail(); + } catch (IllegalRankException e) { + // as expected + } + + NdArray matrix2 = allocate(Shape.make(3, 2)) + .set(vectorOfObjects(valueOf(1L), valueOf(2L)), 0) + .set(vectorOfObjects(valueOf(3L), valueOf(4L)), 1) + .setObject(valueOf(5L), 2, 0) + .setObject(valueOf(6L), 2, 1); + + assertEquals(valueOf(1L), matrix2.getObject(0, 0)); + assertEquals(valueOf(2L), matrix2.getObject(0, 1)); + assertEquals(valueOf(3L), matrix2.getObject(1, 0)); + assertEquals(valueOf(4L), matrix2.getObject(1, 1)); + assertEquals(valueOf(5L), matrix2.getObject(2, 0)); + assertEquals(valueOf(6L), matrix2.getObject(2, 1)); + } + + @Test + public void iterateElements() { + NdArray matrix3d = allocate(Shape.make(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> { + scalar.setObject(valueOf(coords[2])); + }); + + assertEquals(valueOf(0L), matrix3d.getObject(0, 0, 0)); + assertEquals(valueOf(1L), matrix3d.getObject(0, 0, 1)); + assertEquals(valueOf(4L), matrix3d.getObject(0, 0, 4)); + assertEquals(valueOf(2L), matrix3d.getObject(0, 1, 2)); + + matrix3d.elements(1).forEach(vector -> { + vector.set(vectorOfObjects(valueOf(5L), valueOf(6L), valueOf(7L), valueOf(8L), valueOf(9L))); + }); + + assertEquals(valueOf(5L), matrix3d.getObject(0, 0, 0)); + assertEquals(valueOf(6L), matrix3d.getObject(0, 0, 1)); + assertEquals(valueOf(9L), matrix3d.getObject(0, 0, 4)); + assertEquals(valueOf(7L), matrix3d.getObject(0, 1, 2)); + + long value = 0L; + for (NdArray matrix : matrix3d.elements(0)) { + assertEquals(2L, matrix.shape().numDimensions()); + assertEquals(4L, matrix.shape().size(0)); + assertEquals(5L, matrix.shape().size(1)); + + for (NdArray vector : matrix.elements(0)) { + assertEquals(1L, vector.shape().numDimensions()) ; + assertEquals(5L, vector.shape().size(0)); + + for (NdArray scalar : vector.scalars()) { + assertEquals(0L, scalar.shape().numDimensions()) ; + scalar.setObject(valueOf(value++)); + try { + scalar.elements(0); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } + } + } + assertEquals(valueOf(0L), matrix3d.getObject(0, 0, 0)); + assertEquals(valueOf(5L), matrix3d.getObject(0, 1, 0)); + assertEquals(valueOf(9L), matrix3d.getObject(0, 1, 4)); + assertEquals(valueOf(20L), matrix3d.getObject(1, 0, 0)); + assertEquals(valueOf(25L), matrix3d.getObject(1, 1, 0)); + assertEquals(valueOf(99L), matrix3d.getObject(4, 3, 4)); + } + + @Test + public void slices() { + NdArray matrix3d = allocate(Shape.make(5, 4, 5)); + + T val100 = valueOf(100L); + matrix3d.setObject(val100, 1, 0, 0); + T val101 = valueOf(101L); + matrix3d.setObject(val101, 1, 0, 1); + + // Vector (1,0,*) + NdArray vector10X = matrix3d.get(1, 0); + assertEquals(Shape.make(5), vector10X.shape()); + assertEquals(val100, vector10X.getObject(0)); + assertEquals(val101, vector10X.getObject(1)); + + T val102 = valueOf(102L); + vector10X.setObject(val102, 2); + assertEquals(val102, vector10X.getObject(2)); + assertEquals(val102, matrix3d.getObject(1, 0, 2)); + + // Vector (*,0,0) + NdArray vectorX00 = matrix3d.slice(all(), at(0), at(0)); + assertEquals(Shape.make(5), vectorX00.shape()); + assertEquals(val100, vectorX00.getObject(1)); + T val200 = valueOf(200L); + vectorX00.setObject(val200, 2); + assertEquals(val200, vectorX00.getObject(2)); + assertEquals(val200, matrix3d.getObject(2, 0, 0)); + + // Vector (1,0,[2,0]) + NdArray vector10_20 = matrix3d.slice(at(1), at(0), seq(2, 0)); + assertEquals(vector10_20.shape(), Shape.make(2)); + assertEquals(val102, vector10_20.getObject(0)); + assertEquals(val100, vector10_20.getObject(1)); + + // Vector (1,0,[even]) + NdArray vector10_even = matrix3d.slice(at(1), at(0), even()); + assertEquals(vector10_even.shape(), Shape.make(3)); + assertEquals(val100, vector10_even.getObject(0)); + assertEquals(val102, vector10_even.getObject(1)); + + // Vector ([odd]) from vector (1,0,[even]) + NdArray vector10_even_odd = vector10_even.slice(odd()); + assertEquals(vector10_even_odd.shape(), Shape.make(1)); + assertEquals(val102, vector10_even_odd.getObject(0)); + + // Vector (1,0,[flip]) + NdArray vector10_flip = matrix3d.slice(at(1), at(0), flip()); + assertEquals(vector10_flip.shape(), Shape.make(5)); + assertEquals(val100, vector10_flip.getObject(4)); + assertEquals(val101, vector10_flip.getObject(3)); + + // Vector (1,0,[from 1]) from vector (1,0,*) + NdArray vector10_1toX = vector10X.slice(from(1)); + assertEquals(vector10_1toX.shape(), Shape.make(4)); + assertEquals(val101, vector10_1toX.getObject(0)); + assertEquals(val102, vector10_1toX.getObject(1)); + + // Vector (1,0,[to 1]) from vector (1,0,*) + NdArray vector10_Xto1 = vector10X.slice(to(2)); + assertEquals(vector10_Xto1.shape(), Shape.make(2)); + assertEquals(val100, vector10_Xto1.getObject(0)); + assertEquals(val101, vector10_Xto1.getObject(1)); + + // Vector (1,0,[1 to 3]) + NdArray vector10_1to3 = matrix3d.slice(at(1), at(0), range(1, 3)); + assertEquals(vector10_1to3.shape(), Shape.make(2)); + assertEquals(val101, vector10_1to3.getObject(0)); + assertEquals(val102, vector10_1to3.getObject(1)); + + // Scalar (1,0,0) from vector (1,0,*) + NdArray scalar100 = vector10X.get(0); + assertEquals(Shape.make(), scalar100.shape()); + assertEquals(val100, scalar100.getObject()); + + // Slice scalar (1,0,z) + LongNdArray z = NdArrays.scalarOf(2L); + NdArray scalar102 = matrix3d.slice(at(1), at(0), at(z)); + assertEquals(scalar102.shape(), Shape.make()); + assertEquals(val102, scalar102.getObject()); + + // Slicing the 3D matrix so we only keep the first element of the second dimension + NdArray matrix_X0Z = matrix3d.slice(all(), at(0)); + assertEquals(2, matrix_X0Z.rank()); + assertEquals(Shape.make(5, 5), matrix_X0Z.shape()); + assertEquals(val100, matrix_X0Z.getObject(1, 0)); + assertEquals(val101, matrix_X0Z.getObject(1, 1)); + assertEquals(val200, matrix_X0Z.getObject(2, 0)); + } + + @Test + public void writeAndReadWithBuffers() { + DataBuffer buffer = allocateBuffer(15L); + for (long val = 0L; val < buffer.size(); ++val) { + buffer.setObject(valueOf(val), val); + } + NdArray matrix = allocate(Shape.make(3, 5)); + matrix.write(buffer); + assertEquals(valueOf(0L), matrix.getObject(0, 0)); + assertEquals(valueOf(4L), matrix.getObject(0, 4)); + assertEquals(valueOf(5L), matrix.getObject(1, 0)); + assertEquals(valueOf(10L), matrix.getObject(2, 0)); + assertEquals(valueOf(14L), matrix.getObject(2, 4)); + + matrix.setObject(valueOf(100L), 1, 0); + matrix.read(buffer); + assertEquals(valueOf(0L), buffer.getObject(0)); + assertEquals(valueOf(4L), buffer.getObject(4)); + assertEquals(valueOf(100L), buffer.getObject(5)); + assertEquals(valueOf(10L), buffer.getObject(10)); + assertEquals(valueOf(14L), buffer.getObject(14)); + } + + @Test + public void ndArrayCopies() { + NdArray matrixA = allocate(Shape.make(3, 5)); + + long value = 0L; + for (NdArray s : matrixA.scalars()) { + s.setObject(valueOf(value++)); + } + NdArray matrixB = allocate(Shape.make(3, 5)).setObject(valueOf(100L), 1, 0); + matrixA.copyTo(matrixB); + assertEquals(valueOf(0L), matrixB.getObject(0, 0)); + assertEquals(valueOf(4L), matrixB.getObject(0, 4)); + assertEquals(valueOf(5L), matrixB.getObject(1, 0)); + assertEquals(valueOf(10L), matrixB.getObject(2, 0)); + assertEquals(valueOf(14L), matrixB.getObject(2, 4)); + + NdArray matrixC = allocate(Shape.make(3, 4)); + try { + matrixA.copyTo(matrixC); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } + + @Test + @SuppressWarnings("unchecked") + public void writeAndReadWithArrays() { + T[] values = (T[])LongStream.range(0L, 16L).boxed().map(this::valueOf).toArray(); + + NdArray matrix = allocate(Shape.make(3, 4)); + matrix.write(values); + assertEquals(valueOf(0L), matrix.getObject(0, 0)); + assertEquals(valueOf(3L), matrix.getObject(0, 3)); + assertEquals(valueOf(4L), matrix.getObject(1, 0)); + assertEquals(valueOf(11L), matrix.getObject(2, 3)); + + matrix.write(values, 4); + assertEquals(valueOf(4L), matrix.getObject(0, 0)); + assertEquals(valueOf(7L), matrix.getObject(0, 3)); + assertEquals(valueOf(8L), matrix.getObject(1, 0)); + assertEquals(valueOf(15L), matrix.getObject(2, 3)); + + matrix.setObject(valueOf(100L), 1, 0); + matrix.read(values, 2); + assertEquals(valueOf(4L), values[2]); + assertEquals(valueOf(7L), values[5]); + assertEquals(valueOf(100L), values[6]); + assertEquals(valueOf(15L), values[13]); + assertEquals(valueOf(15L), values[15]); + + matrix.read(values); + assertEquals(valueOf(4L), values[0]); + assertEquals(valueOf(7L), values[3]); + assertEquals(valueOf(100L), values[4]); + assertEquals(valueOf(15L), values[11]); + assertEquals(valueOf(15L), values[13]); + assertEquals(valueOf(15L), values[15]); + + try { + matrix.write((T[])LongStream.range(0L, 4L).boxed().map(this::valueOf).toArray()); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, values.length); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, -1); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + matrix.write(values, values.length + 1); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + matrix.read((T[])LongStream.range(0L, 4L).boxed().map(this::valueOf).toArray()); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, values.length); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, -1); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + try { + matrix.read(values, values.length + 1); + fail(); + } catch (IllegalArgumentException e) { + // as expected + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/ShortNdArrayTestBase.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/ShortNdArrayTestBase.java new file mode 100644 index 00000000000..7c5ab8661d2 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/ShortNdArrayTestBase.java @@ -0,0 +1,142 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; +import org.junit.Test; +import org.tensorflow.tools.Shape; + +public abstract class ShortNdArrayTestBase extends NdArrayTestBase { + + @Override + protected abstract ShortNdArray allocate(Shape shape); + + @Override + protected Short valueOf(Long val) { + return val.shortValue(); + } + + @Test + public void iteratePrimitiveElements() { + ShortNdArray matrix3d = allocate(Shape.make(5, 4, 5)); + + matrix3d.scalars().forEachIndexed((coords, scalar) -> { + scalar.setShort((short)coords[2]); + }); + + assertEquals(0, matrix3d.getShort(0, 0, 0)); + assertEquals(1, matrix3d.getShort(0, 0, 1)); + assertEquals(4, matrix3d.getShort(0, 0, 4)); + assertEquals(2, matrix3d.getShort(0, 1, 2)); + + matrix3d.elements(1).forEach(vector -> { + vector.set(NdArrays.vectorOf((short)5, (short)6, (short)7, (short)8, (short)9)); + }); + + assertEquals(5, matrix3d.getShort(0, 0, 0)); + assertEquals(6, matrix3d.getShort(0, 0, 1)); + assertEquals(9, matrix3d.getShort(0, 0, 4)); + assertEquals(7, matrix3d.getShort(0, 1, 2)); + } + + @Test + public void writeAndReadWithPrimitiveArrays() { + short[] values = new short[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; + + ShortNdArray matrix = allocate(Shape.make(3, 4)); + matrix.write(values); + assertEquals(0, matrix.getShort(0, 0)); + assertEquals(3, matrix.getShort(0, 3)); + assertEquals(4, matrix.getShort(1, 0)); + assertEquals(11, matrix.getShort(2, 3)); + + matrix.write(values, 4); + assertEquals(4, matrix.getShort(0, 0)); + assertEquals(7, matrix.getShort(0, 3)); + assertEquals(8, matrix.getShort(1, 0)); + assertEquals(15, matrix.getShort(2, 3)); + + matrix.setShort((short)100, 1, 0); + matrix.read(values, 2); + assertEquals(4, values[2]); + assertEquals(7, values[5]); + assertEquals(100, values[6]); + assertEquals(15, values[13]); + assertEquals(15, values[15]); + + matrix.read(values); + assertEquals(4, values[0]); + assertEquals(7, values[3]); + assertEquals(100, values[4]); + assertEquals(15, values[11]); + assertEquals(15, values[13]); + assertEquals(15, values[15]); + + try { + matrix.write(new short[] { 1, 2, 3, 4 }); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, values.length); + fail(); + } catch (BufferUnderflowException e) { + // as expected + } + try { + matrix.write(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.write(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(new short[4]); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, values.length); + fail(); + } catch (BufferOverflowException e) { + // as expected + } + try { + matrix.read(values, -1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + try { + matrix.read(values, values.length + 1); + fail(); + } catch (IndexOutOfBoundsException e) { + // as expected + } + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/BooleanDenseNdArrayTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/BooleanDenseNdArrayTest.java new file mode 100644 index 00000000000..5422d81c7d2 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/BooleanDenseNdArrayTest.java @@ -0,0 +1,35 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.BooleanNdArray; +import org.tensorflow.tools.ndarray.BooleanNdArrayTestBase; +import org.tensorflow.tools.ndarray.NdArrays; + +public class BooleanDenseNdArrayTest extends BooleanNdArrayTestBase { + + @Override protected BooleanNdArray allocate(Shape shape) { + return NdArrays.ofBooleans(shape); + } + + @Override protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofBooleans(size); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/ByteDenseNdArrayTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/ByteDenseNdArrayTest.java new file mode 100644 index 00000000000..9f817c62a8e --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/ByteDenseNdArrayTest.java @@ -0,0 +1,35 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.ByteNdArray; +import org.tensorflow.tools.ndarray.ByteNdArrayTestBase; +import org.tensorflow.tools.ndarray.NdArrays; + +public class ByteDenseNdArrayTest extends ByteNdArrayTestBase { + + @Override protected ByteNdArray allocate(Shape shape) { + return NdArrays.ofBytes(shape); + } + + @Override protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofBytes(size); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/DoubleDenseNdArrayTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/DoubleDenseNdArrayTest.java new file mode 100644 index 00000000000..bb2565966cd --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/DoubleDenseNdArrayTest.java @@ -0,0 +1,35 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.DoubleNdArray; +import org.tensorflow.tools.ndarray.DoubleNdArrayTestBase; +import org.tensorflow.tools.ndarray.NdArrays; + +public class DoubleDenseNdArrayTest extends DoubleNdArrayTestBase { + + @Override protected DoubleNdArray allocate(Shape shape) { + return NdArrays.ofDoubles(shape); + } + + @Override protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofDoubles(size); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/FloatDenseNdArrayTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/FloatDenseNdArrayTest.java new file mode 100644 index 00000000000..e7c9bdd4ec7 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/FloatDenseNdArrayTest.java @@ -0,0 +1,35 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.FloatNdArray; +import org.tensorflow.tools.ndarray.FloatNdArrayTestBase; +import org.tensorflow.tools.ndarray.NdArrays; + +public class FloatDenseNdArrayTest extends FloatNdArrayTestBase { + + @Override protected FloatNdArray allocate(Shape shape) { + return NdArrays.ofFloats(shape); + } + + @Override protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofFloats(size); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/IntDenseNdArrayTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/IntDenseNdArrayTest.java new file mode 100644 index 00000000000..f9eb305c81d --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/IntDenseNdArrayTest.java @@ -0,0 +1,35 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.IntNdArray; +import org.tensorflow.tools.ndarray.IntNdArrayTestBase; +import org.tensorflow.tools.ndarray.NdArrays; + +public class IntDenseNdArrayTest extends IntNdArrayTestBase { + + @Override protected IntNdArray allocate(Shape shape) { + return NdArrays.ofInts(shape); + } + + @Override protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofInts(size); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/LongDenseNdArrayTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/LongDenseNdArrayTest.java new file mode 100644 index 00000000000..42a45a48c36 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/LongDenseNdArrayTest.java @@ -0,0 +1,35 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.LongNdArray; +import org.tensorflow.tools.ndarray.LongNdArrayTestBase; +import org.tensorflow.tools.ndarray.NdArrays; + +public class LongDenseNdArrayTest extends LongNdArrayTestBase { + + @Override protected LongNdArray allocate(Shape shape) { + return NdArrays.ofLongs(shape); + } + + @Override protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofLongs(size); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/ShortDenseNdArrayTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/ShortDenseNdArrayTest.java new file mode 100644 index 00000000000..dfe6f00852c --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/ShortDenseNdArrayTest.java @@ -0,0 +1,35 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.NdArrays; +import org.tensorflow.tools.ndarray.ShortNdArray; +import org.tensorflow.tools.ndarray.ShortNdArrayTestBase; + +public class ShortDenseNdArrayTest extends ShortNdArrayTestBase { + + @Override protected ShortNdArray allocate(Shape shape) { + return NdArrays.ofShorts(shape); + } + + @Override protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofShorts(size); + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/StringDenseNdArrayTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/StringDenseNdArrayTest.java new file mode 100644 index 00000000000..f47f00e92fe --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/dense/StringDenseNdArrayTest.java @@ -0,0 +1,43 @@ +/* + Copyright 2019 The TensorFlow Authors. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ======================================================================= + */ +package org.tensorflow.tools.ndarray.impl.dense; + +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.buffer.DataBuffer; +import org.tensorflow.tools.buffer.DataBuffers; +import org.tensorflow.tools.ndarray.NdArray; +import org.tensorflow.tools.ndarray.NdArrayTestBase; +import org.tensorflow.tools.ndarray.NdArrays; + +public class StringDenseNdArrayTest extends NdArrayTestBase { + + @Override protected NdArray allocate(Shape shape) { + return NdArrays.ofObjects(String.class, shape); + } + + @Override protected DataBuffer allocateBuffer(long size) { + return DataBuffers.ofObjects(String.class, size); + } + + @Override protected String valueOf(Long val) { + return val.toString(); + } + + protected String zeroOrNull() { + return null; + } +} diff --git a/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/sequence/ElementSequenceTest.java b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/sequence/ElementSequenceTest.java new file mode 100644 index 00000000000..ba69f6c7660 --- /dev/null +++ b/tensorflow-tools/src/test/java/org/tensorflow/tools/ndarray/impl/sequence/ElementSequenceTest.java @@ -0,0 +1,60 @@ +package org.tensorflow.tools.ndarray.impl.sequence; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.Test; +import org.tensorflow.tools.Shape; +import org.tensorflow.tools.ndarray.IntNdArray; +import org.tensorflow.tools.ndarray.NdArraySequence; +import org.tensorflow.tools.ndarray.NdArrays; +import org.tensorflow.tools.ndarray.impl.AbstractNdArray; + +public class ElementSequenceTest { + + @Test + public void iterateVectorsWithIndex() { + IntNdArray array = NdArrays.ofInts(Shape.make(2, 3, 2)); + + @SuppressWarnings("unchecked") + NdArraySequence sequence = ElementSequence + .create((AbstractNdArray)array, 1); + List coords = new ArrayList<>((int)array.shape().size()); + sequence.forEachIndexed((c, e) -> coords.add(Arrays.copyOf(c, c.length))); + + assertEquals(6, coords.size()); + assertArrayEquals(new long[] {0, 0}, coords.get(0)); + assertArrayEquals(new long[] {0, 1}, coords.get(1)); + assertArrayEquals(new long[] {0, 2}, coords.get(2)); + assertArrayEquals(new long[] {1, 0}, coords.get(3)); + assertArrayEquals(new long[] {1, 1}, coords.get(4)); + assertArrayEquals(new long[] {1, 2}, coords.get(5)); + } + + @Test + public void iterateScalarsWithIndex() { + IntNdArray array = NdArrays.ofInts(Shape.make(2, 3, 2)); + + @SuppressWarnings("unchecked") + NdArraySequence cursor = ElementSequence.create((AbstractNdArray)array, 2); + List coords = new ArrayList<>((int)array.shape().size()); + cursor.forEachIndexed((c, e) -> coords.add(Arrays.copyOf(c, c.length))); + + assertEquals(12, coords.size()); + assertArrayEquals(new long[] {0, 0, 0}, coords.get(0)); + assertArrayEquals(new long[] {0, 0, 1}, coords.get(1)); + assertArrayEquals(new long[] {0, 1, 0}, coords.get(2)); + assertArrayEquals(new long[] {0, 1, 1}, coords.get(3)); + assertArrayEquals(new long[] {0, 2, 0}, coords.get(4)); + assertArrayEquals(new long[] {0, 2, 1}, coords.get(5)); + assertArrayEquals(new long[] {1, 0, 0}, coords.get(6)); + assertArrayEquals(new long[] {1, 0, 1}, coords.get(7)); + assertArrayEquals(new long[] {1, 1, 0}, coords.get(8)); + assertArrayEquals(new long[] {1, 1, 1}, coords.get(9)); + assertArrayEquals(new long[] {1, 2, 0}, coords.get(10)); + assertArrayEquals(new long[] {1, 2, 1}, coords.get(11)); + } +} diff --git a/tensorflow-tools/src/test/resources/COPYRIGHT.txt b/tensorflow-tools/src/test/resources/COPYRIGHT.txt new file mode 100644 index 00000000000..5e7bd50bb48 --- /dev/null +++ b/tensorflow-tools/src/test/resources/COPYRIGHT.txt @@ -0,0 +1 @@ +All images in this folder and its subfolders are free of any copyright. \ No newline at end of file diff --git a/tensorflow-tools/src/test/resources/castle.jpg b/tensorflow-tools/src/test/resources/castle.jpg new file mode 100644 index 00000000000..c5b07b4bc2a Binary files /dev/null and b/tensorflow-tools/src/test/resources/castle.jpg differ