Which dimension of the array is called the innermost dimension of the array? I was going through some tensorflow documentation "ctc loss" where they describe one jargon called innermost dimension of the array. According to me, there can be three possibilities for the answer. 1. leftmost if see from the right. 2. rightmost if we see from the left. 3. Middle, if we see from both side.
Can someone please explain what innermost dimension means here?. Thanks for going through my doubt.
A dimension is a direction in which you can vary the specification of an array's elements. An array that holds the sales total for each day of the month has one dimension (the day of the month).
In NumPy dimensions are called axes. For example, the array for the coordinates of a point in 3D space, [1, 2, 1] , has one axis. That axis has 3 elements in it, so we say it has a length of 3. In the example pictured below, the array has 2 axes.
N = ndims( A ) returns the number of dimensions in the array A .
If we refer to the tensorflow
repo, we can get the answer:
// The order of entries in "dim" matters: It indicates the layout of the
// values in the tensor in-memory representation.
//
// The first entry in "dim" is the outermost dimension used to layout the
// values, the last entry is the innermost dimension. This matches the
// in-memory layout of RowMajor Eigen tensors.
(emphasis mine)
This is the same as the default (row-major, also called C-style) layout of numpy
arrays, where the last dimension is considered the innermost because it varies the fastest.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With