IncliArray
Loading...
Searching...
No Matches
detail Namespace Reference

Functions

std::vector< int > _computeStrides (std::vector< int > newShape)
 Computes strides from a new shape.
 
std::vector< int > _broadcastShape (std::vector< int > a, std::vector< int > b)
 Computes the broadcasted shape of a and b together.
 
std::vector< int > _broadcastStrides (std::vector< int > originalShape, std::vector< int > originalStrides, std::vector< int > targetShape)
 Computes the broadcasted strides based on original shape and strides, and target shape.
 
int _computeOffset (std::vector< int > index, std::vector< int > strides)
 Computes offset based on the index and strides.
 

Function Documentation

◆ _broadcastShape()

std::vector< int > detail::_broadcastShape ( std::vector< int >  a,
std::vector< int >  b 
)

Computes the broadcasted shape of a and b together.

Parameters
aFirst object for shape broadcasting
aSecond object for shape broadcasting
Returns
Broadcasted shape

◆ _broadcastStrides()

std::vector< int > detail::_broadcastStrides ( std::vector< int >  originalShape,
std::vector< int >  originalStrides,
std::vector< int >  targetShape 
)

Computes the broadcasted strides based on original shape and strides, and target shape.

Parameters
originalShapeOriginal shape
originalStridesOriginal strides
targetShapeThe target shape. It is the shape which the new stride will correspond to
Returns
Computed strides

◆ _computeOffset()

int detail::_computeOffset ( std::vector< int >  index,
std::vector< int >  strides 
)

Computes offset based on the index and strides.

Parameters
indexIndices based on which the offset will be computed
stridesStrides that will be used to compute the offset
Returns
Computed offset value

◆ _computeStrides()

std::vector< int > detail::_computeStrides ( std::vector< int >  newShape)

Computes strides from a new shape.

Parameters
newShapeShape with which strides should be computed
Returns
Computed strides