Class ToNumber<T extends TNumber>
java.lang.Object
org.tensorflow.op.RawOp
org.tensorflow.op.strings.ToNumber<T>
@Operator(group="strings")
public final class ToNumber<T extends TNumber>
extends RawOp
implements Operand<T>
Converts each string in the input Tensor to the specified numeric type.
(Note that int32 overflow results in an error while float overflow
results in a rounded value.)
Example:
strings = ["5.0", "3.0", "7.0"] tf.strings.to_number(strings) <tf.Tensor: shape=(3,), dtype=float32, numpy=array([5., 3., 7.], dtype=float32)>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of this op, as known by TensorFlow core engine -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
OP_NAME
The name of this op, as known by TensorFlow core engine- See Also:
-
-
Constructor Details
-
ToNumber
-
-
Method Details
-
create
@Endpoint(describeByClass=true) public static <T extends TNumber> ToNumber<T> create(Scope scope, Operand<TString> stringTensor, Class<T> outType) Factory method to create a class wrapping a new StringToNumber operation.- Type Parameters:
T- data type forStringToNumberoutput and operands- Parameters:
scope- current scopestringTensor- The stringTensor valueoutType- The numeric type to interpret each string instring_tensoras.- Returns:
- a new instance of ToNumber
-
create
@Endpoint(describeByClass=true) public static ToNumber<TFloat32> create(Scope scope, Operand<TString> stringTensor) Factory method to create a class wrapping a new StringToNumber operation, with the default output types.- Parameters:
scope- current scopestringTensor- The stringTensor value- Returns:
- a new instance of ToNumber, with default output types
-
output
-
asOutput
Description copied from interface:OperandReturns 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.
-