You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/05/23 12:10:05 UTC

[GitHub] [incubator-mxnet] fhieber opened a new issue #15052: broadcast_to is broken in latest MXNet

fhieber opened a new issue #15052: broadcast_to is broken in latest MXNet
URL: https://github.com/apache/incubator-mxnet/issues/15052
 
 
   Latest nightly builds of mxnet broke the `broadcast_to` op.
   The documentation of this operator states:
   ```
   For example::
   
      broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1.,  2.,  3.],
                                              [ 1.,  2.,  3.]])
   
   The dimension which you do not want to change can also be kept as `0` which means copy the original value.
   So with `shape=(2,0)`, we will obtain the same result as in the above example.
   ```
   
   Using `shape=(2,0)` works in mxnet==1.4.1 but not in the nightly builds:
   ```
   > mx.nd.broadcast_to(mx.nd.array([[1,2,3]]), shape=(2,0))
   MXNetError: [14:07:42] src/operator/tensor/./broadcast_reduce_op.h:393: Check failed: ishape[i] == oshape[i] || ishape[i] == 1: Array cannot be broadcasted from [1,3] to [2,0]
   Stack trace:
     [bt] (0) 1   libmxnet.so                         0x0000000111a3a629 mxnet::op::NDArrayOpProp::~NDArrayOpProp() + 4473
     [bt] (1) 2   libmxnet.so                         0x00000001120becb8 void mxnet::op::ReduceAxesOpForwardEx<mshadow::cpu, mshadow::red::sum, true>(nnvm::NodeAttrs const&, mxnet::OpContext const&, std::__1::vector<mxnet::NDArray, std::__1::allocator<mxnet::NDArray> > const&, std::__1::vector<mxnet::OpReqType, std::__1::allocator<mxnet::OpReqType> > const&, std::__1::vector<mxnet::NDArray, std::__1::allocator<mxnet::NDArray> > const&) + 20792
     [bt] (2) 3   libmxnet.so                         0x0000000112ede193 mxnet::imperative::SetShapeType(mxnet::Context const&, nnvm::NodeAttrs const&, std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> > const&, std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> > const&, mxnet::DispatchMode*) + 1603
     [bt] (3) 4   libmxnet.so                         0x0000000112edcaac mxnet::Imperative::Invoke(mxnet::Context const&, nnvm::NodeAttrs const&, std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> > const&, std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> > const&) + 716
     [bt] (4) 5   libmxnet.so                         0x0000000112e22aae SetNDInputsOutputs(nnvm::Op const*, std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> >*, std::__1::vector<mxnet::NDArray*, std::__1::allocator<mxnet::NDArray*> >*, int, void* const*, int*, int, int, void***) + 1582
     [bt] (5) 6   libmxnet.so                         0x0000000112e237f0 MXImperativeInvokeEx + 176
     [bt] (6) 7   libffi.6.dylib                      0x000000010a367884 ffi_call_unix64 + 76
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services