empty¶
-
empty(shape, dtype=<class 'numpy.float32'>, order='C', ctx=None)¶ Return a new array of given shape and type, without initializing entries.
Parameters: - shape : int or tuple of int Shape of the empty array, e.g.,
(2, 3)or2. - dtype : data-type, optional
Desired output data-type for the array, e.g, numpy.int8. Default is numpy.float32. Note that this behavior is different from NumPy’s empty function where float64 is the default value, because float32 is considered as the default data type in deep learning.
- order : {‘C’}, optional, default: ‘C’
How to store multi-dimensional data in memory, currently only row-major (C-style) is supported.
- ctx : device context, optional
Device context on which the memory is allocated. Default is mxnet.context.current_context().
Returns: - out : ndarray
Array of uninitialized (arbitrary) data of the given shape, dtype, and order.
Examples
>>> np.empty([2, 2]) array([[ 0.000000e+00, -2.524355e-29], [ nan, -8.592023e+09]]) # uninitialized
>>> np.empty([2, 2], dtype=int) array([[8751743591039004782, 3196766424264760104], [7583328881310196768, 562950123910254]], dtype=int64) # uninitialized
- shape : int or tuple of int Shape of the empty array, e.g.,