license import { Tensor } from '@tensorflow/tfjs-core' ; import * as tfOps from '@tensorflow/tfjs-core/dist/ops/ops_for_converter' ; import { NamedTensorsMap } from '../../data/types' ; import { ExecutionContext } from '../../executor/execution_context' ; import { InternalOpExecutor , Node } from '../types' ; import { getParamValue } from './utils' ; export const executeOp = ( node , tensorMap , context ) : Tensor [ ] => { switch ( node . op ) { case 'FFT' : { return [ tfOps . fft ( getParamValue ( 'x' , node , tensorMap , context ) as Tensor ) ] ; } case 'IFFT' : { return [ tfOps . ifft ( getParamValue ( 'x' , node , tensorMap , context ) as Tensor ) ] ; } case 'RFFT' : { return [ tfOps . rfft ( getParamValue ( 'x' , node , tensorMap , context ) as Tensor ) ] ; } case 'IRFFT' : { return [ tfOps . irfft ( getParamValue ( 'x' , node , tensorMap , context ) as Tensor ) ] ; } default : throw TypeError ( `Node type ${ node . op } is not implemented` ) ; } } ; export const CATEGORY = 'spectral' ;