tensorflow-opgen-0.1.0.0: Code generation for TensorFlow operations.

Safe HaskellNone
LanguageHaskell2010

TensorFlow.OpGen.ParsedOp

Description

This module helps parse the proto OpDef into a Haskell type which is more descriptive of how the attributes and arguments will be used in the generated code.

Synopsis

Documentation

data ParsedOp

Constructors

ParsedOp 

Fields

parsedOpName :: Name
 
parsedOpSummary :: Text
 
parsedOpDescription :: Text
 
parsedInputs :: [ParsedArg]
 
parsedOutputs :: [ParsedArg]
 
explicitInputAttrs :: [Attr AttrType]

Attributes that must be set explicitly when creating the op. Associated with the type of the attribute.

inferredTypeAttrs :: [Attr TypeParam]

Attributes that are type parameters.

inferredListSizeAttrs :: [Attr (NonEmpty Name)]
 
parsedOpIsMonadic :: Bool

Whether this op is stateful or takes a stateful input. Such ops should not be CSE'd and must be monadic in our API (i.e., return a Build action).

data Name

Constructors

Name 

newtype HaskellName

A name that's appropriate for a variable in a Haskell source file.

Constructors

HaskellName 

Fields

unHaskellName :: Text
 

newtype TFName

A raw name as specified in the OpDef proto.

Constructors

TFName 

Fields

unTFName :: Text
 

Instances

data Attr a

A named attribute, associated with some information about it.

Constructors

Attr 

Fields

attrName :: Name
 
attrDescription :: Text
 
attrInfo :: a
 

data AttrType

The type of an attribute.

Instances

data TypeParam

Constructors

TypeParam 

Fields

typeParamIsList :: Bool
 
typeParamRestrictions :: Maybe (NonEmpty DataType)

The list of allowed types (see: TensorFlow.Types.OneOf). If Nothing, then any type is acceptable.

data ParsedArg

An input or output argument (Tensor) for an op.

data ParsedArgCase

Constructors

SimpleArg 
ListArg 

Fields

argLength :: Name

The attribute that specifies this list's length.

argType :: ArgType
 
argCaseKind :: ArgKind
 
MixedListArg

A heterogeneous list.

ResourceArg 

data ArgType

The type of an argument.

Constructors

ArgTypeFixed DataType

A fixed type.

ArgTypeAttr Name

A type that depends on an attribute.

camelCase :: Text -> Text