mxnet-0.2.0.0: MXNet interface in Haskell.

Copyright(c) 2016-2017 Tao He
LicenseMIT
Maintainersighingnow@gmail.com
Safe HaskellSafe
LanguageHaskell2010

MXNet.Core.Base.DType

Description

DType corresponding between Haskell's data type and numpy's data type.

Synopsis

Documentation

class (Storable a, Show a, Eq a, Ord a, Num a, Real a) => DType a where Source #

DType class, used to quantify types that can be passed to mxnet.

Minimal complete definition

typeid, typename

Methods

typeid :: a -> Int Source #

typename :: a -> String Source #

pattern FLOAT32 :: forall a. (Num a, Eq a) => a Source #

pattern FLOAT64 :: forall a. (Num a, Eq a) => a Source #

pattern FLOAT16 :: forall a. (Num a, Eq a) => a Source #

pattern UINT8 :: forall a. (Num a, Eq a) => a Source #

pattern INT32 :: forall a. (Num a, Eq a) => a Source #

class Tensor (tensor :: * -> *) where Source #

Tensor operations.

Methods

dot :: DType a => tensor a -> tensor a -> IO (tensor a) Source #

Dot product.

reshape :: DType a => tensor a -> [Int] -> IO (tensor a) Source #

Reshape a tensor value.

transpose :: DType a => tensor a -> IO (tensor a) Source #

Transpose a tensor value.

(+.), (-.), (*.), (/.), (^.) :: DType a => tensor a -> tensor a -> IO (tensor a) Source #

Add, subtract, multiply, divide and power with IO action.

(.+), (.-), (.*), (./), (.^) :: DType a => tensor a -> a -> IO (tensor a) infixr 8 .^infixl 7 .*, ./infixl 6 .+, .- Source #

Ordinary arithmetic operators with scalar value.

(..-), (../), (..^) :: DType a => a -> tensor a -> IO (tensor a) infixr 8 ..^infixl 7 ../infixl 6 ..- Source #

Flip version of ordinary arithmetic operators with scalar value.

(.+=), (.-=), (.*=), (./=), (.^=) :: DType a => tensor a -> a -> IO () Source #

Mutable ordinary arithmetic operators with scalar value.

_Maximum, _Minimum, equal, notEqual, greater, greaterEqual, lesser, lesserEqual :: DType a => tensor a -> tensor a -> IO (tensor a) Source #

Compare two tensor values, after comparison, all cell may be set as a same value, or 0, or 1.

_Maximum', _Minimum', equal', notEqual', greater', greaterEqual', lesser', lesserEqual' :: DType a => tensor a -> a -> IO (tensor a) Source #

Compare a tensor value with a scalar value, after comparison, all cell may be set as a same value, or 0, or 1.

Instances

Tensor NDArray Source # 

Methods

dot :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

reshape :: DType a => NDArray a -> [Int] -> IO (NDArray a) Source #

transpose :: DType a => NDArray a -> IO (NDArray a) Source #

(+.) :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

(-.) :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

(*.) :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

(/.) :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

(^.) :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

(.+) :: DType a => NDArray a -> a -> IO (NDArray a) Source #

(.-) :: DType a => NDArray a -> a -> IO (NDArray a) Source #

(.*) :: DType a => NDArray a -> a -> IO (NDArray a) Source #

(./) :: DType a => NDArray a -> a -> IO (NDArray a) Source #

(.^) :: DType a => NDArray a -> a -> IO (NDArray a) Source #

(..-) :: DType a => a -> NDArray a -> IO (NDArray a) Source #

(../) :: DType a => a -> NDArray a -> IO (NDArray a) Source #

(..^) :: DType a => a -> NDArray a -> IO (NDArray a) Source #

(.+=) :: DType a => NDArray a -> a -> IO () Source #

(.-=) :: DType a => NDArray a -> a -> IO () Source #

(.*=) :: DType a => NDArray a -> a -> IO () Source #

(./=) :: DType a => NDArray a -> a -> IO () Source #

(.^=) :: DType a => NDArray a -> a -> IO () Source #

_Maximum :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

_Minimum :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

equal :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

notEqual :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

greater :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

greaterEqual :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

lesser :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

lesserEqual :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

_Maximum' :: DType a => NDArray a -> a -> IO (NDArray a) Source #

_Minimum' :: DType a => NDArray a -> a -> IO (NDArray a) Source #

equal' :: DType a => NDArray a -> a -> IO (NDArray a) Source #

notEqual' :: DType a => NDArray a -> a -> IO (NDArray a) Source #

