license import { KernelConfig , tensor1d , Tile , TileAttrs , TileInputs } from '@tensorflow/tfjs' ; import { createTensorsTypeOpAttr , NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const tileConfig = { kernelName : Tile , backendName : 'tensorflow' , kernelFunc : ( args ) => { const { x } = args . inputs as TileInputs ; const backend = args . backend as NodeJSKernelBackend ; const { reps } = args . attrs as { } as TileAttrs ; const opAttrs = [ createTensorsTypeOpAttr ( 'T' , x . dtype ) , createTensorsTypeOpAttr ( 'Tmultiples' , 'int32' ) ] ; const multiples = tensor1d ( reps , 'int32' ) ; const res = backend . executeSingleOutput ( Tile , opAttrs , [ x , multiples ] ) ; multiples . dispose ( ) ; return res ; } } ;