input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'float64', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float64'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'float64'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'float32', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'float32'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'float32'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'complex128', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'complex128'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'complex128'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'complex64', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'complex64'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'complex64'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'int32', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'int32'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'int32'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'int16', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'int16'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'int16'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'int8', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'int8'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'int8'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'uint32', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'uint32'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint32'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'uint16', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'uint16'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint16'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'uint8', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'uint8'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint8'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'uint8c', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'uint8c'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'uint8c'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.
input array
zero-filled array
var zeros = require( `@stdlib/ndarray/base/zeros` );
var x = zeros( 'generic', [ 2, 2 ], 'row-major' );
// returns <ndarray>
var sh = x.shape;
// returns [ 2, 2 ]
var dt = x.dtype;
// returns 'generic'
var y = zerosLike( x );
// returns <ndarray>
sh = y.shape;
// returns [ 2, 2 ]
dt = y.dtype;
// returns 'generic'
Creates a zero-filled array having the same shape and data type as a provided input ndarray.