【发布时间】:2021-04-03 02:46:46
【问题描述】:
在 R 中,我一直在尝试使用 Tensorflow 数学函数。我的问题是我不知道如何像使用 Python 一样将参数输入到 tensorflow 函数中。
比如tensorflowdot函数怎么做?
x = tf$constant(c(1, 2, 3))
y = tf$constant(c(9, 8, 7))
tf$tensordot(x, y, axes = 1)
Error in py_call_impl(callable, dots$args, dots$keywords) :
TypeError: Cannot convert 1.0 to EagerTensor of dtype int32
我可以手动重现tensordot的输出,但我想使用内置
tf$reduce_sum(x * y)
【问题讨论】:
标签: r tensorflow