I am trying to port some mxnet
code from python. I am running into an issue with simple binary operations on symbols. I have a self-contained reproducible example below:
library(mxnet)
data <- mx.symbol.Variable('data')
x <- mx.symbol.FullyConnected(data = data, num.hidden = 10)
> x - 1 # this works
C++ object <0x10229c700> of class 'MXSymbol' <0x10b248c10>
> 1 - x # this doesn't
Error in 1 - x : non-numeric argument to binary operator
How can I subtract a symbol from a number using mxnet in R?