Closed mikesperber closed 3 years ago
Adding real support for attributes with type func
is non-trivial, so I recommend add the new 2.4 ops to the list at https://github.com/tensorflow/haskell/blob/master/tensorflow-core-ops/Setup.hs#L87. That will avoid generating bindings for them. Could you give that try and see how far it gets you? I can maybe make an attempt this weekend if there is a more significant blocker.
Adding real support for attributes with type
func
is non-trivial, so I recommend add the new 2.4 ops to the list at https://github.com/tensorflow/haskell/blob/master/tensorflow-core-ops/Setup.hs#L87. That will avoid generating bindings for them. Could you give that try and see how far it gets you? I can maybe make an attempt this weekend if there is a more significant blocker.
Done - that went through. (The addition of AttrFunc
was still needed.) Many thanks for the review!
The changes look good to me. We should update the CI to use the new tensorflow version, but that can be done later.
The CI tests failed. I think it is a transient issue in the docker setup (failed to download tensorflow lib because of an SSL error). I'm running it again.
There is another PR that only touches markdown files and it fails the same way, so I think our CI setup is simply broken.
I ran it manually and got the following error
tensorflow-opgen > /tfhs/tensorflow-opgen/src/TensorFlow/OpGen.hs:316:26: error: [-Wincomplete-patterns, -Werror=incomplete-patterns]
tensorflow-opgen > Pattern match(es) are non-exhaustive
tensorflow-opgen > In a case alternative: Patterns not matched: AttrFunc
tensorflow-opgen > |
tensorflow-opgen > 316 | renderAttrBaseType = \case
tensorflow-opgen > | ^^^^^...
The following change was enough to fix it for me. However, I'm testing with tf 2.3.
diff --git a/tensorflow-opgen/src/TensorFlow/OpGen.hs b/tensorflow-opgen/src/TensorFlow/OpGen.hs
index 421b147..0d8a746 100644
--- a/tensorflow-opgen/src/TensorFlow/OpGen.hs
+++ b/tensorflow-opgen/src/TensorFlow/OpGen.hs
@@ -321,6 +321,7 @@ typeSig pre pOp = constraints
AttrType -> "DataType"
AttrShape -> "Shape"
AttrTensor -> "TensorProto"
+ AttrFunc -> error "AttrFunc not supported"
tensorArgAndComment t = tensorArg t <+> hang 0 ("-- ^" <+> argComment t)
outputs = case parsedOutputs pOp of
Can you update the PR and retry? Use stack build --pedantic --test
so that you get the same results as our CI.
The following change was enough to fix it for me. However, I'm testing with tf 2.3.
diff --git a/tensorflow-opgen/src/TensorFlow/OpGen.hs b/tensorflow-opgen/src/TensorFlow/OpGen.hs index 421b147..0d8a746 100644 --- a/tensorflow-opgen/src/TensorFlow/OpGen.hs +++ b/tensorflow-opgen/src/TensorFlow/OpGen.hs @@ -321,6 +321,7 @@ typeSig pre pOp = constraints AttrType -> "DataType" AttrShape -> "Shape" AttrTensor -> "TensorProto" + AttrFunc -> error "AttrFunc not supported" tensorArgAndComment t = tensorArg t <+> hang 0 ("-- ^" <+> argComment t) outputs = case parsedOutputs pOp of
Ah, thanks! Did that, and went through.
Thanks!
I needed this to build with Tensorflow 2.4.
However,
tensorflow-ops
tests fail:This is beyond my ability - help would be appreciated!