Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inner most dimension of an Array

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.

like image 239
lifeisshubh Avatar asked Mar 31 '19 02:03

lifeisshubh


People also ask

What is the dimension of an array?

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).

What is dimension of array in NumPy?

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.

What is a correct syntax to check the number of dimensions in an array?

N = ndims( A ) returns the number of dimensions in the array A .


1 Answers

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.

like image 154
gmds Avatar answered Sep 29 '22 01:09

gmds