Hi, I just started using this framework for building something that is only marginally related to deep learning. As such, pardon me if this is simply due to my unfamiliarity or if this is an issue that doesn't arise often for deep learning applications.
Basically, I'm trying to do simple operations with symbols involving constant tensors but I cannot find an obvious way to do it. There's sym.ones and sym.zeros which create constant symbols of ones and zeros but there doesn't seem to be an easy way to create an arbitrary constant tensor symbol that I can use in operations such as sym.dot...
Yes, it would be nice to have a constant symbol similar to nd.array
weight = mx.symbol.Variable(name="weight", lr_mult=0)
weight = mx.nd.ones((3))
initializer = mx.init.Mixed(['weight', '.*'], [mx.init.Constant(weight), xavier])
As a workaround, you can implement a constant CustomOp. It requires that you serialize the data through the CustomOpProp implementation somehow. One example of this can be seen here:
https://github.com/tqchen/mxnet-gan/blob/master/mxgan/custom_ops.py
Most helpful comment
Yes, it would be nice to have a constant symbol similar to
nd.array