license import { Bincount , BincountAttrs , BincountInputs , KernelConfig , scalar } from '@tensorflow/tfjs' ; import { createTensorsTypeOpAttr , NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const bincountConfig = { kernelName : Bincount , backendName : 'tensorflow' , kernelFunc : ( { inputs , backend , attrs } ) => { const { x , weights } = inputs as BincountInputs ; const { size } = attrs as { } as BincountAttrs ; const nodeBackend = backend as NodeJSKernelBackend ; const $size = scalar ( size , 'int32' ) ; const opAttrs = [ createTensorsTypeOpAttr ( 'T' , weights . dtype ) ] ; const result = nodeBackend . executeSingleOutput ( Bincount , opAttrs , [ x , $size , weights ] ) ; $size . dispose ( ) ; return result ; } } ;