license import './index' ; import * as jasmine_util from '@tensorflow/tfjs-core/dist/jasmine_util' ; Error . stackTraceLimit = Infinity ; const jasmineCtor = require ( 'jasmine' ) ; import { nodeBackend } from './ops/op_utils' ; process . on ( 'unhandledRejection' , e => { throw e ; } ) ; jasmine_util . setTestEnvs ( [ { name : 'test-tensorflow' , backendName : 'tensorflow' , flags : { } } ] ) ; const IGNORE_LIST = [ 'version version' , 'unreliable is true due to both auto gc and string tensors' , 'unreliable is true due to auto gc' , 'depthwiseConv2D' , 'separableConv2d' , 'complex64 memory' , 'depthToSpace test-tensorflow {} throws when blocksize < 2' , 'depthToSpace test-tensorflow {} throws when CPU backend used with data format NCHW' , 'scatterND test-tensorflow {} should work for 2d' , 'scatterND test-tensorflow {} should work for simple 1d' , 'scatterND test-tensorflow {} should work for multiple 1d' , 'scatterND test-tensorflow {} should sum the duplicated indices' , 'scatterND test-tensorflow {} should work for tensorLike input' , 'maxPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor' , 'avgPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor' , 'Reduction: argmax test-tensorflow {} 6D, axis=0' ] ; if ( process . platform === 'win32' ) { IGNORE_LIST . push ( 'tensorboard' ) ; IGNORE_LIST . push ( 'tensorBoard' ) ; IGNORE_LIST . push ( 'clip test-tensorflow {} propagates NaNs' ) ; IGNORE_LIST . push ( 'maxPool test-tensorflow {} [x=[3,3,1] f=[2,2] s=1 ignores NaNs' ) ; } const runner = new jasmineCtor ( ) ; runner . loadConfig ( { spec_files : [ 'src/**/*_test.ts' , 'node_modules/@tensorflow/tfjs-core/dist/**/*_test.js' ] , random : false } ) ; if ( process . env . JASMINE_SEED ) { runner . seed ( process . env . JASMINE_SEED ) ; } const env = jasmine . getEnv ( ) ; env . specFilter = spec => { for ( let i = 0 ; i < IGNORE_LIST . length ; ++ i ) { if ( spec . getFullName ( ) . indexOf ( IGNORE_LIST [ i ] ) > - 1 ) { return false ; } } return true ; } ; console . log ( `Running tests against TensorFlow: ${ nodeBackend ( ) . binding . TF_Version }` ) ; runner . execute ( ) ;