license import { DataType , TensorInfo , util } from '@tensorflow/tfjs-core' ; import { MathBackendCPU } from '../backend_cpu' ; import { complex } from '../kernels/Complex' ; param backend param shape param dtype export function zeros ( backend , shape , dtype = 'float32' ) { if ( dtype === 'complex64' ) { const real = zeros ( backend , shape , 'float32' ) ; const imag = zeros ( backend , shape , 'float32' ) ; return complex ( { inputs : { real , imag } , backend } ) ; } const values = util . makeZerosTypedArray ( util . sizeFromShape ( shape ) , dtype ) ; return backend . makeTensorInfo ( shape , dtype , values ) ; }