Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

dpt.take_along_axis and dpt.put_along_axis raise an Error when indices data type is uint64 #1936

Copy link
Copy link
@vtavana

Description

@vtavana
Issue body actions

In dpctl, take_along_axis raises an error when indices dtype is uint64 while it works properly in NumPy.

import dpctl.tensor as dpt
a = dpt.asarray([[10, 30, 20], [60, 40, 50]])
ind = dpt.asarray([[2, 1, 0], [2, 1, 0]], dtype=dpt.uint64)
dpt.take_along_axis(a, ind, axis=1)
# ValueError: cannot safely promote indices to an integer data type

import numpy
a = numpy.array([[10, 30, 20], [60, 40, 50]])
ind = numpy.array([[2, 1, 0], [2, 1, 0]], dtype=numpy.uint64)
numpy.take_along_axis(a, ind, axis=1)
# array([[20, 30, 10],
#       [50, 40, 60]])

a similar behavior is observed for dpt.put_along_axis

Reactions are currently unavailable

Metadata

Metadata

Assignees

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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.