Skip to content

axis/dims default value in concatenate #903

Open
@lostanlen

Description

While rebasing PR #871 i noticed that our concatenate operator has strange default values for dims:

Here's backend/numpy_backend.py:

    @classmethod
    def concatenate(cls, arrays, dim=1):
        return cls._np.stack(arrays, axis=dim)

Here's backend/tensorflow_backend.py:

    @staticmethod
    def concatenate(arrays, dim=1):
        return tf.stack(arrays, axis=dim)

Here's backend/torch_backend.py:

   @staticmethod
    def concatenate(arrays, dim=2):
        return torch.stack(arrays, dim=dim)

I'm a bit confused by this dim=2 default value. And not too happy that the kwargs is called dim instead of axis, which would be more compliant with the Python Array API.

Our decision here will affect the semantics of #902

@eickenberg thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIIssues in user-facing codemanagement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions