Class ShapeUtils
java.lang.Object
org.tensorflow.framework.utils.ShapeUtils
Various methods for processing with Shapes and Operands
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]getIntArray(Scope scope, Operand<TInt32> dims) Converts a TInt32 type Operand to a Java int arraystatic <T extends TIntegral>
long[]getLongArray(Scope scope, Operand<T> dims) Converts a TInt32 or TInt64 Operand to a java long arraystatic <T extends TIntegral>
long[]getLongArray(T dims) Converts a TInt32 or TInt64 to a java long arraystatic ShapeReduces the shape by eliminating trailing Dimensions.Converts a shape operand to a Shape object
-
Constructor Details
-
ShapeUtils
public ShapeUtils()
-
-
Method Details
-
toShape
Converts a shape operand to a Shape object- Type Parameters:
T- the date type for the shape dimensions.- Parameters:
scope- the TensorFlow scopedims- the Operand containing the shape values- Returns:
- a new Shape based on an Operand that contains dimensions
-
getIntArray
-
getLongArray
Converts a TInt32 or TInt64 Operand to a java long array- Type Parameters:
T- the type of the dimensions, must either be TInt32 or TInt64 type- Parameters:
scope- the TensorFlow scopedims- the Operand- Returns:
- the long array
- Throws:
IllegalArgumentException- if the dims type is not an integer
-
getLongArray
Converts a TInt32 or TInt64 to a java long array- Type Parameters:
T- the type of the dimensions, must either be TInt32 or TInt64 type- Parameters:
dims- the dimension tensor- Returns:
- the long array
- Throws:
IllegalArgumentException- if the dims type is not an integer
-
reduce
-