'Returns a scalar whose value is copied from this array.
This function is equivalent to ``self.asnumpy()[0]``. This NDArray must have shape (1,).
Examples
>>> x = mx.nd.ones((1,), dtype=\'int32\')
>>> x.asscalar()
1
>>> type(x.asscalar())
<type \'numpy.int32\'>'

def asscalar(self):

    if (self.shape != (1,)):
        raise ValueError('The    current    array    is    not    a    scalar')
    return self.asnumpy()[0]
