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

__array_namespace_info__.dtypes raises AttributeError for device passed as a string #1978

Copy link
Copy link
@antonwolfy

Description

@antonwolfy
Issue body actions

Based on dpctl documentation Info.dtypes support a string value of device keyword argument:

device (Optional[:class:dpctl.SyclDevice, :class:dpctl.SyclQueue, :class:dpctl.tensor.Device, str])

but the example below does not work and raises AttributeError exception:

import dpctl, dpctl.tensor as dpt

dpctl.__version__
# Out: '0.19.0dev0+480.g360ce45dc6'

info = dpnp.__array_namespace_info__()
info.dtypes(device="gpu")
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[3], line 1
----> 1 info.dtypes(device="gpu")

File ~/miniforge3/envs/dpnp_dev/lib/python3.11/site-packages/dpctl/tensor/_array_api.py:203, in Info.dtypes(self, device, kind)
    201 elif isinstance(device, dpt.Device):
    202     device = device.sycl_device
--> 203 _fp64 = device.has_aspect_fp64
    204 if kind is None:
    205     return {
    206         key: val
    207         for key, val in self._all_dtypes.items()
    208         if (key != "float64" or _fp64)
    209     }

AttributeError: 'str' object has no attribute 'has_aspect_fp64'
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request

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.