1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
19 |
|
20 | require("./index");
|
21 |
|
22 | require("@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops");
|
23 |
|
24 | require("@tensorflow/tfjs-core/dist/register_all_gradients");
|
25 | var tf = require("@tensorflow/tfjs");
|
26 |
|
27 | var jasmine_util = require("@tensorflow/tfjs-core/dist/jasmine_util");
|
28 | var yargs_1 = require("yargs");
|
29 | Error.stackTraceLimit = Infinity;
|
30 |
|
31 | var jasmineCtor = require('jasmine');
|
32 |
|
33 | process.on('unhandledRejection', function (e) {
|
34 | throw e;
|
35 | });
|
36 | jasmine_util.setTestEnvs([{
|
37 | name: 'test-tensorflow',
|
38 | backendName: 'tensorflow',
|
39 | flags: {},
|
40 | isDataSync: true
|
41 | }]);
|
42 | var IGNORE_LIST = [
|
43 |
|
44 | 'version version',
|
45 | 'unreliable is true due to both auto gc and string tensors',
|
46 | 'unreliable is true due to auto gc',
|
47 |
|
48 | 'depthwiseConv2D',
|
49 | 'separableConv2d',
|
50 | 'complex64 memory',
|
51 |
|
52 | 'depthToSpace test-tensorflow {} throws when blocksize < 2',
|
53 |
|
54 | 'depthToSpace test-tensorflow {} throws when CPU backend used with data format NCHW',
|
55 |
|
56 | 'scatterND test-tensorflow {} should work for 2d',
|
57 | 'scatterND test-tensorflow {} should work for simple 1d',
|
58 | 'scatterND test-tensorflow {} should work for multiple 1d',
|
59 | 'scatterND test-tensorflow {} should sum the duplicated indices',
|
60 | 'scatterND test-tensorflow {} should work for tensorLike input',
|
61 |
|
62 |
|
63 | 'maxPool test-tensorflow {} x=[2,2,3] f=[2,2] s=3 p=1 default dimRoundingMode',
|
64 | 'maxPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor',
|
65 | 'maxPool test-tensorflow {} x=[2,2,3] f=[2,2] s=3 p=1 dimRoundingMode=floor',
|
66 | 'maxPool test-tensorflow {} x=[2,2,3] f=[2,2] s=3 p=1 dimRoundingMode=round',
|
67 | 'maxPool test-tensorflow {} x=[2,2,3] f=[2,2] s=3 p=1 dimRoundingMode=ceil',
|
68 |
|
69 | 'avgPool test-tensorflow {} x=[3,3,1] f=[3,3] s=1 p=explicit',
|
70 |
|
71 | 'avgPool test-tensorflow {} x=[2,2,3] f=[2,2] s=3 p=1 default dimRoundingMode',
|
72 | 'avgPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor',
|
73 | 'avgPool test-tensorflow {} x=[2,2,3] f=[2,2] s=3 p=1 dimRoundingMode=floor',
|
74 | 'avgPool test-tensorflow {} x=[2,2,3] f=[2,2] s=3 p=1 dimRoundingMode=round',
|
75 | 'avgPool test-tensorflow {} x=[2,2,3] f=[2,2] s=3 p=1 dimRoundingMode=ceil',
|
76 |
|
77 | 'avgPool test-tensorflow {} gradient x=[3,3,1] f=[3,3] s=1 p=explicit',
|
78 |
|
79 | 'avgPool3d test-tensorflow {} x=[1,2,2,2,1] f=[2,2,2] s=1 p=1 roundingMode=floor',
|
80 |
|
81 | 'maxPool test-tensorflow {} x=[3,3,1] f=[3,3] s=1 p=explicit',
|
82 | 'maxPoolBackprop test-tensorflow {} gradient x=[3,3,1] f=3 s=1 p=explicit',
|
83 |
|
84 | 'maxPool3d test-tensorflow {} x=[1,2,2,2,1] f=[2,2,2] s=1 p=1 roundingMode=floor',
|
85 |
|
86 | 'argmax test-tensorflow {} 6D, axis=0',
|
87 | 'diag test-tensorflow {} complex',
|
88 | 'diag test-tensorflow {} bool',
|
89 |
|
90 | 'conv2d test-tensorflow {} x=[2,1,2,2] f=[1,1,1,1] s=1 d=1 p=0 NCHW',
|
91 | 'conv2d test-tensorflow {} x=[1,2,2] f=[2,2,1,1] s=1 d=1 p=explicit NCHW',
|
92 | 'conv2d test-tensorflow {} x=[1,2,2] f=[2,2,1,1] s=1 d=1 p=same NCHW',
|
93 | 'conv2d test-tensorflow {} x=[2,2,2] f=[2,2,2,1] s=1 d=1 p=same NCHW',
|
94 | 'conv2d test-tensorflow {} x=[2,1,2,2] f=[2,2,1,1] s=1 d=1 p=same NCHW',
|
95 | 'conv2d test-tensorflow {} gradient x=[1,1,3,3] f=[2,2,1,1] s=1 p=0 NCHW',
|
96 | 'conv2d test-tensorflow {} gradient x=[2,1,3,3] f=[2,2,1,1] s=1 p=0 NCHW',
|
97 |
|
98 | 'conv2dTranspose test-tensorflow {} input=3x3x1,d2=1,f=2,s=2,p=explicit',
|
99 |
|
100 | 'conv2dTranspose test-tensorflow {} input=8x8x8,output=4x4x8,f=8,s=1,inDepth=8,p=same vec4',
|
101 |
|
102 | 'conv2dTranspose test-tensorflow {} gradient input=[1,3,3,1] f=[2,2,2,1] s=[1,1] p=explicit',
|
103 | 'fused conv2d test-tensorflow {} basic in NCHW',
|
104 | 'fused conv2d test-tensorflow {} im2row in NCHW',
|
105 | 'fused conv2d test-tensorflow {} batch in NCHW',
|
106 | 'maxPoolWithArgmax',
|
107 | 'rotate',
|
108 |
|
109 | 'unique test-tensorflow {} 1d tensor with NaN and Infinity',
|
110 |
|
111 | 'pool test-tensorflow {} max x=[3,3,1] f=[3,3] s=1 d=1 p=explicit',
|
112 |
|
113 | 'pool test-tensorflow {} max x=[3,3,1] f=[3,3] s=3 d=1 p=explicit defualt dimRoundingMode',
|
114 |
|
115 | 'pool test-tensorflow {} max x=[3,3,1] f=[3,3] s=3 d=1 p=explicit dimRoundingMode=floor',
|
116 |
|
117 | 'pool test-tensorflow {} max x=[3,3,1] f=[3,3] s=3 d=1 p=explicit dimRoundingMode=round',
|
118 |
|
119 | 'pool test-tensorflow {} max x=[3,3,1] f=[3,3] s=3 d=1 p=explicit dimRoundingMode=ceil',
|
120 |
|
121 | 'pool test-tensorflow {} avg x=[3,3,1] f=[3,3] s=3 d=1 p=explicit defualt dimRoundingMode',
|
122 |
|
123 | 'pool test-tensorflow {} avg x=[3,3,1] f=[3,3] s=3 d=1 p=explicit dimRoundingMode=floor',
|
124 |
|
125 | 'pool test-tensorflow {} avg x=[3,3,1] f=[3,3] s=3 d=1 p=explicit dimRoundingMode=round',
|
126 |
|
127 | 'pool test-tensorflow {} avg x=[3,3,1] f=[3,3] s=3 d=1 p=explicit dimRoundingMode=ceil',
|
128 |
|
129 | 'pool test-tensorflow {} max x=[2,2,3] f=[1,1] s=2 p=1 fractional outputs default rounding',
|
130 |
|
131 | 'pool test-tensorflow {} avg x=[3,3,1] f=[3,3] s=1 d=1 p=explicit',
|
132 |
|
133 | 'pool test-tensorflow {} avg x=[2,2,3] f=[1,1] s=2 p=1 fractional outputs default rounding',
|
134 |
|
135 | 'denseBincount',
|
136 |
|
137 | 'image.transform',
|
138 | 'sign test-tensorflow {} basic',
|
139 | 'sign test-tensorflow {} does not propagate NaNs',
|
140 | 'sign test-tensorflow {} accepts a tensor-like object',
|
141 |
|
142 |
|
143 | 'einsum',
|
144 | 'raggedTensorToTensor',
|
145 | 'searchSorted',
|
146 | 'sparseFillEmptyRows',
|
147 | 'sparseReshape',
|
148 | 'sparseSegmentMean',
|
149 | 'sparseSegmentSum',
|
150 | 'stringNGrams',
|
151 | 'stringSplit',
|
152 | 'stringToHashBucketFast',
|
153 | 'greaterEqual test-tensorflow {} should support string comparison',
|
154 | 'greater test-tensorflow {} should support string comparison',
|
155 | 'lessEqual test-tensorflow {} should support string comparison',
|
156 | 'less test-tensorflow {} should support string comparison',
|
157 |
|
158 | 'leakyrelu test-tensorflow {} int32',
|
159 | 'step kernel test-tensorflow {} with int32 tensor',
|
160 |
|
161 | 'upperBound',
|
162 | 'lowerBound',
|
163 | ];
|
164 | if (process.platform === 'win32') {
|
165 |
|
166 |
|
167 |
|
168 | IGNORE_LIST.push('tensorboard');
|
169 | IGNORE_LIST.push('tensorBoard');
|
170 |
|
171 |
|
172 | IGNORE_LIST.push('clip test-tensorflow {} propagates NaNs');
|
173 | IGNORE_LIST.push('maxPool test-tensorflow {} [x=[3,3,1] f=[2,2] s=1 ignores NaNs');
|
174 | }
|
175 | var runner = new jasmineCtor();
|
176 | runner.loadConfig({ spec_files: ['src/**/*_test.ts'], random: false });
|
177 |
|
178 |
|
179 | require("@tensorflow/tfjs-core/dist/tests");
|
180 | if (process.env.JASMINE_SEED) {
|
181 | runner.seed(process.env.JASMINE_SEED);
|
182 | }
|
183 | var env = jasmine.getEnv();
|
184 | var grepRegex = new RegExp(yargs_1.argv.grep);
|
185 |
|
186 | env.specFilter = function (spec) {
|
187 |
|
188 | if (!grepRegex.test(spec.getFullName())) {
|
189 | return false;
|
190 | }
|
191 |
|
192 | for (var i = 0; i < IGNORE_LIST.length; ++i) {
|
193 | if (spec.getFullName().indexOf(IGNORE_LIST[i]) > -1) {
|
194 | return false;
|
195 | }
|
196 | }
|
197 |
|
198 | return true;
|
199 | };
|
200 |
|
201 | console.log("Running tests against TensorFlow: " + tf.backend().binding.TF_Version);
|
202 | runner.execute();
|