klyn.math.nn.Device.operator[]
method
public operator[](index as Long) as Device
Description

Selects a concrete device in the GPU/NPU category.

Parameters
ParameterDescription
indexNon-negative ordinal returned by list.
Returns

A concrete GPU selector.

Throws
  • IndexException for an unavailable GPU; ValueException for NPU or another category.
Example

device = Device.gpu[0]