I am porting an MxNet paper implementation to PyTorch
mx.init.Xavier(rnd_type="uniform", factor_type="avg", magnitude=0.0003)

and
torch.nn.init.xavier_uniform_(array, gain=0.0003) 

Should be pretty much the same, right?
But the docs and source code show another “definition” of magnitude and gain
Even when scaling gain and magnitude correctly, I am still getting different ranges of numbers.
Both starting from an empty array and initializing it.
The image can show the docs of both PyTorch and MxNet 1.
Am I missing something?
How can I make sure that both PyTorch and MxNet functions are initializing a specific input array in the same way?

Screenshot 2020-02-28 at 16.02.193584×1072 600 KB