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 Source

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 [DataType]]

Attributes that are type parameters. Associated with the list of allowed types (see: TensorFlow.Types.OneOf). If this list is empty, then any type is acceptable.

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 Source

Constructors

Name 

newtype HaskellName Source

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

Constructors

HaskellName 

Fields

unHaskellName :: Text
 

newtype TFName Source

A raw name as specified in the OpDef proto.

Constructors

TFName 

Fields

unTFName :: Text
 

data Attr a Source

A named attribute, associated with some information about it.

Constructors

Attr 

data AttrType Source

The type of an attribute.

Instances

data ParsedArg Source

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

data ParsedArgCase Source

Constructors

SimpleArg 

Fields

argType :: ArgType
 
ListArg 

Fields

argLength :: Name

The attribute that specifies this list's length.

argType :: ArgType
 
MixedListArg

A heterogeneous list. TODO(judahjacobson): Implement this.

Fields

argTypeAttr :: Name
 

data ArgType Source

The type of an argument.

Constructors

ArgTypeFixed DataType

A fixed type.

ArgTypeAttr Name

A type that depends on an attribute.