greater' :: DType a => NDArray a -> a -> IO (NDArray a) Source #

greaterEqual' :: DType a => NDArray a -> a -> IO (NDArray a) Source #

lesser' :: DType a => NDArray a -> a -> IO (NDArray a) Source #

lesserEqual' :: DType a => NDArray a -> a -> IO (NDArray a) Source #

Tensor Symbol Source # 

Methods

dot :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

reshape :: DType a => Symbol a -> [Int] -> IO (Symbol a) Source #

transpose :: DType a => Symbol a -> IO (Symbol a) Source #

(+.) :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

(-.) :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

(*.) :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

(/.) :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

(^.) :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

(.+) :: DType a => Symbol a -> a -> IO (Symbol a) Source #

(.-) :: DType a => Symbol a -> a -> IO (Symbol a) Source #

(.*) :: DType a => Symbol a -> a -> IO (Symbol a) Source #

(./) :: DType a => Symbol a -> a -> IO (Symbol a) Source #

(.^) :: DType a => Symbol a -> a -> IO (Symbol a) Source #

(..-) :: DType a => a -> Symbol a -> IO (Symbol a) Source #

(../) :: DType a => a -> Symbol a -> IO (Symbol a) Source #

(..^) :: DType a => a -> Symbol a -> IO (Symbol a) Source #

(.+=) :: DType a => Symbol a -> a -> IO () Source #

(.-=) :: DType a => Symbol a -> a -> IO () Source #

(.*=) :: DType a => Symbol a -> a -> IO () Source #

(./=) :: DType a => Symbol a -> a -> IO () Source #

(.^=) :: DType a => Symbol a -> a -> IO () Source #

_Maximum :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

_Minimum :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

equal :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

notEqual :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

greater :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

greaterEqual :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

lesser :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

lesserEqual :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

_Maximum' :: DType a => Symbol a -> a -> IO (Symbol a) Source #

_Minimum' :: DType a => Symbol a -> a -> IO (Symbol a) Source #

equal' :: DType a => Symbol a -> a -> IO (Symbol a) Source #

notEqual' :: DType a => Symbol a -> a -> IO (Symbol a) Source #

greater' :: DType a => Symbol a -> a -> IO (Symbol a) Source #

greaterEqual' :: DType a => Symbol a -> a -> IO (Symbol a) Source #

lesser' :: DType a => Symbol a -> a -> IO (Symbol a) Source #

lesserEqual' :: DType a => Symbol a -> a -> IO (Symbol a) Source #

class Tensor tensor => Neural tensor where Source #

Neural network combinators.

Methods

fullyConnected Source #

Arguments

:: DType a 
=> tensor a

Input data.

-> tensor a

Weight matrix.

-> tensor a

Bias parameter.

-> Int

Number of hidden nodes of the output.

-> IO (tensor a) 

Apply a linear transformation: Y = X W^T + b.

correlation Source #

Arguments

:: DType a 
=> tensor a

Input data1 to the correlation.

-> tensor a

Input data2 to the correlation.

-> IO (tensor a) 

Apply correlation to inputs

activation Source #

Arguments

:: DType a 
=> tensor a

Input data to activation function.

-> String

Activation function to be applied, one of {relu, sigmoid, softrelu, tanh}.

-> IO (tensor a) 

ElementWise activation function.

leakyReLU Source #

Arguments

:: DType a 
=> tensor a

Input data to activation function.

-> String

Activation function to be applied, one of {elu, leaky, prelu, rrelu}, default is leaky.

-> IO (tensor a) 

Leaky ReLu activation

The following types are supported:

  1. elu: y = x > 0 ? x : slop * (exp(x)-1)
  2. leaky: y = x > 0 ? x : slope * x
  3. prelu: same as leaky but the slope is learnable.
  4. rrelu: same as leaky but the slope is uniformly randomly chosen from [lower_bound, upper_bound) for training, while fixed to be (lower_bound+upper_bound)/2 for inference.

softmaxActivation Source #

Arguments

:: DType a 
=> tensor a

Input data to activation function.

-> IO (tensor a) 

Apply softmax activation to input.

dropout Source #

Arguments

:: DType a 
=> tensor a

Input data to dropout.

-> Float

Fraction of the input that gets dropped out at training time, default is 0.5.

-> IO (tensor a) 

Apply dropout to input.

batchNorm Source #

Arguments

:: DType a 
=> tensor a

Input data to batch normalization.

-> tensor a

Gamma

-> tensor a

Beta

-> tensor a

Moving mean

-> tensor a

Moving var

-> IO (tensor a) 

