license import { Bincount , BincountAttrs , BincountInputs , KernelConfig , KernelFunc , TensorInfo , TypedArray } from '@tensorflow/tfjs-core' ; import { MathBackendWebGL } from '../backend_webgl' ; import { bincountImplCPU } from '../kernel_utils/shared' ; export function bincount ( args ) { const { inputs , backend , attrs } = args ; const { x , weights } = inputs ; const { size } = attrs ; const xVals = backend . readSync ( x . dataId ) as TypedArray ; const weightsVals = backend . readSync ( weights . dataId ) as TypedArray ; const outVals = bincountImplCPU ( xVals , weightsVals , weights . dtype , weights . shape , size ) ; return backend . makeTensorInfo ( [ size ] , weights . dtype , outVals ) ; } export const bincountConfig = { kernelName : Bincount , backendName : 'webgl' , kernelFunc : bincount as { } as KernelFunc } ;