license import { NumericDataType , util } from '@tensorflow/tfjs-core' ; import { SimpleUnaryImpl , SimpleUnaryOperation } from './unary_types' ; /**
 * Template that creates implementation for unary op.
 */ export function createSimpleUnaryImpl ( op ) { return ( values , dtype , attrs ) => { const newValues = util . getTypedArrayFromDType ( dtype as NumericDataType , values . length ) ; for ( let i = 0 ; i < values . length ; ++ i ) { newValues [ i ] = op ( values [ i ] , attrs ) ; } return newValues ; } ; }