On Wed, Sep 13, 2023 at 8:38 AM Antoine Pitrou <anto...@python.org> wrote:

>
> Le 13/09/2023 à 02:37, Rok Mihevc a écrit :
> >
> >    * **ragged_dimensions** = indices of ragged dimensions whose sizes may
> >      differ. Dimensions where all elements have the same size are called
> >      uniform dimensions. Indices are a subset of all possible dimension
> >      indices ([0, 1, .., N-1]).
> >      Ragged dimensions list can be left out. In that case all dimensions
> >      are assumed ragged.
>
> It's a bit confusing that an empty list means "no ragged dimensions" but
> a missing entry means "all dimensions are ragged". This seems
> error-prone to me.
>
> Also, to be clear, "ragged_dimensions" is only useful for data validation?
>
>
I am also quite confused by how to interpret / use ragged dimensions. Given
that this is a "variable" shaped tensor, I personally find specifying the
exceptional case -- the "uniform" dimensions -- to be much more clear.

I would propose instead:

**uniform_dimenions** = Indices of dimensions whose sizes are guaranteed to
remain constant.
Indices are a subset of all possible dimension indices ([0, 1, .., N-1]).
The uniform dimensions must
still be represented in the `shape` field, and must always be the same
value for all tensors in the
array -- this allows code to interpret the tensor correctly without
accounting for uniform dimensions
while still permitting optional optimizations that take advantage of the
uniformity. Uniform_dimensions
can be left out, in which case it is assumed that all dimensions might be
variable.

Reply via email to