public class
ShapeUtils
Various methods for processing with Shapes and Operands
Public Constructors
Public Methods
Inherited Methods
boolean |
equals(Object arg0)
|
final Class<?> |
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String |
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Constructors
public ShapeUtils ()
Public Methods
public static int[] getIntArray (Scope scope, Operand<TInt32> dims)
Converts a TInt32 type Operand to a Java int array
Parameters
scope | the TensorFlow scope |
---|---|
dims | the shape dimensions operand |
Returns
- the int array of the dimensions
public static long[] getLongArray (T dims)
Converts a TInt32 or TInt64 to a java long array
Parameters
dims | the dimension tensor |
---|
Returns
- the long array
Throws
IllegalArgumentException | if the dims type is not an integer |
---|
public static long[] getLongArray (Scope scope, Operand<T> dims)
Converts a TInt32 or TInt64 Operand to a java long array
Parameters
scope | the TensorFlow scope |
---|---|
dims | the Operand |
Returns
- the long array
Throws
IllegalArgumentException | if the dims type is not an integer |
---|
public static Shape reduce (Shape shape, int axis)
Reduces the shape by eliminating trailing Dimensions.
The last dimension, specified by axis, will be a product of all remaining dimensions
Parameters
shape | the shape to squeeze |
---|---|
axis | the axis to squeeze |
Returns
- the new shape