mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

How to use the function mx.nd.slice.axis()?

Open p2004r opened this issue 9 years ago • 1 comments

Description speaks about 4 arguments.

> mx.nd.slice.axis                
internal C++ function <0x36441b0>
    docstring : Slice the input along certain axis and return a sliced array.

@param src  NDArray
    Source input to the function
@param axis  int, required
    The axis to be sliced
@param begin  int, required
    The beginning index to be sliced
@param end  int, required
    The end index to be sliced
@return out The result mx.ndarray

@export

    signature : void mx.nd.slice.axis()

But inside only two.

> mx.nd.slice.axis@   
[email protected]      mx.nd.slice.axis@pointer    mx.nd.slice.axis@docstring  mx.nd.slice.axis@signature

> [email protected]
function (X1 = NULL, out = NULL) 
{
    .External(list(name = "InternalFunction_invoke", address = <pointer: 0x182b4a0>, 
        dll = list(name = "Rcpp", path = "/usr/local/lib/R/site-library/Rcpp/libs/Rcpp.so", 
            dynamicLookup = TRUE, handle = <pointer: 0x2412840>, 
            info = <pointer: 0x7f177895cd80>), numParameters = -1L), 
        <pointer: 0x36441b0>, X1, out)
}
<environment: 0x33232c8>

And in fact, the function waits for two arguments.

> str(Z$value()$data)
Class 'MXNDArray' <externalptr> 
> mx.nd.slice.axis(Z$value()$data, 1L)
Error in mx.nd.slice.axis(Z$value()$data, 1L) : 
  expecting an external pointer
> mx.nd.slice.axis(Z$value()$data, 0L)
Error in mx.nd.slice.axis(Z$value()$data, 0L) : 
  expecting an external pointer
> mx.nd.slice.axis(Z$value()$data, 0L, 0L, 0L)
Error in mx.nd.slice.axis(Z$value()$data, 0L, 0L, 0L) : 
  unused arguments (0, 0)
> mx.nd.slice.axis(Z$value()$data, 0L, 0L)
Error in mx.nd.slice.axis(Z$value()$data, 0L, 0L) : unused argument (0)

What does parameters "X0" & "out" of the function? How to use these parameters?

p2004r avatar Dec 28 '16 17:12 p2004r

This issue is closed due to lack of activity in the last 90 days. Feel free to reopen if this is still an active issue. Thanks!

yajiedesign avatar Sep 28 '17 07:09 yajiedesign