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.TensorFP64
TensorFP64 relies on preview features of the Java platform:
TensorFP64refers 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
ConstructorsConstructorDescriptionTensorFP64(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 TensorFP64concat(TensorFP64... arrays) Concatenates multipleTensorFP64instances into a singleTensorFP64.doubleget(int index) Gets the double value stored at the specified index of theDoubleArrayinstance.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(double value) static voidinitialize(TensorFP64 tensor, short value) voidset(int index, double value)
-
Constructor Details
-
TensorFP64
The memory segment representing the tensor data in native memory.
-
-
Method Details
-
init
public void init(double value) -
set
public void set(int index, double value) -
get
public double get(int index) Gets the double value stored at the specified index of theDoubleArrayinstance.- Parameters:
index- The index of which to retrieve the double 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
-
getDoubleBuffer
-
initialize
-
concat
Concatenates multipleTensorFP64instances into a singleTensorFP64.- Parameters:
arrays- Variable number ofTensorFP64objects to be concatenated.- Returns:
- A new
TensorFP64instance containing all the elements of the input arrays, concatenated in the order they were provided.
-
TensorFP64when preview features are enabled.