'Returns a copy of the array after casting to a specified type.
Parameters
dtype : numpy.dtype or str
The type of the returned array.
Examples
>>> x = mx.nd.zeros((2,3), dtype=\'float32\')
>>> y = x.astype(\'int32\')
>>> y.dtype
<type \'numpy.int32\'>'

def astype(self, dtype):

    res = empty(self.shape, ctx=self.context, dtype=dtype)
    self.copyto(res)
    return res
