public class AllocationUtils
extends java.lang.Object
Constructor and Description |
---|
AllocationUtils() |
Modifier and Type | Method and Description |
---|---|
static AllocationShape |
buildAllocationShape(DataBuffer buffer)
This method returns AllocationShape for the whole DataBuffer.
|
static AllocationShape |
buildAllocationShape(INDArray array)
This method returns AllocationShape for specific array, that takes in account its real shape: offset, length, etc
|
static AllocationShape |
buildAllocationShape(JCudaBuffer buffer)
This method returns AllocationShape for specific buffer, that takes in account its real shape: offset, length, etc
|
static long |
getByteOffset(AllocationShape shape)
This method returns byte offset based on AllocationShape
|
static int |
getElementSize(AllocationShape shape) |
static DataBuffer |
getPointersBuffer(long[] pointers) |
static long |
getRequiredMemory(AllocationShape shape) |
public static long getRequiredMemory(@NonNull AllocationShape shape)
public static int getElementSize(@NonNull AllocationShape shape)
public static AllocationShape buildAllocationShape(INDArray array)
array
- public static AllocationShape buildAllocationShape(DataBuffer buffer)
buffer
- public static AllocationShape buildAllocationShape(JCudaBuffer buffer)
buffer
- public static long getByteOffset(AllocationShape shape)
public static DataBuffer getPointersBuffer(long[] pointers)