Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ag_if should auto-cast R atomics to the correct dtype. #13

Open
t-kalinowski opened this issue Mar 10, 2022 · 0 comments
Open

ag_if should auto-cast R atomics to the correct dtype. #13

t-kalinowski opened this issue Mar 10, 2022 · 0 comments

Comments

@t-kalinowski
Copy link
Owner

library(tensorflow)
f <- function(x) if(x > 0) x else 0
ff <- tf_function(f)
#> Loaded Tensorflow version 2.8.0
ff(as_tensor(array(1)))
#> Error in py_call_impl(callable, dots$args, dots$keywords): RuntimeError: Evaluation error: TypeError: true_fn and false_fn arguments to tf.cond must have the same number, type, and overall structure of return values.
#> 
#> true_fn output: {'returned': <tf.Tensor 'cond/Identity:0' shape=(1,) dtype=float64>}
#> false_fn output: {'returned': <tf.Tensor 'cond/Identity:0' shape=() dtype=float32>}
#> 
#> Error details:
#> Tensor("cond/Identity:0", shape=(1,), dtype=float64) and Tensor("cond/Identity:0", shape=(), dtype=float32) have different types
#> .

Created on 2022-03-10 by the reprex package (v2.0.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant