Class TensorStorageAccess
java.lang.Object
io.github.kirstenali.deepj.tensor.TensorStorageAccess
- Direct Known Subclasses:
TensorManipulations
Shared physical storage plumbing; logical Tensor operations remain on the concrete facade.
-
Method Summary
Modifier and TypeMethodDescriptionfinal booleanWhether immutable logical geometry covers the whole allocation contiguously from offset zero.final DTypedtype()final floatget(int... indices) final floatget(int row, int column) final Objectfinal GradientStatefinal booleanFalse for lazy storage that has never been touched on the host; such storage reads as zeros.final booleanhasSameShape(TensorStorageAccess other) final booleanhasShape(int... dimensions) Tests exact logical dimensions without copying shape metadata or reading tensor values.final booleanabstract voidfinal intfinal intChecked rank-two dimensions for matrix kernels; other ranks are never implicitly flattened.final intnumel()final intrank()final float[]rawData()Unsafe backing access bypasses mutation tracking; use managed Tensor get/set for application code.final voidfinal booleanfinal voidset(int row, int column, float value) final voidsetAt(float value, int... indices) final voidfinal int[]shape()final intsize(int axis) final longPhysical bytes in the shared allocation; views may address only part of it.final intfinal long[]strides()final float[]Returns a logical row-major copy, converting compact storage to FLOAT32 values when necessary.
-
Method Details
-
coversStorage
public final boolean coversStorage()Whether immutable logical geometry covers the whole allocation contiguously from offset zero. -
rank
public final int rank() -
shape
public final int[] shape() -
hasShape
public final boolean hasShape(int... dimensions) Tests exact logical dimensions without copying shape metadata or reading tensor values. -
size
public final int size(int axis) -
numel
public final int numel() -
hasSameShape
-
strides
public final long[] strides() -
storageOffset
public final int storageOffset() -
isContiguous
public final boolean isContiguous() -
storageBytes
public final long storageBytes()Physical bytes in the shared allocation; views may address only part of it. -
matrixRows
public final int matrixRows()Checked rank-two dimensions for matrix kernels; other ranks are never implicitly flattened. -
matrixCols
public final int matrixCols() -
materialize
public abstract void materialize() -
get
public final float get(int row, int column) -
get
public final float get(int... indices) -
set
public final void set(int row, int column, float value) -
setAt
public final void setAt(float value, int... indices) -
toFloatArray
public final float[] toFloatArray()Returns a logical row-major copy, converting compact storage to FLOAT32 values when necessary. -
gradientState
-
getGpuTag
-
setGpuTag
-
dtype
-
hasHostStorage
public final boolean hasHostStorage()False for lazy storage that has never been touched on the host; such storage reads as zeros. -
rawData
public final float[] rawData()Unsafe backing access bypasses mutation tracking; use managed Tensor get/set for application code. -
retainsDeviceBuffer
public final boolean retainsDeviceBuffer() -
releaseDeviceBufferRetention
public final void releaseDeviceBufferRetention()
-