Device object and device `kwarg` for creation
See original GitHub issueHi,
When reading the section regarding devices, I stumbled upon the following note:
The only way to obtain a Device object is from the .device property on the array object, hence there is no Device object in the array API itself that can be instantiated to point to a specific physical or logical device.
I understood this, as users can never instantiate a Device
object themselves.
But in the paragraph inmediately above there are sentences like:
A device=None keyword for array creation functions, which takes an instance of a Device object.
A .to_device(device) method on the array object, with device again being a Device object, to move an array to a different device.
And both require a Device
object, that according to the note, can’t be directly instantiated, or be obtained from elsewhere than a created array.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top GitHub Comments
Crystal clear! Thanks😄
That’s right. AFAIK the intention is to use
device=a.device
, i.e. when you already have a compliant arraya
and so you can use itsdevice
attribute. As for how to determine the device for the very first array, it is currently listed as out of scope, and each library will use its existing strategy for the choice of the default device, performing device management, etc.