You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose the following nomenclature to uniformize the names within CubeCL.
Nomenclature
Indexing
Use index for linear (contiguous) buffers, slices and arrays.
Use coordinate for the cartesian coordinate of a tensor element.
Use pos or position for cube related objected (CubePos, UnitPos)
Use axis instead of dim for tensor.
Objects in containers
Use element for a value inside a tensor or indexing a line.
Use line or something_line when indexing returns a Line<T>.
A container is lined if it stored Line<T> instead of T. (Currently both lined and vectorized are used).
Example
let element_line = tensor[index];let element = element_line[0];
Length, size and shape
Use len (or length) for linear memory to match rust convention and lines.
Use size for the total number of elements in a tensor or in a line. Thus we always use line_size, never vectorization or vectorization_factor or other similar variations.
Use shape for the length of a tensor's axis. The shape of a tensor is a list (vec, slice or tuple) of the shape of each axis.
Use rank for the number of axes in a tensor.
Prefer something_count instead of num_something. (ex: CubeCount, unit_count)
Tensors
An axis is contiguous if its stride is 1.
The lines of a tensor are parallel to an axis if either it is the only contiguous axis or if it is contiguous and it has a shape greater than 1. Otherwise, the axis is perpendicular.
A tensor is in increasing_order if stride(axis1) < stride(axis2) whenever axis1 < axis2. This is also named column_major_order when the tensor is a matrix (rank == 2).
A tensor is in decreasing_order if stride(axis1) > stride(axis2) whenever axis1 < axis2. This is also named row_major_order when the tensor is a matrix (rank == 2).
A tensor is in non_monotonic_order if it is neither in increasing_order nor decreasing_order.
A stride is all the elements obtained when fixing the coordinates of all axes but one.
Meta
Prefer postfix names such as ReduceError and ReduceStrategy.
Avoid abbreviation except if they are really common and widely used.
Create a conventions.md file in the project root to help users and contributors follow the naming convention (and possible other conventions in the future).
The text was updated successfully, but these errors were encountered:
I propose the following nomenclature to uniformize the names within CubeCL.
Nomenclature
Indexing
index
for linear (contiguous) buffers, slices and arrays.coordinate
for the cartesian coordinate of a tensor element.pos
orposition
for cube related objected (CubePos
,UnitPos
)axis
instead ofdim
for tensor.Objects in containers
element
for a value inside a tensor or indexing a line.line
orsomething_line
when indexing returns aLine<T>
.lined
if it storedLine<T>
instead ofT
. (Currently bothlined
andvectorized
are used).Example
Length, size and shape
len
(orlength
) for linear memory to match rust convention and lines.size
for the total number of elements in a tensor or in a line. Thus we always useline_size
, nevervectorization
orvectorization_factor
or other similar variations.shape
for the length of a tensor's axis. The shape of a tensor is a list (vec, slice or tuple) of the shape of each axis.rank
for the number of axes in a tensor.something_count
instead ofnum_something
. (ex:CubeCount
,unit_count
)Tensors
parallel
to an axis if either it is the only contiguous axis or if it is contiguous and it has a shape greater than 1. Otherwise, the axis isperpendicular
.increasing_order
ifstride(axis1) < stride(axis2)
wheneveraxis1 < axis2
. This is also namedcolumn_major_order
when the tensor is a matrix (rank == 2).decreasing_order
ifstride(axis1) > stride(axis2)
wheneveraxis1 < axis2
. This is also namedrow_major_order
when the tensor is a matrix (rank == 2).non_monotonic_order
if it is neither inincreasing_order
nordecreasing_order
.stride
is all the elements obtained when fixing the coordinates of all axes but one.Meta
ReduceError
andReduceStrategy
.conventions.md
file in the project root to help users and contributors follow the naming convention (and possible other conventions in the future).The text was updated successfully, but these errors were encountered: