Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
- data ParsedOp = ParsedOp {
- parsedOpName :: Name
- parsedOpSummary :: Text
- parsedOpDescription :: Text
- parsedInputs :: [ParsedArg]
- parsedOutputs :: [ParsedArg]
- explicitInputAttrs :: [Attr AttrType]
- inferredTypeAttrs :: [Attr TypeParam]
- inferredListSizeAttrs :: [Attr (NonEmpty Name)]
- parsedOpIsMonadic :: Bool
- data Name = Name {}
- newtype HaskellName = HaskellName {
- unHaskellName :: Text
- newtype TFName = TFName {
- unTFName :: Text
- data Attr a = Attr {
- attrName :: Name
- attrDescription :: Text
- attrInfo :: a
- data AttrType
- data AttrBaseType
- data TypeParam = TypeParam {
- typeParamIsList :: Bool
- typeParamRestrictions :: Maybe (NonEmpty DataType)
- data ParsedArg = ParsedArg {
- parsedArgName :: Name
- parsedArgDescription :: Text
- parsedArgCase :: ParsedArgCase
- data ParsedArgCase
- = SimpleArg {
- argType :: ArgType
- argCaseKind :: ArgKind
- | ListArg { }
- | MixedListArg { }
- | ResourceArg
- = SimpleArg {
- data ArgType
- data ArgKind
- argKind :: ParsedArgCase -> Maybe ArgKind
- parseOp :: OpDef -> ParsedOp
- camelCase :: Text -> Text
Documentation
data ParsedOp
ParsedOp | |
|
data Name
Name | |
|
newtype HaskellName
A name that's appropriate for a variable in a Haskell source file.
HaskellName | |
|
newtype TFName
A raw name as specified in the OpDef proto.
data Attr a
A named attribute, associated with some information about it.
Attr | |
|
data AttrBaseType
data TypeParam
TypeParam | |
|
data ParsedArg
An input or output argument (Tensor) for an op.
ParsedArg | |
|
data ParsedArgCase
SimpleArg | |
| |
ListArg | |
MixedListArg | A heterogeneous list. |
| |
ResourceArg |
data ArgType
The type of an argument.
ArgTypeFixed DataType | A fixed type. |
ArgTypeAttr Name | A type that depends on an attribute. |
argKind :: ParsedArgCase -> Maybe ArgKind
camelCase :: Text -> Text