Skip to content

AttributeError: module 'array_api_compat.torch' has no attribute 'newaxis' #64

Description

@ogrisel

According to:

the namespace modules should expose an alias to None named newaxis to make indexing code more explicit.

However it seems to be missing in array-api-compat, at least for PyTorch:

>>> import array_api_compat.torch as xp
>>> xp.newaxis is None
Traceback (most recent call last):
  Cell In[6], line 1
    xp.newaxis
AttributeError: module 'array_api_compat.torch' has no attribute 'newaxis'

Note, the same snippet works with numpy:

>>> import array_api_compat.numpy as xp
>>> xp.newaxis is None
True

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions