| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Torch.Typed.Factories
Contents
Synopsis
- zeros :: forall shape dtype device. TensorOptions shape dtype device => Tensor device dtype shape
- full :: forall shape dtype device a. (TensorOptions shape dtype device, Scalar a) => a -> Tensor device dtype shape
- ones :: forall shape dtype device. TensorOptions shape dtype device => Tensor device dtype shape
- type family RandDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) :: Constraint where ...
- rand :: forall shape dtype device. (TensorOptions shape dtype device, RandDTypeIsValid device dtype) => IO (Tensor device dtype shape)
- randn :: forall shape dtype device. (TensorOptions shape dtype device, RandDTypeIsValid device dtype) => IO (Tensor device dtype shape)
- randint :: forall shape dtype device. (TensorOptions shape dtype device, RandDTypeIsValid device dtype) => Int -> Int -> IO (Tensor device dtype shape)
- linspace :: forall steps device start end. (Scalar start, Scalar end, KnownNat steps, TensorOptions '[steps] 'Float device) => start -> end -> Tensor device 'Float '[steps]
- eyeSquare :: forall n dtype device. (KnownNat n, TensorOptions '[n, n] dtype device) => Tensor device dtype '[n, n]
Documentation
zeros :: forall shape dtype device. TensorOptions shape dtype device => Tensor device dtype shape Source #
full :: forall shape dtype device a. (TensorOptions shape dtype device, Scalar a) => a -> Tensor device dtype shape Source #
ones :: forall shape dtype device. TensorOptions shape dtype device => Tensor device dtype shape Source #
type family RandDTypeIsValid (device :: (DeviceType, Nat)) (dtype :: DType) :: Constraint where ... Source #
Equations
| RandDTypeIsValid '('CPU, 0) dtype = (DTypeIsNotBool '('CPU, 0) dtype, DTypeIsNotHalf '('CPU, 0) dtype) | |
| RandDTypeIsValid '('CUDA, _) dtype = () | |
| RandDTypeIsValid '('MPS, 0) dtype = () | |
| RandDTypeIsValid '(deviceType, _) dtype = UnsupportedDTypeForDevice deviceType dtype |
rand :: forall shape dtype device. (TensorOptions shape dtype device, RandDTypeIsValid device dtype) => IO (Tensor device dtype shape) Source #
randn :: forall shape dtype device. (TensorOptions shape dtype device, RandDTypeIsValid device dtype) => IO (Tensor device dtype shape) Source #
randint :: forall shape dtype device. (TensorOptions shape dtype device, RandDTypeIsValid device dtype) => Int -> Int -> IO (Tensor device dtype shape) Source #
Arguments
| :: forall steps device start end. (Scalar start, Scalar end, KnownNat steps, TensorOptions '[steps] 'Float device) | |
| => start | start |
| -> end | end |
| -> Tensor device 'Float '[steps] | output |
linspace
>>> dtype &&& shape &&& (t' -> D.asValue (toDynamic t') :: [Float]) $ linspace 7 '( 'D.CPU, 0) 0 3
(Float,([7],[0.0,0.5,1.0,1.5,2.0,2.5,3.0]))
>>> dtype &&& shape &&& (t' -> D.asValue (toDynamic t') :: [Float]) $ linspace 3 '( 'D.CPU, 0) 0 2
(Float,([3],[0.0,1.0,2.0]))
Arguments
| :: forall n dtype device. (KnownNat n, TensorOptions '[n, n] dtype device) | |
| => Tensor device dtype '[n, n] | output |
Orphan instances
| (TensorOptions shape' dtype device, shape' ~ ToNats shape) => Default (NamedTensor device dtype shape) Source # | |
Methods def :: NamedTensor device dtype shape # | |
| TensorOptions shape dtype device => Default (Tensor device dtype shape) Source # | |