java.lang.Object
uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray
uk.ac.manchester.tornado.api.types.tensors.Tensor
uk.ac.manchester.tornado.api.types.tensors.TensorInt64
TensorInt64 relies on preview features of the Java platform:
TensorInt64refers to one or more preview APIs:MemorySegment.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
-
Field Summary
Fields inherited from class uk.ac.manchester.tornado.api.types.arrays.TornadoNativeArray
ARRAY_HEADER -
Constructor Summary
ConstructorsConstructorDescriptionTensorInt64(Shape shape) The memory segment representing the tensor data in native memory. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclear()Clears the contents of the native array.static TensorInt64concat(TensorInt64... arrays) Concatenates multipleTensorInt64instances into a singleTensorInt64.longget(int index) Gets the half_float value stored at the specified index of theHalfFloatArrayinstance.getDType()intlongReturns the number of bytes of theMemorySegmentPREVIEW, excluding the header bytes.longReturns the total number of bytes that theMemorySegmentPREVIEW occupies, including the header bytes.Returns the underlyingMemorySegmentPREVIEW of the native array, without the Tornado Array header.Returns the underlyingMemorySegmentPREVIEW of the native array, including the header.getShape()intgetSize()Returns the number of elements stored in the native array.voidinit(long value) static voidinitialize(TensorInt64 tensor, long value) voidset(int index, long value)
-
Constructor Details
-
TensorInt64
The memory segment representing the tensor data in native memory.
-
-
Method Details
-
init
public void init(long value) -
set
public void set(int index, long value) -
get
public long get(int index) Gets the half_float value stored at the specified index of theHalfFloatArrayinstance.- Parameters:
index- The index of which to retrieve the float value.- Returns:
-
getSize
public int getSize()Description copied from class:TornadoNativeArrayReturns the number of elements stored in the native array.- Specified by:
getSizein classTornadoNativeArray- Returns:
- The number of elements of the native data array.
-
getSegment
Description copied from class:TornadoNativeArrayReturns the underlyingMemorySegmentPREVIEW of the native array, without the Tornado Array header.- Specified by:
getSegmentin classTornadoNativeArray- Returns:
- The
MemorySegmentPREVIEW associated with the native array instance.
-
getSegmentWithHeader
Description copied from class:TornadoNativeArrayReturns the underlyingMemorySegmentPREVIEW of the native array, including the header.- Specified by:
getSegmentWithHeaderin classTornadoNativeArray- Returns:
- The
MemorySegmentPREVIEW associated with the native array instance.
-
getNumBytesOfSegmentWithHeader
public long getNumBytesOfSegmentWithHeader()Description copied from class:TornadoNativeArrayReturns the total number of bytes that theMemorySegmentPREVIEW occupies, including the header bytes.- Specified by:
getNumBytesOfSegmentWithHeaderin classTornadoNativeArray- Returns:
- The total number of bytes of the
MemorySegmentPREVIEW.
-
getNumBytesOfSegment
public long getNumBytesOfSegment()Description copied from class:TornadoNativeArrayReturns the number of bytes of theMemorySegmentPREVIEW, excluding the header bytes.- Specified by:
getNumBytesOfSegmentin classTornadoNativeArray- Returns:
- The number of bytes of the raw data in the
MemorySegmentPREVIEW.
-
clear
protected void clear()Description copied from class:TornadoNativeArrayClears the contents of the native array.- Specified by:
clearin classTornadoNativeArray
-
getElementSize
public int getElementSize()- Specified by:
getElementSizein classTornadoNativeArray
-
getShape
-
getDTypeAsString
- Specified by:
getDTypeAsStringin classTensor
-
getDType
-
getLongBuffer
-
initialize
-
concat
Concatenates multipleTensorInt64instances into a singleTensorInt64.- Parameters:
arrays- Variable number ofTensorInt64objects to be concatenated.- Returns:
- A new
TensorInt64instance containing all the elements of the input arrays, concatenated in the order they were provided.
-
TensorInt64when preview features are enabled.