license import { Bincount , BincountAttrs , BincountInputs , KernelConfig , KernelFunc , TensorInfo , TypedArray } from '@tensorflow/tfjs-core' ; import { MathBackendCPU } from '../backend_cpu' ; import { bincountImpl } from './Bincount_impl' ; export function bincount ( args ) { const { inputs , backend , attrs } = args ; const { x , weights } = inputs ; const { size } = attrs ; const xVals = backend . data . get ( x . dataId ) . values as TypedArray ; const weightsVals = backend . data . get ( weights . dataId ) . values as TypedArray ; const outVals = bincountImpl ( xVals , weightsVals , weights . dtype , weights . shape , size ) ; return backend . makeTensorInfo ( [ size ] , weights . dtype , outVals ) ; } export const bincountConfig = { kernelName : Bincount , backendName : 'cpu' , kernelFunc : bincount as { } as KernelFunc } ;