Tensor Layout Structure
Represents the layout of a tensor in memory.
Definition
Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.3
C#
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.3
public readonly struct TensorLayout : IEquatable<TensorLayout>
- Implements
- IEquatable<TensorLayout>
Remarks
Where a TensorShape specifies the dimensions of a tensor, the TensorLayout specifies how the elements of the tensor are laid out in memory.
Properties
Item | Gets the stride along the specified axis. |
Length | Gets the number of dimensions in the layout. |
Offset | Gets the linear offset of the first element in the tensor. |
Methods
CStyle | Returns a contiguous C-style layout for the specified shape. |
Equals( | Indicates whether this instance and a specified object are equal. (Overrides ValueType.Equals(Object)) |
Equals( | Compares this layout to another layout. |
Equals | Compares this layout to another layout, ignoring the specified axes. |
Fortran | Returns a contiguous Fortran-style layout for the specified shape. |
From | Returns a tensor layout that uses the specified strides. |
Get | Returns the hash code for this instance. (Overrides ValueType.GetHashCode()) |
Get | Gets the Type of the current instance. (Inherited from Object) |
IsContiguous | Gets whether this layout is contiguous for a tensor with the specified shape. |
Linear | Converts the linear index in the specified shape to an offset. |
Swap | Returns a new layout that has the strides along the specified axes swapped. |
ToIndices | Converts a linear index to a set of indexes for each dimension according to the layout. |
ToOffset( | Converts a set of two integer indexes to a linear offset. |
ToOffset(Int32[]) | Converts a set of integer indexes to a linear offset. |
ToOffset( | Converts a set of integer indexes to a linear offset. |
ToOffset( | Converts a set of two integer indexes to a linear offset. |
ToOffset( | Converts a set of three integer indexes to a linear offset. |
ToOffset( | Converts a set of four integer indexes to a linear offset. |
ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType) |
Operators
Equality( | Compares two layouts for equality. |
Inequality( | Compares two layouts for inequality. |
Fields
Scalar | Gets the tensor layout for a scalar. |