Batch normalization.

instanceNorm Source #

Arguments

:: DType a 
=> tensor a

A n-dimensional tensor (n > 2) of the form [batch, channel, spatial_dim1, spatial_dim2, ...].

-> tensor a

Gamma, a vector of length channel, which multiplies the normalized input.

-> tensor a

Beta, a vector of length channel, which is added to the product of the normalized input and the weight.

-> Float

Epsilon to prevent division by 0.

-> IO (tensor a) 

An operator taking in a n-dimensional input tensor (n > 2), and normalizing the input by subtracting the mean and variance calculated over the spatial dimensions.

l2Normalization Source #

Arguments

:: DType a 
=> tensor a

Input data to the L2NormalizationOp.

-> Float

Epsilon to prevent div 0, default is 1e-10.

-> String

Normalization Mode, one of {channel, 'instance', spatial}, default is 'instance'.

-> IO (tensor a) 

Set the l2 norm of each instance to a constant.

convolution Source #

Arguments

:: DType a 
=> tensor a

Input data.

-> tensor a

Weight matrix.

-> tensor a

Bias parameter.

-> String

Convolution kernel size: (h, w) or (d, h, w).

-> Int

Convolution filter(channel) number.

-> IO (tensor a) 

Convolution Compute N-D convolution on (N+2)-D input.

lrn Source #

Arguments

:: DType a 
=> tensor a

Input data to the ConvolutionOp.

-> Float

Alpha, value of the alpha variance scaling parameter in the normalization formula, default is 0.0001.

-> Float

Beta, value of the beta power parameter in the normalization formula, default is 0.75.

-> Float

Value of the k parameter in normalization formula, default is 2.

-> Int

Normalization window width in elements.

-> IO (tensor a) 

Apply convolution to input then add a bias.

deconvolution Source #

Arguments

:: DType a 
=> tensor a

Input data to the DeconvolutionOp.

-> tensor a

Weight matrix.

-> tensor a

Bias parameter.

-> String

Convolution kernel size: (h, w) or (d, h, w).

-> Int

Convolution filter(channel) number.

-> IO (tensor a) 

Apply deconvolution to input then add a bias.

pooling Source #

Arguments

:: DType a 
=> tensor a

Input data to the pooling operator.

-> String

Pooling kernel size: (y, x) or (d, y, x).

-> String

Pooling type to be applied, one of {avg, max, sum}.

-> IO (tensor a) 

Perform pooling on the input.

roiPooling Source #

Arguments

:: DType a 
=> tensor a

Input data to the pooling operator, a 4D Feature maps.

-> tensor a

Bounding box coordinates.

-> String

Fix pooled size: (h, w).

-> Int

Ratio of input feature map height (or w) to raw image height (or w).

-> IO (tensor a) 

Performs region-of-interest pooling on inputs.

rnn Source #

Arguments

:: DType a 
=> tensor a

Input data to RNN.

-> tensor a

Vector of all RNN trainable parameters concatenated.

-> tensor a

Initial hidden state of the RNN.

-> tensor a

Initial cell state for LSTM networks (only for LSTM).

-> Int

Size of the state for each layer.

-> Int

Number of stacked layers.

-> String

The type of RNN to compute, one of {gru, lstm, rnn_relu, rnn_tanh}.

-> IO (tensor a) 

Apply a recurrent layer to input.

embedding Source #

Arguments

:: DType a 
=> tensor a

Input data to the EmbeddingOp.

-> tensor a

Embedding weight matrix.

-> Int

Vocabulary size of the input indices.

-> Int

Dimension of the embedding vectors.

-> IO (tensor a) 

Map integer index to vector representations (embeddings).

bilinearSampler Source #

Arguments

:: DType a 
=> tensor a

Input data to the BilinearsamplerOp.

-> tensor a

Input grid to the BilinearsamplerOp.grid has two channels: x_src, y_src.

-> IO (tensor a) 

