Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)
+ * Computes the exponential linear function.
+ * The ELU function is defined as:
+ *
+ * - $ e ^ x - 1 $ if $ x < 0 $
+ * - $ x $ if $ x >= 0 $
+ *
+ * Examples:
+ *
+ *
+ *
+ * tf.nn.elu(1.0)
+ * <tf.Tensor: shape=(), dtype=float32, numpy=1.0>
+ * tf.nn.elu(0.0)
+ * <tf.Tensor: shape=(), dtype=float32, numpy=0.0>
+ * tf.nn.elu(-1000.0)
+ * <tf.Tensor: shape=(), dtype=float32, numpy=-1.0>
+ *
+ *
+ *
+ * See Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)
*
*
* @param data type for {@code activations} output
@@ -1753,8 +1771,8 @@ public QuantizedReluX quantizedReluX(Operand extends TN
*
*
*
- * tf.nn.relu([-2., 0., -0., 3.]).numpy()
- * array([ 0., 0., -0., 3.], dtype=float32)
+ *
tf.nn.relu([-2., 0., 3.]).numpy()
+ * array([0., 0., 3.], dtype=float32)
*
*
*
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 c68b6ee8ff7..a4a7f5d6dbc 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
@@ -166,7 +166,6 @@
import org.tensorflow.op.core.RefNextIteration;
import org.tensorflow.op.core.RefSelect;
import org.tensorflow.op.core.RefSwitch;
-import org.tensorflow.op.core.RemoteFusedGraphExecute;
import org.tensorflow.op.core.Reshape;
import org.tensorflow.op.core.ResourceCountUpTo;
import org.tensorflow.op.core.ResourceGather;
@@ -187,7 +186,6 @@
import org.tensorflow.op.core.Reverse;
import org.tensorflow.op.core.ReverseSequence;
import org.tensorflow.op.core.Roll;
-import org.tensorflow.op.core.Rpc;
import org.tensorflow.op.core.ScatterAdd;
import org.tensorflow.op.core.ScatterDiv;
import org.tensorflow.op.core.ScatterMax;
@@ -271,7 +269,6 @@
import org.tensorflow.op.core.Timestamp;
import org.tensorflow.op.core.TopKUnique;
import org.tensorflow.op.core.TopKWithUnique;
-import org.tensorflow.op.core.TryRpc;
import org.tensorflow.op.core.Unbatch;
import org.tensorflow.op.core.UnbatchGrad;
import org.tensorflow.op.core.Unique;
@@ -284,6 +281,9 @@
import org.tensorflow.op.core.Variable;
import org.tensorflow.op.core.VariableShape;
import org.tensorflow.op.core.Where;
+import org.tensorflow.op.core.XlaConvV2;
+import org.tensorflow.op.core.XlaDotV2;
+import org.tensorflow.op.core.XlaSetDynamicDimensionSize;
import org.tensorflow.op.core.XlaSpmdFullToShardShape;
import org.tensorflow.op.core.XlaSpmdShardToFullShape;
import org.tensorflow.op.core.Zeros;
@@ -2953,9 +2953,8 @@ public InitializeTableFromTextFile initializeTableFromTextFile(
}
/**
- *
- * Adds v into specified rows of x.
- *
+ * Adds v into specified rows of x.
+ *
* Computes y = x; y[i, :] += v; return y.
*
*
@@ -4159,27 +4158,6 @@ public RefSwitch refSwitch(Operand data, Operand
return RefSwitch.create(scope, data, pred);
}
- /**
- * Execute a sub graph on a remote processor.
- * The graph specifications(such as graph itself, input tensors and output names)
- * are stored as a serialized protocol buffer of RemoteFusedGraphExecuteInfo
- * as serialized_remote_fused_graph_execute_info.
- * The specifications will be passed to a dedicated registered
- * remote fused graph executor. The executor will send the graph specifications
- * to a remote processor and execute that graph. The execution results
- * will be passed to consumer nodes as outputs of this node.
- *
- * @param inputs Arbitrary number of tensors with arbitrary data types
- * @param Toutputs the value of the Toutputs property
- * @param serializedRemoteFusedGraphExecuteInfo Serialized protocol buffer
- * of RemoteFusedGraphExecuteInfo which contains graph specifications.
- * @return a new instance of RemoteFusedGraphExecute
- */
- public RemoteFusedGraphExecute remoteFusedGraphExecute(Iterable> inputs,
- List> Toutputs, String serializedRemoteFusedGraphExecuteInfo) {
- return RemoteFusedGraphExecute.create(scope, inputs, Toutputs, serializedRemoteFusedGraphExecuteInfo);
- }
-
/**
* Reshapes a tensor.
* Given {@code tensor}, this operation returns a tensor that has the same values
@@ -4857,64 +4835,6 @@ public Roll roll(Operand input, Operand extends TNumbe
return Roll.create(scope, input, shift, axis);
}
- /**
- * Perform batches of RPC requests.
- * This op asynchronously performs either a single RPC request, or a batch
- * of requests. RPC requests are defined by three main parameters:
- *
- * - {@code address} (the host+port or BNS address of the request)
- * - {@code method} (the RPC method name for the request)
- * - {@code request} (the serialized proto string, or vector of strings,
- * of the RPC request argument).
- *
- * For example, if you have an RPC service running on port localhost:2345,
- * and its interface is configured with the following proto declaration:
- *
- * service MyService {
- * rpc MyMethod(MyRequestProto) returns (MyResponseProto) {
- * }
- * };
- *
- * then call this op with arguments:
- *
- * address = "localhost:2345"
- * method = "MyService/MyMethod"
- *
- * The {@code request} tensor is a string tensor representing serialized {@code MyRequestProto}
- * strings; and the output string tensor {@code response} will have the same shape
- * and contain (upon successful completion) corresponding serialized
- * {@code MyResponseProto} strings.
- *
For example, to send a single, empty, {@code MyRequestProto}, call
- * this op with {@code request = ""}. To send 5 parallel empty requests,
- * call this op with {@code request = ["", "", "", "", ""]}.
- *
More generally, one can create a batch of {@code MyRequestProto} serialized protos
- * from regular batched tensors using the {@code encode_proto} op, and convert
- * the response {@code MyResponseProto} serialized protos to batched tensors
- * using the {@code decode_proto} op.
- *
NOTE Working with serialized proto strings is faster than instantiating
- * actual proto objects in memory, so no performance degradation is expected
- * compared to writing custom kernels for this workflow.
- *
If the connection fails or the remote worker returns an error
- * status, the op reraises this exception locally.
- *
See the {@code TryRpc} op if you prefer to handle RPC failures manually in the graph.
- *
- * @param address {@code 0-D} or {@code 1-D}. The address (i.e. host_name:port) of the RPC server.
- * If this tensor has more than 1 element, then multiple parallel rpc requests
- * are sent. This argument broadcasts with {@code method} and {@code request}.
- * @param method {@code 0-D} or {@code 1-D}. The method address on the RPC server.
- * If this tensor has more than 1 element, then multiple parallel rpc requests
- * are sent. This argument broadcasts with {@code address} and {@code request}.
- * @param request {@code 0-D} or {@code 1-D}. Serialized proto strings: the rpc request argument.
- * If this tensor has more than 1 element, then multiple parallel rpc requests
- * are sent. This argument broadcasts with {@code address} and {@code method}.
- * @param options carries optional attribute values
- * @return a new instance of Rpc
- */
- public Rpc rpc(Operand address, Operand method, Operand request,
- Rpc.Options... options) {
- return Rpc.create(scope, address, method, request, options);
- }
-
/**
* Adds sparse updates to a variable reference.
* This operation computes
@@ -5930,7 +5850,39 @@ public StageSize stageSize(List> dtypes, StageSize.Option
* in the graph it inputs are masked from the gradient generator. They are not
* taken into account for computing gradients.
* This is useful any time you want to compute a value with TensorFlow but need
- * to pretend that the value was a constant. Some examples include:
+ * to pretend that the value was a constant. For example, the softmax function
+ * for a vector x can be written as
+ *
+ *
+ * def softmax(x):
+ * numerator = tf.exp(x)
+ * denominator = tf.reduce_sum(numerator)
+ * return numerator / denominator
+ *
+ * This however is susceptible to overflow if the values in x are large. An
+ * alternative more stable way is to subtract the maximum of x from each of the
+ * values.
+ *
+ *
+ * def stable_softmax(x):
+ * z = x - tf.reduce_max(x)
+ * numerator = tf.exp(z)
+ * denominator = tf.reduce_sum(numerator)
+ * return numerator / denominator
+ *
+ * However, when we backprop through the softmax to x, we dont want to backprop
+ * through the {@code tf.reduce_max(x)} (if the max values are not unique then the
+ * gradient could flow to the wrong input) calculation and treat that as a
+ * constant. Therefore, we should write this out as
+ *
+ *
+ * def stable_softmax(x):
+ * z = x - tf.stop_gradient(tf.reduce_max(x))
+ * numerator = tf.exp(z)
+ * denominator = tf.reduce_sum(numerator)
+ * return numerator / denominator
+ *
+ * Some other examples include:
*
* - The EM algorithm where the M-step should not involve backpropagation
* through the output of the E-step.
@@ -7193,8 +7145,8 @@ public Timestamp timestamp() {
}
/**
- * Returns the TopK unique values in the array in sorted order. The
- * running time is proportional to the product of K and the input
+ * Returns the TopK unique values in the array in sorted order.
+ * The running time is proportional to the product of K and the input
* size. Sorting the whole array is more efficient for sufficiently large
* values of K. The median-of-medians algorithm is probably faster, but
* difficult to implement efficiently in XLA. If there are fewer than K
@@ -7216,11 +7168,12 @@ public TopKUnique topKUnique(Operand input, Long k) {
}
/**
- * Returns the TopK values in the array in sorted order. This is a combination
- * of MakeUnique and TopKUnique. The returned top-K will have its lower bits
- * replaced by iota, thus it will be close to the original value but not exactly
- * the same. The running time is proportional to the product of K and the input
- * size. NaNs are never returned. Subnormal numbers are flushed to zero.
+ * Returns the TopK values in the array in sorted order.
+ * This is a combination of MakeUnique and TopKUnique. The returned top-K will
+ * have its lower bits replaced by iota, thus it will be close to the original
+ * value but not exactly the same. The running time is proportional to the product
+ * of K and the input size. NaNs are never returned. Subnormal numbers are flushed
+ * to zero.
*
* @param input the input value
* @param k the value of the k property
@@ -7230,67 +7183,6 @@ public TopKWithUnique topKWithUnique(Operand input, Long k) {
return TopKWithUnique.create(scope, input, k);
}
- /**
- * Perform batches of RPC requests.
- * This op asynchronously performs either a single RPC request, or a batch
- * of requests. RPC requests are defined by three main parameters:
- *
- * - {@code address} (the host+port or BNS address of the request)
- * - {@code method} (the method name for the request)
- * - {@code request} (the serialized proto string, or vector of strings,
- * of the RPC request argument).
- *
- * For example, if you have an RPC service running on port localhost:2345,
- * and its interface is configured with the following proto declaration:
- *
- * service MyService {
- * rpc MyMethod(MyRequestProto) returns (MyResponseProto) {
- * }
- * };
- *
- * then call this op with arguments:
- *
- * address = "localhost:2345"
- * method = "MyService/MyMethod"
- *
- * The {@code request} tensor is a string tensor representing serialized {@code MyRequestProto}
- * strings; and the output string tensor {@code response} will have the same shape
- * and contain (upon successful completion) corresponding serialized
- * {@code MyResponseProto} strings.
- *
For example, to send a single, empty, {@code MyRequestProto}, call
- * this op with {@code request = ""}. To send 5 parallel empty requests,
- * call this op with {@code request = ["", "", "", "", ""]}.
- *
More generally, one can create a batch of {@code MyRequestProto} serialized protos
- * from regular batched tensors using the {@code encode_proto} op, and convert
- * the response {@code MyResponseProto} serialized protos to batched tensors
- * using the {@code decode_proto} op.
- *
NOTE Working with serialized proto strings is faster than instantiating
- * actual proto objects in memory, so no performance degradation is expected
- * compared to writing custom kernels for this workflow.
- *
Unlike the standard {@code Rpc} op, if the connection fails or the remote worker
- * returns an error status, this op does not reraise the exception.
- * Instead, the {@code status_code} and {@code status_message} entry for the corresponding RPC
- * call is set with the error returned from the RPC call. The {@code response} tensor
- * will contain valid response values for those minibatch entries whose RPCs did
- * not fail; the rest of the entries will have empty strings.
- *
- * @param address {@code 0-D} or {@code 1-D}. The address (i.e. host_name:port) of the RPC server.
- * If this tensor has more than 1 element, then multiple parallel rpc requests
- * are sent. This argument broadcasts with {@code method} and {@code request}.
- * @param method {@code 0-D} or {@code 1-D}. The method address on the RPC server.
- * If this tensor has more than 1 element, then multiple parallel rpc requests
- * are sent. This argument broadcasts with {@code address} and {@code request}.
- * @param request {@code 0-D} or {@code 1-D}. Serialized proto strings: the rpc request argument.
- * If this tensor has more than 1 element, then multiple parallel rpc requests
- * are sent. This argument broadcasts with {@code address} and {@code method}.
- * @param options carries optional attribute values
- * @return a new instance of TryRpc
- */
- public TryRpc tryRpc(Operand address, Operand method, Operand request,
- TryRpc.Options... options) {
- return TryRpc.create(scope, address, method, request, options);
- }
-
/**
* Reverses the operation of Batch for a single output Tensor.
* An instance of Unbatch either receives an empty batched_tensor, in which case it
@@ -7474,29 +7366,29 @@ public Unique unique(Operand x,
* {@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]}
*
For example:
*
- * # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
- * y, idx, count = unique_with_counts(x)
+ * x = tf.constant([1, 1, 2, 4, 4, 4, 7, 8, 8])
+ * y, idx, count = UniqueWithCountsV2(x, axis = [0])
* y ==> [1, 2, 4, 7, 8]
* idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
* count ==> [2, 1, 3, 1, 2]
*
- * For an {@code 2-D} tensor {@code x} with {@code axis = 0}:
+ *
For a {@code 2-D} tensor {@code x} with {@code axis = 0}:
*
- * # tensor 'x' is [[1, 0, 0],
- * # [1, 0, 0],
- * # [2, 0, 0]]
- * y, idx, count = unique_with_counts(x, axis=0)
+ * x = tf.constant([[1, 0, 0],
+ * [1, 0, 0],
+ * [2, 0, 0]])
+ * y, idx, count = UniqueWithCountsV2(x, axis=[0])
* y ==> [[1, 0, 0],
* [2, 0, 0]]
* idx ==> [0, 0, 1]
* count ==> [2, 1]
*
- * For an {@code 2-D} tensor {@code x} with {@code axis = 1}:
+ *
For a {@code 2-D} tensor {@code x} with {@code axis = 1}:
*
- * # tensor 'x' is [[1, 0, 0],
- * # [1, 0, 0],
- * # [2, 0, 0]]
- * y, idx, count = unique_with_counts(x, axis=1)
+ * x = tf.constant([[1, 0, 0],
+ * [1, 0, 0],
+ * [2, 0, 0]])
+ * y, idx, count = UniqueWithCountsV2(x, axis=[1])
* y ==> [[1, 0],
* [1, 0],
* [2, 0]]
@@ -7530,29 +7422,29 @@ public UniqueWithCounts uniqueWithCounts(Operand
* {@code y[idx[i]] = x[i] for i in [0, 1,...,rank(x) - 1]}
*
For example:
*
- * # tensor 'x' is [1, 1, 2, 4, 4, 4, 7, 8, 8]
- * y, idx, count = unique_with_counts(x)
+ * x = tf.constant([1, 1, 2, 4, 4, 4, 7, 8, 8])
+ * y, idx, count = UniqueWithCountsV2(x, axis = [0])
* y ==> [1, 2, 4, 7, 8]
* idx ==> [0, 0, 1, 2, 2, 2, 3, 4, 4]
* count ==> [2, 1, 3, 1, 2]
*
- * For an {@code 2-D} tensor {@code x} with {@code axis = 0}:
+ *
For a {@code 2-D} tensor {@code x} with {@code axis = 0}:
*
- * # tensor 'x' is [[1, 0, 0],
- * # [1, 0, 0],
- * # [2, 0, 0]]
- * y, idx, count = unique_with_counts(x, axis=0)
+ * x = tf.constant([[1, 0, 0],
+ * [1, 0, 0],
+ * [2, 0, 0]])
+ * y, idx, count = UniqueWithCountsV2(x, axis=[0])
* y ==> [[1, 0, 0],
* [2, 0, 0]]
* idx ==> [0, 0, 1]
* count ==> [2, 1]
*
- * For an {@code 2-D} tensor {@code x} with {@code axis = 1}:
+ *
For a {@code 2-D} tensor {@code x} with {@code axis = 1}:
*
- * # tensor 'x' is [[1, 0, 0],
- * # [1, 0, 0],
- * # [2, 0, 0]]
- * y, idx, count = unique_with_counts(x, axis=1)
+ * x = tf.constant([[1, 0, 0],
+ * [1, 0, 0],
+ * [2, 0, 0]])
+ * y, idx, count = UniqueWithCountsV2(x, axis=[1])
* y ==> [[1, 0],
* [1, 0],
* [2, 0]]
@@ -7805,6 +7697,72 @@ public Where where(Operand extends TType> condition) {
return Where.create(scope, condition);
}
+ /**
+ * Wraps the XLA ConvGeneralDilated operator, documented at
+ * https://www.tensorflow.org/performance/xla/operation_semantics#conv_convolution
+ * .
+ *
+ * @param data type for {@code output} output
+ * @param lhs the input tensor
+ * @param rhs the kernel tensor
+ * @param windowStrides the inter-window strides
+ * @param padding the padding to apply at the start and end of each input dimensions
+ * @param lhsDilation dilation to apply between input elements
+ * @param rhsDilation dilation to apply between kernel elements
+ * @param featureGroupCount number of feature groups for grouped convolution.
+ * @param dimensionNumbers a serialized xla::ConvolutionDimensionNumbers proto.
+ * @param precisionConfig a serialized xla::PrecisionConfig proto.
+ * @param preferredElementType The type of the tensor.
+ * @param data type for {@code XlaConvV2} output and operands
+ * @param data type for {@code XlaConvV2} output and operands
+ * @return a new instance of XlaConvV2
+ */
+ public XlaConvV2 xlaConvV2(Operand extends TType> lhs,
+ Operand extends TType> rhs, Operand windowStrides, Operand padding,
+ Operand lhsDilation, Operand rhsDilation, Operand featureGroupCount,
+ String dimensionNumbers, String precisionConfig, Class preferredElementType) {
+ return XlaConvV2.create(scope, lhs, rhs, windowStrides, padding, lhsDilation, rhsDilation, featureGroupCount, dimensionNumbers, precisionConfig, preferredElementType);
+ }
+
+ /**
+ * Wraps the XLA DotGeneral operator, documented at
+ * https://www.tensorflow.org/performance/xla/operation_semantics#dotgeneral
+ * .
+ *
+ * @param data type for {@code output} output
+ * @param lhs the LHS tensor
+ * @param rhs the RHS tensor
+ * @param dimensionNumbers a serialized xla::DotDimensionNumbers proto.
+ * @param precisionConfig a serialized xla::PrecisionConfig proto.
+ * @param preferredElementType The type of the tensor.
+ * @param data type for {@code XlaDotV2} output and operands
+ * @return a new instance of XlaDotV2
+ */
+ public XlaDotV2 xlaDotV2(Operand extends TType> lhs,
+ Operand extends TType> rhs, String dimensionNumbers, String precisionConfig,
+ Class preferredElementType) {
+ return XlaDotV2.create(scope, lhs, rhs, dimensionNumbers, precisionConfig, preferredElementType);
+ }
+
+ /**
+ * Make a static dimension into a xla bounded dynamic dimension.
+ *
+ * The current static dimension size will become the bound and the second
+ * operand becomes the dynamic size of the dimension.
+ *
+ *
+ * @param data type for {@code output} output
+ * @param input the input value
+ * @param dimIndex the dimIndex value
+ * @param sizeOutput the sizeOutput value
+ * @param data type for {@code XlaSetDynamicDimensionSize} output and operands
+ * @return a new instance of XlaSetDynamicDimensionSize
+ */
+ public XlaSetDynamicDimensionSize xlaSetDynamicDimensionSize(
+ Operand input, Operand dimIndex, Operand sizeOutput) {
+ return XlaSetDynamicDimensionSize.create(scope, input, dimIndex, sizeOutput);
+ }
+
/**
* An op used by XLA SPMD partitioner to switch from automatic partitioning to
* manual partitioning. It annotates the input (full-shape, to be automatically
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java
index d838cc65c48..99caae1fdc2 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/annotations/org/tensorflow/op/XlaOps.java
@@ -261,9 +261,13 @@ public KeyValueSort keyValueSort(Oper
* @param data type for {@code output} output
* @param input A {@code Tensor} of type T.
* @param paddingValue A scalar {@code Tensor} of type T.
- * @param paddingLow the padding to apply at the start of each input dimensions
- * @param paddingHigh the padding to apply at the end of each input dimension.
- * @param paddingInterior the padding to apply between each input element.
+ * @param paddingLow the padding to apply at the start of each input dimensions. Must
+ * be a compile-time constant 1D tensor of length equal to rank of input.
+ * @param paddingHigh the padding to apply at the end of each input dimension. Must
+ * be a compile-time constant 1D tensor of length equal to rank of input.
+ * @param paddingInterior the padding to apply between each input element. Must
+ * be a compile-time constant 1D tensor of length equal to rank of input,
+ * containing only non-negative values.
* @param data type for {@code XlaPad} output and operands
* @param data type for {@code XlaPad} output and operands
* @return a new instance of Pad
@@ -340,11 +344,12 @@ public Send send(Operand extends TType> tensor, String tensorName) {
*
* @param data type for {@code output} output
* @param input the input value
+ * @param options carries optional attribute values
* @param data type for {@code XlaSharding} output and operands
* @return a new instance of Sharding
*/
- public Sharding sharding(Operand input) {
- return Sharding.create(scope, input);
+ public Sharding sharding(Operand input, Sharding.Options... options) {
+ return Sharding.create(scope, input, options);
}
/**
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java
index f83bc6c1394..2441bc1af65 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/global/tensorflow.java
@@ -781,8 +781,52 @@ public static native void TF_TensorBitcastFrom(@Const TF_Tensor from,
// #ifndef TENSORFLOW_C_TF_TSTRING_H_
// #define TENSORFLOW_C_TF_TSTRING_H_
+// #include "tensorflow/c/tf_tensor.h"
// #include "tensorflow/core/platform/ctstring.h"
+// #ifdef SWIG
+// #define TF_CAPI_EXPORT
+// #else
+// #if defined(_WIN32)
+// #ifdef TF_COMPILE_LIBRARY
+// #define TF_CAPI_EXPORT __declspec(dllexport)
+// #else
+// #define TF_CAPI_EXPORT __declspec(dllimport)
+// #endif // TF_COMPILE_LIBRARY
+// #else
+// #define TF_CAPI_EXPORT __attribute__((visibility("default")))
+// #endif // _WIN32
+// #endif // SWIG
+
+// #ifdef __cplusplus
+// #endif
+
+public static native void TF_StringInit(TF_TString t);
+
+public static native void TF_StringCopy(TF_TString dst, @Cast("const char*") BytePointer src,
+ @Cast("size_t") long size);
+public static native void TF_StringCopy(TF_TString dst, String src,
+ @Cast("size_t") long size);
+
+public static native void TF_StringAssignView(TF_TString dst, @Cast("const char*") BytePointer src,
+ @Cast("size_t") long size);
+public static native void TF_StringAssignView(TF_TString dst, String src,
+ @Cast("size_t") long size);
+
+public static native @Cast("const char*") BytePointer TF_StringGetDataPointer(
+ @Const TF_TString tstr);
+
+public static native @Cast("TF_TString_Type") int TF_StringGetType(@Const TF_TString str);
+
+public static native @Cast("size_t") long TF_StringGetSize(@Const TF_TString tstr);
+
+public static native @Cast("size_t") long TF_StringGetCapacity(@Const TF_TString str);
+
+public static native void TF_StringDealloc(TF_TString tstr);
+
+// #ifdef __cplusplus /* end extern "C" */
+// #endif
+
// #endif // THIRD_PARTY_TENSORFLOW_C_TF_TSTRING_H_
@@ -2530,7 +2574,7 @@ public static native void TF_FunctionGetAttrValueProto(
// Return a new execution session with the associated graph, or NULL on
// error. Does not take ownership of any input parameters.
//
-// *`graph` must be a valid graph (not deleted or nullptr). `graph` will be be
+// *`graph` must be a valid graph (not deleted or nullptr). `graph` will be
// kept alive for the lifetime of the returned TF_Session. New nodes can still
// be added to `graph` after this call.
public static native TF_Session TF_NewSession(TF_Graph graph,
@@ -3067,6 +3111,7 @@ public static native void TF_RegisterFilesystemPlugin(
// #include
// #include "tensorflow/c/c_api.h"
+// #include "tensorflow/c/experimental/stream_executor/stream_executor.h"
// #include "tensorflow/c/tf_datatype.h"
// #include "tensorflow/c/tf_status.h"
// #include "tensorflow/c/tf_tensor.h"
@@ -3101,6 +3146,11 @@ public static native void TF_RegisterFilesystemPlugin(
// Targeting ../TF_OpKernelContext.java
+
+// TF_InitKernel to do op/kernel registration.
+// Plugin should implement TF_InitKernel to register kernels. This function
+// should register all kernels in a plugin.
+public static native void TF_InitKernel();
// Targeting ../Create_func_TF_OpKernelConstruction.java
@@ -3158,6 +3208,16 @@ public static native void TF_RegisterKernelBuilder(String kernel_name,
// --------------------------------------------------------------------------
// OpKernelContext routines
+// TF_GetStream returns the SP_Stream available in ctx.
+// This function returns a stream only for devices registered using the
+// StreamExecutor C API
+// (tensorflow/c/experimental/stream_executor/stream_executor.h). It will return
+// nullptr and set error status in all other cases.
+// Experimental: this function doesn't have compatibility guarantees and subject
+// to change at any time.
+public static native @ByVal @Cast("SP_Stream*") Pointer TF_GetStream(TF_OpKernelContext ctx,
+ TF_Status status);
+
// TF_NumInputs returns the number of inputs available in ctx.
public static native int TF_NumInputs(TF_OpKernelContext ctx);
@@ -3200,6 +3260,39 @@ public static native void TF_OpKernelContext_Failure(TF_OpKernelContext ctx,
// Returns the step ID of the given context.
public static native @Cast("int64_t") long TF_StepId(TF_OpKernelContext ctx);
+// Get the list_size and total_size of the attribute `attr_name` of `oper`.
+// list_size - the length of the list.
+// total_size - total size of the list.
+// (1) If attr_type == TF_ATTR_STRING
+// then total_size is the cumulative byte size
+// of all the strings in the list.
+// (3) If attr_type == TF_ATTR_SHAPE
+// then total_size is the number of dimensions
+// of the shape valued attribute, or -1
+// if its rank is unknown.
+// (4) If attr_type == TF_ATTR_SHAPE
+// then total_size is the cumulative number
+// of dimensions of all shapes in the list.
+// (5) Otherwise, total_size is undefined.
+public static native void TF_OpKernelConstruction_GetAttrSize(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntPointer list_size,
+ IntPointer total_size, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrSize(
+ TF_OpKernelConstruction ctx, String attr_name, IntBuffer list_size,
+ IntBuffer total_size, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrSize(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, int[] list_size,
+ int[] total_size, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrSize(
+ TF_OpKernelConstruction ctx, String attr_name, IntPointer list_size,
+ IntPointer total_size, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrSize(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntBuffer list_size,
+ IntBuffer total_size, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrSize(
+ TF_OpKernelConstruction ctx, String attr_name, int[] list_size,
+ int[] total_size, TF_Status status);
+
// Interprets the named kernel construction attribute as a TF_DataType and
// places it into *val. *status is set to TF_OK.
//
@@ -3248,6 +3341,273 @@ public static native void TF_OpKernelConstruction_GetAttrInt32(
TF_OpKernelConstruction ctx, String attr_name, int[] val,
TF_Status status);
+// Interprets the named kernel construction attribute as int64_t and
+// places it into *val. *status is set to TF_OK.
+//
+// If the attribute could not be found or could not be interpreted as
+// int64, *status is populated with an error.
+public static native void TF_OpKernelConstruction_GetAttrInt64(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") LongPointer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") LongBuffer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") long[] val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") LongPointer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") LongBuffer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") long[] val,
+ TF_Status status);
+
+// Interprets the named kernel construction attribute as float and
+// places it into *val. *status is set to TF_OK.
+//
+// If the attribute could not be found or could not be interpreted as
+// float, *status is populated with an error.
+public static native void TF_OpKernelConstruction_GetAttrFloat(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, FloatPointer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloat(
+ TF_OpKernelConstruction ctx, String attr_name, FloatBuffer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloat(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, float[] val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloat(
+ TF_OpKernelConstruction ctx, String attr_name, FloatPointer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloat(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, FloatBuffer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloat(
+ TF_OpKernelConstruction ctx, String attr_name, float[] val,
+ TF_Status status);
+
+// Interprets the named kernel construction attribute as bool and
+// places it into *val. *status is set to TF_OK.
+//
+// If the attribute could not be found or could not be interpreted as
+// bool, *status is populated with an error.
+public static native void TF_OpKernelConstruction_GetAttrBool(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") BytePointer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBool(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") ByteBuffer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBool(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") byte[] val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBool(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") BytePointer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBool(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") ByteBuffer val,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBool(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") byte[] val,
+ TF_Status status);
+
+// Interprets the named kernel construction attribute as string and
+// places it into *val. `val` must
+// point to an array of length at least `max_length` (ideally set to
+// total_size from TF_OpKernelConstruction_GetAttrSize(ctx,
+// attr_name, list_size, total_size)). *status is set to TF_OK.
+//
+// If the attribute could not be found or could not be interpreted as
+// string, *status is populated with an error.
+public static native void TF_OpKernelConstruction_GetAttrString(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char*") BytePointer val,
+ @Cast("size_t") long max_length, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrString(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("char*") ByteBuffer val,
+ @Cast("size_t") long max_length, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrString(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char*") byte[] val,
+ @Cast("size_t") long max_length, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrString(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("char*") BytePointer val,
+ @Cast("size_t") long max_length, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrString(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char*") ByteBuffer val,
+ @Cast("size_t") long max_length, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrString(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("char*") byte[] val,
+ @Cast("size_t") long max_length, TF_Status status);
+
+// Interprets the named kernel construction attribute as a TF_DataType array and
+// places it into *vals. *status is set to TF_OK.
+// `vals` must point to an array of length at least `max_values` (ideally set
+// to list_size from
+// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size,
+// total_size)).
+public static native void TF_OpKernelConstruction_GetAttrTypeList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") IntPointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrTypeList(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("TF_DataType*") IntBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrTypeList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") int[] vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrTypeList(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("TF_DataType*") IntPointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrTypeList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("TF_DataType*") IntBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrTypeList(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("TF_DataType*") int[] vals,
+ int max_vals, TF_Status status);
+
+// Interprets the named kernel construction attribute as int32_t array and
+// places it into *vals. *status is set to TF_OK.
+// `vals` must point to an array of length at least `max_values` (ideally set
+// to list_size from
+// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size,
+// total_size)).
+public static native void TF_OpKernelConstruction_GetAttrInt32List(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntPointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt32List(
+ TF_OpKernelConstruction ctx, String attr_name, IntBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt32List(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, int[] vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt32List(
+ TF_OpKernelConstruction ctx, String attr_name, IntPointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt32List(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, IntBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt32List(
+ TF_OpKernelConstruction ctx, String attr_name, int[] vals,
+ int max_vals, TF_Status status);
+
+// Interprets the named kernel construction attribute as int64_t array and
+// places it into *vals. *status is set to TF_OK.
+// `vals` must point to an array of length at least `max_values` (ideally set
+// to list_size from
+// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size,
+// total_size)).
+public static native void TF_OpKernelConstruction_GetAttrInt64List(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") LongPointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64List(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") LongBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64List(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") long[] vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64List(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") LongPointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64List(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("int64_t*") LongBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrInt64List(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("int64_t*") long[] vals,
+ int max_vals, TF_Status status);
+
+// Interprets the named kernel construction attribute as float array and
+// places it into *vals. *status is set to TF_OK.
+// `vals` must point to an array of length at least `max_values` (ideally set
+// to list_size from
+// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size,
+// total_size)).
+public static native void TF_OpKernelConstruction_GetAttrFloatList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, FloatPointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloatList(
+ TF_OpKernelConstruction ctx, String attr_name, FloatBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloatList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, float[] vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloatList(
+ TF_OpKernelConstruction ctx, String attr_name, FloatPointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloatList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, FloatBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrFloatList(
+ TF_OpKernelConstruction ctx, String attr_name, float[] vals,
+ int max_vals, TF_Status status);
+
+// Interprets the named kernel construction attribute as bool array and
+// places it into *vals. *status is set to TF_OK.
+// `vals` must point to an array of length at least `max_values` (ideally set
+// to list_size from
+// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size,
+// total_size)).
+public static native void TF_OpKernelConstruction_GetAttrBoolList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") BytePointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBoolList(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") ByteBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBoolList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") byte[] vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBoolList(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") BytePointer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBoolList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("unsigned char*") ByteBuffer vals,
+ int max_vals, TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrBoolList(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("unsigned char*") byte[] vals,
+ int max_vals, TF_Status status);
+
+// Interprets the named kernel construction attribute as string array and fills
+// in `vals` and `lengths`, each of which must point to an array of length at
+// least `max_values`. *status is set to TF_OK. The elements of values will
+// point to addresses in `storage` which must be at least `storage_size` bytes
+// in length. Ideally, max_values would be set to list_size and `storage` would
+// be at least total_size, obtained from
+// TF_OpKernelConstruction_GetAttrSize(ctx, attr_name, list_size,
+// total_size).
+public static native void TF_OpKernelConstruction_GetAttrStringList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char**") PointerPointer vals,
+ @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrStringList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char**") @ByPtrPtr BytePointer vals,
+ @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrStringList(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("char**") @ByPtrPtr ByteBuffer vals,
+ @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrStringList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char**") @ByPtrPtr byte[] vals,
+ @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrStringList(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("char**") @ByPtrPtr BytePointer vals,
+ @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrStringList(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, @Cast("char**") @ByPtrPtr ByteBuffer vals,
+ @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size,
+ TF_Status status);
+public static native void TF_OpKernelConstruction_GetAttrStringList(
+ TF_OpKernelConstruction ctx, String attr_name, @Cast("char**") @ByPtrPtr byte[] vals,
+ @Cast("size_t*") SizeTPointer lengths, int max_values, Pointer storage, @Cast("size_t") long storage_size,
+ TF_Status status);
+
+// Return true if the kernel construction has the attr_name
+public static native @Cast("bool") boolean TF_OpKernelConstruction_HasAttr(
+ TF_OpKernelConstruction ctx, @Cast("const char*") BytePointer attr_name, TF_Status status);
+public static native @Cast("bool") boolean TF_OpKernelConstruction_HasAttr(
+ TF_OpKernelConstruction ctx, String attr_name, TF_Status status);
+
// Returns the unique operation name for this OpKernel.
public static native @ByVal TF_StringView TF_OpKernelConstruction_GetName(
TF_OpKernelConstruction ctx);
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java
index aaeee6f00f8..346216e935b 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/GatherV2.java
@@ -21,11 +21,13 @@
import org.tensorflow.Operation;
import org.tensorflow.OperationBuilder;
import org.tensorflow.Output;
+import org.tensorflow.op.Operands;
import org.tensorflow.op.RawOp;
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Endpoint;
import org.tensorflow.types.TInt32;
import org.tensorflow.types.family.TNumber;
+import org.tensorflow.types.family.TType;
/**
* Mutually accumulates multiple tensors of identical type and shape.
@@ -54,6 +56,7 @@ private GatherV2(Operation operation) {
* @param groupSize the groupSize value
* @param groupKey the groupKey value
* @param instanceKey the instanceKey value
+ * @param orderingToken the orderingToken value
* @param options carries optional attribute values
* @param data type for {@code CollectiveGatherV2} output and operands
* @return a new instance of GatherV2
@@ -63,12 +66,13 @@ private GatherV2(Operation operation) {
)
public static GatherV2 create(Scope scope, Operand input,
Operand groupSize, Operand groupKey, Operand instanceKey,
- Options... options) {
+ Iterable> orderingToken, Options... options) {
OperationBuilder opBuilder = scope.env().opBuilder("CollectiveGatherV2", scope.makeOpName("GatherV2"));
opBuilder.addInput(input.asOutput());
opBuilder.addInput(groupSize.asOutput());
opBuilder.addInput(groupKey.asOutput());
opBuilder.addInput(instanceKey.asOutput());
+ opBuilder.addInputList(Operands.asOutputs(orderingToken));
opBuilder = scope.apply(opBuilder);
if (options != null) {
for (Options opts : options) {
@@ -78,6 +82,9 @@ public static GatherV2 create(Scope scope, Operand inp
if (opts.timeoutSeconds != null) {
opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds);
}
+ if (opts.NorderingToken != null) {
+ opBuilder.setAttr("Nordering_token", opts.NorderingToken);
+ }
}
}
return new GatherV2<>(opBuilder.build());
@@ -103,6 +110,16 @@ public static Options timeoutSeconds(Float timeoutSeconds) {
return new Options().timeoutSeconds(timeoutSeconds);
}
+ /**
+ * Sets the NorderingToken option.
+ *
+ * @param NorderingToken the NorderingToken option
+ * @return this Options instance.
+ */
+ public static Options NorderingToken(Long NorderingToken) {
+ return new Options().NorderingToken(NorderingToken);
+ }
+
/**
* Gets data.
*
@@ -125,6 +142,8 @@ public static class Options {
private Float timeoutSeconds;
+ private Long NorderingToken;
+
private Options() {
}
@@ -149,5 +168,16 @@ public Options timeoutSeconds(Float timeoutSeconds) {
this.timeoutSeconds = timeoutSeconds;
return this;
}
+
+ /**
+ * Sets the NorderingToken option.
+ *
+ * @param NorderingToken the NorderingToken option
+ * @return this Options instance.
+ */
+ public Options NorderingToken(Long NorderingToken) {
+ this.NorderingToken = NorderingToken;
+ return this;
+ }
}
}
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java
index 33c7a1da9f7..f6b7321ac66 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/collective/ReduceV2.java
@@ -21,11 +21,13 @@
import org.tensorflow.Operation;
import org.tensorflow.OperationBuilder;
import org.tensorflow.Output;
+import org.tensorflow.op.Operands;
import org.tensorflow.op.RawOp;
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Endpoint;
import org.tensorflow.types.TInt32;
import org.tensorflow.types.family.TNumber;
+import org.tensorflow.types.family.TType;
/**
* Mutually reduces multiple tensors of identical type and shape.
@@ -54,6 +56,7 @@ private ReduceV2(Operation operation) {
* @param groupSize the groupSize value
* @param groupKey the groupKey value
* @param instanceKey the instanceKey value
+ * @param orderingToken the orderingToken value
* @param mergeOp the value of the mergeOp property
* @param finalOp the value of the finalOp property
* @param options carries optional attribute values
@@ -65,12 +68,14 @@ private ReduceV2(Operation operation) {
)
public static ReduceV2 create(Scope scope, Operand input,
Operand groupSize, Operand groupKey, Operand instanceKey,
- String mergeOp, String finalOp, Options... options) {
+ Iterable> orderingToken, String mergeOp, String finalOp,
+ Options... options) {
OperationBuilder opBuilder = scope.env().opBuilder("CollectiveReduceV2", scope.makeOpName("ReduceV2"));
opBuilder.addInput(input.asOutput());
opBuilder.addInput(groupSize.asOutput());
opBuilder.addInput(groupKey.asOutput());
opBuilder.addInput(instanceKey.asOutput());
+ opBuilder.addInputList(Operands.asOutputs(orderingToken));
opBuilder = scope.apply(opBuilder);
opBuilder.setAttr("merge_op", mergeOp);
opBuilder.setAttr("final_op", finalOp);
@@ -82,6 +87,9 @@ public static ReduceV2 create(Scope scope, Operand inp
if (opts.timeoutSeconds != null) {
opBuilder.setAttr("timeout_seconds", opts.timeoutSeconds);
}
+ if (opts.NorderingToken != null) {
+ opBuilder.setAttr("Nordering_token", opts.NorderingToken);
+ }
}
}
return new ReduceV2<>(opBuilder.build());
@@ -107,6 +115,16 @@ public static Options timeoutSeconds(Float timeoutSeconds) {
return new Options().timeoutSeconds(timeoutSeconds);
}
+ /**
+ * Sets the NorderingToken option.
+ *
+ * @param NorderingToken the NorderingToken option
+ * @return this Options instance.
+ */
+ public static Options NorderingToken(Long NorderingToken) {
+ return new Options().NorderingToken(NorderingToken);
+ }
+
/**
* Gets data.
*
@@ -129,6 +147,8 @@ public static class Options {
private Float timeoutSeconds;
+ private Long NorderingToken;
+
private Options() {
}
@@ -153,5 +173,16 @@ public Options timeoutSeconds(Float timeoutSeconds) {
this.timeoutSeconds = timeoutSeconds;
return this;
}
+
+ /**
+ * Sets the NorderingToken option.
+ *
+ * @param NorderingToken the NorderingToken option
+ * @return this Options instance.
+ */
+ public Options NorderingToken(Long NorderingToken) {
+ this.NorderingToken = NorderingToken;
+ return this;
+ }
}
}
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 529ba4c4ac1..eb3cf4e2c03 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
@@ -84,6 +84,9 @@ public static InitializeTableFromTextFile create(Scope scope,
if (opts.delimiter != null) {
opBuilder.setAttr("delimiter", opts.delimiter);
}
+ if (opts.offset != null) {
+ opBuilder.setAttr("offset", opts.offset);
+ }
}
}
return new InitializeTableFromTextFile(opBuilder.build());
@@ -109,6 +112,16 @@ public static Options delimiter(String delimiter) {
return new Options().delimiter(delimiter);
}
+ /**
+ * Sets the offset option.
+ *
+ * @param offset the offset option
+ * @return this Options instance.
+ */
+ public static Options offset(Long offset) {
+ return new Options().offset(offset);
+ }
+
/**
* Optional attributes for {@link org.tensorflow.op.core.InitializeTableFromTextFile}
*/
@@ -117,6 +130,8 @@ public static class Options {
private String delimiter;
+ private Long offset;
+
private Options() {
}
@@ -141,5 +156,16 @@ public Options delimiter(String delimiter) {
this.delimiter = delimiter;
return this;
}
+
+ /**
+ * Sets the offset option.
+ *
+ * @param offset the offset option
+ * @return this Options instance.
+ */
+ public Options offset(Long offset) {
+ this.offset = offset;
+ return this;
+ }
}
}
diff --git a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java
index 9fc6cc0c0b0..c7cc00f87cf 100644
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java
+++ b/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/InplaceAdd.java
@@ -29,9 +29,8 @@
import org.tensorflow.types.family.TType;
/**
- *
* Adds v into specified rows of x.
- *
+ *
* Computes y = x; y[i, :] += v; return y.
*
*
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
deleted file mode 100644
index fda684ab296..00000000000
--- a/tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/core/RemoteFusedGraphExecute.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/* 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 java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import org.tensorflow.Operand;
-import org.tensorflow.Operation;
-import org.tensorflow.OperationBuilder;
-import org.tensorflow.Output;
-import org.tensorflow.op.Operands;
-import org.tensorflow.op.RawOp;
-import org.tensorflow.op.Scope;
-import org.tensorflow.op.annotation.Endpoint;
-import org.tensorflow.op.annotation.Operator;
-import org.tensorflow.types.family.TType;
-
-/**
- * Execute a sub graph on a remote processor.
- * The graph specifications(such as graph itself, input tensors and output names)
- * are stored as a serialized protocol buffer of RemoteFusedGraphExecuteInfo
- * as serialized_remote_fused_graph_execute_info.
- * The specifications will be passed to a dedicated registered
- * remote fused graph executor. The executor will send the graph specifications
- * to a remote processor and execute that graph. The execution results
- * will be passed to consumer nodes as outputs of this node.
- */
-@Operator
-public final class RemoteFusedGraphExecute extends RawOp implements Iterable> {
- /**
- * The name of this op, as known by TensorFlow core engine
- */
- public static final String OP_NAME = "RemoteFusedGraphExecute";
-
- private List