1

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?

David C.
  • 1,974
  • 2
  • 19
  • 29
Zelazny7
  • 39,946
  • 18
  • 70
  • 84

1 Answers1

0

This was an issue in MXNet, which is now resolved in https://github.com/dmlc/mxnet/pull/6758.

Sina Afrooze
  • 960
  • 6
  • 11