Apply bilinear sampling to input feature map, which is the key of “[NIPS2015] Spatial Transformer Networks” output[batch, channel, y_dst, x_dst] = G(data[batch, channel, y_src, x_src) x_dst, y_dst enumerate all spatial locations in output x_src = grid[batch, 0, y_dst, x_dst] y_src = grid[batch, 1, y_dst, x_dst] G() denotes the bilinear interpolation kernel The out-boundary points will be padded as zeros.

gridGenerator Source #

Arguments

:: DType a 
=> tensor a

Input data to the BilinearsamplerOp.

-> tensor a

Input grid to the BilinearsamplerOp.grid has two channels: x_src, y_src.

-> IO (tensor a) 

generate sampling grid for bilinear sampling.

upSampling Source #

Arguments

:: DType a 
=> [tensor a]

Array of tensors to upsample.

-> Int

Up sampling scale.

-> String

Upsampling method, one of {bilinear, nearest}.

-> IO (tensor a) 

Perform nearest neighboor/bilinear up sampling to inputs

spatialTransformer Source #

Arguments

:: DType a 
=> tensor a

Input data to the SpatialTransformerOp.

-> tensor a

Localisation net, the output dim should be 6 when transform_type is affine.

-> IO (tensor a) 

Apply spatial transformer to input feature map.

linearRegressionOutput Source #

Arguments

:: DType a 
=> tensor a

Input data to function.

-> tensor a

Input label to function.

-> IO (tensor a) 

Use linear regression for final output, this is used on final output of a net.

logisticRegressionOutput Source #

Arguments

:: DType a 
=> tensor a

Input data to function.

-> tensor a

Input label to function.

-> IO (tensor a) 

Use Logistic regression for final output, this is used on final output of a net.

softmaxOutput Source #

Arguments

:: DType a 
=> tensor a

Input data.

-> tensor a

Ground truth label.

-> IO (tensor a) 

Softmax with logit loss.

maeRegressionOutput Source #

Arguments

:: DType a 
=> tensor a

Input data to function.

-> tensor a

Input label to function.

-> IO (tensor a) 

Use mean absolute error regression for final output, this is used on final output of a net.

svmOutput Source #

Arguments

:: DType a 
=> tensor a

Input data to svm.

-> tensor a

Label data.

-> Int

Margin, scale the DType(param_.margin) for activation size, default is 1.

-> Float

Regularization coefficient, Scale the coefficient responsible for balacing coefficient size and error tradeoff, default is 1.

-> Bool

Use linear, if set true, uses L1-SVM objective function. Default uses L2-SVM objective, default is False.

-> IO (tensor a) 

Support Vector Machine based transformation on input, backprop L2-SVM

softmaxCrossEntropy Source #

Arguments

:: DType a 
=> tensor a

Input data.

-> tensor a

Input label.

-> IO (tensor a) 

Calculate cross_entropy(data, one_hot(label))

smoothL1 Source #

Arguments

:: DType a 
=> tensor a

Source input

-> Float

Scalar input.

-> IO (tensor a) 

Calculate Smooth L1 Loss(lhs, scalar)

identityAttachKLSparsereg Source #

Arguments

:: DType a 
=> tensor a

Input data.

-> IO (tensor a) 

Apply a sparse regularization to the output a sigmoid activation function.

makeLoss Source #

Arguments

:: DType a 
=> tensor a

Input data.

-> Float

Gradient scale as a supplement to unary and binary operators, default is 1.

-> Float

Valid thresh, default is 0. Regard element valid when x > valid_thresh, this is used only in valid normalization mode.

-> String

Normalization, one of {batch, null, valid}, default is null.

-> IO (tensor a) 

Get output from a symbol and pass 1 gradient back.

blockGrad Source #

Arguments

:: DType a 
=> tensor a

The input.

-> IO (tensor a) 

Get output from a symbol and pass 0 gradient back

custom Source #

Arguments

:: DType a 
=> [tensor a]

Input of custom operator

-> String

Type of custom operator, must be registered first.

-> IO (tensor a) 

Custom operator implemented in frontend.

Instances

Neural NDArray Source # 

Methods

fullyConnected :: DType a => NDArray a -> NDArray a -> NDArray a -> Int -> IO (NDArray a) Source #

correlation :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

activation :: DType a => NDArray a -> String -> IO (NDArray a) Source #

leakyReLU :: DType a => NDArray a -> String -> IO (NDArray a) Source #

softmaxActivation :: DType a => NDArray a -> IO (NDArray a) Source #

dropout :: DType a => NDArray a -> Float -> IO (NDArray a) Source #

batchNorm :: DType a => NDArray a -> NDArray a -> NDArray a -> NDArray a -> NDArray a -> IO (NDArray a) Source #

instanceNorm :: DType a => NDArray a -> NDArray a -> NDArray a -> Float -> IO (NDArray a) Source #

l2Normalization :: DType a => NDArray a -> Float -> String -> IO (NDArray a) Source #

convolution :: DType a => NDArray a -> NDArray a -> NDArray a -> String -> Int -> IO (NDArray a) Source #

lrn :: DType a => NDArray a -> Float -> Float -> Float -> Int -> IO (NDArray a) Source #

deconvolution :: DType a => NDArray a -> NDArray a -> NDArray a -> String -> Int -> IO (NDArray a) Source #

pooling :: DType a => NDArray a -> String -> String -> IO (NDArray a) Source #

roiPooling :: DType a => NDArray a -> NDArray a -> String -> Int -> IO (NDArray a) Source #

rnn :: DType a => NDArray a -> NDArray a -> NDArray a -> NDArray a -> Int -> Int -> String -> IO (NDArray a) Source #

embedding :: DType a => NDArray a -> NDArray a -> Int -> Int -> IO (NDArray a) Source #

bilinearSampler :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

gridGenerator :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

upSampling :: DType a => [NDArray a] -> Int -> String -> IO (NDArray a) Source #

spatialTransformer :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

linearRegressionOutput :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

logisticRegressionOutput :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

softmaxOutput :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

maeRegressionOutput :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

svmOutput :: DType a => NDArray a -> NDArray a -> Int -> Float -> Bool -> IO (NDArray a) Source #

softmaxCrossEntropy :: DType a => NDArray a -> NDArray a -> IO (NDArray a) Source #

smoothL1 :: DType a => NDArray a -> Float -> IO (NDArray a) Source #

identityAttachKLSparsereg :: DType a => NDArray a -> IO (NDArray a) Source #

makeLoss :: DType a => NDArray a -> Float -> Float -> String -> IO (NDArray a) Source #

blockGrad :: DType a => NDArray a -> IO (NDArray a) Source #

custom :: DType a => [NDArray a] -> String -> IO (NDArray a) Source #

Neural Symbol Source # 

Methods

fullyConnected :: DType a => Symbol a -> Symbol a -> Symbol a -> Int -> IO (Symbol a) Source #

correlation :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

activation :: DType a => Symbol a -> String -> IO (Symbol a) Source #

leakyReLU :: DType a => Symbol a -> String -> IO (Symbol a) Source #

softmaxActivation :: DType a => Symbol a -> IO (Symbol a) Source #

dropout :: DType a => Symbol a -> Float -> IO (Symbol a) Source #

batchNorm :: DType a => Symbol a -> Symbol a -> Symbol a -> Symbol a -> Symbol a -> IO (Symbol a) Source #

instanceNorm :: DType a => Symbol a -> Symbol a -> Symbol a -> Float -> IO (Symbol a) Source #

l2Normalization :: DType a => Symbol a -> Float -> String -> IO (Symbol a) Source #

convolution :: DType a => Symbol a -> Symbol a -> Symbol a -> String -> Int -> IO (Symbol a) Source #

lrn :: DType a => Symbol a -> Float -> Float -> Float -> Int -> IO (Symbol a) Source #

deconvolution :: DType a => Symbol a -> Symbol a -> Symbol a -> String -> Int -> IO (Symbol a) Source #

pooling :: DType a => Symbol a -> String -> String -> IO (Symbol a) Source #

roiPooling :: DType a => Symbol a -> Symbol a -> String -> Int -> IO (Symbol a) Source #

rnn :: DType a => Symbol a -> Symbol a -> Symbol a -> Symbol a -> Int -> Int -> String -> IO (Symbol a) Source #

embedding :: DType a => Symbol a -> Symbol a -> Int -> Int -> IO (Symbol a) Source #

bilinearSampler :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

gridGenerator :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

upSampling :: DType a => [Symbol a] -> Int -> String -> IO (Symbol a) Source #

spatialTransformer :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

linearRegressionOutput :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

logisticRegressionOutput :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

softmaxOutput :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

maeRegressionOutput :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

svmOutput :: DType a => Symbol a -> Symbol a -> Int -> Float -> Bool -> IO (Symbol a) Source #

softmaxCrossEntropy :: DType a => Symbol a -> Symbol a -> IO (Symbol a) Source #

smoothL1 :: DType a => Symbol a -> Float -> IO (Symbol a) Source #

identityAttachKLSparsereg :: DType a => Symbol a -> IO (Symbol a) Source #

makeLoss :: DType a => Symbol a -> Float -> Float -> String -> IO (Symbol a) Source #

blockGrad :: DType a => Symbol a -> IO (Symbol a) Source #

custom :: DType a => [Symbol a] -> String -> IO (Symbol a) Source #

data Context Source #

Context definition.

  • DeviceType

    1. cpu
    2. gpu
    3. cpu_pinned

Constructors

Context 

Fields

contextCPU :: Context Source #

Context for CPU 0.

contextGPU :: Context Source #

Context for GPU 0.