1
0
Fork 0
mirror of https://github.com/tensorflow/haskell.git synced 2024-11-05 10:39:44 +01:00
tensorflow-haskell/tensorflow
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 Make code --pedantic (#35) 2016-11-18 10:42:02 -08:00
Setup.hs Initial commit 2016-10-24 19:26:42 +00:00
tensorflow.cabal Add support for logging to tensorboard (#74) 2017-02-20 19:16:42 -08:00
third_party Initial commit 2016-10-24 19:26:42 +00:00