1
0
mirror of https://github.com/tensorflow/haskell.git synced 2024-06-28 15:38:34 +02:00
Commit Graph

8 Commits

Author SHA1 Message Date
Judah Jacobson
9209dfc4c4 Support lists of tensors in ops. (#79)
Adds a new type `ListOf` which wraps a heterogeneous list; for example,
`ListOf (Tensor Value) '[Int32, Float]` represents a list of two
elements: a tensor of int32s and a tensor of floats.

Also changes the `Queue2` type (which suppored pairs of tensors) to
`Queue` (which supports arbitrary lists).
2017-03-17 13:53:19 -07:00
Judah Jacobson
0c8d41250a Remove the type parameter from ResourceHandle. (#76)
This change allows us to reenable the rest of the ResourceHandle ops, and
future-proofs us against more being added.  It removes the custom logic that
assumed there was a "dtype" attribute to guess what the type parameter is
(which wasn't true in general.)

When we switch to ResourceHandle (e.g., for queues and variables) we can add
parameters to the wrapper types like "Queue" on a case-by-case basis.
2017-02-21 19:38:26 -08:00
Judah Jacobson
db75350969 Support type attributes that aren't used by an input/output. (#51)
We should treat such attributes as regular `DataType` values rather than type
parameters; otherwise we'll get ambiguous types.  As with other attributes,
they can either set by default or passed in as an explicit argument to the op.

Allows us to reenable a couple more ops.
2016-12-15 11:52:48 -08:00
Judah Jacobson
1539783ee5 Update type constraints to work around a ghc-8 bug. (#47)
Also removes all the ghc-8-specific logic in the .cabal files.

ghc-8 has issues with deeply nested tuples of constraints.  We can
work around it by:
- Changing TensorTypes to a regular class.  This required FlexibleContexts.
  (But we'll probably need it anyway when we support heterogeneous tensor
  lists.)
- Specializing NoneOf for long type lists.

For more details, see: https://ghc.haskell.org/trac/ghc/ticket/12175.

Also added 'directory' to tensorflow-core-ops' dependencies since it's used
in the Setup script.

One more step towards fixing #38.
2016-11-28 21:15:09 -08:00
Judah Jacobson
cec666e135 Fix Ref and Build semantics for generated code. (#37)
Also:
- Make TensorFlow.Ops.{variable,assign} be the Core generated versions.
- Make ops take "Shape" as mandatory input.
2016-11-21 10:19:15 -08:00
Judah Jacobson
a277c7ddb3 Refactor OpGen. (#36)
Also fixes op lists when the same attribute specifies the length of
both an input and an output.  I added a test of "shapeN" which
previously failed with the following error:

    ERROR: Ran out of counts in toResult. Likely misuse of buildListOp.
2016-11-20 10:00:22 -08:00
Greg Steuck
8db944578a Support ResourceHandle. (#18)
Exposed by moving to newer TF.
2016-11-08 16:48:41 -08:00
Greg Steuck
67690d1499 Initial commit 2016-10-24 19:26:42 +00:00