1
0
Fork 0
mirror of https://github.com/tensorflow/haskell.git synced 2024-11-10 13:09:43 +01:00
tensorflow-haskell/tensorflow-ops
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
tests 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-ops.cabal Add example to README + make haddock link more prominent (#60) 2017-01-16 20:44:45 -08:00