From a81c9d5da692e7f85e461cc146cf59a9c74f4ad5 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Fri, 20 Dec 2019 09:04:08 -0500 Subject: [PATCH 01/29] boilerplate --- tfjs-backend-wasm/src/cc/BUILD | 22 +++++++ tfjs-backend-wasm/src/cc/kernels/Gather.cc | 34 ++++++++++ tfjs-backend-wasm/src/cc/kernels/Gather.h | 30 +++++++++ tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 34 ++++++++++ tfjs-backend-wasm/src/cc/kernels/GatherND.h | 30 +++++++++ tfjs-backend-wasm/src/kernels/Gather.ts | 66 ++++++++++++++++++++ tfjs-backend-wasm/src/kernels/GatherND.ts | 66 ++++++++++++++++++++ tfjs-backend-wasm/src/kernels/all_kernels.ts | 2 + tfjs-backend-wasm/src/setup_test.ts | 1 + tfjs-core/src/ops/gather_nd.ts | 3 +- tfjs-core/src/ops/segment_ops.ts | 15 +++-- 11 files changed, 296 insertions(+), 7 deletions(-) create mode 100644 tfjs-backend-wasm/src/cc/kernels/Gather.cc create mode 100644 tfjs-backend-wasm/src/cc/kernels/Gather.h create mode 100644 tfjs-backend-wasm/src/cc/kernels/GatherND.cc create mode 100644 tfjs-backend-wasm/src/cc/kernels/GatherND.h create mode 100644 tfjs-backend-wasm/src/kernels/Gather.ts create mode 100644 tfjs-backend-wasm/src/kernels/GatherND.ts diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index efa73a29516..6632806058d 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -156,6 +156,8 @@ tfjs_cc_library( ":FusedBatchNorm", ":FusedConv2D", ":FusedDepthwiseConv2D", + ":Gather", + ":GatherND", ":Greater", ":GreaterEqual", ":Less", @@ -386,6 +388,26 @@ tfjs_unit_test( ], ) +tfjs_cc_library( + name = "Gather", + srcs = ["kernels/Gather.cc"], + hdrs = ["kernels/Gather.h"], + deps = [ + ":backend", + ":util", + ], +) + +tfjs_cc_library( + name = "GatherND", + srcs = ["kernels/GatherND.cc"], + hdrs = ["kernels/GatherND.h"], + deps = [ + ":backend", + ":util", + ], +) + tfjs_cc_library( name = "Greater", srcs = ["kernels/Greater.cc"], diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc new file mode 100644 index 00000000000..c497afe555f --- /dev/null +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -0,0 +1,34 @@ +/* Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ===========================================================================*/ + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "src/cc/kernels/Gather.h" + +#include "src/cc/backend.h" +#include "src/cc/util.h" + +namespace tfjs { +namespace wasm { +extern "C" { +#ifdef __EMSCRIPTEN__ +EMSCRIPTEN_KEEPALIVE +#endif + +void Gather() {} +} // extern "C" +} // namespace wasm +} // namespace tfjs diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.h b/tfjs-backend-wasm/src/cc/kernels/Gather.h new file mode 100644 index 00000000000..6995f10cf81 --- /dev/null +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.h @@ -0,0 +1,30 @@ +/* Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ===========================================================================*/ + +#ifndef KERNELS_GATHER_H_ +#define KERNELS_GATHER_H_ + +#include + +namespace tfjs { +namespace wasm { +extern "C" { + +void Gather(); +} + +} // namespace wasm +} // namespace tfjs + +#endif // KERNELS_GATHER_H_ diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc new file mode 100644 index 00000000000..a6447248d13 --- /dev/null +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -0,0 +1,34 @@ +/* Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ===========================================================================*/ + +#ifdef __EMSCRIPTEN__ +#include +#endif + +#include "src/cc/kernels/GatherND.h" + +#include "src/cc/backend.h" +#include "src/cc/util.h" + +namespace tfjs { +namespace wasm { +extern "C" { +#ifdef __EMSCRIPTEN__ +EMSCRIPTEN_KEEPALIVE +#endif + +void GatherND() {} +} // extern "C" +} // namespace wasm +} // namespace tfjs diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.h b/tfjs-backend-wasm/src/cc/kernels/GatherND.h new file mode 100644 index 00000000000..6f8dc1b416d --- /dev/null +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.h @@ -0,0 +1,30 @@ +/* Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ===========================================================================*/ + +#ifndef KERNELS_GATHERND_H_ +#define KERNELS_GATHERND_H_ + +#include + +namespace tfjs { +namespace wasm { +extern "C" { + +void GatherND(); +} + +} // namespace wasm +} // namespace tfjs + +#endif // KERNELS_GATHERND_H_ diff --git a/tfjs-backend-wasm/src/kernels/Gather.ts b/tfjs-backend-wasm/src/kernels/Gather.ts new file mode 100644 index 00000000000..b95e13bc411 --- /dev/null +++ b/tfjs-backend-wasm/src/kernels/Gather.ts @@ -0,0 +1,66 @@ +/** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {NamedAttrMap, NamedTensorInfoMap, registerKernel, TensorInfo, util} from '@tensorflow/tfjs-core'; + +import {BackendWasm} from '../backend_wasm'; + +interface GatherInputs extends NamedTensorInfoMap { + x: TensorInfo; +} + +interface GatherAttrs extends NamedAttrMap { + newWidth: number; + newHeight: number; + alignCorners: boolean; +} + +let wasmGather: (xId: number, outId: number) => void; + +function setup(backend: BackendWasm): void { + wasmGather = backend.wasm.cwrap('Gather', null /*void*/, [ + 'number', // xId + 'number' // outId + ]); +} + +function gather( + args: {backend: BackendWasm, inputs: GatherInputs, attrs: GatherAttrs}): + TensorInfo { + const {backend, inputs, attrs} = args; + const {x} = inputs; + + const out = backend.makeOutput([], x.dtype); + if (util.sizeFromShape(x.shape) === 0) { + return out; + } + + const xData = backend.dataIdMap.get(x.dataId); + + const xId = xData.id; + const outId = backend.dataIdMap.get(out.dataId).id; + wasmGather(xId, outId); + + return out; +} + +registerKernel({ + kernelName: 'Gather', + backendName: 'wasm', + setupFunc: setup, + kernelFunc: gather +}); diff --git a/tfjs-backend-wasm/src/kernels/GatherND.ts b/tfjs-backend-wasm/src/kernels/GatherND.ts new file mode 100644 index 00000000000..1f482b360fd --- /dev/null +++ b/tfjs-backend-wasm/src/kernels/GatherND.ts @@ -0,0 +1,66 @@ +/** + * @license + * Copyright 2019 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================================= + */ + +import {NamedAttrMap, NamedTensorInfoMap, registerKernel, TensorInfo, util} from '@tensorflow/tfjs-core'; + +import {BackendWasm} from '../backend_wasm'; + +interface GatherNDInputs extends NamedTensorInfoMap { + x: TensorInfo; +} + +interface GatherNDAttrs extends NamedAttrMap { + newWidth: number; + newHeight: number; + alignCorners: boolean; +} + +let wasmGatherND: (xId: number, outId: number) => void; + +function setup(backend: BackendWasm): void { + wasmGatherND = backend.wasm.cwrap('GatherND', null /*void*/, [ + 'number', // xId + 'number' // outId + ]); +} + +function gatherND( + args: {backend: BackendWasm, inputs: GatherNDInputs, attrs: GatherNDAttrs}): + TensorInfo { + const {backend, inputs, attrs} = args; + const {x} = inputs; + + const out = backend.makeOutput([], x.dtype); + if (util.sizeFromShape(x.shape) === 0) { + return out; + } + + const xData = backend.dataIdMap.get(x.dataId); + + const xId = xData.id; + const outId = backend.dataIdMap.get(out.dataId).id; + wasmGatherND(xId, outId); + + return out; +} + +registerKernel({ + kernelName: 'GatherND', + backendName: 'wasm', + setupFunc: setup, + kernelFunc: gatherND +}); diff --git a/tfjs-backend-wasm/src/kernels/all_kernels.ts b/tfjs-backend-wasm/src/kernels/all_kernels.ts index 389be69b21b..b5ff14807a6 100644 --- a/tfjs-backend-wasm/src/kernels/all_kernels.ts +++ b/tfjs-backend-wasm/src/kernels/all_kernels.ts @@ -37,6 +37,8 @@ import './FloorDiv'; import './FusedBatchNorm'; import './FusedConv2D'; import './FusedDepthwiseConv2D'; +import './Gather'; +import './GatherND'; import './Greater'; import './GreaterEqual'; import './LogicalAnd'; diff --git a/tfjs-backend-wasm/src/setup_test.ts b/tfjs-backend-wasm/src/setup_test.ts index 12f7d05bb2a..3bd8ee6a3c2 100644 --- a/tfjs-backend-wasm/src/setup_test.ts +++ b/tfjs-backend-wasm/src/setup_test.ts @@ -118,6 +118,7 @@ const TEST_FILTERS: TestFilter[] = [ 'shallow slice an input that was cast' // Slice is not implemented. ] }, + {include: 'gather '}, { include: 'sigmoid ', excludes: [ diff --git a/tfjs-core/src/ops/gather_nd.ts b/tfjs-core/src/ops/gather_nd.ts index a817963f7da..fbb704ac938 100644 --- a/tfjs-core/src/ops/gather_nd.ts +++ b/tfjs-core/src/ops/gather_nd.ts @@ -61,6 +61,7 @@ function gatherND_(x: Tensor|TensorLike, indices: Tensor|TensorLike): Tensor { const $indices = convertToTensor(indices, 'indices', 'gatherND', 'int32'); const $x = convertToTensor(x, 'x', 'gatherND'); return ENGINE.runKernelFunc( - backend => backend.gatherND($x, $indices), {$x, $indices}); + backend => backend.gatherND($x, $indices), {x: $x, indices: $indices}, + null /* backward */, 'GatherND'); } export const gatherND = op({gatherND_}); diff --git a/tfjs-core/src/ops/segment_ops.ts b/tfjs-core/src/ops/segment_ops.ts index 4747452fd42..f6f53c98b5d 100644 --- a/tfjs-core/src/ops/segment_ops.ts +++ b/tfjs-core/src/ops/segment_ops.ts @@ -126,13 +126,16 @@ function gather_( return paramsGrad as T; }; - return {$x: derX}; + return {x: derX}; }; - return (ENGINE.runKernelFunc((backend, save) => { - const res = backend.gather($x, $indices.flatten(), axis); - save([$indices]); - return res; - }, {$x}, grad)).reshape(shapeInfo.outputShape) as T; + return (ENGINE.runKernelFunc( + (backend, save) => { + const res = backend.gather($x, $indices.flatten(), axis); + save([$indices]); + return res; + }, + {x: $x}, grad, 'Gather', {axis})) + .reshape(shapeInfo.outputShape) as T; } function arrayRange(start: number, stop: number): number[] { From ea2d6b1c33c7aedb34a0a3ebdcf4bc4f919130e9 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Sat, 21 Dec 2019 12:11:10 -0500 Subject: [PATCH 02/29] pass info --- tfjs-backend-wasm/src/kernels/GatherND.ts | 44 ++++++++++++++--------- tfjs-core/src/index.ts | 6 ++-- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/tfjs-backend-wasm/src/kernels/GatherND.ts b/tfjs-backend-wasm/src/kernels/GatherND.ts index 1f482b360fd..fcdee1765ba 100644 --- a/tfjs-backend-wasm/src/kernels/GatherND.ts +++ b/tfjs-backend-wasm/src/kernels/GatherND.ts @@ -15,45 +15,57 @@ * ============================================================================= */ -import {NamedAttrMap, NamedTensorInfoMap, registerKernel, TensorInfo, util} from '@tensorflow/tfjs-core'; +import {gather_nd_util, NamedTensorInfoMap, registerKernel, Tensor, TensorInfo} from '@tensorflow/tfjs-core'; import {BackendWasm} from '../backend_wasm'; interface GatherNDInputs extends NamedTensorInfoMap { x: TensorInfo; + indices: TensorInfo; } -interface GatherNDAttrs extends NamedAttrMap { - newWidth: number; - newHeight: number; - alignCorners: boolean; -} - -let wasmGatherND: (xId: number, outId: number) => void; +let wasmGatherND: ( + xId: number, indicesId: number, numSlices: number, sliceRank: number, + sliceSize: number, strides: Uint8Array, outId: number) => void; function setup(backend: BackendWasm): void { wasmGatherND = backend.wasm.cwrap('GatherND', null /*void*/, [ 'number', // xId + 'number', // indicesId + 'number', // numSlices + 'number', // sliceRank + 'number', // sliceSize + 'array', // strides 'number' // outId ]); } -function gatherND( - args: {backend: BackendWasm, inputs: GatherNDInputs, attrs: GatherNDAttrs}): +function gatherND(args: {backend: BackendWasm, inputs: GatherNDInputs}): TensorInfo { - const {backend, inputs, attrs} = args; - const {x} = inputs; + const {backend, inputs} = args; + const {x, indices} = inputs; - const out = backend.makeOutput([], x.dtype); - if (util.sizeFromShape(x.shape) === 0) { + const [resultShape, numSlices, sliceSize, strides] = + gather_nd_util.prepareAndValidate(x as Tensor, indices as Tensor); + + const out = backend.makeOutput(resultShape, x.dtype); + if (numSlices === 0) { return out; } - const xData = backend.dataIdMap.get(x.dataId); + const indicesShape = indices.shape; + const sliceRank = indicesShape[indicesShape.length - 1]; + const xData = backend.dataIdMap.get(x.dataId); const xId = xData.id; + const indicesData = backend.dataIdMap.get(indices.dataId); + const indicesId = indicesData.id; + + const stridesBytes = new Uint8Array(new Int32Array(strides).buffer); + const outId = backend.dataIdMap.get(out.dataId).id; - wasmGatherND(xId, outId); + wasmGatherND( + xId, indicesId, numSlices, sliceRank, sliceSize, stridesBytes, outId); return out; } diff --git a/tfjs-core/src/index.ts b/tfjs-core/src/index.ts index c03e1591962..5a921550548 100644 --- a/tfjs-core/src/index.ts +++ b/tfjs-core/src/index.ts @@ -29,7 +29,6 @@ import './engine'; // Register backend-agnostic flags. import './flags'; - // backend_cpu.ts and backend_webgl.ts are standalone files and should be // explicitly included here. import './backends/webgl/backend_webgl'; @@ -38,7 +37,6 @@ import './backends/cpu/backend_cpu'; import './backends/cpu/all_kernels'; // Import all kernels from webgl. import './backends/webgl/all_kernels'; - import './platforms/platform_browser'; import './platforms/platform_node'; @@ -47,6 +45,7 @@ import * as backend_util from './backends/backend_util'; import * as io from './io/io'; import * as math from './math'; import * as browser from './ops/browser'; +import * as gather_nd_util from './ops/gather_nd_util'; import * as slice_util from './ops/slice_util'; import * as serialization from './serialization'; import {setOpHandler} from './tensor'; @@ -99,7 +98,8 @@ export { backend_util, webgl, tensor_util, - slice_util + slice_util, + gather_nd_util }; // Backend specific. From e8cfab81ecbf1da54b919c03a8212565d2321c47 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Sat, 21 Dec 2019 12:12:33 -0500 Subject: [PATCH 03/29] update interface --- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 4 +++- tfjs-backend-wasm/src/cc/kernels/GatherND.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index a6447248d13..abf6e906cb0 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -28,7 +28,9 @@ extern "C" { EMSCRIPTEN_KEEPALIVE #endif -void GatherND() {} +void GatherND(size_t x_id, size_t indices_id, size_t num_slices, + size_t slice_rank, size_t slice_size, size_t* strides_ptr, + size_t out_id) {} } // extern "C" } // namespace wasm } // namespace tfjs diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.h b/tfjs-backend-wasm/src/cc/kernels/GatherND.h index 6f8dc1b416d..de88651ae9c 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.h +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.h @@ -21,7 +21,9 @@ namespace tfjs { namespace wasm { extern "C" { -void GatherND(); +void GatherND(size_t x_id, size_t indices_id, size_t num_slices, + size_t slice_rank, size_t slice_size, size_t* strides_ptr, + size_t out_id); } } // namespace wasm From 87a04723da76479147a375b082aeff0c5c3c8d74 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Sat, 21 Dec 2019 12:15:02 -0500 Subject: [PATCH 04/29] update --- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index abf6e906cb0..8492a450e7e 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -30,7 +30,17 @@ EMSCRIPTEN_KEEPALIVE void GatherND(size_t x_id, size_t indices_id, size_t num_slices, size_t slice_rank, size_t slice_size, size_t* strides_ptr, - size_t out_id) {} + size_t out_id) { + auto& x_info = backend::get_tensor_info(x_id); + auto& indices_info = backend::get_tensor_info(indices_id); + const std::vector& strides = + std::vector(strides_ptr, strides_ptr + slice_rank); + + const float* x_buf = x_info.f32(); + const int* indices_buf = indices_info.i32(); + auto& out_info = backend::get_tensor_info_out(out_id); + float* out_buf = out_info.f32_write(); +} } // extern "C" } // namespace wasm } // namespace tfjs From 5b717535635ba9d1fbee26c5ec606c2cb119338b Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Sat, 21 Dec 2019 12:16:47 -0500 Subject: [PATCH 05/29] test setup --- tfjs-backend-wasm/package.json | 4 ++-- tfjs-backend-wasm/src/index_test.ts | 17 +++++++++++++++-- tfjs-backend-wasm/yarn.lock | 14 +++----------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/tfjs-backend-wasm/package.json b/tfjs-backend-wasm/package.json index 07c08f53ed8..4dff790a75c 100644 --- a/tfjs-backend-wasm/package.json +++ b/tfjs-backend-wasm/package.json @@ -32,7 +32,7 @@ "path": false }, "peerDependencies": { - "@tensorflow/tfjs-core": "1.5.0" + "@tensorflow/tfjs-core": "link:../tfjs-core" }, "dependencies": { "@types/emscripten": "~0.0.34" @@ -40,7 +40,7 @@ "devDependencies": { "@bazel/bazel": "^0.28.0", "@bazel/buildifier": "0.29.0", - "@tensorflow/tfjs-core": "1.5.0", + "@tensorflow/tfjs-core": "link:../tfjs-core", "@types/jasmine": "~2.8.6", "clang-format": "~1.2.4", "jasmine": "~3.1.0", diff --git a/tfjs-backend-wasm/src/index_test.ts b/tfjs-backend-wasm/src/index_test.ts index 370615f2cf3..05b7b9276fb 100644 --- a/tfjs-backend-wasm/src/index_test.ts +++ b/tfjs-backend-wasm/src/index_test.ts @@ -58,8 +58,8 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { }, 100); // Silences backend registration warnings. - spyOn(console, 'warn'); - spyOn(console, 'log'); + // spyOn(console, 'warn'); + // spyOn(console, 'log'); }); afterEach(() => { @@ -92,4 +92,17 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { expect(() => setWasmPath('too/late')) .toThrowError(/The WASM backend was already initialized. Make sure/); }); + + fit('should work for simple slice', async () => { + const indices = tf.tensor2d([0, 4, 8], [3, 1], 'int32'); + const input = + tf.tensor1d([100, 101, 102, 777, 778, 779, 1000, 1001, 1002], 'int32'); + const shape = [3]; + const result = tf.gatherND(input, indices); + expect(result.shape).toEqual(shape); + expect(result.dtype).toEqual(input.dtype); + const resultData = await result.data(); + console.log(Array.from(resultData)); + // expectArraysClose(await result.data(), [100, 778, 1002]); + }); }); diff --git a/tfjs-backend-wasm/yarn.lock b/tfjs-backend-wasm/yarn.lock index ec0c945a012..ac1064763a2 100644 --- a/tfjs-backend-wasm/yarn.lock +++ b/tfjs-backend-wasm/yarn.lock @@ -73,17 +73,9 @@ resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-0.38.3.tgz#e98231d3d360d51860d9c1a7c3345b40dab4cf81" integrity sha512-o+dNkfDm3qxWQ8h/04cWuTcjR7qnjZi3pQGv4aklVb16oPWx2jF8BzbkwvWuIkdbOl9VnqYP0vaHzwQVJRRcIA== -"@tensorflow/tfjs-core@1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-1.5.0.tgz#a011a68882068d91d82410bb71aa0220867286bc" - integrity sha512-UcTAoVNmBxJLktGWUNbSq7ZEgBvjD0SWS0QcRBMgs93AeLM3xhlyo8MqECQsvCkuReDZwVHhX2fjMrf2M3R99w== - dependencies: - "@types/offscreencanvas" "~2019.3.0" - "@types/seedrandom" "2.4.27" - "@types/webgl-ext" "0.0.30" - "@types/webgl2" "0.0.4" - node-fetch "~2.1.2" - seedrandom "2.4.3" +"@tensorflow/tfjs-core@link:../tfjs-core": + version "0.0.0" + uid "" "@types/emscripten@~0.0.34": version "0.0.34" From e5fb565d5b87fb33fd90b20c8a891e88fd0cd426 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Sat, 21 Dec 2019 12:33:31 -0500 Subject: [PATCH 06/29] pass dtype --- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 6 +++--- tfjs-backend-wasm/src/cc/kernels/GatherND.h | 6 +++--- tfjs-backend-wasm/src/kernels/GatherND.ts | 10 +++++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index 8492a450e7e..9c09bb52c3f 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -28,9 +28,9 @@ extern "C" { EMSCRIPTEN_KEEPALIVE #endif -void GatherND(size_t x_id, size_t indices_id, size_t num_slices, - size_t slice_rank, size_t slice_size, size_t* strides_ptr, - size_t out_id) { +void GatherND(size_t x_id, const DType dtype, size_t indices_id, + size_t num_slices, size_t slice_rank, size_t slice_size, + size_t* strides_ptr, size_t out_id) { auto& x_info = backend::get_tensor_info(x_id); auto& indices_info = backend::get_tensor_info(indices_id); const std::vector& strides = diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.h b/tfjs-backend-wasm/src/cc/kernels/GatherND.h index de88651ae9c..1b449d5db03 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.h +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.h @@ -21,9 +21,9 @@ namespace tfjs { namespace wasm { extern "C" { -void GatherND(size_t x_id, size_t indices_id, size_t num_slices, - size_t slice_rank, size_t slice_size, size_t* strides_ptr, - size_t out_id); +void GatherND(size_t x_id, const DType dtype, size_t indices_id, + size_t num_slices, size_t slice_rank, size_t slice_size, + size_t* strides_ptr, size_t out_id); } } // namespace wasm diff --git a/tfjs-backend-wasm/src/kernels/GatherND.ts b/tfjs-backend-wasm/src/kernels/GatherND.ts index fcdee1765ba..2e5580b6cdc 100644 --- a/tfjs-backend-wasm/src/kernels/GatherND.ts +++ b/tfjs-backend-wasm/src/kernels/GatherND.ts @@ -18,6 +18,7 @@ import {gather_nd_util, NamedTensorInfoMap, registerKernel, Tensor, TensorInfo} from '@tensorflow/tfjs-core'; import {BackendWasm} from '../backend_wasm'; +import {CppDType} from './types'; interface GatherNDInputs extends NamedTensorInfoMap { x: TensorInfo; @@ -25,12 +26,14 @@ interface GatherNDInputs extends NamedTensorInfoMap { } let wasmGatherND: ( - xId: number, indicesId: number, numSlices: number, sliceRank: number, - sliceSize: number, strides: Uint8Array, outId: number) => void; + xId: number, dtype: CppDType, indicesId: number, numSlices: number, + sliceRank: number, sliceSize: number, strides: Uint8Array, outId: number) => + void; function setup(backend: BackendWasm): void { wasmGatherND = backend.wasm.cwrap('GatherND', null /*void*/, [ 'number', // xId + 'number', // dtype 'number', // indicesId 'number', // numSlices 'number', // sliceRank @@ -65,7 +68,8 @@ function gatherND(args: {backend: BackendWasm, inputs: GatherNDInputs}): const outId = backend.dataIdMap.get(out.dataId).id; wasmGatherND( - xId, indicesId, numSlices, sliceRank, sliceSize, stridesBytes, outId); + xId, CppDType[x.dtype], indicesId, numSlices, sliceRank, sliceSize, + stridesBytes, outId); return out; } From db905fcb8361e6dc6a4dadf7400e2e15134b4ccb Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Sun, 22 Dec 2019 11:34:43 -0500 Subject: [PATCH 07/29] compiles --- tfjs-backend-wasm/src/cc/kernels/GatherND.h | 2 +- tfjs-backend-wasm/src/kernels/Gather.ts | 25 +++++++++------------ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.h b/tfjs-backend-wasm/src/cc/kernels/GatherND.h index 1b449d5db03..ff7ee14b010 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.h +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.h @@ -15,7 +15,7 @@ #ifndef KERNELS_GATHERND_H_ #define KERNELS_GATHERND_H_ -#include +#include "src/cc/backend.h" namespace tfjs { namespace wasm { diff --git a/tfjs-backend-wasm/src/kernels/Gather.ts b/tfjs-backend-wasm/src/kernels/Gather.ts index b95e13bc411..09127c16762 100644 --- a/tfjs-backend-wasm/src/kernels/Gather.ts +++ b/tfjs-backend-wasm/src/kernels/Gather.ts @@ -15,7 +15,7 @@ * ============================================================================= */ -import {NamedAttrMap, NamedTensorInfoMap, registerKernel, TensorInfo, util} from '@tensorflow/tfjs-core'; +import {NamedTensorInfoMap, registerKernel, TensorInfo, util} from '@tensorflow/tfjs-core'; import {BackendWasm} from '../backend_wasm'; @@ -23,26 +23,20 @@ interface GatherInputs extends NamedTensorInfoMap { x: TensorInfo; } -interface GatherAttrs extends NamedAttrMap { - newWidth: number; - newHeight: number; - alignCorners: boolean; -} - -let wasmGather: (xId: number, outId: number) => void; +let wasmGather: (xId: number, indicesId: number, outId: number) => void; function setup(backend: BackendWasm): void { wasmGather = backend.wasm.cwrap('Gather', null /*void*/, [ 'number', // xId + 'number', // indicesId 'number' // outId ]); } -function gather( - args: {backend: BackendWasm, inputs: GatherInputs, attrs: GatherAttrs}): +function gather(args: {backend: BackendWasm, inputs: GatherInputs}): TensorInfo { - const {backend, inputs, attrs} = args; - const {x} = inputs; + const {backend, inputs} = args; + const {x, indices} = inputs; const out = backend.makeOutput([], x.dtype); if (util.sizeFromShape(x.shape) === 0) { @@ -50,10 +44,13 @@ function gather( } const xData = backend.dataIdMap.get(x.dataId); - const xId = xData.id; + + const indicesData = backend.dataIdMap.get(indices.dataId); + const indicesId = indicesData.id; + const outId = backend.dataIdMap.get(out.dataId).id; - wasmGather(xId, outId); + wasmGather(xId, indicesId, outId); return out; } From 14950b65222fc004dc0d1d1fb4a334ea1c8b8bd6 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Sun, 22 Dec 2019 11:52:24 -0500 Subject: [PATCH 08/29] compiles --- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index 9c09bb52c3f..b6e6bda4649 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -21,6 +21,19 @@ #include "src/cc/backend.h" #include "src/cc/util.h" +namespace { + +template +void gathernd_impl(const T* x_ptr, const int* indices_ptr, T* out_buf_ptr) {} + +template void gathernd_impl(const float* x_ptr, const int* indices_ptr, + float* out_buf_ptr); +template void gathernd_impl(const int* x_ptr, const int* indices_ptr, + int* out_buf_ptr); +template void gathernd_impl(const bool* x_ptr, const int* indices_ptr, + bool* out_buf_ptr); +} // namespace + namespace tfjs { namespace wasm { extern "C" { @@ -40,6 +53,21 @@ void GatherND(size_t x_id, const DType dtype, size_t indices_id, const int* indices_buf = indices_info.i32(); auto& out_info = backend::get_tensor_info_out(out_id); float* out_buf = out_info.f32_write(); + + switch (dtype) { + case DType::float32: + gathernd_impl(x_info.f32(), indices_buf, out_info.f32_write()); + break; + case DType::int32: + gathernd_impl(x_info.i32(), indices_buf, out_info.i32_write()); + break; + case DType::boolean: + gathernd_impl(x_info.b(), indices_buf, out_info.b_write()); + break; + default: + util::warn("Scatter for tensor id %d failed. Unknown dtype %d", + indices_id, dtype); + } } } // extern "C" } // namespace wasm From 4c55a15acffa212eb4780eea1362eeb1f4814c27 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 08:47:02 -0500 Subject: [PATCH 09/29] logic --- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 44 ++++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index b6e6bda4649..c2d8d5e6106 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -24,13 +24,46 @@ namespace { template -void gathernd_impl(const T* x_ptr, const int* indices_ptr, T* out_buf_ptr) {} +void gathernd_impl(const T* x_ptr, const int* indices_ptr, size_t num_slices, + size_t slice_rank, size_t slice_size, + const std::vector& strides_ptr, T* out_buf_ptr) { + for (size_t i = 0; i < num_slices; ++i) { + size_t flattened_index = 0; + + for (size_t j = 0; j < slice_rank; ++j) { + flattened_index += *indices_ptr * strides_ptr[j]; + + indices_ptr++; + } + + x_ptr += flattened_index * slice_size; + + for (size_t k = 0; k < slice_size; ++k) { + *out_buf_ptr += *x_ptr; + + out_buf_ptr++; + x_ptr++; + } + + out_buf_ptr += slice_size; + x_ptr -= ((flattened_index + 1) * slice_size); + } +} template void gathernd_impl(const float* x_ptr, const int* indices_ptr, + size_t num_slices, size_t slice_rank, + size_t slice_size, + const std::vector& strides_ptr, float* out_buf_ptr); template void gathernd_impl(const int* x_ptr, const int* indices_ptr, + size_t num_slices, size_t slice_rank, + size_t slice_size, + const std::vector& strides_ptr, int* out_buf_ptr); template void gathernd_impl(const bool* x_ptr, const int* indices_ptr, + size_t num_slices, size_t slice_rank, + size_t slice_size, + const std::vector& strides_ptr, bool* out_buf_ptr); } // namespace @@ -56,13 +89,16 @@ void GatherND(size_t x_id, const DType dtype, size_t indices_id, switch (dtype) { case DType::float32: - gathernd_impl(x_info.f32(), indices_buf, out_info.f32_write()); + gathernd_impl(x_info.f32(), indices_buf, num_slices, slice_rank, + slice_size, strides, out_info.f32_write()); break; case DType::int32: - gathernd_impl(x_info.i32(), indices_buf, out_info.i32_write()); + gathernd_impl(x_info.i32(), indices_buf, num_slices, slice_rank, + slice_size, strides, out_info.i32_write()); break; case DType::boolean: - gathernd_impl(x_info.b(), indices_buf, out_info.b_write()); + gathernd_impl(x_info.b(), indices_buf, num_slices, slice_rank, + slice_size, strides, out_info.b_write()); break; default: util::warn("Scatter for tensor id %d failed. Unknown dtype %d", From 5dc40994e40e47a814fbcde61d35b7852fd7734c Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 09:15:33 -0500 Subject: [PATCH 10/29] fix --- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index c2d8d5e6106..3fb2af7aa46 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -29,9 +29,8 @@ void gathernd_impl(const T* x_ptr, const int* indices_ptr, size_t num_slices, const std::vector& strides_ptr, T* out_buf_ptr) { for (size_t i = 0; i < num_slices; ++i) { size_t flattened_index = 0; - for (size_t j = 0; j < slice_rank; ++j) { - flattened_index += *indices_ptr * strides_ptr[j]; + flattened_index += (*indices_ptr * strides_ptr[j]); indices_ptr++; } @@ -39,13 +38,12 @@ void gathernd_impl(const T* x_ptr, const int* indices_ptr, size_t num_slices, x_ptr += flattened_index * slice_size; for (size_t k = 0; k < slice_size; ++k) { - *out_buf_ptr += *x_ptr; + *out_buf_ptr = *x_ptr; out_buf_ptr++; x_ptr++; } - out_buf_ptr += slice_size; x_ptr -= ((flattened_index + 1) * slice_size); } } From 0f3f09466e4dc8423b49bdcbb5389b12897b4736 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 09:19:48 -0500 Subject: [PATCH 11/29] add tests --- tfjs-backend-wasm/src/index_test.ts | 2 +- tfjs-backend-wasm/src/setup_test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tfjs-backend-wasm/src/index_test.ts b/tfjs-backend-wasm/src/index_test.ts index 05b7b9276fb..75fe241c14d 100644 --- a/tfjs-backend-wasm/src/index_test.ts +++ b/tfjs-backend-wasm/src/index_test.ts @@ -93,7 +93,7 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { .toThrowError(/The WASM backend was already initialized. Make sure/); }); - fit('should work for simple slice', async () => { + it('should work for simple slice', async () => { const indices = tf.tensor2d([0, 4, 8], [3, 1], 'int32'); const input = tf.tensor1d([100, 101, 102, 777, 778, 779, 1000, 1001, 1002], 'int32'); diff --git a/tfjs-backend-wasm/src/setup_test.ts b/tfjs-backend-wasm/src/setup_test.ts index 3bd8ee6a3c2..23dab789401 100644 --- a/tfjs-backend-wasm/src/setup_test.ts +++ b/tfjs-backend-wasm/src/setup_test.ts @@ -118,7 +118,7 @@ const TEST_FILTERS: TestFilter[] = [ 'shallow slice an input that was cast' // Slice is not implemented. ] }, - {include: 'gather '}, + {include: 'gather'}, { include: 'sigmoid ', excludes: [ From f257a8c590c1de29c663ed70195a8a46d51b1d19 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 10:13:25 -0500 Subject: [PATCH 12/29] compiles --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 3 +- tfjs-backend-wasm/src/cc/kernels/Gather.h | 5 +-- tfjs-backend-wasm/src/index_test.ts | 37 ++++++++++++++++++++++ tfjs-backend-wasm/src/kernels/Gather.ts | 27 ++++++++++++---- tfjs-core/src/ops/segment_ops.ts | 4 +-- 5 files changed, 65 insertions(+), 11 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index c497afe555f..5132e63ea31 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -28,7 +28,8 @@ extern "C" { EMSCRIPTEN_KEEPALIVE #endif -void Gather() {} +void Gather(size_t x_id, const DType dtype, size_t indices_id, size_t axis, + size_t out_id) {} } // extern "C" } // namespace wasm } // namespace tfjs diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.h b/tfjs-backend-wasm/src/cc/kernels/Gather.h index 6995f10cf81..bc8e87cd22c 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.h +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.h @@ -15,13 +15,14 @@ #ifndef KERNELS_GATHER_H_ #define KERNELS_GATHER_H_ -#include +#include "src/cc/backend.h" namespace tfjs { namespace wasm { extern "C" { -void Gather(); +void Gather(size_t x_id, const DType dtype, size_t indices_id, size_t axis, + size_t out_id); } } // namespace wasm diff --git a/tfjs-backend-wasm/src/index_test.ts b/tfjs-backend-wasm/src/index_test.ts index 75fe241c14d..f9ee89f3bc9 100644 --- a/tfjs-backend-wasm/src/index_test.ts +++ b/tfjs-backend-wasm/src/index_test.ts @@ -105,4 +105,41 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { console.log(Array.from(resultData)); // expectArraysClose(await result.data(), [100, 778, 1002]); }); + + fit('1D (gather), 1D indices', async () => { + const t = tf.tensor1d([1, 2, 3]); + + const t2 = tf.gather(t, tf.tensor1d([0, 2, 0, 1], 'int32'), 0); + console.log(t2.shape); + expect(t2.shape).toEqual([4]); + const resultData = await t2.data(); + console.log(Array.from(resultData)); + // expectArraysClose(await t2.data(), [1, 3, 1, 2]); + }); + + fit('1D (gather), 2D indices', async () => { + const t = tf.tensor1d([1, 2, 3]); + + const t2 = tf.gather(t, tf.tensor2d([0, 2, 0, 1], [1, 4], 'int32'), 0); + console.log(t2.shape); + expect(t2.shape).toEqual([1, 4]); + const resultData = await t2.data(); + console.log(Array.from(resultData)); + // expectArraysClose(await t2.data(), [1, 3, 1, 2]); + }); + + fit('2D (gather), scalar indices', async () => { + const t = tf.tensor2d([1, 11, 2, 22], [2, 2]); + let t2 = tf.gather(t, tf.scalar(1, 'int32'), 0); + expect(t2.shape).toEqual([2]); + let resultData = await t2.data(); + console.log(Array.from(resultData)); + // expectArraysClose(await t2.data(), [2, 22]); + + t2 = tf.gather(t, tf.scalar(1, 'int32'), 1); + expect(t2.shape).toEqual([2]); + resultData = await t2.data(); + console.log(Array.from(resultData)); + // expectArraysClose(await t2.data(), [11, 22]); + }); }); diff --git a/tfjs-backend-wasm/src/kernels/Gather.ts b/tfjs-backend-wasm/src/kernels/Gather.ts index 09127c16762..b99de879748 100644 --- a/tfjs-backend-wasm/src/kernels/Gather.ts +++ b/tfjs-backend-wasm/src/kernels/Gather.ts @@ -15,30 +15,45 @@ * ============================================================================= */ -import {NamedTensorInfoMap, registerKernel, TensorInfo, util} from '@tensorflow/tfjs-core'; +import {NamedAttrMap, NamedTensorInfoMap, registerKernel, TensorInfo, util} from '@tensorflow/tfjs-core'; import {BackendWasm} from '../backend_wasm'; +import {CppDType} from './types'; interface GatherInputs extends NamedTensorInfoMap { x: TensorInfo; + indices: TensorInfo; } -let wasmGather: (xId: number, indicesId: number, outId: number) => void; +interface GatherAttrs extends NamedAttrMap { + axis: number; +} + +let wasmGather: ( + xId: number, dtype: CppDType, indicesId: number, axis: number, + outId: number) => void; function setup(backend: BackendWasm): void { wasmGather = backend.wasm.cwrap('Gather', null /*void*/, [ 'number', // xId + 'number', // dtype 'number', // indicesId + 'number', // axis 'number' // outId ]); } -function gather(args: {backend: BackendWasm, inputs: GatherInputs}): +function gather( + args: {backend: BackendWasm, inputs: GatherInputs, attrs: GatherAttrs}): TensorInfo { - const {backend, inputs} = args; + const {backend, inputs, attrs} = args; const {x, indices} = inputs; + const {axis} = attrs; + + const newShape = x.shape.slice(); + newShape[axis] = util.sizeFromShape(indices.shape); - const out = backend.makeOutput([], x.dtype); + const out = backend.makeOutput(newShape, x.dtype); if (util.sizeFromShape(x.shape) === 0) { return out; } @@ -50,7 +65,7 @@ function gather(args: {backend: BackendWasm, inputs: GatherInputs}): const indicesId = indicesData.id; const outId = backend.dataIdMap.get(out.dataId).id; - wasmGather(xId, indicesId, outId); + wasmGather(xId, CppDType[x.dtype], indicesId, axis, outId); return out; } diff --git a/tfjs-core/src/ops/segment_ops.ts b/tfjs-core/src/ops/segment_ops.ts index f6f53c98b5d..1a00f6a7a3f 100644 --- a/tfjs-core/src/ops/segment_ops.ts +++ b/tfjs-core/src/ops/segment_ops.ts @@ -126,7 +126,7 @@ function gather_( return paramsGrad as T; }; - return {x: derX}; + return {x: derX, indices: () => $indices}; }; return (ENGINE.runKernelFunc( (backend, save) => { @@ -134,7 +134,7 @@ function gather_( save([$indices]); return res; }, - {x: $x}, grad, 'Gather', {axis})) + {x: $x, indices: $indices}, grad, 'Gather', {axis})) .reshape(shapeInfo.outputShape) as T; } From 7b5876fb0879d9c4a79c9bb9253d261f0ef5757d Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 10:44:41 -0500 Subject: [PATCH 13/29] compiles --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 38 +++++++++++++++++++- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 2 -- tfjs-backend-wasm/src/setup_test.ts | 7 +++- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index 5132e63ea31..c7b0e6e9d30 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -21,6 +21,20 @@ #include "src/cc/backend.h" #include "src/cc/util.h" +namespace { + +template +void gather_impl(const T* x_ptr, const int* indices_ptr, const size_t axis, + T* out_buf_ptr) {} + +template void gather_impl(const float* x_ptr, const int* indices_ptr, + const size_t axis, float* out_buf); +template void gather_impl(const int* x_ptr, const int* indices_ptr, + const size_t axis, int* out_buf); +template void gather_impl(const bool* x_ptr, const int* indices_ptr, + const size_t axis, bool* out_buf); +} // namespace + namespace tfjs { namespace wasm { extern "C" { @@ -29,7 +43,29 @@ EMSCRIPTEN_KEEPALIVE #endif void Gather(size_t x_id, const DType dtype, size_t indices_id, size_t axis, - size_t out_id) {} + size_t out_id) { + auto& x_info = backend::get_tensor_info(x_id); + auto& indices_info = backend::get_tensor_info(indices_id); + + const int* indices_buf = indices_info.i32(); + auto& out_info = backend::get_tensor_info_out(out_id); + + switch (dtype) { + case DType::float32: + gather_impl(x_info.f32(), indices_buf, axis, out_info.f32_write()); + break; + case DType::int32: + gather_impl(x_info.i32(), indices_buf, axis, + out_info.i32_write()); + break; + case DType::boolean: + gather_impl(x_info.b(), indices_buf, axis, out_info.b_write()); + break; + default: + util::warn("Scatter for tensor id %d failed. Unknown dtype %d", x_id, + dtype); + } +} } // extern "C" } // namespace wasm } // namespace tfjs diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index 3fb2af7aa46..9bdf8d993b9 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -80,10 +80,8 @@ void GatherND(size_t x_id, const DType dtype, size_t indices_id, const std::vector& strides = std::vector(strides_ptr, strides_ptr + slice_rank); - const float* x_buf = x_info.f32(); const int* indices_buf = indices_info.i32(); auto& out_info = backend::get_tensor_info_out(out_id); - float* out_buf = out_info.f32_write(); switch (dtype) { case DType::float32: diff --git a/tfjs-backend-wasm/src/setup_test.ts b/tfjs-backend-wasm/src/setup_test.ts index 23dab789401..878c5fbad42 100644 --- a/tfjs-backend-wasm/src/setup_test.ts +++ b/tfjs-backend-wasm/src/setup_test.ts @@ -118,7 +118,12 @@ const TEST_FILTERS: TestFilter[] = [ 'shallow slice an input that was cast' // Slice is not implemented. ] }, - {include: 'gather'}, + { + include: 'gather', + excludes: [ + 'gradient' // Not yet implemented. + ] + }, { include: 'sigmoid ', excludes: [ From 7d35b0f73f686f71212339beb0972b9b54ad1cba Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 10:49:28 -0500 Subject: [PATCH 14/29] compiles --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 26 ++++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index c7b0e6e9d30..bac063bb64d 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -25,14 +25,23 @@ namespace { template void gather_impl(const T* x_ptr, const int* indices_ptr, const size_t axis, - T* out_buf_ptr) {} + const size_t out_size, T* out_buf_ptr) { + for (size_t i = 0; i < out_size; ++i) { + *out_buf_ptr = i; + + out_buf_ptr++; + } +} template void gather_impl(const float* x_ptr, const int* indices_ptr, - const size_t axis, float* out_buf); + const size_t axis, const size_t out_size, + float* out_buf); template void gather_impl(const int* x_ptr, const int* indices_ptr, - const size_t axis, int* out_buf); + const size_t axis, const size_t out_size, + int* out_buf); template void gather_impl(const bool* x_ptr, const int* indices_ptr, - const size_t axis, bool* out_buf); + const size_t axis, const size_t out_size, + bool* out_buf); } // namespace namespace tfjs { @@ -49,17 +58,20 @@ void Gather(size_t x_id, const DType dtype, size_t indices_id, size_t axis, const int* indices_buf = indices_info.i32(); auto& out_info = backend::get_tensor_info_out(out_id); + const size_t out_size = out_info.size; switch (dtype) { case DType::float32: - gather_impl(x_info.f32(), indices_buf, axis, out_info.f32_write()); + gather_impl(x_info.f32(), indices_buf, axis, out_size, + out_info.f32_write()); break; case DType::int32: - gather_impl(x_info.i32(), indices_buf, axis, + gather_impl(x_info.i32(), indices_buf, axis, out_size, out_info.i32_write()); break; case DType::boolean: - gather_impl(x_info.b(), indices_buf, axis, out_info.b_write()); + gather_impl(x_info.b(), indices_buf, axis, out_size, + out_info.b_write()); break; default: util::warn("Scatter for tensor id %d failed. Unknown dtype %d", x_id, From 3f2e33a270466fd80df6867c240775a0a34603fe Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 11:17:28 -0500 Subject: [PATCH 15/29] setup --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 48 ++++++++++++++-------- tfjs-backend-wasm/src/cc/kernels/Gather.h | 5 ++- tfjs-backend-wasm/src/kernels/Gather.ts | 18 ++++++-- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index bac063bb64d..c3c2a01737a 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -24,8 +24,11 @@ namespace { template -void gather_impl(const T* x_ptr, const int* indices_ptr, const size_t axis, - const size_t out_size, T* out_buf_ptr) { +void gather_impl(const T* x_ptr, const std::vector& x_shape, + const int* indices_ptr, const size_t axis, + const size_t out_size, const std::vector& out_shape, + T* out_buf_ptr) { + // need: outshape, x_shape for (size_t i = 0; i < out_size; ++i) { *out_buf_ptr = i; @@ -33,14 +36,23 @@ void gather_impl(const T* x_ptr, const int* indices_ptr, const size_t axis, } } -template void gather_impl(const float* x_ptr, const int* indices_ptr, - const size_t axis, const size_t out_size, +template void gather_impl(const float* x_ptr, + const std::vector& x_shape, + const int* indices_ptr, const size_t axis, + const size_t out_size, + const std::vector& out_shape, float* out_buf); -template void gather_impl(const int* x_ptr, const int* indices_ptr, - const size_t axis, const size_t out_size, +template void gather_impl(const int* x_ptr, + const std::vector& x_shape, + const int* indices_ptr, const size_t axis, + const size_t out_size, + const std::vector& out_shape, int* out_buf); -template void gather_impl(const bool* x_ptr, const int* indices_ptr, - const size_t axis, const size_t out_size, +template void gather_impl(const bool* x_ptr, + const std::vector& x_shape, + const int* indices_ptr, const size_t axis, + const size_t out_size, + const std::vector& out_shape, bool* out_buf); } // namespace @@ -51,8 +63,9 @@ extern "C" { EMSCRIPTEN_KEEPALIVE #endif -void Gather(size_t x_id, const DType dtype, size_t indices_id, size_t axis, - size_t out_id) { +void Gather(size_t x_id, const DType dtype, const size_t* x_shape_ptr, + const size_t rank, size_t indices_id, size_t axis, + const size_t* out_shape_ptr, size_t out_id) { auto& x_info = backend::get_tensor_info(x_id); auto& indices_info = backend::get_tensor_info(indices_id); @@ -60,18 +73,21 @@ void Gather(size_t x_id, const DType dtype, size_t indices_id, size_t axis, auto& out_info = backend::get_tensor_info_out(out_id); const size_t out_size = out_info.size; + auto x_shape = std::vector(x_shape_ptr, x_shape_ptr + rank); + auto out_shape = std::vector(out_shape_ptr, out_shape_ptr + rank); + switch (dtype) { case DType::float32: - gather_impl(x_info.f32(), indices_buf, axis, out_size, - out_info.f32_write()); + gather_impl(x_info.f32(), x_shape, indices_buf, axis, out_size, + out_shape, out_info.f32_write()); break; case DType::int32: - gather_impl(x_info.i32(), indices_buf, axis, out_size, - out_info.i32_write()); + gather_impl(x_info.i32(), x_shape, indices_buf, axis, out_size, + out_shape, out_info.i32_write()); break; case DType::boolean: - gather_impl(x_info.b(), indices_buf, axis, out_size, - out_info.b_write()); + gather_impl(x_info.b(), x_shape, indices_buf, axis, out_size, + out_shape, out_info.b_write()); break; default: util::warn("Scatter for tensor id %d failed. Unknown dtype %d", x_id, diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.h b/tfjs-backend-wasm/src/cc/kernels/Gather.h index bc8e87cd22c..f307df51569 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.h +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.h @@ -21,8 +21,9 @@ namespace tfjs { namespace wasm { extern "C" { -void Gather(size_t x_id, const DType dtype, size_t indices_id, size_t axis, - size_t out_id); +void Gather(size_t x_id, const DType dtype, const size_t* x_shape_ptr, + const size_t rank, size_t indices_id, size_t axis, + const size_t* out_shape_ptr, size_t out_id); } } // namespace wasm diff --git a/tfjs-backend-wasm/src/kernels/Gather.ts b/tfjs-backend-wasm/src/kernels/Gather.ts index b99de879748..1451aca4541 100644 --- a/tfjs-backend-wasm/src/kernels/Gather.ts +++ b/tfjs-backend-wasm/src/kernels/Gather.ts @@ -29,16 +29,20 @@ interface GatherAttrs extends NamedAttrMap { axis: number; } -let wasmGather: ( - xId: number, dtype: CppDType, indicesId: number, axis: number, - outId: number) => void; +let wasmGather: + (xId: number, dtype: CppDType, xShape: Uint8Array, rank: number, + indicesId: number, axis: number, outShape: Uint8Array, outId: number) => + void; function setup(backend: BackendWasm): void { wasmGather = backend.wasm.cwrap('Gather', null /*void*/, [ 'number', // xId 'number', // dtype + 'array', // x.shape + 'number', // rank 'number', // indicesId 'number', // axis + 'array', // out.shape 'number' // outId ]); } @@ -52,6 +56,7 @@ function gather( const newShape = x.shape.slice(); newShape[axis] = util.sizeFromShape(indices.shape); + const rank = x.shape.length; const out = backend.makeOutput(newShape, x.dtype); if (util.sizeFromShape(x.shape) === 0) { @@ -65,7 +70,12 @@ function gather( const indicesId = indicesData.id; const outId = backend.dataIdMap.get(out.dataId).id; - wasmGather(xId, CppDType[x.dtype], indicesId, axis, outId); + + const xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); + const outShapeBytes = new Uint8Array(new Int32Array(newShape).buffer); + wasmGather( + xId, CppDType[x.dtype], xShapeBytes, rank, indicesId, axis, outShapeBytes, + outId); return out; } From 09beda1e707cc88a183d6b64bceb0046e2d7bee9 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 11:51:53 -0500 Subject: [PATCH 16/29] logic --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 49 ++++++++++++---------- tfjs-backend-wasm/src/cc/kernels/Gather.h | 2 +- tfjs-backend-wasm/src/kernels/Gather.ts | 23 +++++----- 3 files changed, 42 insertions(+), 32 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index c3c2a01737a..686dec5c7d9 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -24,35 +24,40 @@ namespace { template -void gather_impl(const T* x_ptr, const std::vector& x_shape, +void gather_impl(const T* x_ptr, const std::vector& x_strides, const int* indices_ptr, const size_t axis, - const size_t out_size, const std::vector& out_shape, + const size_t out_size, const std::vector& out_strides, T* out_buf_ptr) { - // need: outshape, x_shape for (size_t i = 0; i < out_size; ++i) { - *out_buf_ptr = i; + auto loc = tfjs::util::offset_to_loc(i, out_strides); + const size_t new_loc = loc[axis]; + loc[axis] = indices_ptr[new_loc]; + + const size_t original_index = tfjs::util::loc_to_offset(loc, x_strides); + + *out_buf_ptr = x_ptr[original_index]; out_buf_ptr++; } } template void gather_impl(const float* x_ptr, - const std::vector& x_shape, + const std::vector& x_strides, const int* indices_ptr, const size_t axis, const size_t out_size, - const std::vector& out_shape, + const std::vector& out_strides, float* out_buf); template void gather_impl(const int* x_ptr, - const std::vector& x_shape, + const std::vector& x_strides, const int* indices_ptr, const size_t axis, const size_t out_size, - const std::vector& out_shape, + const std::vector& out_strides, int* out_buf); template void gather_impl(const bool* x_ptr, - const std::vector& x_shape, + const std::vector& x_strides, const int* indices_ptr, const size_t axis, const size_t out_size, - const std::vector& out_shape, + const std::vector& out_strides, bool* out_buf); } // namespace @@ -63,9 +68,9 @@ extern "C" { EMSCRIPTEN_KEEPALIVE #endif -void Gather(size_t x_id, const DType dtype, const size_t* x_shape_ptr, - const size_t rank, size_t indices_id, size_t axis, - const size_t* out_shape_ptr, size_t out_id) { +void Gather(size_t x_id, const DType dtype, const size_t* x_strides_ptr, + const size_t strides_size, size_t indices_id, size_t axis, + const size_t* out_strides_ptr, size_t out_id) { auto& x_info = backend::get_tensor_info(x_id); auto& indices_info = backend::get_tensor_info(indices_id); @@ -73,21 +78,23 @@ void Gather(size_t x_id, const DType dtype, const size_t* x_shape_ptr, auto& out_info = backend::get_tensor_info_out(out_id); const size_t out_size = out_info.size; - auto x_shape = std::vector(x_shape_ptr, x_shape_ptr + rank); - auto out_shape = std::vector(out_shape_ptr, out_shape_ptr + rank); + const auto x_strides = + std::vector(x_strides_ptr, x_strides_ptr + strides_size); + const auto out_strides = + std::vector(out_strides_ptr, out_strides_ptr + strides_size); switch (dtype) { case DType::float32: - gather_impl(x_info.f32(), x_shape, indices_buf, axis, out_size, - out_shape, out_info.f32_write()); + gather_impl(x_info.f32(), x_strides, indices_buf, axis, out_size, + out_strides, out_info.f32_write()); break; case DType::int32: - gather_impl(x_info.i32(), x_shape, indices_buf, axis, out_size, - out_shape, out_info.i32_write()); + gather_impl(x_info.i32(), x_strides, indices_buf, axis, out_size, + out_strides, out_info.i32_write()); break; case DType::boolean: - gather_impl(x_info.b(), x_shape, indices_buf, axis, out_size, - out_shape, out_info.b_write()); + gather_impl(x_info.b(), x_strides, indices_buf, axis, out_size, + out_strides, out_info.b_write()); break; default: util::warn("Scatter for tensor id %d failed. Unknown dtype %d", x_id, diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.h b/tfjs-backend-wasm/src/cc/kernels/Gather.h index f307df51569..7f97b90fbf5 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.h +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.h @@ -22,7 +22,7 @@ namespace wasm { extern "C" { void Gather(size_t x_id, const DType dtype, const size_t* x_shape_ptr, - const size_t rank, size_t indices_id, size_t axis, + const size_t strides_size, size_t indices_id, size_t axis, const size_t* out_shape_ptr, size_t out_id); } diff --git a/tfjs-backend-wasm/src/kernels/Gather.ts b/tfjs-backend-wasm/src/kernels/Gather.ts index 1451aca4541..25479954af5 100644 --- a/tfjs-backend-wasm/src/kernels/Gather.ts +++ b/tfjs-backend-wasm/src/kernels/Gather.ts @@ -30,19 +30,19 @@ interface GatherAttrs extends NamedAttrMap { } let wasmGather: - (xId: number, dtype: CppDType, xShape: Uint8Array, rank: number, - indicesId: number, axis: number, outShape: Uint8Array, outId: number) => + (xId: number, dtype: CppDType, xStrides: Uint8Array, stridesSize: number, + indicesId: number, axis: number, outStrides: Uint8Array, outId: number) => void; function setup(backend: BackendWasm): void { wasmGather = backend.wasm.cwrap('Gather', null /*void*/, [ 'number', // xId 'number', // dtype - 'array', // x.shape - 'number', // rank + 'array', // xStrides + 'number', // stridesSize 'number', // indicesId 'number', // axis - 'array', // out.shape + 'array', // outStrides 'number' // outId ]); } @@ -56,7 +56,7 @@ function gather( const newShape = x.shape.slice(); newShape[axis] = util.sizeFromShape(indices.shape); - const rank = x.shape.length; + const stridesSize = x.shape.length - 1; const out = backend.makeOutput(newShape, x.dtype); if (util.sizeFromShape(x.shape) === 0) { @@ -71,11 +71,14 @@ function gather( const outId = backend.dataIdMap.get(out.dataId).id; - const xShapeBytes = new Uint8Array(new Int32Array(x.shape).buffer); - const outShapeBytes = new Uint8Array(new Int32Array(newShape).buffer); + const xStridesBytes = + new Uint8Array(new Int32Array(util.computeStrides(x.shape)).buffer); + const outStridesBytes = + new Uint8Array(new Int32Array(util.computeStrides(newShape)).buffer); + wasmGather( - xId, CppDType[x.dtype], xShapeBytes, rank, indicesId, axis, outShapeBytes, - outId); + xId, CppDType[x.dtype], xStridesBytes, stridesSize, indicesId, axis, + outStridesBytes, outId); return out; } From 6e304d9cd040b930f10c2f3a0fa3157f4e44ef4a Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 12:23:04 -0500 Subject: [PATCH 17/29] rm --- tfjs-backend-wasm/src/index_test.ts | 54 ++--------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) diff --git a/tfjs-backend-wasm/src/index_test.ts b/tfjs-backend-wasm/src/index_test.ts index f9ee89f3bc9..370615f2cf3 100644 --- a/tfjs-backend-wasm/src/index_test.ts +++ b/tfjs-backend-wasm/src/index_test.ts @@ -58,8 +58,8 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { }, 100); // Silences backend registration warnings. - // spyOn(console, 'warn'); - // spyOn(console, 'log'); + spyOn(console, 'warn'); + spyOn(console, 'log'); }); afterEach(() => { @@ -92,54 +92,4 @@ describeWithFlags('wasm init', BROWSER_ENVS, () => { expect(() => setWasmPath('too/late')) .toThrowError(/The WASM backend was already initialized. Make sure/); }); - - it('should work for simple slice', async () => { - const indices = tf.tensor2d([0, 4, 8], [3, 1], 'int32'); - const input = - tf.tensor1d([100, 101, 102, 777, 778, 779, 1000, 1001, 1002], 'int32'); - const shape = [3]; - const result = tf.gatherND(input, indices); - expect(result.shape).toEqual(shape); - expect(result.dtype).toEqual(input.dtype); - const resultData = await result.data(); - console.log(Array.from(resultData)); - // expectArraysClose(await result.data(), [100, 778, 1002]); - }); - - fit('1D (gather), 1D indices', async () => { - const t = tf.tensor1d([1, 2, 3]); - - const t2 = tf.gather(t, tf.tensor1d([0, 2, 0, 1], 'int32'), 0); - console.log(t2.shape); - expect(t2.shape).toEqual([4]); - const resultData = await t2.data(); - console.log(Array.from(resultData)); - // expectArraysClose(await t2.data(), [1, 3, 1, 2]); - }); - - fit('1D (gather), 2D indices', async () => { - const t = tf.tensor1d([1, 2, 3]); - - const t2 = tf.gather(t, tf.tensor2d([0, 2, 0, 1], [1, 4], 'int32'), 0); - console.log(t2.shape); - expect(t2.shape).toEqual([1, 4]); - const resultData = await t2.data(); - console.log(Array.from(resultData)); - // expectArraysClose(await t2.data(), [1, 3, 1, 2]); - }); - - fit('2D (gather), scalar indices', async () => { - const t = tf.tensor2d([1, 11, 2, 22], [2, 2]); - let t2 = tf.gather(t, tf.scalar(1, 'int32'), 0); - expect(t2.shape).toEqual([2]); - let resultData = await t2.data(); - console.log(Array.from(resultData)); - // expectArraysClose(await t2.data(), [2, 22]); - - t2 = tf.gather(t, tf.scalar(1, 'int32'), 1); - expect(t2.shape).toEqual([2]); - resultData = await t2.data(); - console.log(Array.from(resultData)); - // expectArraysClose(await t2.data(), [11, 22]); - }); }); From 04a6ee9c5b91d567e8466a4c25e4cffa2ca283b5 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 12:26:15 -0500 Subject: [PATCH 18/29] upgrade --- tfjs-backend-wasm/yarn.lock | 165 +++++++++++++++++++----------------- 1 file changed, 86 insertions(+), 79 deletions(-) diff --git a/tfjs-backend-wasm/yarn.lock b/tfjs-backend-wasm/yarn.lock index ac1064763a2..3df88bde3c2 100644 --- a/tfjs-backend-wasm/yarn.lock +++ b/tfjs-backend-wasm/yarn.lock @@ -69,9 +69,9 @@ "@bazel/buildifier-win32_x64" "0.29.0" "@bazel/hide-bazel-files@latest": - version "0.38.3" - resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-0.38.3.tgz#e98231d3d360d51860d9c1a7c3345b40dab4cf81" - integrity sha512-o+dNkfDm3qxWQ8h/04cWuTcjR7qnjZi3pQGv4aklVb16oPWx2jF8BzbkwvWuIkdbOl9VnqYP0vaHzwQVJRRcIA== + version "1.0.0" + resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-1.0.0.tgz#779070dcb5ae121ff6c72d73bf3fb7bf68285d75" + integrity sha512-dfw2W7xDUPlRMcDMVO8gDkX9Xb7Thy3sP4PDODv+eiHOvwIi116X/wwy7mQUZISkJdEJ1zWy9ydpzvfetpYh4w== "@tensorflow/tfjs-core@link:../tfjs-core": version "0.0.0" @@ -82,7 +82,12 @@ resolved "https://registry.yarnpkg.com/@types/emscripten/-/emscripten-0.0.34.tgz#12b4a344274fb102ff2f6c877b37587bc3e46008" integrity sha512-QSb9ojDincskc+uKMI0KXp8e1NALFINCrMlp8VGKGcTSxeEyRTTKyjWw75NYrCZHUsVEEEpr1tYHpbtaC++/sQ== -"@types/estree@*", "@types/estree@0.0.39": +"@types/estree@*": + version "0.0.40" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.40.tgz#0e6cb9b9bbd098031fa19e4b4e8131bc70e5de13" + integrity sha512-p3KZgMto/JyxosKGmnLDJ/dG5wf+qTRMUjHJcspC2oQKa4jP7mz+tv0ND56lLBu3ojHlhzY33Ol+khLyNmilkA== + +"@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== @@ -93,9 +98,9 @@ integrity sha512-056oRlBBp7MDzr+HoU5su099s/s7wjZ3KcHxLfv+Byqb9MwdLUvsfLgw1VS97hsh3ddxSPyQu+olHMnoVTUY6g== "@types/node@*": - version "12.11.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.11.2.tgz#75ba3beda30d690b89a5089ca1c6e8e386150b76" - integrity sha512-dsfE4BHJkLQW+reOS6b17xhZ/6FB1rB8eRRvO08nn5o+voxf3i74tuyFWNH6djdfgX7Sm5s6LD8t6mJug4dpDw== + version "13.1.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.1.0.tgz#225cbaac5fdb2b9ac651b02c070d8aa3c37cc812" + integrity sha512-zwrxviZS08kRX40nqBrmERElF2vpw4IUTd5khkhBTfFH8AOaeoLVx48EC4+ZzS2/Iga7NevncqnsUSYjM4OWYA== "@types/offscreencanvas@~2019.3.0": version "2019.3.0" @@ -361,9 +366,9 @@ better-assert@~1.0.0: callsite "1.0.0" big-integer@^1.6.17: - version "1.6.47" - resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.47.tgz#e1e9320e26c4cc81f64fbf4b3bb20e025bf18e2d" - integrity sha512-9t9f7X3as2XGX8b52GqG6ox0GvIdM86LyIXASJnDCFhYNgt+A+MByQZ3W2PyMRZjEvG5f8TEbSPfEotVuMJnQg== + version "1.6.48" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" + integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== binary-extensions@^1.0.0: version "1.13.1" @@ -378,15 +383,22 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" +bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + blob@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== bluebird@^3.3.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de" - integrity sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg== + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bluebird@~3.4.1: version "3.4.7" @@ -837,9 +849,9 @@ copy-descriptor@^0.1.0: integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js@^2.2.0: - version "2.6.10" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.10.tgz#8a5b8391f8cc7013da703411ce5b585706300d7f" - integrity sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA== + version "2.6.11" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" + integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== core-util-is@~1.0.0: version "1.0.2" @@ -1264,6 +1276,11 @@ fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -1288,9 +1305,9 @@ finalhandler@1.1.2: unpipe "~1.0.0" find-cache-dir@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.1.0.tgz#9935894999debef4cf9f677fdf646d002c4cdecb" - integrity sha512-zw+EFiNBNPgI2NTrKkDd1xd7q0cs6wr/iWnr/oUkI0yF9K9GqQ+riIt4aiyFaaqpaWbxPrJXHI+QvmNUQbX+0Q== + version "3.2.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.2.0.tgz#e7fe44c1abc1299f516146e563108fd1006c1874" + integrity sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg== dependencies: commondir "^1.0.1" make-dir "^3.0.0" @@ -1374,12 +1391,12 @@ fs.realpath@^1.0.0: integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@^1.2.7: - version "1.2.9" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" - integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== + version "1.2.11" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.11.tgz#67bf57f4758f02ede88fb2a1712fef4d15358be3" + integrity sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw== dependencies: + bindings "^1.5.0" nan "^2.12.1" - node-pre-gyp "^0.12.0" fstream@^1.0.12: version "1.0.12" @@ -1439,19 +1456,7 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.1.1, glob@^7.1.4: - version "7.1.5" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0" - integrity sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.6, glob@^7.1.3: +glob@^7.0.0, glob@^7.0.6, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -1463,12 +1468,7 @@ glob@^7.0.6, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" - integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== - -graceful-fs@^4.1.2, graceful-fs@^4.1.6: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== @@ -1598,9 +1598,9 @@ https-browserify@^1.0.0: integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= https-proxy-agent@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793" - integrity sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg== + version "2.2.4" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" + integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== dependencies: agent-base "^4.3.0" debug "^3.1.0" @@ -2245,17 +2245,17 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.40.0: - version "1.40.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" - integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== +mime-db@1.42.0: + version "1.42.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.42.0.tgz#3e252907b4c7adb906597b4b65636272cf9e7bac" + integrity sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ== mime-types@~2.1.24: - version "2.1.24" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" - integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== + version "2.1.25" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.25.tgz#39772d46621f93e2a80a856c53b86a62156a6437" + integrity sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg== dependencies: - mime-db "1.40.0" + mime-db "1.42.0" mime@^2.3.1: version "2.4.4" @@ -2380,10 +2380,10 @@ node-fetch@~2.1.2: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= -node-pre-gyp@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" - integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== +node-pre-gyp@*: + version "0.14.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" + integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== dependencies: detect-libc "^1.0.2" mkdirp "^0.5.1" @@ -2394,7 +2394,7 @@ node-pre-gyp@^0.12.0: rc "^1.2.7" rimraf "^2.6.1" semver "^5.3.0" - tar "^4" + tar "^4.4.2" nopt@3.x: version "3.0.6" @@ -2434,14 +2434,21 @@ normalize-path@^3.0.0: integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== npm-bundled@^1.0.1: - version "1.0.6" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" - integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== + version "1.1.1" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b" + integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA== + dependencies: + npm-normalize-package-bin "^1.0.1" + +npm-normalize-package-bin@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" + integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== npm-packlist@^1.1.6, npm-packlist@^1.4.1: - version "1.4.6" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.6.tgz#53ba3ed11f8523079f1457376dd379ee4ea42ff4" - integrity sha512-u65uQdb+qwtGvEJh/DgQgW1Xg7sqeNbmxYyrvlNznaVTjV3E5P6F/EFjM+BVHXl7JJlsdG8A64M0XI8FI/IOlg== + version "1.4.7" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.7.tgz#9e954365a06b80b18111ea900945af4f88ed4848" + integrity sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" @@ -2957,17 +2964,17 @@ resolve@1.1.7, resolve@1.1.x: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.12.0, resolve@^1.1.6, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2: +resolve@1.12.0: version "1.12.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== dependencies: path-parse "^1.0.6" -resolve@^1.10.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.13.1.tgz#be0aa4c06acd53083505abb35f4d66932ab35d16" - integrity sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w== +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2: + version "1.14.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.14.1.tgz#9e018c540fcf0c427d678b9931cbf45e984bcaff" + integrity sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg== dependencies: path-parse "^1.0.6" @@ -3037,9 +3044,9 @@ rollup-plugin-terser@~5.1.3: terser "^4.1.0" rollup-plugin-typescript2@~0.25.2: - version "0.25.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.25.2.tgz#1a165df08560902da45b355413464caca1765d3a" - integrity sha512-+tpZj/ZIf2lwjyjX6xEW1S5Y38/21TB3p6poLodISIia8owMMfIKuFFnWcESE4FPBHkR8XPKqjY0PH9IUJJK+Q== + version "0.25.3" + resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.25.3.tgz#a5fb2f0f85488789334ce540abe6c7011cbdf40f" + integrity sha512-ADkSaidKBovJmf5VBnZBZe+WzaZwofuvYdzGAKTN/J4hN7QJCFYAq7IrH9caxlru6T5qhX41PNFS1S4HqhsGQg== dependencies: find-cache-dir "^3.0.0" fs-extra "8.1.0" @@ -3186,9 +3193,9 @@ snapdragon@^0.8.1: use "^3.1.0" socket.io-adapter@~1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" - integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= + version "1.1.2" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz#ab3f0d6f66b8fc7fca3959ab5991f82221789be9" + integrity sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g== socket.io-client@2.1.1: version "2.1.1" @@ -3447,7 +3454,7 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" -tar@^4: +tar@^4.4.2: version "4.4.13" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== @@ -3461,9 +3468,9 @@ tar@^4: yallist "^3.0.3" terser@^4.1.0: - version "4.4.2" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.2.tgz#448fffad0245f4c8a277ce89788b458bfd7706e8" - integrity sha512-Uufrsvhj9O1ikwgITGsZ5EZS6qPokUOkCegS7fYOdGTv+OA90vndUbU6PEjr5ePqHfNUbGyMO7xyIZv2MhsALQ== + version "4.4.3" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.3.tgz#401abc52b88869cf904412503b1eb7da093ae2f0" + integrity sha512-0ikKraVtRDKGzHrzkCv5rUNDzqlhmhowOBqC0XqUHFpW+vJ45+20/IFBcebwKfiS2Z9fJin6Eo+F1zLZsxi8RA== dependencies: commander "^2.20.0" source-map "~0.6.1" From fec4cd5ae30370346796181b4fb5b62f01b69dfa Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 14:48:40 -0500 Subject: [PATCH 19/29] rename --- tfjs-backend-wasm/src/cc/BUILD | 7 ++--- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 6 ++-- tfjs-backend-wasm/src/cc/kernels/GatherND.h | 32 -------------------- tfjs-backend-wasm/src/kernels/GatherND.ts | 18 +++++------ tfjs-backend-wasm/src/kernels/all_kernels.ts | 2 +- tfjs-core/src/index.ts | 4 +-- tfjs-core/src/ops/gather_nd.ts | 2 +- 7 files changed, 18 insertions(+), 53 deletions(-) delete mode 100644 tfjs-backend-wasm/src/cc/kernels/GatherND.h diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index 6632806058d..cc750af1129 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -157,7 +157,7 @@ tfjs_cc_library( ":FusedConv2D", ":FusedDepthwiseConv2D", ":Gather", - ":GatherND", + ":GatherNd", ":Greater", ":GreaterEqual", ":Less", @@ -399,9 +399,8 @@ tfjs_cc_library( ) tfjs_cc_library( - name = "GatherND", - srcs = ["kernels/GatherND.cc"], - hdrs = ["kernels/GatherND.h"], + name = "GatherNd", + srcs = ["kernels/GatherNd.cc"], deps = [ ":backend", ":util", diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index 9bdf8d993b9..d9c96c646d3 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -16,8 +16,6 @@ #include #endif -#include "src/cc/kernels/GatherND.h" - #include "src/cc/backend.h" #include "src/cc/util.h" @@ -72,7 +70,7 @@ extern "C" { EMSCRIPTEN_KEEPALIVE #endif -void GatherND(size_t x_id, const DType dtype, size_t indices_id, +void GatherNd(size_t x_id, const DType dtype, size_t indices_id, size_t num_slices, size_t slice_rank, size_t slice_size, size_t* strides_ptr, size_t out_id) { auto& x_info = backend::get_tensor_info(x_id); @@ -97,7 +95,7 @@ void GatherND(size_t x_id, const DType dtype, size_t indices_id, slice_size, strides, out_info.b_write()); break; default: - util::warn("Scatter for tensor id %d failed. Unknown dtype %d", + util::warn("GatherNd for tensor id %d failed. Unknown dtype %d", indices_id, dtype); } } diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.h b/tfjs-backend-wasm/src/cc/kernels/GatherND.h deleted file mode 100644 index ff7ee14b010..00000000000 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2019 Google Inc. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ===========================================================================*/ - -#ifndef KERNELS_GATHERND_H_ -#define KERNELS_GATHERND_H_ - -#include "src/cc/backend.h" - -namespace tfjs { -namespace wasm { -extern "C" { - -void GatherND(size_t x_id, const DType dtype, size_t indices_id, - size_t num_slices, size_t slice_rank, size_t slice_size, - size_t* strides_ptr, size_t out_id); -} - -} // namespace wasm -} // namespace tfjs - -#endif // KERNELS_GATHERND_H_ diff --git a/tfjs-backend-wasm/src/kernels/GatherND.ts b/tfjs-backend-wasm/src/kernels/GatherND.ts index 2e5580b6cdc..d3fc9b13f9d 100644 --- a/tfjs-backend-wasm/src/kernels/GatherND.ts +++ b/tfjs-backend-wasm/src/kernels/GatherND.ts @@ -15,23 +15,23 @@ * ============================================================================= */ -import {gather_nd_util, NamedTensorInfoMap, registerKernel, Tensor, TensorInfo} from '@tensorflow/tfjs-core'; +import {gather_util, NamedTensorInfoMap, registerKernel, Tensor, TensorInfo} from '@tensorflow/tfjs-core'; import {BackendWasm} from '../backend_wasm'; import {CppDType} from './types'; -interface GatherNDInputs extends NamedTensorInfoMap { +interface GatherNdInputs extends NamedTensorInfoMap { x: TensorInfo; indices: TensorInfo; } -let wasmGatherND: ( +let wasmGatherNd: ( xId: number, dtype: CppDType, indicesId: number, numSlices: number, sliceRank: number, sliceSize: number, strides: Uint8Array, outId: number) => void; function setup(backend: BackendWasm): void { - wasmGatherND = backend.wasm.cwrap('GatherND', null /*void*/, [ + wasmGatherNd = backend.wasm.cwrap('GatherNd', null /*void*/, [ 'number', // xId 'number', // dtype 'number', // indicesId @@ -43,13 +43,13 @@ function setup(backend: BackendWasm): void { ]); } -function gatherND(args: {backend: BackendWasm, inputs: GatherNDInputs}): +function gatherNd(args: {backend: BackendWasm, inputs: GatherNdInputs}): TensorInfo { const {backend, inputs} = args; const {x, indices} = inputs; const [resultShape, numSlices, sliceSize, strides] = - gather_nd_util.prepareAndValidate(x as Tensor, indices as Tensor); + gather_util.prepareAndValidate(x as Tensor, indices as Tensor); const out = backend.makeOutput(resultShape, x.dtype); if (numSlices === 0) { @@ -67,7 +67,7 @@ function gatherND(args: {backend: BackendWasm, inputs: GatherNDInputs}): const stridesBytes = new Uint8Array(new Int32Array(strides).buffer); const outId = backend.dataIdMap.get(out.dataId).id; - wasmGatherND( + wasmGatherNd( xId, CppDType[x.dtype], indicesId, numSlices, sliceRank, sliceSize, stridesBytes, outId); @@ -75,8 +75,8 @@ function gatherND(args: {backend: BackendWasm, inputs: GatherNDInputs}): } registerKernel({ - kernelName: 'GatherND', + kernelName: 'GatherNd', backendName: 'wasm', setupFunc: setup, - kernelFunc: gatherND + kernelFunc: gatherNd }); diff --git a/tfjs-backend-wasm/src/kernels/all_kernels.ts b/tfjs-backend-wasm/src/kernels/all_kernels.ts index b5ff14807a6..2ff31000a96 100644 --- a/tfjs-backend-wasm/src/kernels/all_kernels.ts +++ b/tfjs-backend-wasm/src/kernels/all_kernels.ts @@ -38,7 +38,7 @@ import './FusedBatchNorm'; import './FusedConv2D'; import './FusedDepthwiseConv2D'; import './Gather'; -import './GatherND'; +import './GatherNd'; import './Greater'; import './GreaterEqual'; import './LogicalAnd'; diff --git a/tfjs-core/src/index.ts b/tfjs-core/src/index.ts index 5a921550548..43d138bcce8 100644 --- a/tfjs-core/src/index.ts +++ b/tfjs-core/src/index.ts @@ -45,7 +45,7 @@ import * as backend_util from './backends/backend_util'; import * as io from './io/io'; import * as math from './math'; import * as browser from './ops/browser'; -import * as gather_nd_util from './ops/gather_nd_util'; +import * as gather_util from './ops/gather_nd_util'; import * as slice_util from './ops/slice_util'; import * as serialization from './serialization'; import {setOpHandler} from './tensor'; @@ -99,7 +99,7 @@ export { webgl, tensor_util, slice_util, - gather_nd_util + gather_util }; // Backend specific. diff --git a/tfjs-core/src/ops/gather_nd.ts b/tfjs-core/src/ops/gather_nd.ts index fbb704ac938..521396856f8 100644 --- a/tfjs-core/src/ops/gather_nd.ts +++ b/tfjs-core/src/ops/gather_nd.ts @@ -62,6 +62,6 @@ function gatherND_(x: Tensor|TensorLike, indices: Tensor|TensorLike): Tensor { const $x = convertToTensor(x, 'x', 'gatherND'); return ENGINE.runKernelFunc( backend => backend.gatherND($x, $indices), {x: $x, indices: $indices}, - null /* backward */, 'GatherND'); + null /* backward */, 'GatherNd'); } export const gatherND = op({gatherND_}); From b39a63233392cec012efc18d9b58e597bbeefec5 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 14:50:08 -0500 Subject: [PATCH 20/29] remove hdr --- tfjs-backend-wasm/src/cc/BUILD | 1 - tfjs-backend-wasm/src/cc/kernels/Gather.cc | 2 -- tfjs-backend-wasm/src/cc/kernels/Gather.h | 32 ---------------------- 3 files changed, 35 deletions(-) delete mode 100644 tfjs-backend-wasm/src/cc/kernels/Gather.h diff --git a/tfjs-backend-wasm/src/cc/BUILD b/tfjs-backend-wasm/src/cc/BUILD index cc750af1129..58deb71453e 100644 --- a/tfjs-backend-wasm/src/cc/BUILD +++ b/tfjs-backend-wasm/src/cc/BUILD @@ -391,7 +391,6 @@ tfjs_unit_test( tfjs_cc_library( name = "Gather", srcs = ["kernels/Gather.cc"], - hdrs = ["kernels/Gather.h"], deps = [ ":backend", ":util", diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index 686dec5c7d9..7d781ca8552 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -16,8 +16,6 @@ #include #endif -#include "src/cc/kernels/Gather.h" - #include "src/cc/backend.h" #include "src/cc/util.h" diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.h b/tfjs-backend-wasm/src/cc/kernels/Gather.h deleted file mode 100644 index 7f97b90fbf5..00000000000 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2019 Google Inc. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ===========================================================================*/ - -#ifndef KERNELS_GATHER_H_ -#define KERNELS_GATHER_H_ - -#include "src/cc/backend.h" - -namespace tfjs { -namespace wasm { -extern "C" { - -void Gather(size_t x_id, const DType dtype, const size_t* x_shape_ptr, - const size_t strides_size, size_t indices_id, size_t axis, - const size_t* out_shape_ptr, size_t out_id); -} - -} // namespace wasm -} // namespace tfjs - -#endif // KERNELS_GATHER_H_ From d16136fe6a8da93ce95e2fdff3315d8a6434dc27 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 15:05:05 -0500 Subject: [PATCH 21/29] remove templates --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 19 -- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 16 -- tfjs-backend-wasm/yarn.lock | 223 +------------------ 3 files changed, 9 insertions(+), 249 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index 7d781ca8552..32d86b26664 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -38,25 +38,6 @@ void gather_impl(const T* x_ptr, const std::vector& x_strides, out_buf_ptr++; } } - -template void gather_impl(const float* x_ptr, - const std::vector& x_strides, - const int* indices_ptr, const size_t axis, - const size_t out_size, - const std::vector& out_strides, - float* out_buf); -template void gather_impl(const int* x_ptr, - const std::vector& x_strides, - const int* indices_ptr, const size_t axis, - const size_t out_size, - const std::vector& out_strides, - int* out_buf); -template void gather_impl(const bool* x_ptr, - const std::vector& x_strides, - const int* indices_ptr, const size_t axis, - const size_t out_size, - const std::vector& out_strides, - bool* out_buf); } // namespace namespace tfjs { diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index d9c96c646d3..cd4208ecbe6 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -45,22 +45,6 @@ void gathernd_impl(const T* x_ptr, const int* indices_ptr, size_t num_slices, x_ptr -= ((flattened_index + 1) * slice_size); } } - -template void gathernd_impl(const float* x_ptr, const int* indices_ptr, - size_t num_slices, size_t slice_rank, - size_t slice_size, - const std::vector& strides_ptr, - float* out_buf_ptr); -template void gathernd_impl(const int* x_ptr, const int* indices_ptr, - size_t num_slices, size_t slice_rank, - size_t slice_size, - const std::vector& strides_ptr, - int* out_buf_ptr); -template void gathernd_impl(const bool* x_ptr, const int* indices_ptr, - size_t num_slices, size_t slice_rank, - size_t slice_size, - const std::vector& strides_ptr, - bool* out_buf_ptr); } // namespace namespace tfjs { diff --git a/tfjs-backend-wasm/yarn.lock b/tfjs-backend-wasm/yarn.lock index 3df88bde3c2..7c6bc475379 100644 --- a/tfjs-backend-wasm/yarn.lock +++ b/tfjs-backend-wasm/yarn.lock @@ -191,11 +191,6 @@ ansi-regex@^2.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -216,19 +211,6 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" -aproba@^1.0.3: - version "1.2.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" - integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== - -are-we-there-yet@~1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" - integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== - dependencies: - delegates "^1.0.0" - readable-stream "^2.0.6" - arg@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.2.tgz#e70c90579e02c63d80e3ad4e31d8bfdb8bd50064" @@ -675,11 +657,6 @@ chokidar@^2.0.3: optionalDependencies: fsevents "^1.2.7" -chownr@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142" - integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw== - cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -811,11 +788,6 @@ console-browserify@^1.1.0: resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== -console-control-strings@^1.0.0, console-control-strings@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= - constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" @@ -969,11 +941,6 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= -deep-extend@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -1008,11 +975,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -delegates@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= - depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -1026,11 +988,6 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" -detect-libc@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - di@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" @@ -1378,13 +1335,6 @@ fs-extra@^7.0.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs-minipass@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1408,20 +1358,6 @@ fstream@^1.0.12: mkdirp ">=0.5 0" rimraf "2" -gauge@~2.7.3: - version "2.7.4" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" - integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= - dependencies: - aproba "^1.0.3" - console-control-strings "^1.0.0" - has-unicode "^2.0.0" - object-assign "^4.1.0" - signal-exit "^3.0.0" - string-width "^1.0.1" - strip-ansi "^3.0.1" - wide-align "^1.1.0" - get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" @@ -1506,11 +1442,6 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= -has-unicode@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= - has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -1605,7 +1536,7 @@ https-proxy-agent@^2.2.1: agent-base "^4.3.0" debug "^3.1.0" -iconv-lite@0.4.24, iconv-lite@^0.4.4: +iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -1664,11 +1595,6 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -ini@~1.3.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - inline-source-map@~0.6.0: version "0.6.2" resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" @@ -1775,11 +1701,6 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" @@ -2284,7 +2205,7 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minimist@^1.1.3, minimist@^1.2.0: +minimist@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= @@ -2294,21 +2215,6 @@ minimist@~0.0.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= -minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - -minizlib@^1.2.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" - mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" @@ -2317,7 +2223,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= @@ -2356,15 +2262,6 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -needle@^2.2.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" - integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== - dependencies: - debug "^3.2.6" - iconv-lite "^0.4.4" - sax "^1.2.4" - negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -2380,22 +2277,6 @@ node-fetch@~2.1.2: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= -node-pre-gyp@*: - version "0.14.0" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz#9a0596533b877289bcad4e143982ca3d904ddc83" - integrity sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA== - dependencies: - detect-libc "^1.0.2" - mkdirp "^0.5.1" - needle "^2.2.1" - nopt "^4.0.1" - npm-packlist "^1.1.6" - npmlog "^4.0.2" - rc "^1.2.7" - rimraf "^2.6.1" - semver "^5.3.0" - tar "^4.4.2" - nopt@3.x: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -2403,14 +2284,6 @@ nopt@3.x: dependencies: abbrev "1" -nopt@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" - integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= - dependencies: - abbrev "1" - osenv "^0.1.4" - normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -2445,7 +2318,7 @@ npm-normalize-package-bin@^1.0.1: resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== -npm-packlist@^1.1.6, npm-packlist@^1.4.1: +npm-packlist@^1.4.1: version "1.4.7" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.7.tgz#9e954365a06b80b18111ea900945af4f88ed4848" integrity sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ== @@ -2453,16 +2326,6 @@ npm-packlist@^1.1.6, npm-packlist@^1.4.1: ignore-walk "^3.0.1" npm-bundled "^1.0.1" -npmlog@^4.0.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" - integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== - dependencies: - are-we-there-yet "~1.1.2" - console-control-strings "~1.1.0" - gauge "~2.7.3" - set-blocking "~2.0.0" - null-check@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" @@ -2473,7 +2336,7 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.0.1, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -2557,19 +2420,11 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: +os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -osenv@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" - integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== - dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" - p-limit@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" @@ -2832,16 +2687,6 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" -rc@^1.2.7: - version "1.2.8" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" - integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== - dependencies: - deep-extend "^0.6.0" - ini "~1.3.0" - minimist "^1.2.0" - strip-json-comments "~2.0.1" - read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -2868,7 +2713,7 @@ read-pkg@^1.0.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@~2.3.6: +readable-stream@^2.0.2, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -2988,7 +2833,7 @@ rfdc@^1.1.4: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.4.tgz#ba72cc1367a0ccd9cf81a870b3b58bd3ad07f8c2" integrity sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug== -rimraf@2, rimraf@^2.6.0, rimraf@^2.6.1: +rimraf@2, rimraf@^2.6.0: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -3099,11 +2944,6 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sax@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" - integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== - seedrandom@2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-2.4.3.tgz#2438504dad33917314bff18ac4d794f16d6aaecc" @@ -3124,7 +2964,7 @@ serialize-javascript@^2.1.2: resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== -set-blocking@^2.0.0, set-blocking@~2.0.0: +set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= @@ -3378,14 +3218,6 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2": - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - string_decoder@^1.1.1, string_decoder@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -3407,13 +3239,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -3428,11 +3253,6 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - supports-color@^3.1.0: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" @@ -3454,19 +3274,6 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" -tar@^4.4.2: - version "4.4.13" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" - integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== - dependencies: - chownr "^1.1.1" - fs-minipass "^1.2.5" - minipass "^2.8.6" - minizlib "^1.2.1" - mkdirp "^0.5.0" - safe-buffer "^5.1.2" - yallist "^3.0.3" - terser@^4.1.0: version "4.4.3" resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.3.tgz#401abc52b88869cf904412503b1eb7da093ae2f0" @@ -3770,13 +3577,6 @@ which@^1.1.1, which@^1.2.1: dependencies: isexe "^2.0.0" -wide-align@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" @@ -3846,11 +3646,6 @@ yallist@^2.1.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= -yallist@^3.0.0, yallist@^3.0.3: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - yargs-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" From 43cdb3f6b84c09259a36ae8f8884f8e7df157d4b Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 15:09:55 -0500 Subject: [PATCH 22/29] use const --- tfjs-backend-wasm/src/cc/kernels/GatherND.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc index cd4208ecbe6..c0b8dfdad6b 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherND.cc @@ -22,8 +22,9 @@ namespace { template -void gathernd_impl(const T* x_ptr, const int* indices_ptr, size_t num_slices, - size_t slice_rank, size_t slice_size, +void gathernd_impl(const T* x_ptr, const int* indices_ptr, + const size_t num_slices, const size_t slice_rank, + const size_t slice_size, const std::vector& strides_ptr, T* out_buf_ptr) { for (size_t i = 0; i < num_slices; ++i) { size_t flattened_index = 0; @@ -54,9 +55,10 @@ extern "C" { EMSCRIPTEN_KEEPALIVE #endif -void GatherNd(size_t x_id, const DType dtype, size_t indices_id, - size_t num_slices, size_t slice_rank, size_t slice_size, - size_t* strides_ptr, size_t out_id) { +void GatherNd(const size_t x_id, const DType dtype, const size_t indices_id, + const size_t num_slices, const size_t slice_rank, + const size_t slice_size, const size_t* strides_ptr, + const size_t out_id) { auto& x_info = backend::get_tensor_info(x_id); auto& indices_info = backend::get_tensor_info(indices_id); const std::vector& strides = From 3e2b663557658ef9f65491a4df5c130e6a11e693 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 15:10:12 -0500 Subject: [PATCH 23/29] restore --- tfjs-backend-wasm/yarn.lock | 390 +++++++++++++++++++++++++++--------- 1 file changed, 298 insertions(+), 92 deletions(-) diff --git a/tfjs-backend-wasm/yarn.lock b/tfjs-backend-wasm/yarn.lock index 7c6bc475379..8da2ee7c983 100644 --- a/tfjs-backend-wasm/yarn.lock +++ b/tfjs-backend-wasm/yarn.lock @@ -69,25 +69,28 @@ "@bazel/buildifier-win32_x64" "0.29.0" "@bazel/hide-bazel-files@latest": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-1.0.0.tgz#779070dcb5ae121ff6c72d73bf3fb7bf68285d75" - integrity sha512-dfw2W7xDUPlRMcDMVO8gDkX9Xb7Thy3sP4PDODv+eiHOvwIi116X/wwy7mQUZISkJdEJ1zWy9ydpzvfetpYh4w== + version "0.38.3" + resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-0.38.3.tgz#e98231d3d360d51860d9c1a7c3345b40dab4cf81" + integrity sha512-o+dNkfDm3qxWQ8h/04cWuTcjR7qnjZi3pQGv4aklVb16oPWx2jF8BzbkwvWuIkdbOl9VnqYP0vaHzwQVJRRcIA== -"@tensorflow/tfjs-core@link:../tfjs-core": - version "0.0.0" - uid "" +"@tensorflow/tfjs-core@1.5.1": + version "1.5.1" + resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-1.5.1.tgz#490209617f744fef660e8f81fe8b858e95b0d10b" + integrity sha512-N4fsi8mLsRwRs8UJN2cARB1rYFxyVXkLyZ4wOusiR976BwwZbCwQrTTSIPzPqYT3rwiexEUzm7sM6ZaDl5dpXA== + dependencies: + "@types/offscreencanvas" "~2019.3.0" + "@types/seedrandom" "2.4.27" + "@types/webgl-ext" "0.0.30" + "@types/webgl2" "0.0.4" + node-fetch "~2.1.2" + seedrandom "2.4.3" "@types/emscripten@~0.0.34": version "0.0.34" resolved "https://registry.yarnpkg.com/@types/emscripten/-/emscripten-0.0.34.tgz#12b4a344274fb102ff2f6c877b37587bc3e46008" integrity sha512-QSb9ojDincskc+uKMI0KXp8e1NALFINCrMlp8VGKGcTSxeEyRTTKyjWw75NYrCZHUsVEEEpr1tYHpbtaC++/sQ== -"@types/estree@*": - version "0.0.40" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.40.tgz#0e6cb9b9bbd098031fa19e4b4e8131bc70e5de13" - integrity sha512-p3KZgMto/JyxosKGmnLDJ/dG5wf+qTRMUjHJcspC2oQKa4jP7mz+tv0ND56lLBu3ojHlhzY33Ol+khLyNmilkA== - -"@types/estree@0.0.39": +"@types/estree@*", "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== @@ -98,9 +101,9 @@ integrity sha512-056oRlBBp7MDzr+HoU5su099s/s7wjZ3KcHxLfv+Byqb9MwdLUvsfLgw1VS97hsh3ddxSPyQu+olHMnoVTUY6g== "@types/node@*": - version "13.1.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.1.0.tgz#225cbaac5fdb2b9ac651b02c070d8aa3c37cc812" - integrity sha512-zwrxviZS08kRX40nqBrmERElF2vpw4IUTd5khkhBTfFH8AOaeoLVx48EC4+ZzS2/Iga7NevncqnsUSYjM4OWYA== + version "12.11.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.11.2.tgz#75ba3beda30d690b89a5089ca1c6e8e386150b76" + integrity sha512-dsfE4BHJkLQW+reOS6b17xhZ/6FB1rB8eRRvO08nn5o+voxf3i74tuyFWNH6djdfgX7Sm5s6LD8t6mJug4dpDw== "@types/offscreencanvas@~2019.3.0": version "2019.3.0" @@ -191,6 +194,11 @@ ansi-regex@^2.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -211,6 +219,19 @@ anymatch@^2.0.0: micromatch "^3.1.4" normalize-path "^2.1.1" +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + arg@^4.1.0: version "4.1.2" resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.2.tgz#e70c90579e02c63d80e3ad4e31d8bfdb8bd50064" @@ -348,9 +369,9 @@ better-assert@~1.0.0: callsite "1.0.0" big-integer@^1.6.17: - version "1.6.48" - resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" - integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== + version "1.6.47" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.47.tgz#e1e9320e26c4cc81f64fbf4b3bb20e025bf18e2d" + integrity sha512-9t9f7X3as2XGX8b52GqG6ox0GvIdM86LyIXASJnDCFhYNgt+A+MByQZ3W2PyMRZjEvG5f8TEbSPfEotVuMJnQg== binary-extensions@^1.0.0: version "1.13.1" @@ -365,22 +386,15 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - blob@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/blob/-/blob-0.0.5.tgz#d680eeef25f8cd91ad533f5b01eed48e64caf683" integrity sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig== bluebird@^3.3.0: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + version "3.7.1" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de" + integrity sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg== bluebird@~3.4.1: version "3.4.7" @@ -657,6 +671,11 @@ chokidar@^2.0.3: optionalDependencies: fsevents "^1.2.7" +chownr@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142" + integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw== + cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -788,6 +807,11 @@ console-browserify@^1.1.0: resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + constants-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" @@ -821,9 +845,9 @@ copy-descriptor@^0.1.0: integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= core-js@^2.2.0: - version "2.6.11" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c" - integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg== + version "2.6.10" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.10.tgz#8a5b8391f8cc7013da703411ce5b585706300d7f" + integrity sha512-I39t74+4t+zau64EN1fE5v2W31Adtc/REhzWN+gWRRXg6WH5qAsZm62DHpQ1+Yhe4047T55jvzz7MUqF/dBBlA== core-util-is@~1.0.0: version "1.0.2" @@ -941,6 +965,11 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -975,6 +1004,11 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -988,6 +1022,11 @@ des.js@^1.0.0: inherits "^2.0.1" minimalistic-assert "^1.0.0" +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + di@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" @@ -1233,11 +1272,6 @@ fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -1262,9 +1296,9 @@ finalhandler@1.1.2: unpipe "~1.0.0" find-cache-dir@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.2.0.tgz#e7fe44c1abc1299f516146e563108fd1006c1874" - integrity sha512-1JKclkYYsf1q9WIJKLZa9S9muC+08RIjzAlLrK4QcYLJMS6mk9yombQ9qf+zJ7H9LS800k0s44L4sDq9VYzqyg== + version "3.1.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.1.0.tgz#9935894999debef4cf9f677fdf646d002c4cdecb" + integrity sha512-zw+EFiNBNPgI2NTrKkDd1xd7q0cs6wr/iWnr/oUkI0yF9K9GqQ+riIt4aiyFaaqpaWbxPrJXHI+QvmNUQbX+0Q== dependencies: commondir "^1.0.1" make-dir "^3.0.0" @@ -1335,18 +1369,25 @@ fs-extra@^7.0.1: jsonfile "^4.0.0" universalify "^0.1.0" +fs-minipass@^1.2.5: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" + integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== + dependencies: + minipass "^2.6.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@^1.2.7: - version "1.2.11" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.11.tgz#67bf57f4758f02ede88fb2a1712fef4d15358be3" - integrity sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw== + version "1.2.9" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" + integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== dependencies: - bindings "^1.5.0" nan "^2.12.1" + node-pre-gyp "^0.12.0" fstream@^1.0.12: version "1.0.12" @@ -1358,6 +1399,20 @@ fstream@^1.0.12: mkdirp ">=0.5 0" rimraf "2" +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" @@ -1392,7 +1447,19 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.6, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4: +glob@^7.0.0, glob@^7.1.1, glob@^7.1.4: + version "7.1.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0" + integrity sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.6, glob@^7.1.3: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -1404,7 +1471,12 @@ glob@^7.0.0, glob@^7.0.6, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: +graceful-fs@^4.1.11, graceful-fs@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" + integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== + +graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== @@ -1442,6 +1514,11 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" @@ -1529,14 +1606,14 @@ https-browserify@^1.0.0: integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= https-proxy-agent@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" - integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== + version "2.2.2" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793" + integrity sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg== dependencies: agent-base "^4.3.0" debug "^3.1.0" -iconv-lite@0.4.24: +iconv-lite@0.4.24, iconv-lite@^0.4.4: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -1595,6 +1672,11 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + inline-source-map@~0.6.0: version "0.6.2" resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" @@ -1701,6 +1783,11 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" @@ -2166,17 +2253,17 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.42.0: - version "1.42.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.42.0.tgz#3e252907b4c7adb906597b4b65636272cf9e7bac" - integrity sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ== +mime-db@1.40.0: + version "1.40.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" + integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== mime-types@~2.1.24: - version "2.1.25" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.25.tgz#39772d46621f93e2a80a856c53b86a62156a6437" - integrity sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg== + version "2.1.24" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== dependencies: - mime-db "1.42.0" + mime-db "1.40.0" mime@^2.3.1: version "2.4.4" @@ -2205,7 +2292,7 @@ minimist@0.0.8: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= -minimist@^1.1.3: +minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= @@ -2215,6 +2302,21 @@ minimist@~0.0.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= +minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" + integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.2.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" + integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== + dependencies: + minipass "^2.9.0" + mixin-deep@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" @@ -2223,7 +2325,7 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1: +mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= @@ -2262,6 +2364,15 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" +needle@^2.2.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" + integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== + dependencies: + debug "^3.2.6" + iconv-lite "^0.4.4" + sax "^1.2.4" + negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -2277,6 +2388,22 @@ node-fetch@~2.1.2: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.1.2.tgz#ab884e8e7e57e38a944753cec706f788d1768bb5" integrity sha1-q4hOjn5X44qUR1POxwb3iNF2i7U= +node-pre-gyp@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" + integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + nopt@3.x: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -2284,6 +2411,14 @@ nopt@3.x: dependencies: abbrev "1" +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= + dependencies: + abbrev "1" + osenv "^0.1.4" + normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -2307,25 +2442,28 @@ normalize-path@^3.0.0: integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== npm-bundled@^1.0.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b" - integrity sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA== - dependencies: - npm-normalize-package-bin "^1.0.1" - -npm-normalize-package-bin@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" - integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== + version "1.0.6" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" + integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== -npm-packlist@^1.4.1: - version "1.4.7" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.7.tgz#9e954365a06b80b18111ea900945af4f88ed4848" - integrity sha512-vAj7dIkp5NhieaGZxBJB8fF4R0078rqsmhJcAfXZ6O7JJhjhPK96n5Ry1oZcfLXgfun0GWTZPOxaEyqv8GBykQ== +npm-packlist@^1.1.6, npm-packlist@^1.4.1: + version "1.4.6" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.6.tgz#53ba3ed11f8523079f1457376dd379ee4ea42ff4" + integrity sha512-u65uQdb+qwtGvEJh/DgQgW1Xg7sqeNbmxYyrvlNznaVTjV3E5P6F/EFjM+BVHXl7JJlsdG8A64M0XI8FI/IOlg== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + null-check@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" @@ -2336,7 +2474,7 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -object-assign@^4.0.1, object-assign@^4.1.1: +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -2420,11 +2558,19 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-tmpdir@~1.0.2: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + p-limit@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" @@ -2687,6 +2833,16 @@ raw-body@2.4.0: iconv-lite "0.4.24" unpipe "1.0.0" +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -2713,7 +2869,7 @@ read-pkg@^1.0.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@^2.0.2, readable-stream@~2.3.6: +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -2809,17 +2965,17 @@ resolve@1.1.7, resolve@1.1.x: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@1.12.0: +resolve@1.12.0, resolve@^1.1.6, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2: version "1.12.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== dependencies: path-parse "^1.0.6" -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2: - version "1.14.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.14.1.tgz#9e018c540fcf0c427d678b9931cbf45e984bcaff" - integrity sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg== +resolve@^1.10.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.13.1.tgz#be0aa4c06acd53083505abb35f4d66932ab35d16" + integrity sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w== dependencies: path-parse "^1.0.6" @@ -2833,7 +2989,7 @@ rfdc@^1.1.4: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.1.4.tgz#ba72cc1367a0ccd9cf81a870b3b58bd3ad07f8c2" integrity sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug== -rimraf@2, rimraf@^2.6.0: +rimraf@2, rimraf@^2.6.0, rimraf@^2.6.1: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== @@ -2889,9 +3045,9 @@ rollup-plugin-terser@~5.1.3: terser "^4.1.0" rollup-plugin-typescript2@~0.25.2: - version "0.25.3" - resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.25.3.tgz#a5fb2f0f85488789334ce540abe6c7011cbdf40f" - integrity sha512-ADkSaidKBovJmf5VBnZBZe+WzaZwofuvYdzGAKTN/J4hN7QJCFYAq7IrH9caxlru6T5qhX41PNFS1S4HqhsGQg== + version "0.25.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.25.2.tgz#1a165df08560902da45b355413464caca1765d3a" + integrity sha512-+tpZj/ZIf2lwjyjX6xEW1S5Y38/21TB3p6poLodISIia8owMMfIKuFFnWcESE4FPBHkR8XPKqjY0PH9IUJJK+Q== dependencies: find-cache-dir "^3.0.0" fs-extra "8.1.0" @@ -2944,6 +3100,11 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + seedrandom@2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-2.4.3.tgz#2438504dad33917314bff18ac4d794f16d6aaecc" @@ -2964,7 +3125,7 @@ serialize-javascript@^2.1.2: resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-2.1.2.tgz#ecec53b0e0317bdc95ef76ab7074b7384785fa61" integrity sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ== -set-blocking@^2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= @@ -3033,9 +3194,9 @@ snapdragon@^0.8.1: use "^3.1.0" socket.io-adapter@~1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz#ab3f0d6f66b8fc7fca3959ab5991f82221789be9" - integrity sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g== + version "1.1.1" + resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" + integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= socket.io-client@2.1.1: version "2.1.1" @@ -3218,6 +3379,14 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + string_decoder@^1.1.1, string_decoder@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -3239,6 +3408,13 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -3253,6 +3429,11 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + supports-color@^3.1.0: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" @@ -3274,10 +3455,23 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" +tar@^4: + version "4.4.13" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" + integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.8.6" + minizlib "^1.2.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.3" + terser@^4.1.0: - version "4.4.3" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.3.tgz#401abc52b88869cf904412503b1eb7da093ae2f0" - integrity sha512-0ikKraVtRDKGzHrzkCv5rUNDzqlhmhowOBqC0XqUHFpW+vJ45+20/IFBcebwKfiS2Z9fJin6Eo+F1zLZsxi8RA== + version "4.4.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.2.tgz#448fffad0245f4c8a277ce89788b458bfd7706e8" + integrity sha512-Uufrsvhj9O1ikwgITGsZ5EZS6qPokUOkCegS7fYOdGTv+OA90vndUbU6PEjr5ePqHfNUbGyMO7xyIZv2MhsALQ== dependencies: commander "^2.20.0" source-map "~0.6.1" @@ -3577,6 +3771,13 @@ which@^1.1.1, which@^1.2.1: dependencies: isexe "^2.0.0" +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" @@ -3646,6 +3847,11 @@ yallist@^2.1.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= +yallist@^3.0.0, yallist@^3.0.3: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + yargs-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" From 806c182c5cdc3f67cc4b6b752a715e04523859c9 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 15:13:17 -0500 Subject: [PATCH 24/29] use const --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 7 ++++--- tfjs-backend-wasm/yarn.lock | 14 +++----------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index 32d86b26664..696b01eb73b 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -47,9 +47,10 @@ extern "C" { EMSCRIPTEN_KEEPALIVE #endif -void Gather(size_t x_id, const DType dtype, const size_t* x_strides_ptr, - const size_t strides_size, size_t indices_id, size_t axis, - const size_t* out_strides_ptr, size_t out_id) { +void Gather(const size_t x_id, const DType dtype, const size_t* x_strides_ptr, + const size_t strides_size, const size_t indices_id, + const size_t axis, const size_t* out_strides_ptr, + const size_t out_id) { auto& x_info = backend::get_tensor_info(x_id); auto& indices_info = backend::get_tensor_info(indices_id); diff --git a/tfjs-backend-wasm/yarn.lock b/tfjs-backend-wasm/yarn.lock index 8da2ee7c983..ac1064763a2 100644 --- a/tfjs-backend-wasm/yarn.lock +++ b/tfjs-backend-wasm/yarn.lock @@ -73,17 +73,9 @@ resolved "https://registry.yarnpkg.com/@bazel/hide-bazel-files/-/hide-bazel-files-0.38.3.tgz#e98231d3d360d51860d9c1a7c3345b40dab4cf81" integrity sha512-o+dNkfDm3qxWQ8h/04cWuTcjR7qnjZi3pQGv4aklVb16oPWx2jF8BzbkwvWuIkdbOl9VnqYP0vaHzwQVJRRcIA== -"@tensorflow/tfjs-core@1.5.1": - version "1.5.1" - resolved "https://registry.yarnpkg.com/@tensorflow/tfjs-core/-/tfjs-core-1.5.1.tgz#490209617f744fef660e8f81fe8b858e95b0d10b" - integrity sha512-N4fsi8mLsRwRs8UJN2cARB1rYFxyVXkLyZ4wOusiR976BwwZbCwQrTTSIPzPqYT3rwiexEUzm7sM6ZaDl5dpXA== - dependencies: - "@types/offscreencanvas" "~2019.3.0" - "@types/seedrandom" "2.4.27" - "@types/webgl-ext" "0.0.30" - "@types/webgl2" "0.0.4" - node-fetch "~2.1.2" - seedrandom "2.4.3" +"@tensorflow/tfjs-core@link:../tfjs-core": + version "0.0.0" + uid "" "@types/emscripten@~0.0.34": version "0.0.34" From 3ecac84c8c0976ff11e02ed1bf3f64d750c5e0b0 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 15:14:32 -0500 Subject: [PATCH 25/29] change case --- tfjs-backend-wasm/src/cc/kernels/{GatherND.cc => GatherNd.cc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tfjs-backend-wasm/src/cc/kernels/{GatherND.cc => GatherNd.cc} (100%) diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherND.cc b/tfjs-backend-wasm/src/cc/kernels/GatherNd.cc similarity index 100% rename from tfjs-backend-wasm/src/cc/kernels/GatherND.cc rename to tfjs-backend-wasm/src/cc/kernels/GatherNd.cc From 31bd2f5012a56e971470002719612ac828bacefa Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 15:15:15 -0500 Subject: [PATCH 26/29] case --- tfjs-backend-wasm/src/kernels/{GatherND.ts => GatherNd.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tfjs-backend-wasm/src/kernels/{GatherND.ts => GatherNd.ts} (100%) diff --git a/tfjs-backend-wasm/src/kernels/GatherND.ts b/tfjs-backend-wasm/src/kernels/GatherNd.ts similarity index 100% rename from tfjs-backend-wasm/src/kernels/GatherND.ts rename to tfjs-backend-wasm/src/kernels/GatherNd.ts From 80d63602c21e337457dab19dc79432e0da017c37 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 15:16:16 -0500 Subject: [PATCH 27/29] name --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index 696b01eb73b..99bb270b646 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -77,7 +77,7 @@ void Gather(const size_t x_id, const DType dtype, const size_t* x_strides_ptr, out_strides, out_info.b_write()); break; default: - util::warn("Scatter for tensor id %d failed. Unknown dtype %d", x_id, + util::warn("Gather for tensor id %d failed. Unknown dtype %d", x_id, dtype); } } From 00710be014322487561d8cb716d9087ac3dbeb8d Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 16:20:42 -0500 Subject: [PATCH 28/29] use int32 --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 14 +++++++------- tfjs-backend-wasm/src/cc/kernels/GatherNd.cc | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index 99bb270b646..ebf2fa49894 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -22,9 +22,9 @@ namespace { template -void gather_impl(const T* x_ptr, const std::vector& x_strides, - const int* indices_ptr, const size_t axis, - const size_t out_size, const std::vector& out_strides, +void gather_impl(const T* x_ptr, const std::vector& x_strides, + const int32_t* indices_ptr, const size_t axis, + const size_t out_size, const std::vector& out_strides, T* out_buf_ptr) { for (size_t i = 0; i < out_size; ++i) { auto loc = tfjs::util::offset_to_loc(i, out_strides); @@ -47,9 +47,9 @@ extern "C" { EMSCRIPTEN_KEEPALIVE #endif -void Gather(const size_t x_id, const DType dtype, const size_t* x_strides_ptr, +void Gather(const size_t x_id, const DType dtype, const int32_t* x_strides_ptr, const size_t strides_size, const size_t indices_id, - const size_t axis, const size_t* out_strides_ptr, + const size_t axis, const int32_t* out_strides_ptr, const size_t out_id) { auto& x_info = backend::get_tensor_info(x_id); auto& indices_info = backend::get_tensor_info(indices_id); @@ -59,9 +59,9 @@ void Gather(const size_t x_id, const DType dtype, const size_t* x_strides_ptr, const size_t out_size = out_info.size; const auto x_strides = - std::vector(x_strides_ptr, x_strides_ptr + strides_size); + std::vector(x_strides_ptr, x_strides_ptr + strides_size); const auto out_strides = - std::vector(out_strides_ptr, out_strides_ptr + strides_size); + std::vector(out_strides_ptr, out_strides_ptr + strides_size); switch (dtype) { case DType::float32: diff --git a/tfjs-backend-wasm/src/cc/kernels/GatherNd.cc b/tfjs-backend-wasm/src/cc/kernels/GatherNd.cc index c0b8dfdad6b..6d9b1a77ed3 100644 --- a/tfjs-backend-wasm/src/cc/kernels/GatherNd.cc +++ b/tfjs-backend-wasm/src/cc/kernels/GatherNd.cc @@ -22,10 +22,10 @@ namespace { template -void gathernd_impl(const T* x_ptr, const int* indices_ptr, +void gathernd_impl(const T* x_ptr, const int32_t* indices_ptr, const size_t num_slices, const size_t slice_rank, const size_t slice_size, - const std::vector& strides_ptr, T* out_buf_ptr) { + const std::vector& strides_ptr, T* out_buf_ptr) { for (size_t i = 0; i < num_slices; ++i) { size_t flattened_index = 0; for (size_t j = 0; j < slice_rank; ++j) { @@ -57,12 +57,12 @@ EMSCRIPTEN_KEEPALIVE void GatherNd(const size_t x_id, const DType dtype, const size_t indices_id, const size_t num_slices, const size_t slice_rank, - const size_t slice_size, const size_t* strides_ptr, + const size_t slice_size, const int32_t* strides_ptr, const size_t out_id) { auto& x_info = backend::get_tensor_info(x_id); auto& indices_info = backend::get_tensor_info(indices_id); - const std::vector& strides = - std::vector(strides_ptr, strides_ptr + slice_rank); + const std::vector& strides = + std::vector(strides_ptr, strides_ptr + slice_rank); const int* indices_buf = indices_info.i32(); auto& out_info = backend::get_tensor_info_out(out_id); From c690b8a7cb28728b31d047369ec89e66776e9b38 Mon Sep 17 00:00:00 2001 From: Ann Yuan Date: Mon, 23 Dec 2019 16:57:14 -0500 Subject: [PATCH 29/29] clean --- tfjs-backend-wasm/src/cc/kernels/Gather.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tfjs-backend-wasm/src/cc/kernels/Gather.cc b/tfjs-backend-wasm/src/cc/kernels/Gather.cc index ebf2fa49894..a8510d0813c 100644 --- a/tfjs-backend-wasm/src/cc/kernels/Gather.cc +++ b/tfjs-backend-wasm/src/cc/kernels/Gather.cc @@ -22,9 +22,9 @@ namespace { template -void gather_impl(const T* x_ptr, const std::vector& x_strides, +void gather_impl(const T* x_ptr, const std::vector& x_strides, const int32_t* indices_ptr, const size_t axis, - const size_t out_size, const std::vector& out_strides, + const size_t out_size, const std::vector& out_strides, T* out_buf_ptr) { for (size_t i = 0; i < out_size; ++i) { auto loc = tfjs::util::offset_to_loc(i, out_strides); @@ -59,9 +59,9 @@ void Gather(const size_t x_id, const DType dtype, const int32_t* x_strides_ptr, const size_t out_size = out_info.size; const auto x_strides = - std::vector(x_strides_ptr, x_strides_ptr + strides_size); + std::vector(x_strides_ptr, x_strides_ptr + strides_size); const auto out_strides = - std::vector(out_strides_ptr, out_strides_ptr + strides_size); + std::vector(out_strides_ptr, out_strides_ptr + strides_size); switch (dtype) { case DType::float32: