mxnet-dataiter-0.1.0.0: mxnet dataiters

Safe HaskellNone
LanguageHaskell2010

MXNet.Core.IO.DataIter.Conduit

Synopsis

Documentation

data ConduitData m a Source #

Instances

Monad m => Dataset (ConduitData m) Source # 

Methods

fromListD :: [e] -> ConduitData m e #

zipD :: ConduitData m e1 -> ConduitData m e2 -> ConduitData m (e1, e2) #

sizeD :: (DatasetConstraint (ConduitData m) m, Monad m) => ConduitData m e -> m Int #

forEachD :: (DatasetConstraint (ConduitData m) m, Monad m) => ConduitData m e -> (e -> m a) -> m [a] #

forEachD_i :: (DatasetConstraint (ConduitData m) m, Monad m) => ConduitData m e -> ((Int, e) -> m a) -> m [a] #

forEachD_ni :: (DatasetConstraint (ConduitData m) m, Monad m) => ConduitData m e -> (((Int, Int), e) -> m a) -> m [a] #

type DatasetConstraint (ConduitData m1) m2 Source # 
type DatasetConstraint (ConduitData m1) m2 = (~) (* -> *) m1 m2

class Dataset (d :: * -> *) where #

Abstract Dataset type class

Minimal complete definition

fromListD, zipD, sizeD, forEachD

Methods

fromListD :: [e] -> d e #

Create Dataset from `[]`. note that depending on the instance, it may or may not work with infinitive list.

zipD :: d e1 -> d e2 -> d (e1, e2) #

Zip two Datasets

sizeD :: (DatasetConstraint d m, Monad m) => d e -> m Int #

Get number of elements

forEachD :: (DatasetConstraint d m, Monad m) => d e -> (e -> m a) -> m [a] #

Apply a function on each element of Dataset

forEachD_i :: (DatasetConstraint d m, Monad m) => d e -> ((Int, e) -> m a) -> m [a] #

Apply a function on each element of Dataset together with the element's index. Note that the default implmentation assumes the Dataset can be created from a infinitive list.

forEachD_ni :: (DatasetConstraint d m, Monad m) => d e -> (((Int, Int), e) -> m a) -> m [a] #

Apply a function on each element of Dataset together with the total number of elements and the element's index.

Instances

Monad m => Dataset (StreamData m) # 

Methods

fromListD :: [e] -> StreamData m e #

zipD :: StreamData m e1 -> StreamData m e2 -> StreamData m (e1, e2) #

sizeD :: (DatasetConstraint (StreamData m) m, Monad m) => StreamData m e -> m Int #

forEachD :: (DatasetConstraint (StreamData m) m, Monad m) => StreamData m e -> (e -> m a) -> m [a] #

forEachD_i :: (DatasetConstraint (StreamData m) m, Monad m) => StreamData m e -> ((Int, e) -> m a) -> m [a] #

forEachD_ni :: (DatasetConstraint (StreamData m) m, Monad m) => StreamData m e -> (((Int, Int), e) -> m a) -> m [a] #

Monad m => Dataset (ConduitData m) # 

Methods

fromListD :: [e] -> ConduitData m e #

zipD :: ConduitData m e1 -> ConduitData m e2 -> ConduitData m (e1, e2) #

sizeD :: (DatasetConstraint (ConduitData m) m, Monad m) => ConduitData m e -> m Int #

forEachD :: (DatasetConstraint (ConduitData m) m, Monad m) => ConduitData m e -> (e -> m a) -> m [a] #

forEachD_i :: (DatasetConstraint (ConduitData m) m, Monad m) => ConduitData m e -> ((Int, e) -> m a) -> m [a] #

forEachD_ni :: (DatasetConstraint (ConduitData m) m, Monad m) => ConduitData m e -> (((Int, Int), e) -> m a) -> m [a] #