Skip to content

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

Closed
@ogrisel

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

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