1
0
Fork 0
mirror of https://github.com/tensorflow/haskell.git synced 2024-12-26 03:29:45 +01:00
tensorflow-haskell/tensorflow-opgen
Judah Jacobson c99a23b6a7 Add versions of each op that take optional params as an extra arg. (#84)
Each op `foo :: ...` now has a corresponding `foo' :: OpParams -> ...`
which lets you set optional attributes.  `OpParams` is currently a type alias for
`OpDef -> OpDef`.  In the future we should consider more type safety, e.g.,
using type-level strings and OverloadedLabels for optional attributes.

I used it to replace a few manual `buildOp`s in our code with the codegenerated
ops, now that it's easier to set attributes.  I also removed `tensorAttr` and
`named` since it's now possible to set those op attributes directly.

Although this clutters up the API a bit, I think it's simpler than using type
classes to implement optional arguments (as in, for example, `Text.Printf`) --
especially in terms of type inference with the rest of the library.
2017-03-20 18:16:38 -07:00
..
src/TensorFlow Add versions of each op that take optional params as an extra arg. (#84) 2017-03-20 18:16:38 -07:00
Setup.hs Initial commit 2016-10-24 19:26:42 +00:00
tensorflow-opgen.cabal Refactor OpGen. (#36) 2016-11-20 10:00:22 -08:00
third_party Initial commit 2016-10-24 19:26:42 +00:00