hasktorch-gradually-typed-0.2.0.0: experimental project for hasktorch
Safe HaskellSafe-Inferred
LanguageHaskell2010

Torch.GraduallyTyped.Device

Synopsis

Documentation

data DeviceType (deviceId :: Type) where Source #

Data type to represent compute devices.

Constructors

CPU :: forall deviceId. DeviceType deviceId

The tensor is stored in the CPU's memory.

CUDA :: forall deviceId. deviceId -> DeviceType deviceId

The tensor is stored the memory of the GPU with ID deviceId.

Instances

Instances details
Show deviceId => Show (DeviceType deviceId) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

showsPrec :: Int -> DeviceType deviceId -> ShowS Source #

show :: DeviceType deviceId -> String Source #

showList :: [DeviceType deviceId] -> ShowS Source #

Eq deviceId => Eq (DeviceType deviceId) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

(==) :: DeviceType deviceId -> DeviceType deviceId -> Bool Source #

(/=) :: DeviceType deviceId -> DeviceType deviceId -> Bool Source #

Ord deviceId => Ord (DeviceType deviceId) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

compare :: DeviceType deviceId -> DeviceType deviceId -> Ordering Source #

(<) :: DeviceType deviceId -> DeviceType deviceId -> Bool Source #

(<=) :: DeviceType deviceId -> DeviceType deviceId -> Bool Source #

(>) :: DeviceType deviceId -> DeviceType deviceId -> Bool Source #

(>=) :: DeviceType deviceId -> DeviceType deviceId -> Bool Source #

max :: DeviceType deviceId -> DeviceType deviceId -> DeviceType deviceId Source #

min :: DeviceType deviceId -> DeviceType deviceId -> DeviceType deviceId Source #

KnownDevice ('UncheckedDevice :: Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

SGetGeneratorDevice ('UncheckedDevice :: Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Random

SGetDevice ('UncheckedDevice :: Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDevice :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor gradient layout 'UncheckedDevice dataType shape -> SDevice 'UncheckedDevice Source #

getDeviceType :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor gradient layout 'UncheckedDevice dataType shape -> DeviceType Int16 Source #

SingKind (Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Associated Types

type Demote (Device (DeviceType Nat)) = (r :: Type) Source #

SingKind (DeviceType Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Associated Types

type Demote (DeviceType Nat) = (r :: Type) Source #

SingI ('CPU :: DeviceType Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

sing :: Sing 'CPU Source #

SingI deviceType => SingI ('Device deviceType :: Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

sing :: Sing ('Device deviceType) Source #

KnownNat deviceId => SingI ('CUDA deviceId :: DeviceType Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

sing :: Sing ('CUDA deviceId) Source #

KnownDeviceType deviceType => KnownDevice ('Device deviceType) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

SGetGeneratorDevice ('Device ('CPU :: DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Random

KnownNat deviceIndex => SGetGeneratorDevice ('Device ('CUDA deviceIndex)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Random

SGetDevice ('Device ('CPU :: DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDevice :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor gradient layout ('Device 'CPU) dataType shape -> SDevice ('Device 'CPU) Source #

getDeviceType :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor gradient layout ('Device 'CPU) dataType shape -> DeviceType Int16 Source #

KnownNat deviceIndex => SGetDevice ('Device ('CUDA deviceIndex)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Tensor.Type

Methods

sGetDevice :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor gradient layout ('Device ('CUDA deviceIndex)) dataType shape -> SDevice ('Device ('CUDA deviceIndex)) Source #

getDeviceType :: forall (gradient :: Gradient RequiresGradient) (layout :: Layout LayoutType) (dataType :: DataType DType) (shape :: Shape [Dim (Name Symbol) (Size Nat)]). Tensor gradient layout ('Device ('CUDA deviceIndex)) dataType shape -> DeviceType Int16 Source #

type Demote (Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

type Demote (DeviceType Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

type Sing = SDevice
type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

data SDeviceType (deviceType :: DeviceType Nat) where Source #

Constructors

SCPU :: SDeviceType 'CPU 
SCUDA :: forall deviceId. KnownNat deviceId => SDeviceType ('CUDA deviceId) 

Instances

Instances details
Show (SDeviceType deviceType) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

showsPrec :: Int -> SDeviceType deviceType -> ShowS Source #

show :: SDeviceType deviceType -> String Source #

showList :: [SDeviceType deviceType] -> ShowS Source #

type family CUDAF (deviceType :: DeviceType Nat) :: Nat where ... Source #

Equations

CUDAF ('CUDA deviceId) = deviceId 

class KnownDeviceType (deviceType :: DeviceType Nat) where Source #

Instances

Instances details
KnownDeviceType ('CPU :: DeviceType Nat) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

KnownNat deviceId => KnownDeviceType ('CUDA deviceId) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

data Device (deviceType :: Type) where Source #

Data type to represent whether or not the compute device is checked, that is, known to the compiler.

Constructors

UncheckedDevice :: forall deviceType. Device deviceType

The compute device is unknown to the compiler.

Device :: forall deviceType. deviceType -> Device deviceType

The compute device is known to the compiler.

Instances

Instances details
Show deviceType => Show (Device deviceType) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

showsPrec :: Int -> Device deviceType -> ShowS Source #

show :: Device deviceType -> String Source #

showList :: [Device deviceType] -> ShowS Source #

SingKind (Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Associated Types

type Demote (Device (DeviceType Nat)) = (r :: Type) Source #

SingI deviceType => SingI ('Device deviceType :: Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

sing :: Sing ('Device deviceType) Source #

type Demote (Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

type Sing Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

type Sing = SDevice

data SDevice (deviceType :: Device (DeviceType Nat)) where Source #

Constructors

SUncheckedDevice :: DeviceType Int16 -> SDevice 'UncheckedDevice 
SDevice :: forall deviceType. SDeviceType deviceType -> SDevice ('Device deviceType) 

Instances

Instances details
Show (SDevice device) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

Methods

showsPrec :: Int -> SDevice device -> ShowS Source #

show :: SDevice device -> String Source #

showList :: [SDevice device] -> ShowS Source #

class KnownDevice (device :: Device (DeviceType Nat)) where Source #

Instances

Instances details
KnownDevice ('UncheckedDevice :: Device (DeviceType Nat)) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

KnownDeviceType deviceType => KnownDevice ('Device deviceType) Source # 
Instance details

Defined in Torch.GraduallyTyped.Device

type family GetDevices f where ... Source #

Equations

GetDevices (a :: Device (DeviceType Nat)) = '[a] 
GetDevices (f g) = Concat (GetDevices f) (GetDevices g) 
GetDevices _ = '[]