diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.d.ts new file mode 100644 index 000000000..d0b08039e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const expConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.js new file mode 100644 index 000000000..bfd3ebfc6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Exp.js @@ -0,0 +1,29 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.expConfig = { + kernelName: tfjs_1.Exp, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var xTensor = x.dtype === 'int32' ? x.toFloat() : x; + return backend.executeSingleInput(tfjs_1.Exp, xTensor); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.d.ts new file mode 100644 index 000000000..27b314df9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const expandDimsConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.js new file mode 100644 index 000000000..051b8ee1e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ExpandDims.js @@ -0,0 +1,32 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.expandDimsConfig = { + kernelName: tfjs_1.ExpandDims, + backendName: 'tensorflow', + kernelFunc: function (args) { + var input = args.inputs.input; + var backend = args.backend; + var dim = args.attrs.dim; + var dimTensor = tfjs_1.scalar(dim, 'int32'); + var res = backend.executeSingleOutput(tfjs_1.ExpandDims, [], [input, dimTensor]); + dimTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.d.ts new file mode 100644 index 000000000..eb795a69f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const expm1Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.js new file mode 100644 index 000000000..4e32cfac8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Expm1.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.expm1Config = { + kernelName: tfjs_1.Expm1, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Expm1, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.d.ts new file mode 100644 index 000000000..d44def8eb --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const FFTConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.js new file mode 100644 index 000000000..5327f6805 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FFT.js @@ -0,0 +1,31 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +// tslint:disable-next-line: variable-name +exports.FFTConfig = { + kernelName: tfjs_1.FFT, + backendName: 'tensorflow', + kernelFunc: function (args) { + var input = args.inputs.input; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tcomplex', input.dtype)]; + return backend.executeSingleOutput(tfjs_1.FFT, opAttrs, [input]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.d.ts new file mode 100644 index 000000000..408811b26 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const fillConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.js new file mode 100644 index 000000000..4db78f4ad --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Fill.js @@ -0,0 +1,57 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.fillConfig = { + kernelName: tfjs_1.Fill, + backendName: 'tensorflow', + kernelFunc: function (args) { + var backend = args.backend; + var _a = args.attrs, shape = _a.shape, value = _a.value; + var dtype = args.attrs.dtype; + // TODO(cais, nkreeger): Investigate whether backend can be made into + // a dtype helper method. The underlying op kernel doesn't accept undefined + // or null dtype. + if (dtype == null) { + if (typeof value === 'number') { + dtype = 'float32'; + } + else { + dtype = 'string'; + } + } + var shapeTensor = tfjs_1.tensor1d(shape, 'int32'); + var valueTensor = tfjs_1.scalar(value, dtype); + var opAttrs = [ + { + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.getDTypeInteger(dtype) + }, + { + name: 'index_type', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_INT32 + } + ]; + var res = backend.executeSingleOutput(tfjs_1.Fill, opAttrs, [shapeTensor, valueTensor]); + shapeTensor.dispose(); + valueTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.d.ts new file mode 100644 index 000000000..bb1f5e020 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const floorConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.js new file mode 100644 index 000000000..da9aac91e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Floor.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.floorConfig = { + kernelName: tfjs_1.Floor, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Floor, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.d.ts new file mode 100644 index 000000000..d593bccd3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const floorDivConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.js new file mode 100644 index 000000000..c420be721 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FloorDiv.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.floorDivConfig = { + kernelName: tfjs_1.FloorDiv, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.FloorDiv, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.d.ts new file mode 100644 index 000000000..7ec1febb6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const fusedBatchNormConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.js new file mode 100644 index 000000000..9634cc622 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedBatchNorm.js @@ -0,0 +1,65 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.fusedBatchNormConfig = { + kernelName: tfjs_1.FusedBatchNorm, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, x = _a.x, mean = _a.mean, variance = _a.variance; + var _b = args.inputs, scale = _b.scale, offset = _b.offset; + var backend = args.backend; + var varianceEpsilon = args.attrs.varianceEpsilon; + return tfjs_1.tidy(function () { + if (mean.rank > 1) { + // Fused batch norm doesn't work with high-dim mean/var/scale/offset. + var inv = tfjs_1.rsqrt(tfjs_1.add(variance, tfjs_1.scalar(varianceEpsilon))); + if (scale != null) { + inv = tfjs_1.mul(inv, scale); + } + var xNorm = tfjs_1.mul(tfjs_1.sub(x, mean), inv); + return offset != null ? tfjs_1.add(xNorm, offset) : xNorm; + } + var dataFormat = 'NHWC'; + var depth = x.shape[3]; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + { + name: 'epsilon', + type: backend.binding.TF_ATTR_FLOAT, + value: varianceEpsilon + }, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + { name: 'is_training', type: backend.binding.TF_ATTR_BOOL, value: false }, + ]; + var numOutputs = 5; + if (scale == null) { + scale = tfjs_1.fill([depth], 1); + } + if (offset == null) { + offset = tfjs_1.fill([depth], 0); + } + return backend.executeMultipleOutputs(tfjs_1.FusedBatchNorm, opAttrs, [x, scale, offset, mean, variance], numOutputs)[0]; + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.d.ts new file mode 100644 index 000000000..79bef995a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const fusedConv2DConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.js new file mode 100644 index 000000000..98b7eec15 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedConv2D.js @@ -0,0 +1,44 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var Conv2D_1 = require("./Conv2D"); +exports.fusedConv2DConfig = { + kernelName: tfjs_1.FusedConv2D, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, x = _a.x, filter = _a.filter, bias = _a.bias, preluActivationWeights = _a.preluActivationWeights; + var backend = args.backend; + var _b = args.attrs, strides = _b.strides, pad = _b.pad, dataFormat = _b.dataFormat, dilations = _b.dilations, dimRoundingMode = _b.dimRoundingMode, activation = _b.activation, leakyreluAlpha = _b.leakyreluAlpha; + var $dataFormat = tfjs_1.backend_util.convertConv2DDataFormat(dataFormat); + var convInfo = tfjs_1.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, dilations, pad, dimRoundingMode, false /* depthwise */, $dataFormat); + var result = Conv2D_1.conv2dImpl(x, filter, convInfo, backend); + var toDispose = []; + if (bias != null) { + toDispose.push(result); + result = tfjs_1.add(result, bias); + } + var temp = result; + result = backend.applyActivation(result, activation, preluActivationWeights, leakyreluAlpha); + if (temp !== result) { + toDispose.push(temp); + } + toDispose.forEach(function (t) { return t.dispose(); }); + return result; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.d.ts new file mode 100644 index 000000000..d3ba58165 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const fusedDepthwiseConv2DConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.js new file mode 100644 index 000000000..af855878a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/FusedDepthwiseConv2D.js @@ -0,0 +1,47 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var DepthwiseConv2dNative_1 = require("./DepthwiseConv2dNative"); +exports.fusedDepthwiseConv2DConfig = { + kernelName: tfjs_1.FusedDepthwiseConv2D, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, x = _a.x, filter = _a.filter, bias = _a.bias, preluActivationWeights = _a.preluActivationWeights; + var backend = args.backend; + var _b = args.attrs, strides = _b.strides, pad = _b.pad, dilations = _b.dilations, dimRoundingMode = _b.dimRoundingMode, activation = _b.activation, leakyreluAlpha = _b.leakyreluAlpha; + var $dilations = dilations; + if ($dilations == null) { + $dilations = [1, 1]; + } + var convInfo = tfjs_1.backend_util.computeConv2DInfo(x.shape, filter.shape, strides, $dilations, pad, dimRoundingMode, true /* depthwise */); + var result = DepthwiseConv2dNative_1.depthwiseConv2dNativeImpl(x, filter, convInfo, backend); + var toDispose = []; + if (bias != null) { + toDispose.push(result); + result = tfjs_1.add(result, bias); + } + var temp = result; + result = backend.applyActivation(result, activation, preluActivationWeights, leakyreluAlpha); + if (temp !== result) { + toDispose.push(temp); + } + toDispose.forEach(function (t) { return t.dispose(); }); + return result; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.d.ts new file mode 100644 index 000000000..d1d63bf1f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const gatherNdConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.js new file mode 100644 index 000000000..49f526d93 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherNd.js @@ -0,0 +1,33 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.gatherNdConfig = { + kernelName: tfjs_1.GatherNd, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, params = _a.params, indices = _a.indices; + var backend = args.backend; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tparams', params.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', 'int32') + ]; + return backend.executeSingleOutput(tfjs_1.GatherNd, opAttrs, [params, indices]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.d.ts new file mode 100644 index 000000000..c5cc97f31 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const gatherV2Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.js new file mode 100644 index 000000000..4ed5969b4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GatherV2.js @@ -0,0 +1,41 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.gatherV2Config = { + kernelName: tfjs_1.GatherV2, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, x = _a.x, indices = _a.indices; + var backend = args.backend; + var _b = args.attrs, axis = _b.axis, batchDims = _b.batchDims; + // validate the inputs + tfjs_1.backend_util.segment_util.collectGatherOpShapeInfo(x, indices, axis, batchDims); + var axisTensor = tfjs_1.scalar(axis, 'int32'); + var opAttrs = [ + { name: 'batch_dims', type: backend.binding.TF_ATTR_INT, value: batchDims }, + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tparams', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', indices.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Taxis', 'int32') + ]; + var res = backend.executeSingleOutput(tfjs_1.GatherV2, opAttrs, [x, indices, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.d.ts new file mode 100644 index 000000000..8a1df7103 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const greaterConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.js new file mode 100644 index 000000000..6bef0d177 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Greater.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.greaterConfig = { + kernelName: tfjs_1.Greater, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.Greater, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.d.ts new file mode 100644 index 000000000..26f7798ef --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const greaterEqualConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.js new file mode 100644 index 000000000..476aee8b0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/GreaterEqual.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.greaterEqualConfig = { + kernelName: tfjs_1.GreaterEqual, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.GreaterEqual, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.d.ts new file mode 100644 index 000000000..d6a8a4764 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const IFFTConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.js new file mode 100644 index 000000000..982aeb393 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IFFT.js @@ -0,0 +1,31 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +// tslint:disable-next-line: variable-name +exports.IFFTConfig = { + kernelName: tfjs_1.IFFT, + backendName: 'tensorflow', + kernelFunc: function (args) { + var input = args.inputs.input; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tcomplex', input.dtype)]; + return backend.executeSingleOutput(tfjs_1.IFFT, opAttrs, [input]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.d.ts new file mode 100644 index 000000000..1dc8e921f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const identityConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.js new file mode 100644 index 000000000..3ba359c62 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Identity.js @@ -0,0 +1,29 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.identityConfig = { + kernelName: tfjs_1.Identity, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + // Backend needs to track refCount for the dataId for identity op + args.backend.incRef(x.dataId); + return { dataId: x.dataId, shape: x.shape, dtype: x.dtype }; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.d.ts new file mode 100644 index 000000000..c3b0f5c5f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const imagConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.js new file mode 100644 index 000000000..b7e71c623 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Imag.js @@ -0,0 +1,41 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.imagConfig = { + kernelName: tfjs_1.Imag, + backendName: 'tensorflow', + kernelFunc: function (args) { + var input = args.inputs.input; + var backend = args.backend; + var opAttrs = [ + { + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_COMPLEX64 + }, + { + name: 'Tout', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_FLOAT + } + ]; + var inputs = [input]; + return backend.executeSingleOutput(tfjs_1.Imag, opAttrs, inputs); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.d.ts new file mode 100644 index 000000000..c3c56256e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const isFiniteConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.js new file mode 100644 index 000000000..65a73a176 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsFinite.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.isFiniteConfig = { + kernelName: tfjs_1.IsFinite, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.IsFinite, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.d.ts new file mode 100644 index 000000000..5d45cdd99 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const isInfConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.js new file mode 100644 index 000000000..36bdf6b25 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsInf.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.isInfConfig = { + kernelName: tfjs_1.IsInf, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.IsInf, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.d.ts new file mode 100644 index 000000000..d2fb05a24 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const isNanConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.js new file mode 100644 index 000000000..75ac69c7b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/IsNan.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.isNanConfig = { + kernelName: tfjs_1.IsNan, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.IsNan, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.d.ts new file mode 100644 index 000000000..7934d16ea --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const LRNConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.js new file mode 100644 index 000000000..7547e6390 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRN.js @@ -0,0 +1,42 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +// tslint:disable-next-line: variable-name +exports.LRNConfig = { + kernelName: tfjs_1.LRN, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, depthRadius = _a.depthRadius, bias = _a.bias, alpha = _a.alpha, beta = _a.beta; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + { + name: 'depth_radius', + type: backend.binding.TF_ATTR_INT, + value: depthRadius + }, + { name: 'bias', type: backend.binding.TF_ATTR_FLOAT, value: bias }, + { name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha }, + { name: 'beta', type: backend.binding.TF_ATTR_FLOAT, value: beta }, + ]; + return backend.executeSingleOutput(tfjs_1.LRN, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.d.ts new file mode 100644 index 000000000..1e9425877 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const LRNGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.js new file mode 100644 index 000000000..b6a86c0f9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LRNGrad.js @@ -0,0 +1,42 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +// tslint:disable-next-line: variable-name +exports.LRNGradConfig = { + kernelName: tfjs_1.LRNGrad, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, x = _a.x, y = _a.y, dy = _a.dy; + var backend = args.backend; + var _b = args.attrs, depthRadius = _b.depthRadius, bias = _b.bias, alpha = _b.alpha, beta = _b.beta; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', dy.dtype), + { + name: 'depth_radius', + type: backend.binding.TF_ATTR_INT, + value: depthRadius + }, + { name: 'bias', type: backend.binding.TF_ATTR_FLOAT, value: bias }, + { name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha }, + { name: 'beta', type: backend.binding.TF_ATTR_FLOAT, value: beta }, + ]; + return backend.executeSingleOutput(tfjs_1.LRNGrad, opAttrs, [dy, x, y]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.d.ts new file mode 100644 index 000000000..4dd598f0a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const leakyReluConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.js new file mode 100644 index 000000000..eccf79ab2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LeakyRelu.js @@ -0,0 +1,36 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.leakyReluConfig = { + kernelName: tfjs_1.LeakyRelu, + backendName: 'tensorflow', + kernelFunc: function (args) { + var inputs = args.inputs; + var attrs = args.attrs; + var backend = args.backend; + var x = inputs.x; + var alpha = attrs.alpha; + var opAttrs = [ + { name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha }, + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype) + ]; + return backend.executeSingleOutput(tfjs_1.LeakyRelu, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.d.ts new file mode 100644 index 000000000..04f834593 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const lessConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.js new file mode 100644 index 000000000..95a42d555 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Less.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.lessConfig = { + kernelName: tfjs_1.Less, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.Less, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.d.ts new file mode 100644 index 000000000..6a0a3aa2e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const lessEqualConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.js new file mode 100644 index 000000000..a9e12a09c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LessEqual.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.lessEqualConfig = { + kernelName: tfjs_1.LessEqual, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.LessEqual, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.d.ts new file mode 100644 index 000000000..8e423b256 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const linSpaceConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.js new file mode 100644 index 000000000..c467c30e9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LinSpace.js @@ -0,0 +1,38 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.linSpaceConfig = { + kernelName: tfjs_1.LinSpace, + backendName: 'tensorflow', + kernelFunc: function (args) { + var backend = args.backend; + var _a = args.attrs, start = _a.start, stop = _a.stop, num = _a.num; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', 'float32'), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32') + ]; + return tfjs_1.tidy(function () { + var inputs = [ + tfjs_1.scalar(start, 'float32'), tfjs_1.scalar(stop, 'float32'), tfjs_1.scalar(num, 'int32') + ]; + return backend.executeSingleOutput(tfjs_1.LinSpace, opAttrs, inputs); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.d.ts new file mode 100644 index 000000000..fd3a921ad --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const logConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.js new file mode 100644 index 000000000..d9efecb70 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.logConfig = { + kernelName: tfjs_1.Log, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Log, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.d.ts new file mode 100644 index 000000000..38cbae1a8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const log1pConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.js new file mode 100644 index 000000000..b72381262 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Log1p.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.log1pConfig = { + kernelName: tfjs_1.Log1p, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Log1p, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.d.ts new file mode 100644 index 000000000..9522780c2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const logicalAndConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.js new file mode 100644 index 000000000..c0005c10c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalAnd.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.logicalAndConfig = { + kernelName: tfjs_1.LogicalAnd, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + return backend.executeSingleOutput(tfjs_1.LogicalAnd, [], [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.d.ts new file mode 100644 index 000000000..678f95132 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const logicalNotConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.js new file mode 100644 index 000000000..cfddbe25e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalNot.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.logicalNotConfig = { + kernelName: tfjs_1.LogicalNot, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleOutput(tfjs_1.LogicalNot, [], [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.d.ts new file mode 100644 index 000000000..9ea4f6c5a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const logicalOrConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.js new file mode 100644 index 000000000..f918b8cb9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/LogicalOr.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.logicalOrConfig = { + kernelName: tfjs_1.LogicalOr, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + return backend.executeSingleOutput(tfjs_1.LogicalOr, [], [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.d.ts new file mode 100644 index 000000000..be6cc3267 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const maxConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.js new file mode 100644 index 000000000..2e1aea1bb --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Max.js @@ -0,0 +1,33 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.maxConfig = { + kernelName: tfjs_1.Max, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, reductionIndices = _a.reductionIndices, keepDims = _a.keepDims; + var axes = tfjs_1.util.parseAxisParam(reductionIndices, x.shape); + var axesTensor = tfjs_1.tensor1d(axes, 'int32'); + var res = backend.executeSingleOutput(tfjs_1.Max, backend.createReductionOpAttrs(x, keepDims), [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.d.ts new file mode 100644 index 000000000..e6a7d5d0e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const maxPoolConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.js new file mode 100644 index 000000000..c9d653ca7 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool.js @@ -0,0 +1,49 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.maxPoolConfig = { + kernelName: tfjs_1.MaxPool, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, filterSize = _a.filterSize, strides = _a.strides, pad = _a.pad, dimRoundingMode = _a.dimRoundingMode; + var convInfo = tfjs_1.backend_util.computePool2DInfo(x.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode); + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error("TF Backend supports only 'valid' and 'same' padding " + + ("while padding was " + convInfo.padInfo.type)); + } + var ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; + var $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + var padding = convInfo.padInfo.type; + var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, + { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, + { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + } + ]; + return backend.executeSingleOutput(tfjs_1.MaxPool, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.d.ts new file mode 100644 index 000000000..278b1cc47 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const maxPool3DConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.js new file mode 100644 index 000000000..a2483b001 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3D.js @@ -0,0 +1,53 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.maxPool3DConfig = { + kernelName: tfjs_1.MaxPool3D, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, filterSize = _a.filterSize, strides = _a.strides, pad = _a.pad, dataFormat = _a.dataFormat, dimRoundingMode = _a.dimRoundingMode; + var convInfo = tfjs_1.backend_util.computePool3DInfo(x.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode, dataFormat); + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error("TF Backend supports only 'valid' and 'same' padding " + + ("while padding was " + convInfo.padInfo.type)); + } + var ksize = [ + 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 + ]; + var $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + var padding = convInfo.padInfo.type; + var $dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, + { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, + { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: $dataFormat + } + ]; + return backend.executeSingleOutput(tfjs_1.MaxPool3D, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.d.ts new file mode 100644 index 000000000..54e7a34a1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const maxPool3DGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.js new file mode 100644 index 000000000..aec0ca281 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPool3DGrad.js @@ -0,0 +1,54 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.maxPool3DGradConfig = { + kernelName: tfjs_1.MaxPool3DGrad, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, dy = _a.dy, input = _a.input, output = _a.output; + var backend = args.backend; + var _b = args.attrs, filterSize = _b.filterSize, strides = _b.strides, pad = _b.pad, dimRoundingMode = _b.dimRoundingMode; + var convInfo = tfjs_1.backend_util.computePool3DInfo(input.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode); + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error("TF Backend supports only 'valid' and 'same' padding " + + ("while padding type was " + convInfo.padInfo.type)); + } + var ksize = [ + 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 + ]; + var $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + var padding = convInfo.padInfo.type; + var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', input.dtype), + { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, + { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, + { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + ]; + return backend.executeSingleOutput(tfjs_1.MaxPool3DGrad, opAttrs, [input, output, dy]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.d.ts new file mode 100644 index 000000000..8324ed935 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const maxPoolGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.js new file mode 100644 index 000000000..c6d77cca5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MaxPoolGrad.js @@ -0,0 +1,50 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.maxPoolGradConfig = { + kernelName: tfjs_1.MaxPoolGrad, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, dy = _a.dy, input = _a.input, output = _a.output; + var backend = args.backend; + var _b = args.attrs, filterSize = _b.filterSize, strides = _b.strides, pad = _b.pad, dimRoundingMode = _b.dimRoundingMode; + var convInfo = tfjs_1.backend_util.computePool2DInfo(input.shape, filterSize, strides, 1 /* dilations */, pad, dimRoundingMode); + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error("TF Backend supports only 'valid' and 'same' padding " + + ("while padding type was " + convInfo.padInfo.type)); + } + var ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; + var $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + var padding = convInfo.padInfo.type; + var dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', input.dtype), + { name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize }, + { name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides }, + { name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding }, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + ]; + return backend.executeSingleOutput(tfjs_1.MaxPoolGrad, opAttrs, [input, output, dy]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.d.ts new file mode 100644 index 000000000..23a653d94 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const maximumConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.js new file mode 100644 index 000000000..cc1593f6f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Maximum.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.maximumConfig = { + kernelName: tfjs_1.Maximum, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.Maximum, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.d.ts new file mode 100644 index 000000000..517d22542 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const meanConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.js new file mode 100644 index 000000000..4d8028673 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mean.js @@ -0,0 +1,36 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.meanConfig = { + kernelName: tfjs_1.Mean, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; + var axes = tfjs_1.util.parseAxisParam(axis, x.shape); + var axesTensor = tfjs_1.tensor1d(axes, 'int32'); + // Cast to float32 to match existing tfjs implementation/tests. + var asFloat32 = tfjs_1.cast(x, 'float32'); + var res = backend.executeSingleOutput(tfjs_1.Mean, backend.createReductionOpAttrs(x, keepDims), [asFloat32, axesTensor]); + asFloat32.dispose(); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.d.ts new file mode 100644 index 000000000..c25780c57 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const minConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.js new file mode 100644 index 000000000..eb27a4c83 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Min.js @@ -0,0 +1,33 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.minConfig = { + kernelName: tfjs_1.Min, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; + var axes = tfjs_1.util.parseAxisParam(axis, x.shape); + var axesTensor = tfjs_1.tensor1d(axes, 'int32'); + var res = backend.executeSingleOutput(tfjs_1.Min, backend.createReductionOpAttrs(x, keepDims), [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.d.ts new file mode 100644 index 000000000..c66a2992a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const minimumConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.js new file mode 100644 index 000000000..87423ea8a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Minimum.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.minimumConfig = { + kernelName: tfjs_1.Minimum, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.Minimum, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.d.ts new file mode 100644 index 000000000..f08dd0d3f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const mirrorPadConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.js new file mode 100644 index 000000000..9ea7f9561 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/MirrorPad.js @@ -0,0 +1,42 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.mirrorPadConfig = { + kernelName: tfjs_1.MirrorPad, + backendName: 'tensorflow', + kernelFunc: function (_a) { + var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; + var x = inputs.x; + var _b = attrs, paddings = _b.paddings, mode = _b.mode; + var nodeBackend = backend; + var paddingsTensor = tfjs_1.tensor2d(paddings, [paddings.length, 2], 'int32'); + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype), { + name: 'mode', + type: nodeBackend.binding.TF_ATTR_STRING, + value: mode.toUpperCase() + } + ]; + var output = nodeBackend.executeSingleOutput('MirrorPad', opAttrs, [x, paddingsTensor]); + paddingsTensor.dispose(); + return output; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.d.ts new file mode 100644 index 000000000..44e932168 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const modConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.js new file mode 100644 index 000000000..5697340e9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Mod.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.modConfig = { + kernelName: tfjs_1.Mod, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', a.dtype)]; + return backend.executeSingleOutput('FloorMod', opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.d.ts new file mode 100644 index 000000000..04efe4e1e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const multinomialConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.js new file mode 100644 index 000000000..27a5d3e10 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multinomial.js @@ -0,0 +1,43 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.multinomialConfig = { + kernelName: tfjs_1.Multinomial, + backendName: 'tensorflow', + kernelFunc: function (args) { + var logits = args.inputs.logits; + var backend = args.backend; + var _a = args.attrs, numSamples = _a.numSamples, seed = _a.seed, normalized = _a.normalized; + if (normalized) { + throw new Error('TF Node backend does not support normalized logits ' + + 'passed to multinomial'); + } + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', logits.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('output_dtype', 'int32'), + { name: 'seed', type: backend.binding.TF_ATTR_INT, value: seed }, + { name: 'seed2', type: backend.binding.TF_ATTR_INT, value: seed * seed }, + ]; + var numSamplesTensor = tfjs_1.scalar(numSamples, 'int32'); + var res = backend.executeSingleOutput(tfjs_1.Multinomial, opAttrs, [logits, numSamplesTensor]); + numSamplesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.d.ts new file mode 100644 index 000000000..c185cf567 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const multiplyConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.js new file mode 100644 index 000000000..11b41c36e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Multiply.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.multiplyConfig = { + kernelName: tfjs_1.Multiply, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput('Mul', opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.d.ts new file mode 100644 index 000000000..e4a4f106f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const negConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.js new file mode 100644 index 000000000..2bebc8e8a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Neg.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.negConfig = { + kernelName: tfjs_1.Neg, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Neg, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.d.ts new file mode 100644 index 000000000..358e88523 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const nonMaxSuppressionV3Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.js new file mode 100644 index 000000000..d33b8f4c5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV3.js @@ -0,0 +1,41 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.nonMaxSuppressionV3Config = { + kernelName: tfjs_1.NonMaxSuppressionV3, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, boxes = _a.boxes, scores = _a.scores; + var backend = args.backend; + var _b = args.attrs, maxOutputSize = _b.maxOutputSize, iouThreshold = _b.iouThreshold, scoreThreshold = _b.scoreThreshold; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', boxes.dtype)]; + var maxOutputSizeTensor = tfjs_1.scalar(maxOutputSize, 'int32'); + var iouThresholdTensor = tfjs_1.scalar(iouThreshold); + var scoreThresholdTensor = tfjs_1.scalar(scoreThreshold); + var res = backend.executeSingleOutput(tfjs_1.NonMaxSuppressionV3, opAttrs, [ + boxes, scores, maxOutputSizeTensor, iouThresholdTensor, + scoreThresholdTensor + ]); + maxOutputSizeTensor.dispose(); + iouThresholdTensor.dispose(); + scoreThresholdTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.d.ts new file mode 100644 index 000000000..9b2d2211c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2019 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const nonMaxSuppressionV4Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.js new file mode 100644 index 000000000..d89722f5f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV4.js @@ -0,0 +1,50 @@ +"use strict"; +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +// TODO(nsthorat, dsmilkov): Remove dependency on tensors, use dataId. +exports.nonMaxSuppressionV4Config = { + kernelName: tfjs_1.NonMaxSuppressionV4, + backendName: 'tensorflow', + kernelFunc: function (_a) { + var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; + var _b = inputs, boxes = _b.boxes, scores = _b.scores; + var _c = attrs, maxOutputSize = _c.maxOutputSize, iouThreshold = _c.iouThreshold, scoreThreshold = _c.scoreThreshold, padToMaxOutputSize = _c.padToMaxOutputSize; + var maxOutputSizeTensor = tfjs_1.scalar(maxOutputSize, 'int32'); + var iouThresholdTensor = tfjs_1.scalar(iouThreshold, 'float32'); + var scoreThresholdTensor = tfjs_1.scalar(scoreThreshold, 'float32'); + var nodeBackend = backend; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', boxes.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T_threshold', 'float32'), { + name: 'pad_to_max_output_size', + type: nodeBackend.binding.TF_ATTR_BOOL, + value: padToMaxOutputSize + } + ]; + var _d = nodeBackend.executeMultipleOutputs('NonMaxSuppressionV4', opAttrs, [ + boxes, scores, maxOutputSizeTensor, + iouThresholdTensor, scoreThresholdTensor + ], 2), selectedIndices = _d[0], validOutputs = _d[1]; + maxOutputSizeTensor.dispose(); + iouThresholdTensor.dispose(); + scoreThresholdTensor.dispose(); + return [selectedIndices, validOutputs]; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.d.ts new file mode 100644 index 000000000..e347b3ab0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2019 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const nonMaxSuppressionV5Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.js new file mode 100644 index 000000000..23c3e9f97 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NonMaxSuppressionV5.js @@ -0,0 +1,46 @@ +"use strict"; +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +// TODO(nsthorat, dsmilkov): Remove dependency on tensors, use dataId. +exports.nonMaxSuppressionV5Config = { + kernelName: 'NonMaxSuppressionV5', + backendName: 'tensorflow', + kernelFunc: function (_a) { + var inputs = _a.inputs, backend = _a.backend, attrs = _a.attrs; + var _b = inputs, boxes = _b.boxes, scores = _b.scores; + var _c = attrs, maxOutputSize = _c.maxOutputSize, iouThreshold = _c.iouThreshold, scoreThreshold = _c.scoreThreshold, softNmsSigma = _c.softNmsSigma; + var maxOutputSizeTensor = tfjs_1.scalar(maxOutputSize, 'int32'); + var iouThresholdTensor = tfjs_1.scalar(iouThreshold); + var scoreThresholdTensor = tfjs_1.scalar(scoreThreshold); + var softNmsSigmaTensor = tfjs_1.scalar(softNmsSigma); + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', boxes.dtype)]; + var nodeBackend = backend; + var _d = nodeBackend.executeMultipleOutputs('NonMaxSuppressionV5', opAttrs, [ + boxes, scores, maxOutputSizeTensor, + iouThresholdTensor, scoreThresholdTensor, softNmsSigmaTensor + ], 3), selectedIndices = _d[0], selectedScores = _d[1], validOutputs = _d[2]; + maxOutputSizeTensor.dispose(); + iouThresholdTensor.dispose(); + scoreThresholdTensor.dispose(); + softNmsSigmaTensor.dispose(); + validOutputs.dispose(); + return [selectedIndices, selectedScores]; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.d.ts new file mode 100644 index 000000000..e9148a15c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const notEqualConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.js new file mode 100644 index 000000000..eece111db --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/NotEqual.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.notEqualConfig = { + kernelName: tfjs_1.NotEqual, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.NotEqual, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.d.ts new file mode 100644 index 000000000..cb59c1d26 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const oneHotConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.js new file mode 100644 index 000000000..4b45622f2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OneHot.js @@ -0,0 +1,42 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.oneHotConfig = { + kernelName: tfjs_1.OneHot, + backendName: 'tensorflow', + kernelFunc: function (args) { + var indices = args.inputs.indices; + var backend = args.backend; + var _a = args.attrs, depth = _a.depth, onValue = _a.onValue, offValue = _a.offValue; + var depthTensor = tfjs_1.scalar(depth, 'int32'); + var onValueTensor = tfjs_1.scalar(onValue, 'int32'); + var offValueTensor = tfjs_1.scalar(offValue, 'int32'); + var opAttrs = [ + { name: 'axis', type: backend.binding.TF_ATTR_INT, value: -1 }, + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', indices.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('TI', indices.dtype) + ]; + var res = backend.executeSingleOutput(tfjs_1.OneHot, opAttrs, [indices, depthTensor, onValueTensor, offValueTensor]); + depthTensor.dispose(); + onValueTensor.dispose(); + offValueTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.d.ts new file mode 100644 index 000000000..01d2e7c35 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const onesLikeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.js new file mode 100644 index 000000000..ae5cd7152 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/OnesLike.js @@ -0,0 +1,33 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.onesLikeConfig = { + kernelName: tfjs_1.OnesLike, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var opAttrs = [{ + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.getDTypeInteger(x.dtype) + }]; + return backend.executeSingleOutput(tfjs_1.OnesLike, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.d.ts new file mode 100644 index 000000000..1c53c4b6d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.d.ts @@ -0,0 +1,24 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig, PackAttrs, PackInputs, TensorInfo } from '@tensorflow/tfjs'; +import { NodeJSKernelBackend } from '../nodejs_kernel_backend'; +export declare function pack(args: { + inputs: PackInputs; + backend: NodeJSKernelBackend; + attrs: PackAttrs; +}): TensorInfo; +export declare const packConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.js new file mode 100644 index 000000000..a163b9f2a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pack.js @@ -0,0 +1,37 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +function pack(args) { + var inputs = args.inputs, backend = args.backend, attrs = args.attrs; + var axis = attrs.axis; + var opAttrs = [ + { name: 'N', type: backend.binding.TF_ATTR_INT, value: inputs.length }, + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', inputs), + { name: 'axis', type: backend.binding.TF_ATTR_INT, value: axis } + ]; + var res = backend.executeSingleOutput(tfjs_1.Pack, opAttrs, inputs); + return res; +} +exports.pack = pack; +exports.packConfig = { + kernelName: tfjs_1.Pack, + backendName: 'tensorflow', + kernelFunc: pack +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.d.ts new file mode 100644 index 000000000..e297ae2cc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const padV2Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.js new file mode 100644 index 000000000..3bdef6e18 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/PadV2.js @@ -0,0 +1,40 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.padV2Config = { + kernelName: tfjs_1.PadV2, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, paddings = _a.paddings, constantValue = _a.constantValue; + // Bind tensor values + var paddingsTensor = tfjs_1.tensor2d(paddings, [paddings.length, 2], 'int32'); + var constantTensor = tfjs_1.scalar(constantValue, x.dtype); + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype) + ]; + var res = backend.executeSingleOutput(tfjs_1.PadV2, opAttrs, [x, paddingsTensor, constantTensor]); + paddingsTensor.dispose(); + constantTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.d.ts new file mode 100644 index 000000000..5f728e2e6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const powConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.js new file mode 100644 index 000000000..deabdc582 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Pow.js @@ -0,0 +1,33 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.powConfig = { + kernelName: tfjs_1.Pow, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var dtype = tfjs_1.backend_util.upcastType(a.dtype, b.dtype); + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', dtype)]; + return tfjs_1.tidy(function () { + return backend.executeSingleOutput(tfjs_1.Pow, opAttrs, [tfjs_1.cast(a, dtype), tfjs_1.cast(b, dtype)]); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.d.ts new file mode 100644 index 000000000..c1fbeab78 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const preluConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.js new file mode 100644 index 000000000..ce674b22f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prelu.js @@ -0,0 +1,33 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.preluConfig = { + kernelName: tfjs_1.Prelu, + backendName: 'tensorflow', + kernelFunc: function (args) { + var inputs = args.inputs; + var x = inputs.x; + var alpha = inputs.alpha; + return tfjs_1.tidy(function () { + var pos = tfjs_1.relu(x); + var neg = alpha.mul(x.sub(tfjs_1.abs(x))).mul(0.5); + return pos.add(neg); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.d.ts new file mode 100644 index 000000000..aae550640 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const prodConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.js new file mode 100644 index 000000000..572f4f0fe --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Prod.js @@ -0,0 +1,39 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.prodConfig = { + kernelName: tfjs_1.Prod, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; + var axes = tfjs_1.util.parseAxisParam(axis, x.shape); + var axesTensor = tfjs_1.tensor1d(axes, 'int32'); + var opAttrs = [ + { name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims }, + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32') + ]; + var res = backend.executeSingleOutput(tfjs_1.Prod, opAttrs, [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.d.ts new file mode 100644 index 000000000..ea84dc4dc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const rangeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.js new file mode 100644 index 000000000..c079a9a02 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Range.js @@ -0,0 +1,53 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.rangeConfig = { + kernelName: tfjs_1.Range, + backendName: 'tensorflow', + kernelFunc: function (args) { + var backend = args.backend; + var _a = args.attrs, start = _a.start, stop = _a.stop, dtype = _a.dtype; + var step = args.attrs.step; + // TensorFlow.js specific allowances + var sameStartStop = start === stop; + var increasingRangeNegativeStep = start < stop && step < 0; + var decreasingRangePositiveStep = stop < start && step > 1; + if (sameStartStop || increasingRangeNegativeStep || + decreasingRangePositiveStep) { + return tfjs_1.zeros([0], dtype); + } + if (stop < start && step === 1) { + // Auto adjust the step's sign if it hasn't been set + // (or was set to 1) + step = -1; + } + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', dtype)]; + var startTensor = tfjs_1.scalar(start); + var stopTensor = tfjs_1.scalar(stop); + var stepTensor = tfjs_1.scalar(step); + var res = backend.executeSingleOutput(tfjs_1.Range, opAttrs, [startTensor, stopTensor, stepTensor]); + var castedRes = res.cast(dtype); + startTensor.dispose(); + stopTensor.dispose(); + stepTensor.dispose(); + res.dispose(); + return castedRes; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.d.ts new file mode 100644 index 000000000..bfad23440 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const realConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.js new file mode 100644 index 000000000..b7b8c7b94 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Real.js @@ -0,0 +1,37 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.realConfig = { + kernelName: tfjs_1.Real, + backendName: 'tensorflow', + kernelFunc: function (args) { + var input = args.inputs.input; + var backend = args.backend; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', input), { + name: 'Tout', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_FLOAT + } + ]; + var inputs = [input]; + return backend.executeSingleOutput(tfjs_1.Real, opAttrs, inputs); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.d.ts new file mode 100644 index 000000000..0d47935b3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const realDivConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.js new file mode 100644 index 000000000..4406042c4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/RealDiv.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.realDivConfig = { + kernelName: tfjs_1.RealDiv, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.RealDiv, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.d.ts new file mode 100644 index 000000000..f79756b05 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const reciprocalConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.js new file mode 100644 index 000000000..40279f140 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reciprocal.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.reciprocalConfig = { + kernelName: tfjs_1.Reciprocal, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Reciprocal, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.d.ts new file mode 100644 index 000000000..1cd331fd2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const reluConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.js new file mode 100644 index 000000000..26fb3587e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.reluConfig = { + kernelName: tfjs_1.Relu, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Relu, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.d.ts new file mode 100644 index 000000000..8260e07a9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const relu6Config: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.js new file mode 100644 index 000000000..5fbce31d2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Relu6.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.relu6Config = { + kernelName: tfjs_1.Relu6, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Relu6, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.d.ts new file mode 100644 index 000000000..075fbc4f7 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const reshapeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.js new file mode 100644 index 000000000..0d77bf558 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reshape.js @@ -0,0 +1,37 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.reshapeConfig = { + kernelName: tfjs_1.Reshape, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var shape = args.attrs.shape; + var shapeTensor = tfjs_1.tensor1d(shape, 'int32'); + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tshape', shapeTensor.dtype) + ]; + var res = backend.executeSingleOutput(tfjs_1.Reshape, opAttrs, [x, shapeTensor]); + shapeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.d.ts new file mode 100644 index 000000000..cf007f0f4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const resizeBilinearConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.js new file mode 100644 index 000000000..333fbf29a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinear.js @@ -0,0 +1,47 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.resizeBilinearConfig = { + kernelName: tfjs_1.ResizeBilinear, + backendName: 'tensorflow', + kernelFunc: function (args) { + var images = args.inputs.images; + var backend = args.backend; + var _a = args.attrs, alignCorners = _a.alignCorners, halfPixelCenters = _a.halfPixelCenters, size = _a.size; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', images.dtype), + { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + }, + { + name: 'half_pixel_centers', + type: backend.binding.TF_ATTR_BOOL, + value: halfPixelCenters + }, + ]; + var newHeight = size[0], newWidth = size[1]; + var sizeTensor = tfjs_1.tensor1d([newHeight, newWidth], 'int32'); + var ret = backend.executeSingleOutput(tfjs_1.ResizeBilinear, opAttrs, [images, sizeTensor]); + sizeTensor.dispose(); + return ret; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.d.ts new file mode 100644 index 000000000..4cf98fb46 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const resizeBilinearGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.js new file mode 100644 index 000000000..2c305847a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeBilinearGrad.js @@ -0,0 +1,37 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.resizeBilinearGradConfig = { + kernelName: tfjs_1.ResizeBilinearGrad, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, images = _a.images, dy = _a.dy; + var backend = args.backend; + var alignCorners = args.attrs.alignCorners; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', images.dtype), { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + } + ]; + return backend.executeSingleOutput(tfjs_1.ResizeBilinearGrad, opAttrs, [dy, images]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.d.ts new file mode 100644 index 000000000..24ca2a34e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const resizeNearestNeighborConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.js new file mode 100644 index 000000000..a5f55007c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighbor.js @@ -0,0 +1,47 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.resizeNearestNeighborConfig = { + kernelName: tfjs_1.ResizeNearestNeighbor, + backendName: 'tensorflow', + kernelFunc: function (args) { + var images = args.inputs.images; + var backend = args.backend; + var _a = args.attrs, alignCorners = _a.alignCorners, halfPixelCenters = _a.halfPixelCenters, size = _a.size; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', images.dtype), + { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + }, + { + name: 'half_pixel_centers', + type: backend.binding.TF_ATTR_BOOL, + value: halfPixelCenters + }, + ]; + var newHeight = size[0], newWidth = size[1]; + var sizeTensor = tfjs_1.tensor1d([newHeight, newWidth], 'int32'); + var res = backend.executeSingleOutput(tfjs_1.ResizeNearestNeighbor, opAttrs, [images, sizeTensor]); + sizeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.d.ts new file mode 100644 index 000000000..63c939d83 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const resizeNearestNeighborGradConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.js new file mode 100644 index 000000000..0f67c4ba9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ResizeNearestNeighborGrad.js @@ -0,0 +1,41 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.resizeNearestNeighborGradConfig = { + kernelName: tfjs_1.ResizeNearestNeighborGrad, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, images = _a.images, dy = _a.dy; + var backend = args.backend; + var alignCorners = args.attrs.alignCorners; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', images.dtype), { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + } + ]; + var _b = images.shape, origHeight = _b[1], origWidth = _b[2]; + var sizeTensor = tfjs_1.tensor1d([origHeight, origWidth], 'int32'); + var res = backend.executeSingleOutput(tfjs_1.ResizeNearestNeighborGrad, opAttrs, [dy, sizeTensor]); + sizeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.d.ts new file mode 100644 index 000000000..8b8b8fe61 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const reverseConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.js new file mode 100644 index 000000000..a03d18b49 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Reverse.js @@ -0,0 +1,38 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.reverseConfig = { + kernelName: tfjs_1.Reverse, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var dims = args.attrs.dims; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tidx', 'int32'), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype) + ]; + var axes = tfjs_1.util.parseAxisParam(dims, x.shape); + var axisTensor = tfjs_1.tensor1d(axes, 'int32'); + var res = backend.executeSingleOutput('ReverseV2', opAttrs, [x, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.d.ts new file mode 100644 index 000000000..c09ce60d3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const roundConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.js new file mode 100644 index 000000000..70964efd8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Round.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.roundConfig = { + kernelName: tfjs_1.Round, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Round, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.d.ts new file mode 100644 index 000000000..d7a6a18e1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const rsqrtConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.js new file mode 100644 index 000000000..70211b3c8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Rsqrt.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.rsqrtConfig = { + kernelName: tfjs_1.Rsqrt, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Rsqrt, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.d.ts new file mode 100644 index 000000000..991cdec30 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const scatterNdConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.js new file mode 100644 index 000000000..123df0a51 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ScatterNd.js @@ -0,0 +1,37 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.scatterNdConfig = { + kernelName: tfjs_1.ScatterNd, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, indices = _a.indices, updates = _a.updates; + var backend = args.backend; + var shape = args.attrs.shape; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', updates.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', 'int32') + ]; + var shapeTensor = tfjs_1.tensor1d(shape, 'int32'); + var ret = backend.executeSingleOutput(tfjs_1.ScatterNd, opAttrs, [indices, updates, shapeTensor]); + shapeTensor.dispose(); + return ret; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.d.ts new file mode 100644 index 000000000..37ce6635e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const selectConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.js new file mode 100644 index 000000000..424392732 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Select.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.selectConfig = { + kernelName: tfjs_1.Select, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, condition = _a.condition, t = _a.t, e = _a.e; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(t.dtype, e.dtype))]; + return backend.executeSingleOutput(tfjs_1.Select, opAttrs, [condition, t, e]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.d.ts new file mode 100644 index 000000000..b026150ee --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const seluConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.js new file mode 100644 index 000000000..48289f9b8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Selu.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.seluConfig = { + kernelName: tfjs_1.Selu, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Selu, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.d.ts new file mode 100644 index 000000000..3ed66e9af --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const sigmoidConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.js new file mode 100644 index 000000000..47d213a97 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sigmoid.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.sigmoidConfig = { + kernelName: tfjs_1.Sigmoid, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Sigmoid, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.d.ts new file mode 100644 index 000000000..45ec8a935 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const signConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.js new file mode 100644 index 000000000..c3d7f8378 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sign.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.signConfig = { + kernelName: tfjs_1.Sign, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Sign, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.d.ts new file mode 100644 index 000000000..e7a3c77ec --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const sinConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.js new file mode 100644 index 000000000..e15623658 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sin.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.sinConfig = { + kernelName: tfjs_1.Sin, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Sin, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.d.ts new file mode 100644 index 000000000..f297afd86 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const sinhConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.js new file mode 100644 index 000000000..4e4325fb4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sinh.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.sinhConfig = { + kernelName: tfjs_1.Sinh, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Sinh, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.d.ts new file mode 100644 index 000000000..39f341a9a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const sliceConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.js new file mode 100644 index 000000000..b91407d79 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Slice.js @@ -0,0 +1,41 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.sliceConfig = { + kernelName: tfjs_1.Slice, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, begin = _a.begin, size = _a.size; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Index', 'int32') + ]; + // Bind tensor values + var _b = tfjs_1.backend_util.slice_util.parseSliceParams(x, begin, size), begin_ = _b[0], size_ = _b[1]; + var beginTensor = tfjs_1.tensor1d(begin_, 'int32'); + var sizeTensor = tfjs_1.tensor1d(size_, 'int32'); + var res = backend.executeSingleOutput(tfjs_1.Slice, opAttrs, [x, beginTensor, sizeTensor]); + beginTensor.dispose(); + sizeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.d.ts new file mode 100644 index 000000000..37b8b3408 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const softmaxConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.js new file mode 100644 index 000000000..63ab9d9f2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softmax.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.softmaxConfig = { + kernelName: 'Softmax', + backendName: 'tensorflow', + kernelFunc: function (_a) { + var inputs = _a.inputs, backend = _a.backend; + var logits = inputs.logits; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', logits.dtype)]; + var nodeBackend = backend; + return nodeBackend.executeSingleOutput('Softmax', opAttrs, [logits]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.d.ts new file mode 100644 index 000000000..6fe82a069 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const softplusConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.js new file mode 100644 index 000000000..0996422c5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Softplus.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.softplusConfig = { + kernelName: tfjs_1.Softplus, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Softplus, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.d.ts new file mode 100644 index 000000000..34ce1b5f8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const spaceToBatchNDConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.js new file mode 100644 index 000000000..24daa4539 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SpaceToBatchND.js @@ -0,0 +1,40 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.spaceToBatchNDConfig = { + kernelName: tfjs_1.SpaceToBatchND, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, blockShape = _a.blockShape, paddings = _a.paddings; + var blockShapeTensor = tfjs_1.tensor1d(blockShape, 'int32'); + var paddingsTensor = tfjs_1.tensor2d(paddings, [paddings.length, paddings[0].length], 'int32'); + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tblock_shape', 'int32'), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype) + ]; + var res = backend.executeSingleOutput(tfjs_1.SpaceToBatchND, opAttrs, [x, blockShapeTensor, paddingsTensor]); + blockShapeTensor.dispose(); + paddingsTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.d.ts new file mode 100644 index 000000000..96dddde53 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const sparseToDenseConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.js new file mode 100644 index 000000000..b6d5923f6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SparseToDense.js @@ -0,0 +1,42 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.sparseToDenseConfig = { + kernelName: tfjs_1.SparseToDense, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, sparseIndices = _a.sparseIndices, sparseValues = _a.sparseValues, defaultValue = _a.defaultValue; + var backend = args.backend; + var outputShape = args.attrs.outputShape; + var opAttrs = [ + { + name: 'validate_indices', + type: backend.binding.TF_ATTR_BOOL, + value: true + }, + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', sparseValues.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', sparseIndices.dtype) + ]; + var outputShapeTensor = tfjs_1.tensor1d(outputShape, 'int32'); + var res = backend.executeSingleOutput(tfjs_1.SparseToDense, opAttrs, [sparseIndices, outputShapeTensor, sparseValues, defaultValue]); + outputShapeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.d.ts new file mode 100644 index 000000000..df93fe243 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const splitVConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.js new file mode 100644 index 000000000..4756aba37 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SplitV.js @@ -0,0 +1,49 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.splitVConfig = { + kernelName: tfjs_1.SplitV, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, numOrSizeSplits = _a.numOrSizeSplits, axis = _a.axis; + var $axis = tfjs_1.util.parseAxisParam(axis, x.shape)[0]; + var splitSizes = tfjs_1.backend_util.prepareSplitSize(x, numOrSizeSplits, $axis); + var opAttrs = [ + { + name: 'num_split', + type: backend.binding.TF_ATTR_INT, + value: splitSizes.length + }, + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x), { + name: 'Tlen', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_INT32 + } + ]; + var inputs = [x]; + return tfjs_1.tidy(function () { + inputs.push(tfjs_1.tensor1d(splitSizes, 'int32')); + inputs.push(tfjs_1.scalar($axis, 'int32')); + return backend.executeMultipleOutputs(tfjs_1.SplitV, opAttrs, inputs, splitSizes.length); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.d.ts new file mode 100644 index 000000000..7927da0bc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const sqrtConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.js new file mode 100644 index 000000000..0db05727f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sqrt.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.sqrtConfig = { + kernelName: tfjs_1.Sqrt, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Sqrt, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.d.ts new file mode 100644 index 000000000..13ff3b31f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const squareConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.js new file mode 100644 index 000000000..9242ce267 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Square.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.squareConfig = { + kernelName: tfjs_1.Square, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Square, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.d.ts new file mode 100644 index 000000000..228da9e04 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const squaredDifferenceConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.js new file mode 100644 index 000000000..92896f7ff --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/SquaredDifference.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.squaredDifferenceConfig = { + kernelName: tfjs_1.SquaredDifference, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', a.dtype)]; + return backend.executeSingleOutput(tfjs_1.SquaredDifference, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.d.ts new file mode 100644 index 000000000..c1b3699fb --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const stepConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.js new file mode 100644 index 000000000..c1d004155 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Step.js @@ -0,0 +1,36 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.stepConfig = { + kernelName: tfjs_1.Step, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var alpha = args.attrs.alpha; + var dtype = x.dtype; + return tfjs_1.tidy(function () { + var nans = tfjs_1.isNaN(x); + var stepNoNans = tfjs_1.where(tfjs_1.greater(x, tfjs_1.scalar(0, dtype)), tfjs_1.ones(x.shape), tfjs_1.fill(x.shape, alpha, dtype)); + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(x.dtype, stepNoNans.dtype))]; + return backend.executeSingleOutput('Select', opAttrs, [nans, x, stepNoNans]); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.d.ts new file mode 100644 index 000000000..f9eef24cd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const stridedSliceConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.js new file mode 100644 index 000000000..64b3e19e1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/StridedSlice.js @@ -0,0 +1,100 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.stridedSliceConfig = { + kernelName: tfjs_1.StridedSlice, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, beginMask = _a.beginMask, endMask = _a.endMask, ellipsisMask = _a.ellipsisMask, newAxisMask = _a.newAxisMask, shrinkAxisMask = _a.shrinkAxisMask; + var _b = args.attrs, begin = _b.begin, end = _b.end, strides = _b.strides; + // make a copy because it may be modified in-place further down. + begin = begin.slice(); + end = end.slice(); + if (strides == null) { + strides = new Array(begin.length); + } + var ellipsisAxes = tfjs_1.backend_util.slice_util.maskToAxes(ellipsisMask); + if (ellipsisAxes.length > 1) { + throw new Error('Multiple ellipses in slice is not allowed.'); + } + if (ellipsisMask !== 0 && newAxisMask !== 0) { + throw new Error('Using both ellipsisMask and newAxisMask is not yet supported.'); + } + if (ellipsisMask !== 0 && shrinkAxisMask !== 0) { + throw new Error('Using both ellipsisMask and shrinkAxisMask is not yet supported.'); + } + return tfjs_1.tidy(function () { + var numInterpolatedAxes = x.rank - begin.length; + // Expand the dims of x based on the newAxisMask. + var expandAxes = tfjs_1.backend_util.slice_util.maskToAxes(newAxisMask); + var newShape = x.shape.slice(); + expandAxes.forEach(function (axis) { + begin[axis] = 0; + end[axis] = 1; + newShape.splice(axis, 0, 1); + }); + x = tfjs_1.reshape(x, newShape); + var _a = tfjs_1.backend_util.slice_util.getNormalizedAxes(x.shape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, beginMask, endMask, ellipsisMask), normalizedBegin = _a.begin, normalizedEnd = _a.end, normalizedStrides = _a.strides; + begin = normalizedBegin; + end = normalizedEnd; + strides = normalizedStrides; + var shrinkAxes = tfjs_1.backend_util.slice_util.maskToAxes(shrinkAxisMask); + // Adjust the ends based on the shrink mask. + shrinkAxes.forEach(function (axis) { + end[axis] = begin[axis] + 1; + strides[axis] = 1; + }); + // Figure out the output shape. + var size = tfjs_1.backend_util.slice_util.computeOutShape(begin, end, strides); + // Remove the axes based on shrinkMask. + var outShape = size.filter(function (_, axis) { return shrinkAxes.indexOf(axis) === -1; }); + var nonStrided = strides.every(function (v) { return v === 1; }); + if (nonStrided) { + return tfjs_1.reshape(tfjs_1.slice(x, begin, size), outShape); + } + var beginTensor = tfjs_1.tensor1d(begin, 'int32'); + for (var axis = 0; axis < end.length; axis++) { + // Unlike Numpy, when the strides are negative, TF C uses -n-1 instead + // of -1 as the "end" in order to include the first element. + if (strides[axis] < 0 && end[axis] === -1) { + end[axis] -= x.shape[axis]; + } + } + var endTensor = tfjs_1.tensor1d(end, 'int32'); + var stridesTensor = tfjs_1.tensor1d(strides, 'int32'); + // Because tfjs allows begin, end and strides to be of different lengths + // It has custom code (see above to handle the masking), so we do not + // pass the mask info to the tensorflow backend. + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Index', 'int32'), + { name: 'begin_mask', type: backend.binding.TF_ATTR_INT, value: 0 }, + { name: 'end_mask', type: backend.binding.TF_ATTR_INT, value: 0 }, + { name: 'ellipsis_mask', type: backend.binding.TF_ATTR_INT, value: 0 }, + { name: 'new_axis_mask', type: backend.binding.TF_ATTR_INT, value: 0 }, + { name: 'shrink_axis_mask', type: backend.binding.TF_ATTR_INT, value: 0 } + ]; + var res = backend.executeSingleOutput(tfjs_1.StridedSlice, opAttrs, [x, beginTensor, endTensor, stridesTensor]); + return tfjs_1.reshape(res, outShape); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.d.ts new file mode 100644 index 000000000..241a478fd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const subConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.js new file mode 100644 index 000000000..8ce3f5ab2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sub.js @@ -0,0 +1,30 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.subConfig = { + kernelName: tfjs_1.Sub, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b; + var backend = args.backend; + var opAttrs = [nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(tfjs_1.Sub, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.d.ts new file mode 100644 index 000000000..7afb1ec8a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const sumConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.js new file mode 100644 index 000000000..fc1127dbc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Sum.js @@ -0,0 +1,33 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.sumConfig = { + kernelName: tfjs_1.Sum, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, axis = _a.axis, keepDims = _a.keepDims; + var axes = tfjs_1.util.parseAxisParam(axis, x.shape); + var axisTensor = tfjs_1.tensor1d(axes, 'int32'); + var res = backend.executeSingleOutput(tfjs_1.Sum, backend.createReductionOpAttrs(x, keepDims), [x, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.d.ts new file mode 100644 index 000000000..8ad63abe8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const tanConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.js new file mode 100644 index 000000000..507527171 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tan.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.tanConfig = { + kernelName: tfjs_1.Tan, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Tan, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.d.ts new file mode 100644 index 000000000..47b92dd8b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const tanhConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.js new file mode 100644 index 000000000..159aeeef9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tanh.js @@ -0,0 +1,28 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.tanhConfig = { + kernelName: tfjs_1.Tanh, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + return backend.executeSingleInput(tfjs_1.Tanh, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.d.ts new file mode 100644 index 000000000..33cf0482f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const tileConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.js new file mode 100644 index 000000000..9e2eb1edd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Tile.js @@ -0,0 +1,37 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.tileConfig = { + kernelName: tfjs_1.Tile, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var reps = args.attrs.reps; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tmultiples', 'int32') + ]; + var multiples = tfjs_1.tensor1d(reps, 'int32'); + var res = backend.executeSingleOutput(tfjs_1.Tile, opAttrs, [x, multiples]); + multiples.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.d.ts new file mode 100644 index 000000000..7e2029e0c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const topKConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.js new file mode 100644 index 000000000..5a360c5e0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/TopK.js @@ -0,0 +1,42 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var util_1 = require("util"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.topKConfig = { + kernelName: tfjs_1.TopK, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var _a = args.attrs, k = _a.k, sorted = _a.sorted; + var kCount = util_1.isNullOrUndefined(k) ? 1 : k; + var isSorted = util_1.isNullOrUndefined(sorted) ? true : sorted; + var opAttrs = [ + { name: 'sorted', type: backend.binding.TF_ATTR_BOOL, value: isSorted }, + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + ]; + var kTensor = tfjs_1.scalar(kCount, 'int32'); + // 'TopKV2' has two-hard coded output attributes: + // TODO(yassogba) consider renamine constant in kernel names; + var res = backend.executeMultipleOutputs('TopKV2', opAttrs, [x, kTensor], 2); + kTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.d.ts new file mode 100644 index 000000000..199b13686 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const transposeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.js new file mode 100644 index 000000000..4fc5faba1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Transpose.js @@ -0,0 +1,37 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.transposeConfig = { + kernelName: tfjs_1.Transpose, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var perm = args.attrs.perm; + var permTensor = tfjs_1.tensor1d(perm, 'int32'); + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tperm', 'int32') + ]; + var res = backend.executeSingleOutput(tfjs_1.Transpose, opAttrs, [x, permTensor]); + permTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.d.ts new file mode 100644 index 000000000..97f9fa19a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const unpackConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.js new file mode 100644 index 000000000..26d34e115 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/Unpack.js @@ -0,0 +1,42 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.unpackConfig = { + kernelName: tfjs_1.Unpack, + backendName: 'tensorflow', + kernelFunc: function (args) { + var value = args.inputs.value; + var backend = args.backend; + var axis = args.attrs.axis; + if (axis < 0) { + axis += value.shape.length; + } + if (axis >= value.shape.length) { + throw new Error("Invalid axis supplied: " + axis + " shape length: " + value.shape.length); + } + var num = value.shape[axis]; + var opAttrs = [ + { name: 'num', type: backend.binding.TF_ATTR_INT, value: num }, + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', value.dtype), + { name: 'axis', type: backend.binding.TF_ATTR_INT, value: axis } + ]; + return backend.executeMultipleOutputs(tfjs_1.Unpack, opAttrs, [value], num); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.d.ts new file mode 100644 index 000000000..9fc96a6ed --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const unsortedSegmentSumConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.js new file mode 100644 index 000000000..aa14cf88b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/UnsortedSegmentSum.js @@ -0,0 +1,38 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("../nodejs_kernel_backend"); +exports.unsortedSegmentSumConfig = { + kernelName: tfjs_1.UnsortedSegmentSum, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, x = _a.x, segmentIds = _a.segmentIds; + var backend = args.backend; + var numSegments = args.attrs.numSegments; + var opAttrs = [ + nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', x.dtype), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tindices', 'int32'), + nodejs_kernel_backend_1.createTensorsTypeOpAttr('Tnumsegments', 'int32') + ]; + var numSegmentsT = tfjs_1.scalar(numSegments, 'int32'); + var res = backend.executeSingleOutput(tfjs_1.UnsortedSegmentSum, opAttrs, [x, segmentIds, numSegmentsT]); + numSegmentsT.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.d.ts new file mode 100644 index 000000000..31415b63c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const zerosLikeConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.js new file mode 100644 index 000000000..8ea88d8bd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/ZerosLike.js @@ -0,0 +1,33 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports.zerosLikeConfig = { + kernelName: tfjs_1.ZerosLike, + backendName: 'tensorflow', + kernelFunc: function (args) { + var x = args.inputs.x; + var backend = args.backend; + var opAttrs = [{ + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.getDTypeInteger(x.dtype) + }]; + return backend.executeSingleOutput(tfjs_1.ZerosLike, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.d.ts new file mode 100644 index 000000000..d7976022d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.d.ts @@ -0,0 +1,18 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 { KernelConfig } from '@tensorflow/tfjs'; +export declare const _fusedMatMulConfig: KernelConfig; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.js new file mode 100644 index 000000000..fc9ab3824 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/kernels/_FusedMatMul.js @@ -0,0 +1,38 @@ +"use strict"; +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +exports._fusedMatMulConfig = { + kernelName: tfjs_1._FusedMatMul, + backendName: 'tensorflow', + kernelFunc: function (args) { + var _a = args.inputs, a = _a.a, b = _a.b, bias = _a.bias, preluActivationWeights = _a.preluActivationWeights; + var backend = args.backend; + var _b = args.attrs, transposeA = _b.transposeA, transposeB = _b.transposeB, activation = _b.activation, leakyreluAlpha = _b.leakyreluAlpha; + // Core TensorFlow does not have a fused BatchMatMul op. Combine calls to + // achieve the same results: + return tfjs_1.tidy(function () { + var result = tfjs_1.matMul(a, b, transposeA, transposeB); + if (bias != null) { + result = tfjs_1.add(result, bias); + } + result = backend.applyActivation(result, activation, preluActivationWeights, leakyreluAlpha); + return result; + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.d.ts new file mode 100644 index 000000000..d892fcd71 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.d.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +/** + * Public API symbols under the tf.node.* namespace. + */ +import { tensorBoard } from './callbacks'; +import { decodeBmp, decodeGif, decodeImage, decodeJpeg, decodePng, encodeJpeg, encodePng } from './image'; +import { getMetaGraphsFromSavedModel, getNumOfSavedModels, loadSavedModel } from './saved_model'; +import { summaryFileWriter } from './tensorboard'; +export declare const node: { + decodeImage: typeof decodeImage; + decodeBmp: typeof decodeBmp; + decodeGif: typeof decodeGif; + decodePng: typeof decodePng; + decodeJpeg: typeof decodeJpeg; + encodeJpeg: typeof encodeJpeg; + encodePng: typeof encodePng; + summaryFileWriter: typeof summaryFileWriter; + tensorBoard: typeof tensorBoard; + getMetaGraphsFromSavedModel: typeof getMetaGraphsFromSavedModel; + getNumOfSavedModels: typeof getNumOfSavedModels; + loadSavedModel: typeof loadSavedModel; +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.js new file mode 100644 index 000000000..08e8938fd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/node.js @@ -0,0 +1,39 @@ +"use strict"; +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Public API symbols under the tf.node.* namespace. + */ +var callbacks_1 = require("./callbacks"); +var image_1 = require("./image"); +var saved_model_1 = require("./saved_model"); +var tensorboard_1 = require("./tensorboard"); +exports.node = { + decodeImage: image_1.decodeImage, + decodeBmp: image_1.decodeBmp, + decodeGif: image_1.decodeGif, + decodePng: image_1.decodePng, + decodeJpeg: image_1.decodeJpeg, + encodeJpeg: image_1.encodeJpeg, + encodePng: image_1.encodePng, + summaryFileWriter: tensorboard_1.summaryFileWriter, + tensorBoard: callbacks_1.tensorBoard, + getMetaGraphsFromSavedModel: saved_model_1.getMetaGraphsFromSavedModel, + getNumOfSavedModels: saved_model_1.getNumOfSavedModels, + loadSavedModel: saved_model_1.loadSavedModel +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.d.ts new file mode 100644 index 000000000..76a090969 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.d.ts @@ -0,0 +1,112 @@ +/** + * @license + * Copyright 2018 Google LLC. 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 * as tf from '@tensorflow/tfjs'; +import { backend_util, BackendTimingInfo, DataId, DataType, KernelBackend, ModelTensorInfo, Scalar, ScalarLike, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorInfo } from '@tensorflow/tfjs'; +import { TFEOpAttr, TFJSBinding } from './tfjs_binding'; +export declare class NodeJSKernelBackend extends KernelBackend { + binding: TFJSBinding; + isGPUPackage: boolean; + isUsingGpuDevice: boolean; + private tensorMap; + constructor(binding: TFJSBinding, packageName: string); + getDTypeInteger(dtype: DataType): number; + private typeAttributeFromTensor; + private createOutputTensor; + private getInputTensorIds; + createReductionOpAttrs(tensor: TensorInfo, keepDims?: boolean): TFEOpAttr[]; + floatPrecision(): 16 | 32; + epsilon(): number; + /** + * Executes an op that has a single input and output. + * + * Helper function to wrap executeSingleOutput in a particular case. + * @param name The name of the Op to execute. + * @param input The input Tensor for the Op. + */ + executeSingleInput(name: string, input: TensorInfo): Tensor; + /** + * Executes a TensorFlow Eager Op that provides one output Tensor. + * @param name The name of the Op to execute. + * @param opAttrs The list of Op attributes required to execute. + * @param inputs The list of input Tensors for the Op. + * @return A resulting Tensor from Op execution. + */ + executeSingleOutput(name: string, opAttrs: TFEOpAttr[], inputs: TensorInfo[]): Tensor; + /** + * Executes a TensorFlow Eager Op that provides multiple output Tensors. + * @param name The name of the Op to execute. + * @param opAttrs The list of Op attributes required to execute. + * @param inputs The list of input Tensors for the Op. + * @param numOutputs The number of output Tensors for Op execution. + * @return A resulting Tensor array from Op execution. + */ + executeMultipleOutputs(name: string, opAttrs: TFEOpAttr[], inputs: TensorInfo[], numOutputs: number): Tensor[]; + numDataIds(): number; + dispose(): void; + read(dataId: DataId): Promise; + readSync(dataId: DataId): backend_util.BackendValues; + /** + * Dispose the memory if the dataId has 0 refCount. Return true if the memory + * is released, false otherwise. + * @param dataId + * @oaram force Optional, remove the data regardless of refCount + */ + disposeData(dataId: DataId, force?: boolean): boolean; + /** Return refCount of a `TensorData`. */ + refCount(dataId: DataId): number; + incRef(dataId: DataId): void; + move(dataId: DataId, values: backend_util.BackendValues, shape: number[], dtype: DataType, refCount: number): void; + write(values: backend_util.BackendValues, shape: number[], dtype: DataType): DataId; + applyActivation(input: T, activation: string, preluActivationWeights?: Tensor, leakyreluAlpha?: number): T; + divide(a: Tensor, b: Tensor): Tensor; + divNoNan(a: Tensor, b: Tensor): Tensor; + where(condition: Tensor): Tensor2D; + topKValues(x: T, k: number): Tensor1D; + topKIndices(x: Tensor, k: number): Tensor1D; + int(x: T): T; + decodeJpeg(contents: Uint8Array, channels: number, ratio: number, fancyUpscaling: boolean, tryRecoverTruncated: boolean, acceptableFraction: number, dctMethod: string): Tensor3D; + decodePng(contents: Uint8Array, channels: number): Tensor3D; + decodeBmp(contents: Uint8Array, channels: number): Tensor3D; + decodeGif(contents: Uint8Array): Tensor4D; + executeEncodeImageOp(name: string, opAttrs: TFEOpAttr[], imageData: Uint8Array, imageShape: number[]): Tensor; + encodeJpeg(imageData: Uint8Array, imageShape: number[], format: '' | 'grayscale' | 'rgb', quality: number, progressive: boolean, optimizeSize: boolean, chromaDownsampling: boolean, densityUnit: 'in' | 'cm', xDensity: number, yDensity: number, xmpMetadata: string): Tensor; + encodePng(imageData: Uint8Array, imageShape: number[], compression: number): Tensor; + deleteSavedModel(id: number): void; + loadSavedModelMetaGraph(path: string, tags: string): number; + private getMappedInputTensorIds; + runSavedModel(id: number, inputs: Tensor[], inputTensorInfos: ModelTensorInfo[], outputOpNames: string[]): Tensor[]; + summaryWriter(logdir: string): Tensor1D; + createSummaryFileWriter(resourceHandle: Tensor, logdir: string, maxQueue?: number, flushMillis?: number, filenameSuffix?: string): void; + writeScalarSummary(resourceHandle: Tensor, step: number, name: string, value: Scalar | number): void; + flushSummaryWriter(resourceHandle: Tensor): void; + memory(): { + unreliable: boolean; + }; + time(f: () => void): Promise; + getNumOfSavedModels(): number; +} +/** Returns an instance of the Node.js backend. */ +export declare function nodeBackend(): NodeJSKernelBackend; +/** Returns the TF dtype for a given DataType. */ +export declare function getTFDType(dataType: tf.DataType): number; +/** + * Creates a TFEOpAttr for a 'type' OpDef attribute from a Tensor or list of + * Tensors. + */ +export declare function createTensorsTypeOpAttr(attrName: string, tensorsOrDtype: tf.Tensor | tf.Tensor[] | tf.DataType): TFEOpAttr; +export declare function createOpAttr(attrName: string, tensorsOrDtype: tf.Tensor | tf.Tensor[] | tf.DataType, value: ScalarLike): TFEOpAttr; +export declare function ensureTensorflowBackend(): void; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.js new file mode 100644 index 000000000..4a7966086 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend.js @@ -0,0 +1,600 @@ +"use strict"; +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("@tensorflow/tfjs"); +var tfjs_1 = require("@tensorflow/tfjs"); +var util_1 = require("util"); +var int64_tensors_1 = require("./int64_tensors"); +var NodeJSKernelBackend = /** @class */ (function (_super) { + __extends(NodeJSKernelBackend, _super); + function NodeJSKernelBackend(binding, packageName) { + var _this = _super.call(this) || this; + _this.binding = binding; + _this.isGPUPackage = packageName === '@tensorflow/tfjs-node-gpu'; + _this.isUsingGpuDevice = _this.binding.isUsingGpuDevice(); + _this.tensorMap = new tf.DataStorage(_this, tf.engine()); + return _this; + } + NodeJSKernelBackend.prototype.getDTypeInteger = function (dtype) { + switch (dtype) { + case 'float32': + return this.binding.TF_FLOAT; + case 'int32': + return this.binding.TF_INT32; + case 'bool': + return this.binding.TF_BOOL; + case 'complex64': + return this.binding.TF_COMPLEX64; + case 'string': + return this.binding.TF_STRING; + default: + throw new Error("Unsupported DType: " + dtype); + } + }; + NodeJSKernelBackend.prototype.typeAttributeFromTensor = function (value) { + return this.getDTypeInteger(value.dtype); + }; + // Creates a new Tensor and maps the dataId to the passed in ID. + NodeJSKernelBackend.prototype.createOutputTensor = function (metadata) { + var newId = {}; + this.tensorMap.set(newId, { + shape: metadata.shape, + dtype: metadata.dtype, + id: metadata.id, + values: null, + refCount: 1 + }); + var dtype; + switch (metadata.dtype) { + case this.binding.TF_FLOAT: + dtype = 'float32'; + break; + case this.binding.TF_INT32: + dtype = 'int32'; + break; + case this.binding.TF_INT64: + console.warn('INT64 output tensor will be stored as BigInt64Array.'); + // INT64 is not supported in TFJS yet, cast it to int32. + dtype = 'int32'; + break; + case this.binding.TF_BOOL: + dtype = 'bool'; + break; + case this.binding.TF_COMPLEX64: + dtype = 'complex64'; + break; + case this.binding.TF_STRING: + dtype = 'string'; + break; + case this.binding.TF_RESOURCE: + // NOTE(cais): We currently represent resource-type Tensors + // as string of ubytes. + dtype = 'string'; + break; + case this.binding.TF_UINT8: + // TensorFlow uses UINT8 as dtype for image tensor. UINT8 is not + // supported in TFJS yet, cast it to int32. + dtype = 'int32'; + break; + default: + throw new Error("Unknown dtype enum " + metadata.dtype); + } + // TODO(yassogba) Enable this once all the kernels are removed from backend. + // We can then change the return type from Tensor to TensorInfo. + // return {dataId: newId, shape: metadata.shape, dtype}; + return tf.engine().makeTensorFromDataId(newId, metadata.shape, dtype); + }; + // Prepares Tensor instances for Op execution. + NodeJSKernelBackend.prototype.getInputTensorIds = function (tensors) { + var ids = []; + for (var i = 0; i < tensors.length; i++) { + if (tensors[i] instanceof int64_tensors_1.Int64Scalar) { + // Then `tensors[i]` is a Int64Scalar, which we currently represent + // using an `Int32Array`. + var value = tensors[i].valueArray; + var id = this.binding.createTensor([], this.binding.TF_INT64, value); + ids.push(id); + } + else { + var info = this.tensorMap.get(tensors[i].dataId); + // TODO - what about ID in this case? Handle in write()?? + if (info.values != null) { + // Values were delayed to write into the TensorHandle. Do that before + // Op execution and clear stored values. + info.id = + this.binding.createTensor(info.shape, info.dtype, info.values); + info.values = null; + } + ids.push(info.id); + } + } + return ids; + }; + NodeJSKernelBackend.prototype.createReductionOpAttrs = function (tensor, keepDims) { + if (keepDims === void 0) { keepDims = false; } + return [ + { name: 'keep_dims', type: this.binding.TF_ATTR_BOOL, value: keepDims }, + createTensorsTypeOpAttr('T', tensor.dtype), + createTensorsTypeOpAttr('Tidx', 'int32') + ]; + }; + NodeJSKernelBackend.prototype.floatPrecision = function () { + return 32; + }; + NodeJSKernelBackend.prototype.epsilon = function () { + return _super.prototype.epsilon.call(this); + }; + /** + * Executes an op that has a single input and output. + * + * Helper function to wrap executeSingleOutput in a particular case. + * @param name The name of the Op to execute. + * @param input The input Tensor for the Op. + */ + NodeJSKernelBackend.prototype.executeSingleInput = function (name, input) { + var opAttrs = [createTensorsTypeOpAttr('T', input.dtype)]; + return this.executeSingleOutput(name, opAttrs, [input]); + }; + /** + * Executes a TensorFlow Eager Op that provides one output Tensor. + * @param name The name of the Op to execute. + * @param opAttrs The list of Op attributes required to execute. + * @param inputs The list of input Tensors for the Op. + * @return A resulting Tensor from Op execution. + */ + NodeJSKernelBackend.prototype.executeSingleOutput = function (name, opAttrs, inputs) { + var outputMetadata = this.binding.executeOp(name, opAttrs, this.getInputTensorIds(inputs), 1); + return this.createOutputTensor(outputMetadata[0]); + }; + /** + * Executes a TensorFlow Eager Op that provides multiple output Tensors. + * @param name The name of the Op to execute. + * @param opAttrs The list of Op attributes required to execute. + * @param inputs The list of input Tensors for the Op. + * @param numOutputs The number of output Tensors for Op execution. + * @return A resulting Tensor array from Op execution. + */ + NodeJSKernelBackend.prototype.executeMultipleOutputs = function (name, opAttrs, inputs, numOutputs) { + var _this = this; + var outputMetadata = this.binding.executeOp(name, opAttrs, this.getInputTensorIds(inputs), numOutputs); + return outputMetadata.map(function (m) { return _this.createOutputTensor(m); }); + }; + NodeJSKernelBackend.prototype.numDataIds = function () { + return this.tensorMap.numDataIds(); + }; + NodeJSKernelBackend.prototype.dispose = function () { }; + NodeJSKernelBackend.prototype.read = function (dataId) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [2 /*return*/, this.readSync(dataId)]; + }); + }); + }; + NodeJSKernelBackend.prototype.readSync = function (dataId) { + if (!this.tensorMap.has(dataId)) { + throw new Error("Tensor " + dataId + " was not registered!"); + } + var info = this.tensorMap.get(dataId); + if (info.values != null) { + return info.values; + } + else { + return this.binding.tensorDataSync(info.id); + } + }; + /** + * Dispose the memory if the dataId has 0 refCount. Return true if the memory + * is released, false otherwise. + * @param dataId + * @oaram force Optional, remove the data regardless of refCount + */ + NodeJSKernelBackend.prototype.disposeData = function (dataId, force) { + if (force === void 0) { force = false; } + // No-op if already disposed. + if (this.tensorMap.has(dataId)) { + var id = this.tensorMap.get(dataId).id; + this.tensorMap.get(dataId).refCount--; + if (!force && this.tensorMap.get(dataId).refCount > 0) { + return false; + } + if (id != null && id >= 0) { + this.binding.deleteTensor(id); + } + this.tensorMap.delete(dataId); + } + return true; + }; + /** Return refCount of a `TensorData`. */ + NodeJSKernelBackend.prototype.refCount = function (dataId) { + if (this.tensorMap.has(dataId)) { + var tensorData = this.tensorMap.get(dataId); + return tensorData.refCount; + } + return 0; + }; + NodeJSKernelBackend.prototype.incRef = function (dataId) { + this.tensorMap.get(dataId).refCount++; + }; + NodeJSKernelBackend.prototype.move = function (dataId, values, shape, dtype, refCount) { + this.tensorMap.set(dataId, { shape: shape, dtype: getTFDType(dtype), values: values, id: -1, refCount: refCount }); + }; + NodeJSKernelBackend.prototype.write = function (values, shape, dtype) { + var dataId = {}; + this.move(dataId, values, shape, dtype, 1); + return dataId; + }; + NodeJSKernelBackend.prototype.applyActivation = function (input, activation, preluActivationWeights, leakyreluAlpha) { + var result = input; + if (activation != null) { + if (activation === 'linear') { + // No-op + } + else if (activation === 'relu') { + result = tf.relu(result); + } + else if (activation === 'prelu') { + result = tf.prelu(result, preluActivationWeights); + } + else if (activation === 'leakyrelu') { + result = tf.leakyRelu(result, leakyreluAlpha); + } + else if (activation === 'elu') { + result = tf.elu(result); + } + else if (activation === 'relu6') { + result = tf.relu6(result); + } + else if (activation === 'sigmoid') { + result = tf.sigmoid(result); + } + else { + throw new Error("Activation: " + activation + " has not been implemented for the Node.js backend"); + } + } + return result; + }; + NodeJSKernelBackend.prototype.divide = function (a, b) { + var opAttrs = [createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return this.executeSingleOutput('Div', opAttrs, [a, b]); + }; + NodeJSKernelBackend.prototype.divNoNan = function (a, b) { + var opAttrs = [createTensorsTypeOpAttr('T', tfjs_1.backend_util.upcastType(a.dtype, b.dtype))]; + return this.executeSingleOutput('DivNoNan', opAttrs, [a, b]); + }; + NodeJSKernelBackend.prototype.where = function (condition) { + return this.executeSingleOutput('Where', [], [condition]); + }; + NodeJSKernelBackend.prototype.topKValues = function (x, k) { + throw new Error('Method not implemented.'); + }; + NodeJSKernelBackend.prototype.topKIndices = function (x, k) { + throw new Error('Method not implemented.'); + }; + NodeJSKernelBackend.prototype.int = function (x) { + throw new Error('Method not implemented.'); + }; + NodeJSKernelBackend.prototype.decodeJpeg = function (contents, channels, ratio, fancyUpscaling, tryRecoverTruncated, acceptableFraction, dctMethod) { + var opAttrs = [ + { name: 'channels', type: this.binding.TF_ATTR_INT, value: channels }, + { name: 'ratio', type: this.binding.TF_ATTR_INT, value: ratio }, { + name: 'fancy_upscaling', + type: this.binding.TF_ATTR_BOOL, + value: fancyUpscaling + }, + { + name: 'try_recover_truncated', + type: this.binding.TF_ATTR_BOOL, + value: tryRecoverTruncated + }, + { + name: 'acceptable_fraction', + type: this.binding.TF_ATTR_FLOAT, + value: acceptableFraction + }, + { name: 'dct_method', type: this.binding.TF_ATTR_STRING, value: dctMethod } + ]; + var inputArgs = [tfjs_1.scalar(contents, 'string')]; + return this.executeSingleOutput('DecodeJpeg', opAttrs, inputArgs); + }; + NodeJSKernelBackend.prototype.decodePng = function (contents, channels) { + var opAttrs = [{ name: 'channels', type: this.binding.TF_ATTR_INT, value: channels }]; + var inputArgs = [tfjs_1.scalar(contents, 'string')]; + return this.executeSingleOutput('DecodePng', opAttrs, inputArgs); + }; + NodeJSKernelBackend.prototype.decodeBmp = function (contents, channels) { + var opAttrs = [{ name: 'channels', type: this.binding.TF_ATTR_INT, value: channels }]; + var inputArgs = [tfjs_1.scalar(contents, 'string')]; + return this.executeSingleOutput('DecodeBmp', opAttrs, inputArgs); + }; + NodeJSKernelBackend.prototype.decodeGif = function (contents) { + var inputArgs = [tfjs_1.scalar(contents, 'string')]; + return this.executeSingleOutput('DecodeGif', [], inputArgs); + }; + NodeJSKernelBackend.prototype.executeEncodeImageOp = function (name, opAttrs, imageData, imageShape) { + var inputTensorId = this.binding.createTensor(imageShape, this.binding.TF_UINT8, imageData); + var outputMetadata = this.binding.executeOp(name, opAttrs, [inputTensorId], 1); + var outputTensorInfo = outputMetadata[0]; + // prevent the tensor data from being converted to a UTF8 string, since + // the encoded data is not valid UTF8 + outputTensorInfo.dtype = this.binding.TF_UINT8; + return this.createOutputTensor(outputTensorInfo); + }; + NodeJSKernelBackend.prototype.encodeJpeg = function (imageData, imageShape, format, quality, progressive, optimizeSize, chromaDownsampling, densityUnit, xDensity, yDensity, xmpMetadata) { + var opAttrs = [ + { name: 'format', type: this.binding.TF_ATTR_STRING, value: format }, + { name: 'quality', type: this.binding.TF_ATTR_INT, value: quality }, { + name: 'progressive', + type: this.binding.TF_ATTR_BOOL, + value: progressive + }, + { + name: 'optimize_size', + type: this.binding.TF_ATTR_BOOL, + value: optimizeSize + }, + { + name: 'chroma_downsampling', + type: this.binding.TF_ATTR_BOOL, + value: chromaDownsampling + }, + { + name: 'density_unit', + type: this.binding.TF_ATTR_STRING, + value: densityUnit + }, + { name: 'x_density', type: this.binding.TF_ATTR_INT, value: xDensity }, + { name: 'y_density', type: this.binding.TF_ATTR_INT, value: yDensity }, { + name: 'xmp_metadata', + type: this.binding.TF_ATTR_STRING, + value: xmpMetadata + } + ]; + return this.executeEncodeImageOp('EncodeJpeg', opAttrs, imageData, imageShape); + }; + NodeJSKernelBackend.prototype.encodePng = function (imageData, imageShape, compression) { + var opAttrs = [ + { name: 'compression', type: this.binding.TF_ATTR_INT, value: compression } + ]; + return this.executeEncodeImageOp('EncodePng', opAttrs, imageData, imageShape); + }; + NodeJSKernelBackend.prototype.deleteSavedModel = function (id) { + this.binding.deleteSavedModel(id); + }; + NodeJSKernelBackend.prototype.loadSavedModelMetaGraph = function (path, tags) { + return this.binding.loadSavedModel(path, tags); + }; + NodeJSKernelBackend.prototype.getMappedInputTensorIds = function (inputs, inputTensorInfos) { + var tensorIds = this.getInputTensorIds(inputs); + for (var i = 0; i < inputs.length; i++) { + if (inputTensorInfos[i] != null) { + if (inputTensorInfos[i].tfDtype === 'DT_UINT8') { + var data = Uint8Array.from(inputs[i].dataSync()); + var inputTensorId = this.binding.createTensor(inputs[i].shape, this.binding.TF_UINT8, data); + tensorIds[i] = inputTensorId; + } + else if (inputTensorInfos[i].tfDtype === 'DT_INT64') { + var data = int64_tensors_1.encodeInt32ArrayAsInt64(inputs[i].dataSync()); + var inputTensorId = this.binding.createTensor(inputs[i].shape, this.binding.TF_INT64, data); + tensorIds[i] = inputTensorId; + } + } + } + return tensorIds; + }; + NodeJSKernelBackend.prototype.runSavedModel = function (id, inputs, inputTensorInfos, outputOpNames) { + var _this = this; + var outputMetadata = this.binding.runSavedModel(id, this.getMappedInputTensorIds(inputs, inputTensorInfos), inputTensorInfos.map(function (info) { return info.name; }).join(','), outputOpNames.join(',')); + return outputMetadata.map(function (m) { return _this.createOutputTensor(m); }); + }; + // ------------------------------------------------------------ + // TensorBoard-related (tfjs-node-specific) backend kernels. + NodeJSKernelBackend.prototype.summaryWriter = function (logdir) { + var opAttrs = [ + { + name: 'shared_name', + type: this.binding.TF_ATTR_STRING, + value: "logdir:" + logdir + }, + { name: 'container', type: this.binding.TF_ATTR_STRING, value: '' } + ]; + var writerResource = this.executeSingleOutput('SummaryWriter', opAttrs, []); + return writerResource; + }; + NodeJSKernelBackend.prototype.createSummaryFileWriter = function (resourceHandle, logdir, maxQueue, flushMillis, filenameSuffix) { + var inputArgs = [ + resourceHandle, tfjs_1.scalar(logdir), + tfjs_1.scalar(maxQueue == null ? 10 : maxQueue, 'int32'), + tfjs_1.scalar(flushMillis == null ? 2 * 60 * 1000 : flushMillis, 'int32'), + tfjs_1.scalar(filenameSuffix == null ? '.v2' : filenameSuffix) + ]; + this.executeMultipleOutputs('CreateSummaryFileWriter', [], inputArgs, 0); + }; + NodeJSKernelBackend.prototype.writeScalarSummary = function (resourceHandle, step, name, value) { + var _this = this; + tfjs_1.tidy(function () { + tfjs_1.util.assert(Number.isInteger(step), function () { return "step is expected to be an integer, but is instead " + step; }); + var inputArgs = [resourceHandle, new int64_tensors_1.Int64Scalar(step), tfjs_1.scalar(name, 'string')]; + var typeAttr; + if (typeof value === 'number') { + inputArgs.push(tfjs_1.scalar(value)); + typeAttr = _this.binding.TF_FLOAT; + } + else { + // `value` is a Scalar. + tfjs_1.util.assert(value.rank === 0, function () { return "A non-scalar tensor (rank " + value.rank + ") is passed to " + + "writeScalarSummary()"; }); + inputArgs.push(value); + typeAttr = _this.typeAttributeFromTensor(value); + } + var opAttrs = [{ name: 'T', type: _this.binding.TF_ATTR_TYPE, value: typeAttr }]; + _this.binding.executeOp('WriteScalarSummary', opAttrs, _this.getInputTensorIds(inputArgs), 0); + }); + }; + NodeJSKernelBackend.prototype.flushSummaryWriter = function (resourceHandle) { + var inputArgs = [resourceHandle]; + this.executeMultipleOutputs('FlushSummaryWriter', [], inputArgs, 0); + }; + // ~ TensorBoard-related (tfjs-node-specific) backend kernels. + // ------------------------------------------------------------ + NodeJSKernelBackend.prototype.memory = function () { + // Due to automatic garbage collection, the numbers are unreliable. + // TODO(kreeger): Since there is finalization in C, count the true + // number of undisposed tensors. + return { unreliable: true }; + }; + NodeJSKernelBackend.prototype.time = function (f) { + return __awaiter(this, void 0, void 0, function () { + var start, elapsed; + return __generator(this, function (_a) { + start = process.hrtime(); + f(); + elapsed = process.hrtime(start); + return [2 /*return*/, { kernelMs: elapsed[0] * 1000 + elapsed[1] / 1000000 }]; + }); + }); + }; + NodeJSKernelBackend.prototype.getNumOfSavedModels = function () { + return this.binding.getNumOfSavedModels(); + }; + return NodeJSKernelBackend; +}(tfjs_1.KernelBackend)); +exports.NodeJSKernelBackend = NodeJSKernelBackend; +/** Returns an instance of the Node.js backend. */ +function nodeBackend() { + return tf.findBackend('tensorflow'); +} +exports.nodeBackend = nodeBackend; +/** Returns the TF dtype for a given DataType. */ +function getTFDType(dataType) { + var binding = nodeBackend().binding; + switch (dataType) { + case 'float32': + return binding.TF_FLOAT; + case 'int32': + return binding.TF_INT32; + case 'bool': + return binding.TF_BOOL; + case 'complex64': + return binding.TF_COMPLEX64; + case 'string': + return binding.TF_STRING; + // tslint:disable-next-line:no-any + case 'int64': + // int64 is not a generally supported dtype in TensorFlow.js + // (tfjs-core). However, it needs to be included here for the purpose of + // writing the `step` value to TensorBoard via WriteScalarSummary and + // other op kernels. + return binding.TF_INT64; + default: + var errorMessage = "Unknown dtype: " + dataType; + throw new Error(errorMessage); + } +} +exports.getTFDType = getTFDType; +/** + * Creates a TFEOpAttr for a 'type' OpDef attribute from a Tensor or list of + * Tensors. + */ +function createTensorsTypeOpAttr(attrName, tensorsOrDtype) { + if (util_1.isNullOrUndefined(tensorsOrDtype)) { + throw new Error('Invalid input tensors value.'); + } + return { + name: attrName, + type: nodeBackend().binding.TF_ATTR_TYPE, + value: (tensorsOrDtype instanceof tf.Tensor || Array.isArray(tensorsOrDtype)) ? + getTFDTypeForInputs(tensorsOrDtype) : + getTFDType(tensorsOrDtype) + }; +} +exports.createTensorsTypeOpAttr = createTensorsTypeOpAttr; +// TODO(yassogba) remove? who uses this? +function createOpAttr(attrName, tensorsOrDtype, value) { + if (util_1.isNullOrUndefined(tensorsOrDtype)) { + throw new Error('Invalid input tensors value.'); + } + return { name: attrName, type: nodeBackend().binding.TF_BOOL, value: value }; +} +exports.createOpAttr = createOpAttr; +/** Returns the dtype number for a single or list of input Tensors. */ +function getTFDTypeForInputs(tensors) { + if (util_1.isNullOrUndefined(tensors)) { + throw new Error('Invalid input tensors value.'); + } + if (util_1.isArray(tensors)) { + for (var i = 0; i < tensors.length; i++) { + return getTFDType(tensors[i].dtype); + } + return -1; + } + else { + return getTFDType(tensors.dtype); + } +} +function ensureTensorflowBackend() { + tf.util.assert(tf.getBackend() === 'tensorflow', function () { return "Expect the current backend to be \"tensorflow\", but got \"" + tf.getBackend() + "\""; }); +} +exports.ensureTensorflowBackend = ensureTensorflowBackend; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.d.ts new file mode 100644 index 000000000..4a6d69728 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.d.ts @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.js new file mode 100644 index 000000000..a3f0ea1f1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/nodejs_kernel_backend_test.js @@ -0,0 +1,188 @@ +"use strict"; +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tf = require("@tensorflow/tfjs"); +// tslint:disable-next-line: no-imports-from-dist +var jasmine_util_1 = require("@tensorflow/tfjs-core/dist/jasmine_util"); +var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); +describe('delayed upload', function () { + it('should handle data before op execution', function () { return __awaiter(_this, void 0, void 0, function () { + var t, _a, _b, r, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + t = tf.tensor1d([1, 2, 3]); + _b = (_a = tf.test_util).expectArraysClose; + return [4 /*yield*/, t.data()]; + case 1: + _b.apply(_a, [_e.sent(), [1, 2, 3]]); + r = t.add(tf.tensor1d([4, 5, 6])); + _d = (_c = tf.test_util).expectArraysClose; + return [4 /*yield*/, r.data()]; + case 2: + _d.apply(_c, [_e.sent(), [5, 7, 9]]); + return [2 /*return*/]; + } + }); + }); }); + it('Should not cache tensors in the tensor map for device support. ', function () { + var logits = tf.tensor1d([1, 2, 3]); + var softmaxLogits = tf.softmax(logits); + var data = softmaxLogits.dataSync(); + expect(softmaxLogits.dataSync()[0]).toEqual(data[0]); + expect(softmaxLogits.dataSync()[1]).toEqual(data[1]); + expect(softmaxLogits.dataSync()[2]).toEqual(data[2]); + }); +}); +describe('type casting', function () { + it('exp support int32', function () { + tf.exp(tf.scalar(2, 'int32')); + }); +}); +describe('conv3d dilations', function () { + it('CPU should throw error on dilations >1', function () { + var input = tf.ones([1, 2, 2, 2, 1]); + var filter = tf.ones([1, 1, 1, 1, 1]); + expect(function () { + tf.conv3d(input, filter, 1, 'same', 'NDHWC', [2, 2, 2]); + }).toThrowError(); + }); + it('GPU should handle dilations >1', function () { + // This test can only run locally with CUDA bindings and GPU package + // installed. + if (tf.backend().isUsingGpuDevice) { + var input = tf.ones([1, 2, 2, 2, 1]); + var filter = tf.ones([1, 1, 1, 1, 1]); + tf.conv3d(input, filter, 1, 'same', 'NDHWC', [2, 2, 2]); + } + }); +}); +describe('Exposes Backend for internal Op execution.', function () { + it('Provides the Node backend over a function', function () { + var backend = nodejs_kernel_backend_1.nodeBackend(); + expect(backend instanceof nodejs_kernel_backend_1.NodeJSKernelBackend).toBeTruthy(); + }); + it('Provides internal access to the binding', function () { + expect(nodejs_kernel_backend_1.nodeBackend().binding).toBeDefined(); + }); + it('throw error if backend is not tensorflow', function (done) { return __awaiter(_this, void 0, void 0, function () { + var testBackend_1; + return __generator(this, function (_a) { + try { + testBackend_1 = new jasmine_util_1.TestKernelBackend(); + tf.registerBackend('fake', function () { return testBackend_1; }); + tf.setBackend('fake'); + nodejs_kernel_backend_1.ensureTensorflowBackend(); + done.fail(); + } + catch (err) { + expect(err.message) + .toBe('Expect the current backend to be "tensorflow", but got "fake"'); + tf.setBackend('tensorflow'); + done(); + } + return [2 /*return*/]; + }); + }); }); +}); +describe('getTFDType()', function () { + var binding = nodejs_kernel_backend_1.nodeBackend().binding; + it('handles float32', function () { + expect(nodejs_kernel_backend_1.getTFDType('float32')).toBe(binding.TF_FLOAT); + }); + it('handles int32', function () { + expect(nodejs_kernel_backend_1.getTFDType('int32')).toBe(binding.TF_INT32); + }); + it('handles bool', function () { + expect(nodejs_kernel_backend_1.getTFDType('bool')).toBe(binding.TF_BOOL); + }); + it('handles unknown types', function () { + expect(function () { return nodejs_kernel_backend_1.getTFDType(null); }).toThrowError(); + }); +}); +describe('createTypeOpAttr()', function () { + var binding = nodejs_kernel_backend_1.nodeBackend().binding; + it('Creates a valid type attribute', function () { + var attr = nodejs_kernel_backend_1.createTensorsTypeOpAttr('foo', 'float32'); + expect(attr.name).toBe('foo'); + expect(attr.type).toBe(binding.TF_ATTR_TYPE); + expect(attr.value).toBe(binding.TF_FLOAT); + }); + it('handles unknown dtypes', function () { + expect(function () { return nodejs_kernel_backend_1.createTensorsTypeOpAttr('foo', null); }).toThrowError(); + }); +}); +describe('Returns TFEOpAttr for a Tensor or list of Tensors', function () { + var binding = nodejs_kernel_backend_1.nodeBackend().binding; + it('handles a single Tensor', function () { + var result = nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tf.scalar(13, 'float32')); + expect(result.name).toBe('T'); + expect(result.type).toBe(binding.TF_ATTR_TYPE); + expect(result.value).toBe(binding.TF_FLOAT); + }); + it('handles a list of Tensors', function () { + var tensors = [tf.scalar(1, 'int32'), tf.scalar(20.1, 'float32')]; + var result = nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', tensors); + expect(result.name).toBe('T'); + expect(result.type).toBe(binding.TF_ATTR_TYPE); + expect(result.value).toBe(binding.TF_INT32); + }); + it('handles null', function () { + expect(function () { return nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', null); }).toThrowError(); + }); + it('handles list of null', function () { + var inputs = [null, null]; + expect(function () { return nodejs_kernel_backend_1.createTensorsTypeOpAttr('T', inputs); }).toThrowError(); + }); +}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/proto/api_pb.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/proto/api_pb.js new file mode 100644 index 000000000..7088a13a2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/proto/api_pb.js @@ -0,0 +1,9136 @@ +// source: api.proto +/** + * @fileoverview + * @enhanceable + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.tensorflow.Any', null, global); +goog.exportSymbol('proto.tensorflow.AssetFileDef', null, global); +goog.exportSymbol('proto.tensorflow.AttrValue', null, global); +goog.exportSymbol('proto.tensorflow.AttrValue.ListValue', null, global); +goog.exportSymbol('proto.tensorflow.AttrValue.ValueCase', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.AnyList', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.BytesList', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.FloatList', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.Int64List', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.KindCase', null, global); +goog.exportSymbol('proto.tensorflow.CollectionDef.NodeList', null, global); +goog.exportSymbol('proto.tensorflow.DataType', null, global); +goog.exportSymbol('proto.tensorflow.FunctionDef', null, global); +goog.exportSymbol('proto.tensorflow.FunctionDefLibrary', null, global); +goog.exportSymbol('proto.tensorflow.GradientDef', null, global); +goog.exportSymbol('proto.tensorflow.GraphDef', null, global); +goog.exportSymbol('proto.tensorflow.MetaGraphDef', null, global); +goog.exportSymbol('proto.tensorflow.MetaGraphDef.MetaInfoDef', null, global); +goog.exportSymbol('proto.tensorflow.NameAttrList', null, global); +goog.exportSymbol('proto.tensorflow.NodeDef', null, global); +goog.exportSymbol('proto.tensorflow.OpDef', null, global); +goog.exportSymbol('proto.tensorflow.OpDef.ArgDef', null, global); +goog.exportSymbol('proto.tensorflow.OpDef.AttrDef', null, global); +goog.exportSymbol('proto.tensorflow.OpDef.OpDeprecation', null, global); +goog.exportSymbol('proto.tensorflow.OpList', null, global); +goog.exportSymbol('proto.tensorflow.SavedModel', null, global); +goog.exportSymbol('proto.tensorflow.SaverDef', null, global); +goog.exportSymbol('proto.tensorflow.SaverDef.CheckpointFormatVersion', null, global); +goog.exportSymbol('proto.tensorflow.SignatureDef', null, global); +goog.exportSymbol('proto.tensorflow.Tensor', null, global); +goog.exportSymbol('proto.tensorflow.TensorInfo', null, global); +goog.exportSymbol('proto.tensorflow.TensorInfo.CooSparse', null, global); +goog.exportSymbol('proto.tensorflow.TensorInfo.EncodingCase', null, global); +goog.exportSymbol('proto.tensorflow.TensorShape', null, global); +goog.exportSymbol('proto.tensorflow.TensorShape.Dim', null, global); +goog.exportSymbol('proto.tensorflow.VersionDef', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.Any = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.Any, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.Any.displayName = 'proto.tensorflow.Any'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.TensorShape = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.TensorShape.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.TensorShape, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.TensorShape.displayName = 'proto.tensorflow.TensorShape'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.TensorShape.Dim = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.TensorShape.Dim, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.TensorShape.Dim.displayName = 'proto.tensorflow.TensorShape.Dim'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.Tensor = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.Tensor.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.Tensor, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.Tensor.displayName = 'proto.tensorflow.Tensor'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.AttrValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tensorflow.AttrValue.oneofGroups_); +}; +goog.inherits(proto.tensorflow.AttrValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.AttrValue.displayName = 'proto.tensorflow.AttrValue'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.AttrValue.ListValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.AttrValue.ListValue.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.AttrValue.ListValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.AttrValue.ListValue.displayName = 'proto.tensorflow.AttrValue.ListValue'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.NameAttrList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.NameAttrList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.NameAttrList.displayName = 'proto.tensorflow.NameAttrList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.NodeDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.NodeDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.NodeDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.NodeDef.displayName = 'proto.tensorflow.NodeDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.VersionDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.VersionDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.VersionDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.VersionDef.displayName = 'proto.tensorflow.VersionDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.GraphDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.GraphDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.GraphDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.GraphDef.displayName = 'proto.tensorflow.GraphDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tensorflow.CollectionDef.oneofGroups_); +}; +goog.inherits(proto.tensorflow.CollectionDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.displayName = 'proto.tensorflow.CollectionDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.NodeList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.NodeList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.NodeList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.NodeList.displayName = 'proto.tensorflow.CollectionDef.NodeList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.BytesList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.BytesList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.BytesList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.BytesList.displayName = 'proto.tensorflow.CollectionDef.BytesList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.Int64List = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.Int64List.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.Int64List, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.Int64List.displayName = 'proto.tensorflow.CollectionDef.Int64List'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.FloatList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.FloatList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.FloatList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.FloatList.displayName = 'proto.tensorflow.CollectionDef.FloatList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.CollectionDef.AnyList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.CollectionDef.AnyList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.CollectionDef.AnyList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.CollectionDef.AnyList.displayName = 'proto.tensorflow.CollectionDef.AnyList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.SaverDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.SaverDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.SaverDef.displayName = 'proto.tensorflow.SaverDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.TensorInfo = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tensorflow.TensorInfo.oneofGroups_); +}; +goog.inherits(proto.tensorflow.TensorInfo, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.TensorInfo.displayName = 'proto.tensorflow.TensorInfo'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.TensorInfo.CooSparse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.TensorInfo.CooSparse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.TensorInfo.CooSparse.displayName = 'proto.tensorflow.TensorInfo.CooSparse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.SignatureDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.SignatureDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.SignatureDef.displayName = 'proto.tensorflow.SignatureDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.AssetFileDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.AssetFileDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.AssetFileDef.displayName = 'proto.tensorflow.AssetFileDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.OpDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.OpDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpDef.displayName = 'proto.tensorflow.OpDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpDef.ArgDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.OpDef.ArgDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpDef.ArgDef.displayName = 'proto.tensorflow.OpDef.ArgDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpDef.AttrDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.OpDef.AttrDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpDef.AttrDef.displayName = 'proto.tensorflow.OpDef.AttrDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpDef.OpDeprecation = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.OpDef.OpDeprecation, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpDef.OpDeprecation.displayName = 'proto.tensorflow.OpDef.OpDeprecation'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.OpList = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.OpList.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.OpList, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.OpList.displayName = 'proto.tensorflow.OpList'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.MetaGraphDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.MetaGraphDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.MetaGraphDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.MetaGraphDef.displayName = 'proto.tensorflow.MetaGraphDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.MetaGraphDef.MetaInfoDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.MetaGraphDef.MetaInfoDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.MetaGraphDef.MetaInfoDef.displayName = 'proto.tensorflow.MetaGraphDef.MetaInfoDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.SavedModel = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.SavedModel.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.SavedModel, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.SavedModel.displayName = 'proto.tensorflow.SavedModel'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.FunctionDefLibrary = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.FunctionDefLibrary.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.FunctionDefLibrary, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.FunctionDefLibrary.displayName = 'proto.tensorflow.FunctionDefLibrary'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.FunctionDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.tensorflow.FunctionDef.repeatedFields_, null); +}; +goog.inherits(proto.tensorflow.FunctionDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.FunctionDef.displayName = 'proto.tensorflow.FunctionDef'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.tensorflow.GradientDef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.tensorflow.GradientDef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.tensorflow.GradientDef.displayName = 'proto.tensorflow.GradientDef'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.Any.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.Any.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.Any} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.Any.toObject = function(includeInstance, msg) { + var f, obj = { + typeUrl: jspb.Message.getFieldWithDefault(msg, 1, ""), + value: msg.getValue_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.Any} + */ +proto.tensorflow.Any.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.Any; + return proto.tensorflow.Any.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.Any} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.Any} + */ +proto.tensorflow.Any.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setTypeUrl(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.Any.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.Any.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.Any} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.Any.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTypeUrl(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } +}; + + +/** + * optional string type_url = 1; + * @return {string} + */ +proto.tensorflow.Any.prototype.getTypeUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.Any.prototype.setTypeUrl = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes value = 2; + * @return {!(string|Uint8Array)} + */ +proto.tensorflow.Any.prototype.getValue = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes value = 2; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.tensorflow.Any.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.tensorflow.Any.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.tensorflow.Any.prototype.setValue = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.TensorShape.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.TensorShape.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.TensorShape.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.TensorShape} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorShape.toObject = function(includeInstance, msg) { + var f, obj = { + dimList: jspb.Message.toObjectList(msg.getDimList(), + proto.tensorflow.TensorShape.Dim.toObject, includeInstance), + unknownRank: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.TensorShape} + */ +proto.tensorflow.TensorShape.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.TensorShape; + return proto.tensorflow.TensorShape.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.TensorShape} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.TensorShape} + */ +proto.tensorflow.TensorShape.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = new proto.tensorflow.TensorShape.Dim; + reader.readMessage(value,proto.tensorflow.TensorShape.Dim.deserializeBinaryFromReader); + msg.addDim(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setUnknownRank(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.TensorShape.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.TensorShape.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.TensorShape} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorShape.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDimList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.tensorflow.TensorShape.Dim.serializeBinaryToWriter + ); + } + f = message.getUnknownRank(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.TensorShape.Dim.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.TensorShape.Dim.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.TensorShape.Dim} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorShape.Dim.toObject = function(includeInstance, msg) { + var f, obj = { + size: jspb.Message.getFieldWithDefault(msg, 1, 0), + name: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.TensorShape.Dim} + */ +proto.tensorflow.TensorShape.Dim.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.TensorShape.Dim; + return proto.tensorflow.TensorShape.Dim.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.TensorShape.Dim} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.TensorShape.Dim} + */ +proto.tensorflow.TensorShape.Dim.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setSize(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.TensorShape.Dim.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.TensorShape.Dim.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.TensorShape.Dim} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorShape.Dim.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSize(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional int64 size = 1; + * @return {number} + */ +proto.tensorflow.TensorShape.Dim.prototype.getSize = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.TensorShape.Dim.prototype.setSize = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.tensorflow.TensorShape.Dim.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorShape.Dim.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated Dim dim = 2; + * @return {!Array} + */ +proto.tensorflow.TensorShape.prototype.getDimList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.TensorShape.Dim, 2)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.TensorShape.prototype.setDimList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.tensorflow.TensorShape.Dim=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.TensorShape.Dim} + */ +proto.tensorflow.TensorShape.prototype.addDim = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.TensorShape.Dim, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.TensorShape.prototype.clearDimList = function() { + this.setDimList([]); +}; + + +/** + * optional bool unknown_rank = 3; + * @return {boolean} + */ +proto.tensorflow.TensorShape.prototype.getUnknownRank = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.TensorShape.prototype.setUnknownRank = function(value) { + jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.Tensor.repeatedFields_ = [5,6,7,8,9,10,11,16,17]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.Tensor.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.Tensor.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.Tensor} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.Tensor.toObject = function(includeInstance, msg) { + var f, obj = { + dtype: jspb.Message.getFieldWithDefault(msg, 1, 0), + tensorShape: (f = msg.getTensorShape()) && proto.tensorflow.TensorShape.toObject(includeInstance, f), + versionNumber: jspb.Message.getFieldWithDefault(msg, 3, 0), + tensorContent: msg.getTensorContent_asB64(), + floatValList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 5)) == null ? undefined : f, + doubleValList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 6)) == null ? undefined : f, + intValList: (f = jspb.Message.getRepeatedField(msg, 7)) == null ? undefined : f, + stringValList: msg.getStringValList_asB64(), + scomplexValList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 9)) == null ? undefined : f, + int64ValList: (f = jspb.Message.getRepeatedField(msg, 10)) == null ? undefined : f, + boolValList: (f = jspb.Message.getRepeatedBooleanField(msg, 11)) == null ? undefined : f, + uint32ValList: (f = jspb.Message.getRepeatedField(msg, 16)) == null ? undefined : f, + uint64ValList: (f = jspb.Message.getRepeatedField(msg, 17)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.Tensor} + */ +proto.tensorflow.Tensor.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.Tensor; + return proto.tensorflow.Tensor.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.Tensor} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.Tensor} + */ +proto.tensorflow.Tensor.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); + msg.setDtype(value); + break; + case 2: + var value = new proto.tensorflow.TensorShape; + reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); + msg.setTensorShape(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersionNumber(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setTensorContent(value); + break; + case 5: + var value = /** @type {!Array} */ (reader.readPackedFloat()); + msg.setFloatValList(value); + break; + case 6: + var value = /** @type {!Array} */ (reader.readPackedDouble()); + msg.setDoubleValList(value); + break; + case 7: + var value = /** @type {!Array} */ (reader.readPackedInt32()); + msg.setIntValList(value); + break; + case 8: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addStringVal(value); + break; + case 9: + var value = /** @type {!Array} */ (reader.readPackedFloat()); + msg.setScomplexValList(value); + break; + case 10: + var value = /** @type {!Array} */ (reader.readPackedInt64()); + msg.setInt64ValList(value); + break; + case 11: + var value = /** @type {!Array} */ (reader.readPackedBool()); + msg.setBoolValList(value); + break; + case 16: + var value = /** @type {!Array} */ (reader.readPackedUint32()); + msg.setUint32ValList(value); + break; + case 17: + var value = /** @type {!Array} */ (reader.readPackedUint64()); + msg.setUint64ValList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.Tensor.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.Tensor.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.Tensor} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.Tensor.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDtype(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getTensorShape(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.TensorShape.serializeBinaryToWriter + ); + } + f = message.getVersionNumber(); + if (f !== 0) { + writer.writeInt32( + 3, + f + ); + } + f = message.getTensorContent_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getFloatValList(); + if (f.length > 0) { + writer.writePackedFloat( + 5, + f + ); + } + f = message.getDoubleValList(); + if (f.length > 0) { + writer.writePackedDouble( + 6, + f + ); + } + f = message.getIntValList(); + if (f.length > 0) { + writer.writePackedInt32( + 7, + f + ); + } + f = message.getStringValList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 8, + f + ); + } + f = message.getScomplexValList(); + if (f.length > 0) { + writer.writePackedFloat( + 9, + f + ); + } + f = message.getInt64ValList(); + if (f.length > 0) { + writer.writePackedInt64( + 10, + f + ); + } + f = message.getBoolValList(); + if (f.length > 0) { + writer.writePackedBool( + 11, + f + ); + } + f = message.getUint32ValList(); + if (f.length > 0) { + writer.writePackedUint32( + 16, + f + ); + } + f = message.getUint64ValList(); + if (f.length > 0) { + writer.writePackedUint64( + 17, + f + ); + } +}; + + +/** + * optional DataType dtype = 1; + * @return {!proto.tensorflow.DataType} + */ +proto.tensorflow.Tensor.prototype.getDtype = function() { + return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.tensorflow.DataType} value */ +proto.tensorflow.Tensor.prototype.setDtype = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional TensorShape tensor_shape = 2; + * @return {?proto.tensorflow.TensorShape} + */ +proto.tensorflow.Tensor.prototype.getTensorShape = function() { + return /** @type{?proto.tensorflow.TensorShape} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorShape, 2)); +}; + + +/** @param {?proto.tensorflow.TensorShape|undefined} value */ +proto.tensorflow.Tensor.prototype.setTensorShape = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.Tensor.prototype.clearTensorShape = function() { + this.setTensorShape(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.Tensor.prototype.hasTensorShape = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int32 version_number = 3; + * @return {number} + */ +proto.tensorflow.Tensor.prototype.getVersionNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.Tensor.prototype.setVersionNumber = function(value) { + jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional bytes tensor_content = 4; + * @return {!(string|Uint8Array)} + */ +proto.tensorflow.Tensor.prototype.getTensorContent = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes tensor_content = 4; + * This is a type-conversion wrapper around `getTensorContent()` + * @return {string} + */ +proto.tensorflow.Tensor.prototype.getTensorContent_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getTensorContent())); +}; + + +/** + * optional bytes tensor_content = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getTensorContent()` + * @return {!Uint8Array} + */ +proto.tensorflow.Tensor.prototype.getTensorContent_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getTensorContent())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.tensorflow.Tensor.prototype.setTensorContent = function(value) { + jspb.Message.setProto3BytesField(this, 4, value); +}; + + +/** + * repeated float float_val = 5; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getFloatValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 5)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setFloatValList = function(value) { + jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addFloatVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearFloatValList = function() { + this.setFloatValList([]); +}; + + +/** + * repeated double double_val = 6; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getDoubleValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 6)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setDoubleValList = function(value) { + jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addDoubleVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearDoubleValList = function() { + this.setDoubleValList([]); +}; + + +/** + * repeated int32 int_val = 7; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getIntValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 7)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setIntValList = function(value) { + jspb.Message.setField(this, 7, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addIntVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 7, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearIntValList = function() { + this.setIntValList([]); +}; + + +/** + * repeated bytes string_val = 8; + * @return {!(Array|Array)} + */ +proto.tensorflow.Tensor.prototype.getStringValList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 8)); +}; + + +/** + * repeated bytes string_val = 8; + * This is a type-conversion wrapper around `getStringValList()` + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getStringValList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getStringValList())); +}; + + +/** + * repeated bytes string_val = 8; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStringValList()` + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getStringValList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getStringValList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.tensorflow.Tensor.prototype.setStringValList = function(value) { + jspb.Message.setField(this, 8, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addStringVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 8, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearStringValList = function() { + this.setStringValList([]); +}; + + +/** + * repeated float scomplex_val = 9; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getScomplexValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 9)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setScomplexValList = function(value) { + jspb.Message.setField(this, 9, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addScomplexVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 9, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearScomplexValList = function() { + this.setScomplexValList([]); +}; + + +/** + * repeated int64 int64_val = 10; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getInt64ValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 10)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setInt64ValList = function(value) { + jspb.Message.setField(this, 10, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addInt64Val = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 10, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearInt64ValList = function() { + this.setInt64ValList([]); +}; + + +/** + * repeated bool bool_val = 11; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getBoolValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 11)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setBoolValList = function(value) { + jspb.Message.setField(this, 11, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addBoolVal = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 11, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearBoolValList = function() { + this.setBoolValList([]); +}; + + +/** + * repeated uint32 uint32_val = 16; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getUint32ValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 16)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setUint32ValList = function(value) { + jspb.Message.setField(this, 16, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addUint32Val = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 16, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearUint32ValList = function() { + this.setUint32ValList([]); +}; + + +/** + * repeated uint64 uint64_val = 17; + * @return {!Array} + */ +proto.tensorflow.Tensor.prototype.getUint64ValList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 17)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.Tensor.prototype.setUint64ValList = function(value) { + jspb.Message.setField(this, 17, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.Tensor.prototype.addUint64Val = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 17, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.Tensor.prototype.clearUint64ValList = function() { + this.setUint64ValList([]); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.tensorflow.AttrValue.oneofGroups_ = [[1,2,3,4,5,6,7,8,9,10]]; + +/** + * @enum {number} + */ +proto.tensorflow.AttrValue.ValueCase = { + VALUE_NOT_SET: 0, + LIST: 1, + S: 2, + I: 3, + F: 4, + B: 5, + TYPE: 6, + SHAPE: 7, + TENSOR: 8, + PLACEHOLDER: 9, + FUNC: 10 +}; + +/** + * @return {proto.tensorflow.AttrValue.ValueCase} + */ +proto.tensorflow.AttrValue.prototype.getValueCase = function() { + return /** @type {proto.tensorflow.AttrValue.ValueCase} */(jspb.Message.computeOneofCase(this, proto.tensorflow.AttrValue.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.AttrValue.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.AttrValue.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.AttrValue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AttrValue.toObject = function(includeInstance, msg) { + var f, obj = { + list: (f = msg.getList()) && proto.tensorflow.AttrValue.ListValue.toObject(includeInstance, f), + s: msg.getS_asB64(), + i: jspb.Message.getFieldWithDefault(msg, 3, 0), + f: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0), + b: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + type: jspb.Message.getFieldWithDefault(msg, 6, 0), + shape: (f = msg.getShape()) && proto.tensorflow.TensorShape.toObject(includeInstance, f), + tensor: (f = msg.getTensor()) && proto.tensorflow.Tensor.toObject(includeInstance, f), + placeholder: jspb.Message.getFieldWithDefault(msg, 9, ""), + func: (f = msg.getFunc()) && proto.tensorflow.NameAttrList.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.AttrValue} + */ +proto.tensorflow.AttrValue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.AttrValue; + return proto.tensorflow.AttrValue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.AttrValue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.AttrValue} + */ +proto.tensorflow.AttrValue.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.AttrValue.ListValue; + reader.readMessage(value,proto.tensorflow.AttrValue.ListValue.deserializeBinaryFromReader); + msg.setList(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setS(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setI(value); + break; + case 4: + var value = /** @type {number} */ (reader.readFloat()); + msg.setF(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setB(value); + break; + case 6: + var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); + msg.setType(value); + break; + case 7: + var value = new proto.tensorflow.TensorShape; + reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); + msg.setShape(value); + break; + case 8: + var value = new proto.tensorflow.Tensor; + reader.readMessage(value,proto.tensorflow.Tensor.deserializeBinaryFromReader); + msg.setTensor(value); + break; + case 9: + var value = /** @type {string} */ (reader.readString()); + msg.setPlaceholder(value); + break; + case 10: + var value = new proto.tensorflow.NameAttrList; + reader.readMessage(value,proto.tensorflow.NameAttrList.deserializeBinaryFromReader); + msg.setFunc(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.AttrValue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.AttrValue.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.AttrValue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AttrValue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getList(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.AttrValue.ListValue.serializeBinaryToWriter + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 2)); + if (f != null) { + writer.writeBytes( + 2, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 3)); + if (f != null) { + writer.writeInt64( + 3, + f + ); + } + f = /** @type {number} */ (jspb.Message.getField(message, 4)); + if (f != null) { + writer.writeFloat( + 4, + f + ); + } + f = /** @type {boolean} */ (jspb.Message.getField(message, 5)); + if (f != null) { + writer.writeBool( + 5, + f + ); + } + f = /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeEnum( + 6, + f + ); + } + f = message.getShape(); + if (f != null) { + writer.writeMessage( + 7, + f, + proto.tensorflow.TensorShape.serializeBinaryToWriter + ); + } + f = message.getTensor(); + if (f != null) { + writer.writeMessage( + 8, + f, + proto.tensorflow.Tensor.serializeBinaryToWriter + ); + } + f = /** @type {string} */ (jspb.Message.getField(message, 9)); + if (f != null) { + writer.writeString( + 9, + f + ); + } + f = message.getFunc(); + if (f != null) { + writer.writeMessage( + 10, + f, + proto.tensorflow.NameAttrList.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.AttrValue.ListValue.repeatedFields_ = [2,3,4,5,6,7,8,9]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.AttrValue.ListValue.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.AttrValue.ListValue.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.AttrValue.ListValue} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AttrValue.ListValue.toObject = function(includeInstance, msg) { + var f, obj = { + sList: msg.getSList_asB64(), + iList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + fList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 4)) == null ? undefined : f, + bList: (f = jspb.Message.getRepeatedBooleanField(msg, 5)) == null ? undefined : f, + typeList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, + shapeList: jspb.Message.toObjectList(msg.getShapeList(), + proto.tensorflow.TensorShape.toObject, includeInstance), + tensorList: jspb.Message.toObjectList(msg.getTensorList(), + proto.tensorflow.Tensor.toObject, includeInstance), + funcList: jspb.Message.toObjectList(msg.getFuncList(), + proto.tensorflow.NameAttrList.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.AttrValue.ListValue} + */ +proto.tensorflow.AttrValue.ListValue.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.AttrValue.ListValue; + return proto.tensorflow.AttrValue.ListValue.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.AttrValue.ListValue} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.AttrValue.ListValue} + */ +proto.tensorflow.AttrValue.ListValue.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addS(value); + break; + case 3: + var value = /** @type {!Array} */ (reader.readPackedInt64()); + msg.setIList(value); + break; + case 4: + var value = /** @type {!Array} */ (reader.readPackedFloat()); + msg.setFList(value); + break; + case 5: + var value = /** @type {!Array} */ (reader.readPackedBool()); + msg.setBList(value); + break; + case 6: + var value = /** @type {!Array} */ (reader.readPackedEnum()); + msg.setTypeList(value); + break; + case 7: + var value = new proto.tensorflow.TensorShape; + reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); + msg.addShape(value); + break; + case 8: + var value = new proto.tensorflow.Tensor; + reader.readMessage(value,proto.tensorflow.Tensor.deserializeBinaryFromReader); + msg.addTensor(value); + break; + case 9: + var value = new proto.tensorflow.NameAttrList; + reader.readMessage(value,proto.tensorflow.NameAttrList.deserializeBinaryFromReader); + msg.addFunc(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.AttrValue.ListValue.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.AttrValue.ListValue} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AttrValue.ListValue.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 2, + f + ); + } + f = message.getIList(); + if (f.length > 0) { + writer.writePackedInt64( + 3, + f + ); + } + f = message.getFList(); + if (f.length > 0) { + writer.writePackedFloat( + 4, + f + ); + } + f = message.getBList(); + if (f.length > 0) { + writer.writePackedBool( + 5, + f + ); + } + f = message.getTypeList(); + if (f.length > 0) { + writer.writePackedEnum( + 6, + f + ); + } + f = message.getShapeList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 7, + f, + proto.tensorflow.TensorShape.serializeBinaryToWriter + ); + } + f = message.getTensorList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 8, + f, + proto.tensorflow.Tensor.serializeBinaryToWriter + ); + } + f = message.getFuncList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 9, + f, + proto.tensorflow.NameAttrList.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated bytes s = 2; + * @return {!(Array|Array)} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getSList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 2)); +}; + + +/** + * repeated bytes s = 2; + * This is a type-conversion wrapper around `getSList()` + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getSList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getSList())); +}; + + +/** + * repeated bytes s = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSList()` + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getSList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getSList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setSList = function(value) { + jspb.Message.setField(this, 2, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addS = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 2, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearSList = function() { + this.setSList([]); +}; + + +/** + * repeated int64 i = 3; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getIList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setIList = function(value) { + jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addI = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearIList = function() { + this.setIList([]); +}; + + +/** + * repeated float f = 4; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getFList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 4)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setFList = function(value) { + jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addF = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearFList = function() { + this.setFList([]); +}; + + +/** + * repeated bool b = 5; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getBList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedBooleanField(this, 5)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setBList = function(value) { + jspb.Message.setField(this, 5, value || []); +}; + + +/** + * @param {boolean} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addB = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 5, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearBList = function() { + this.setBList([]); +}; + + +/** + * repeated DataType type = 6; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getTypeList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 6)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setTypeList = function(value) { + jspb.Message.setField(this, 6, value || []); +}; + + +/** + * @param {!proto.tensorflow.DataType} value + * @param {number=} opt_index + */ +proto.tensorflow.AttrValue.ListValue.prototype.addType = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 6, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearTypeList = function() { + this.setTypeList([]); +}; + + +/** + * repeated TensorShape shape = 7; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getShapeList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.TensorShape, 7)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setShapeList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 7, value); +}; + + +/** + * @param {!proto.tensorflow.TensorShape=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.TensorShape} + */ +proto.tensorflow.AttrValue.ListValue.prototype.addShape = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.tensorflow.TensorShape, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearShapeList = function() { + this.setShapeList([]); +}; + + +/** + * repeated Tensor tensor = 8; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getTensorList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.Tensor, 8)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setTensorList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 8, value); +}; + + +/** + * @param {!proto.tensorflow.Tensor=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.Tensor} + */ +proto.tensorflow.AttrValue.ListValue.prototype.addTensor = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.tensorflow.Tensor, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearTensorList = function() { + this.setTensorList([]); +}; + + +/** + * repeated NameAttrList func = 9; + * @return {!Array} + */ +proto.tensorflow.AttrValue.ListValue.prototype.getFuncList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.NameAttrList, 9)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.AttrValue.ListValue.prototype.setFuncList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 9, value); +}; + + +/** + * @param {!proto.tensorflow.NameAttrList=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.NameAttrList} + */ +proto.tensorflow.AttrValue.ListValue.prototype.addFunc = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 9, opt_value, proto.tensorflow.NameAttrList, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.AttrValue.ListValue.prototype.clearFuncList = function() { + this.setFuncList([]); +}; + + +/** + * optional ListValue list = 1; + * @return {?proto.tensorflow.AttrValue.ListValue} + */ +proto.tensorflow.AttrValue.prototype.getList = function() { + return /** @type{?proto.tensorflow.AttrValue.ListValue} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.AttrValue.ListValue, 1)); +}; + + +/** @param {?proto.tensorflow.AttrValue.ListValue|undefined} value */ +proto.tensorflow.AttrValue.prototype.setList = function(value) { + jspb.Message.setOneofWrapperField(this, 1, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearList = function() { + this.setList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasList = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional bytes s = 2; + * @return {!(string|Uint8Array)} + */ +proto.tensorflow.AttrValue.prototype.getS = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes s = 2; + * This is a type-conversion wrapper around `getS()` + * @return {string} + */ +proto.tensorflow.AttrValue.prototype.getS_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getS())); +}; + + +/** + * optional bytes s = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getS()` + * @return {!Uint8Array} + */ +proto.tensorflow.AttrValue.prototype.getS_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getS())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.tensorflow.AttrValue.prototype.setS = function(value) { + jspb.Message.setOneofField(this, 2, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearS = function() { + jspb.Message.setOneofField(this, 2, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasS = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional int64 i = 3; + * @return {number} + */ +proto.tensorflow.AttrValue.prototype.getI = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.AttrValue.prototype.setI = function(value) { + jspb.Message.setOneofField(this, 3, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearI = function() { + jspb.Message.setOneofField(this, 3, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasI = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional float f = 4; + * @return {number} + */ +proto.tensorflow.AttrValue.prototype.getF = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); +}; + + +/** @param {number} value */ +proto.tensorflow.AttrValue.prototype.setF = function(value) { + jspb.Message.setOneofField(this, 4, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearF = function() { + jspb.Message.setOneofField(this, 4, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasF = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bool b = 5; + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.getB = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.AttrValue.prototype.setB = function(value) { + jspb.Message.setOneofField(this, 5, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearB = function() { + jspb.Message.setOneofField(this, 5, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasB = function() { + return jspb.Message.getField(this, 5) != null; +}; + + +/** + * optional DataType type = 6; + * @return {!proto.tensorflow.DataType} + */ +proto.tensorflow.AttrValue.prototype.getType = function() { + return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {!proto.tensorflow.DataType} value */ +proto.tensorflow.AttrValue.prototype.setType = function(value) { + jspb.Message.setOneofField(this, 6, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearType = function() { + jspb.Message.setOneofField(this, 6, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasType = function() { + return jspb.Message.getField(this, 6) != null; +}; + + +/** + * optional TensorShape shape = 7; + * @return {?proto.tensorflow.TensorShape} + */ +proto.tensorflow.AttrValue.prototype.getShape = function() { + return /** @type{?proto.tensorflow.TensorShape} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorShape, 7)); +}; + + +/** @param {?proto.tensorflow.TensorShape|undefined} value */ +proto.tensorflow.AttrValue.prototype.setShape = function(value) { + jspb.Message.setOneofWrapperField(this, 7, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearShape = function() { + this.setShape(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasShape = function() { + return jspb.Message.getField(this, 7) != null; +}; + + +/** + * optional Tensor tensor = 8; + * @return {?proto.tensorflow.Tensor} + */ +proto.tensorflow.AttrValue.prototype.getTensor = function() { + return /** @type{?proto.tensorflow.Tensor} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.Tensor, 8)); +}; + + +/** @param {?proto.tensorflow.Tensor|undefined} value */ +proto.tensorflow.AttrValue.prototype.setTensor = function(value) { + jspb.Message.setOneofWrapperField(this, 8, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearTensor = function() { + this.setTensor(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasTensor = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * optional string placeholder = 9; + * @return {string} + */ +proto.tensorflow.AttrValue.prototype.getPlaceholder = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 9, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.AttrValue.prototype.setPlaceholder = function(value) { + jspb.Message.setOneofField(this, 9, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearPlaceholder = function() { + jspb.Message.setOneofField(this, 9, proto.tensorflow.AttrValue.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasPlaceholder = function() { + return jspb.Message.getField(this, 9) != null; +}; + + +/** + * optional NameAttrList func = 10; + * @return {?proto.tensorflow.NameAttrList} + */ +proto.tensorflow.AttrValue.prototype.getFunc = function() { + return /** @type{?proto.tensorflow.NameAttrList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.NameAttrList, 10)); +}; + + +/** @param {?proto.tensorflow.NameAttrList|undefined} value */ +proto.tensorflow.AttrValue.prototype.setFunc = function(value) { + jspb.Message.setOneofWrapperField(this, 10, proto.tensorflow.AttrValue.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AttrValue.prototype.clearFunc = function() { + this.setFunc(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AttrValue.prototype.hasFunc = function() { + return jspb.Message.getField(this, 10) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.NameAttrList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.NameAttrList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.NameAttrList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.NameAttrList.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + attrMap: (f = msg.getAttrMap()) ? f.toObject(includeInstance, proto.tensorflow.AttrValue.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.NameAttrList} + */ +proto.tensorflow.NameAttrList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.NameAttrList; + return proto.tensorflow.NameAttrList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.NameAttrList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.NameAttrList} + */ +proto.tensorflow.NameAttrList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = msg.getAttrMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.AttrValue.deserializeBinaryFromReader, ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.NameAttrList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.NameAttrList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.NameAttrList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.NameAttrList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getAttrMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.AttrValue.serializeBinaryToWriter); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.NameAttrList.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.NameAttrList.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * map attr = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.NameAttrList.prototype.getAttrMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + proto.tensorflow.AttrValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.NameAttrList.prototype.clearAttrMap = function() { + this.getAttrMap().clear(); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.NodeDef.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.NodeDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.NodeDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.NodeDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.NodeDef.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + op: jspb.Message.getFieldWithDefault(msg, 2, ""), + inputList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + device: jspb.Message.getFieldWithDefault(msg, 4, ""), + attrMap: (f = msg.getAttrMap()) ? f.toObject(includeInstance, proto.tensorflow.AttrValue.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.NodeDef} + */ +proto.tensorflow.NodeDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.NodeDef; + return proto.tensorflow.NodeDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.NodeDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.NodeDef} + */ +proto.tensorflow.NodeDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setOp(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addInput(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDevice(value); + break; + case 5: + var value = msg.getAttrMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.AttrValue.deserializeBinaryFromReader, ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.NodeDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.NodeDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.NodeDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.NodeDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getOp(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getInputList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getDevice(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getAttrMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.AttrValue.serializeBinaryToWriter); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.NodeDef.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.NodeDef.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string op = 2; + * @return {string} + */ +proto.tensorflow.NodeDef.prototype.getOp = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.NodeDef.prototype.setOp = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * repeated string input = 3; + * @return {!Array} + */ +proto.tensorflow.NodeDef.prototype.getInputList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.NodeDef.prototype.setInputList = function(value) { + jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + */ +proto.tensorflow.NodeDef.prototype.addInput = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.NodeDef.prototype.clearInputList = function() { + this.setInputList([]); +}; + + +/** + * optional string device = 4; + * @return {string} + */ +proto.tensorflow.NodeDef.prototype.getDevice = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.NodeDef.prototype.setDevice = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * map attr = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.NodeDef.prototype.getAttrMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + proto.tensorflow.AttrValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.NodeDef.prototype.clearAttrMap = function() { + this.getAttrMap().clear(); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.VersionDef.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.VersionDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.VersionDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.VersionDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.VersionDef.toObject = function(includeInstance, msg) { + var f, obj = { + producer: jspb.Message.getFieldWithDefault(msg, 1, 0), + minConsumer: jspb.Message.getFieldWithDefault(msg, 2, 0), + badConsumersList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.VersionDef} + */ +proto.tensorflow.VersionDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.VersionDef; + return proto.tensorflow.VersionDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.VersionDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.VersionDef} + */ +proto.tensorflow.VersionDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setProducer(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setMinConsumer(value); + break; + case 3: + var value = /** @type {!Array} */ (reader.readPackedInt32()); + msg.setBadConsumersList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.VersionDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.VersionDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.VersionDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.VersionDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getProducer(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getMinConsumer(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } + f = message.getBadConsumersList(); + if (f.length > 0) { + writer.writePackedInt32( + 3, + f + ); + } +}; + + +/** + * optional int32 producer = 1; + * @return {number} + */ +proto.tensorflow.VersionDef.prototype.getProducer = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.VersionDef.prototype.setProducer = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional int32 min_consumer = 2; + * @return {number} + */ +proto.tensorflow.VersionDef.prototype.getMinConsumer = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.VersionDef.prototype.setMinConsumer = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * repeated int32 bad_consumers = 3; + * @return {!Array} + */ +proto.tensorflow.VersionDef.prototype.getBadConsumersList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.VersionDef.prototype.setBadConsumersList = function(value) { + jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.VersionDef.prototype.addBadConsumers = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.VersionDef.prototype.clearBadConsumersList = function() { + this.setBadConsumersList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.GraphDef.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.GraphDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.GraphDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.GraphDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.GraphDef.toObject = function(includeInstance, msg) { + var f, obj = { + nodeList: jspb.Message.toObjectList(msg.getNodeList(), + proto.tensorflow.NodeDef.toObject, includeInstance), + versions: (f = msg.getVersions()) && proto.tensorflow.VersionDef.toObject(includeInstance, f), + library: (f = msg.getLibrary()) && proto.tensorflow.FunctionDefLibrary.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.GraphDef} + */ +proto.tensorflow.GraphDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.GraphDef; + return proto.tensorflow.GraphDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.GraphDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.GraphDef} + */ +proto.tensorflow.GraphDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.NodeDef; + reader.readMessage(value,proto.tensorflow.NodeDef.deserializeBinaryFromReader); + msg.addNode(value); + break; + case 4: + var value = new proto.tensorflow.VersionDef; + reader.readMessage(value,proto.tensorflow.VersionDef.deserializeBinaryFromReader); + msg.setVersions(value); + break; + case 2: + var value = new proto.tensorflow.FunctionDefLibrary; + reader.readMessage(value,proto.tensorflow.FunctionDefLibrary.deserializeBinaryFromReader); + msg.setLibrary(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.GraphDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.GraphDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.GraphDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.GraphDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNodeList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.tensorflow.NodeDef.serializeBinaryToWriter + ); + } + f = message.getVersions(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.tensorflow.VersionDef.serializeBinaryToWriter + ); + } + f = message.getLibrary(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.FunctionDefLibrary.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated NodeDef node = 1; + * @return {!Array} + */ +proto.tensorflow.GraphDef.prototype.getNodeList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.NodeDef, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.GraphDef.prototype.setNodeList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.tensorflow.NodeDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.NodeDef} + */ +proto.tensorflow.GraphDef.prototype.addNode = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.NodeDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.GraphDef.prototype.clearNodeList = function() { + this.setNodeList([]); +}; + + +/** + * optional VersionDef versions = 4; + * @return {?proto.tensorflow.VersionDef} + */ +proto.tensorflow.GraphDef.prototype.getVersions = function() { + return /** @type{?proto.tensorflow.VersionDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.VersionDef, 4)); +}; + + +/** @param {?proto.tensorflow.VersionDef|undefined} value */ +proto.tensorflow.GraphDef.prototype.setVersions = function(value) { + jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.GraphDef.prototype.clearVersions = function() { + this.setVersions(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.GraphDef.prototype.hasVersions = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional FunctionDefLibrary library = 2; + * @return {?proto.tensorflow.FunctionDefLibrary} + */ +proto.tensorflow.GraphDef.prototype.getLibrary = function() { + return /** @type{?proto.tensorflow.FunctionDefLibrary} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.FunctionDefLibrary, 2)); +}; + + +/** @param {?proto.tensorflow.FunctionDefLibrary|undefined} value */ +proto.tensorflow.GraphDef.prototype.setLibrary = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.GraphDef.prototype.clearLibrary = function() { + this.setLibrary(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.GraphDef.prototype.hasLibrary = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.tensorflow.CollectionDef.oneofGroups_ = [[1,2,3,4,5]]; + +/** + * @enum {number} + */ +proto.tensorflow.CollectionDef.KindCase = { + KIND_NOT_SET: 0, + NODE_LIST: 1, + BYTES_LIST: 2, + INT64_LIST: 3, + FLOAT_LIST: 4, + ANY_LIST: 5 +}; + +/** + * @return {proto.tensorflow.CollectionDef.KindCase} + */ +proto.tensorflow.CollectionDef.prototype.getKindCase = function() { + return /** @type {proto.tensorflow.CollectionDef.KindCase} */(jspb.Message.computeOneofCase(this, proto.tensorflow.CollectionDef.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.toObject = function(includeInstance, msg) { + var f, obj = { + nodeList: (f = msg.getNodeList()) && proto.tensorflow.CollectionDef.NodeList.toObject(includeInstance, f), + bytesList: (f = msg.getBytesList()) && proto.tensorflow.CollectionDef.BytesList.toObject(includeInstance, f), + int64List: (f = msg.getInt64List()) && proto.tensorflow.CollectionDef.Int64List.toObject(includeInstance, f), + floatList: (f = msg.getFloatList()) && proto.tensorflow.CollectionDef.FloatList.toObject(includeInstance, f), + anyList: (f = msg.getAnyList()) && proto.tensorflow.CollectionDef.AnyList.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef} + */ +proto.tensorflow.CollectionDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef; + return proto.tensorflow.CollectionDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef} + */ +proto.tensorflow.CollectionDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.CollectionDef.NodeList; + reader.readMessage(value,proto.tensorflow.CollectionDef.NodeList.deserializeBinaryFromReader); + msg.setNodeList(value); + break; + case 2: + var value = new proto.tensorflow.CollectionDef.BytesList; + reader.readMessage(value,proto.tensorflow.CollectionDef.BytesList.deserializeBinaryFromReader); + msg.setBytesList(value); + break; + case 3: + var value = new proto.tensorflow.CollectionDef.Int64List; + reader.readMessage(value,proto.tensorflow.CollectionDef.Int64List.deserializeBinaryFromReader); + msg.setInt64List(value); + break; + case 4: + var value = new proto.tensorflow.CollectionDef.FloatList; + reader.readMessage(value,proto.tensorflow.CollectionDef.FloatList.deserializeBinaryFromReader); + msg.setFloatList(value); + break; + case 5: + var value = new proto.tensorflow.CollectionDef.AnyList; + reader.readMessage(value,proto.tensorflow.CollectionDef.AnyList.deserializeBinaryFromReader); + msg.setAnyList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getNodeList(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.CollectionDef.NodeList.serializeBinaryToWriter + ); + } + f = message.getBytesList(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.CollectionDef.BytesList.serializeBinaryToWriter + ); + } + f = message.getInt64List(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.CollectionDef.Int64List.serializeBinaryToWriter + ); + } + f = message.getFloatList(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.tensorflow.CollectionDef.FloatList.serializeBinaryToWriter + ); + } + f = message.getAnyList(); + if (f != null) { + writer.writeMessage( + 5, + f, + proto.tensorflow.CollectionDef.AnyList.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.NodeList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.NodeList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.NodeList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.NodeList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.NodeList.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.NodeList} + */ +proto.tensorflow.CollectionDef.NodeList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.NodeList; + return proto.tensorflow.CollectionDef.NodeList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.NodeList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.NodeList} + */ +proto.tensorflow.CollectionDef.NodeList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.addValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.NodeList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.NodeList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.NodeList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.NodeList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writeRepeatedString( + 1, + f + ); + } +}; + + +/** + * repeated string value = 1; + * @return {!Array} + */ +proto.tensorflow.CollectionDef.NodeList.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.CollectionDef.NodeList.prototype.setValueList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + */ +proto.tensorflow.CollectionDef.NodeList.prototype.addValue = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.NodeList.prototype.clearValueList = function() { + this.setValueList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.BytesList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.BytesList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.BytesList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.BytesList.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: msg.getValueList_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.BytesList} + */ +proto.tensorflow.CollectionDef.BytesList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.BytesList; + return proto.tensorflow.CollectionDef.BytesList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.BytesList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.BytesList} + */ +proto.tensorflow.CollectionDef.BytesList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.BytesList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.BytesList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.BytesList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } +}; + + +/** + * repeated bytes value = 1; + * @return {!(Array|Array)} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.getValueList = function() { + return /** @type {!(Array|Array)} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes value = 1; + * This is a type-conversion wrapper around `getValueList()` + * @return {!Array} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.getValueList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getValueList())); +}; + + +/** + * repeated bytes value = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValueList()` + * @return {!Array} + */ +proto.tensorflow.CollectionDef.BytesList.prototype.getValueList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getValueList())); +}; + + +/** @param {!(Array|Array)} value */ +proto.tensorflow.CollectionDef.BytesList.prototype.setValueList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + */ +proto.tensorflow.CollectionDef.BytesList.prototype.addValue = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.BytesList.prototype.clearValueList = function() { + this.setValueList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.Int64List.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.Int64List.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.Int64List.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.Int64List} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.Int64List.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.Int64List} + */ +proto.tensorflow.CollectionDef.Int64List.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.Int64List; + return proto.tensorflow.CollectionDef.Int64List.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.Int64List} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.Int64List} + */ +proto.tensorflow.CollectionDef.Int64List.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Array} */ (reader.readPackedInt64()); + msg.setValueList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.Int64List.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.Int64List.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.Int64List} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.Int64List.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writePackedInt64( + 1, + f + ); + } +}; + + +/** + * repeated int64 value = 1; + * @return {!Array} + */ +proto.tensorflow.CollectionDef.Int64List.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.CollectionDef.Int64List.prototype.setValueList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.CollectionDef.Int64List.prototype.addValue = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.Int64List.prototype.clearValueList = function() { + this.setValueList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.FloatList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.FloatList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.FloatList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.FloatList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.FloatList.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.FloatList} + */ +proto.tensorflow.CollectionDef.FloatList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.FloatList; + return proto.tensorflow.CollectionDef.FloatList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.FloatList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.FloatList} + */ +proto.tensorflow.CollectionDef.FloatList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Array} */ (reader.readPackedFloat()); + msg.setValueList(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.FloatList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.FloatList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.FloatList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.FloatList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writePackedFloat( + 1, + f + ); + } +}; + + +/** + * repeated float value = 1; + * @return {!Array} + */ +proto.tensorflow.CollectionDef.FloatList.prototype.getValueList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedFloatingPointField(this, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.CollectionDef.FloatList.prototype.setValueList = function(value) { + jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + */ +proto.tensorflow.CollectionDef.FloatList.prototype.addValue = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.FloatList.prototype.clearValueList = function() { + this.setValueList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.CollectionDef.AnyList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.CollectionDef.AnyList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.CollectionDef.AnyList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.CollectionDef.AnyList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.AnyList.toObject = function(includeInstance, msg) { + var f, obj = { + valueList: jspb.Message.toObjectList(msg.getValueList(), + proto.tensorflow.Any.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.CollectionDef.AnyList} + */ +proto.tensorflow.CollectionDef.AnyList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.CollectionDef.AnyList; + return proto.tensorflow.CollectionDef.AnyList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.CollectionDef.AnyList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.CollectionDef.AnyList} + */ +proto.tensorflow.CollectionDef.AnyList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.Any; + reader.readMessage(value,proto.tensorflow.Any.deserializeBinaryFromReader); + msg.addValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.CollectionDef.AnyList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.CollectionDef.AnyList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.CollectionDef.AnyList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.CollectionDef.AnyList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValueList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.tensorflow.Any.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated Any value = 1; + * @return {!Array} + */ +proto.tensorflow.CollectionDef.AnyList.prototype.getValueList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.Any, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.CollectionDef.AnyList.prototype.setValueList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.tensorflow.Any=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.Any} + */ +proto.tensorflow.CollectionDef.AnyList.prototype.addValue = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.Any, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.CollectionDef.AnyList.prototype.clearValueList = function() { + this.setValueList([]); +}; + + +/** + * optional NodeList node_list = 1; + * @return {?proto.tensorflow.CollectionDef.NodeList} + */ +proto.tensorflow.CollectionDef.prototype.getNodeList = function() { + return /** @type{?proto.tensorflow.CollectionDef.NodeList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.NodeList, 1)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.NodeList|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setNodeList = function(value) { + jspb.Message.setOneofWrapperField(this, 1, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearNodeList = function() { + this.setNodeList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasNodeList = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional BytesList bytes_list = 2; + * @return {?proto.tensorflow.CollectionDef.BytesList} + */ +proto.tensorflow.CollectionDef.prototype.getBytesList = function() { + return /** @type{?proto.tensorflow.CollectionDef.BytesList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.BytesList, 2)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.BytesList|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setBytesList = function(value) { + jspb.Message.setOneofWrapperField(this, 2, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearBytesList = function() { + this.setBytesList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasBytesList = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Int64List int64_list = 3; + * @return {?proto.tensorflow.CollectionDef.Int64List} + */ +proto.tensorflow.CollectionDef.prototype.getInt64List = function() { + return /** @type{?proto.tensorflow.CollectionDef.Int64List} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.Int64List, 3)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.Int64List|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setInt64List = function(value) { + jspb.Message.setOneofWrapperField(this, 3, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearInt64List = function() { + this.setInt64List(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasInt64List = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional FloatList float_list = 4; + * @return {?proto.tensorflow.CollectionDef.FloatList} + */ +proto.tensorflow.CollectionDef.prototype.getFloatList = function() { + return /** @type{?proto.tensorflow.CollectionDef.FloatList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.FloatList, 4)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.FloatList|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setFloatList = function(value) { + jspb.Message.setOneofWrapperField(this, 4, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearFloatList = function() { + this.setFloatList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasFloatList = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional AnyList any_list = 5; + * @return {?proto.tensorflow.CollectionDef.AnyList} + */ +proto.tensorflow.CollectionDef.prototype.getAnyList = function() { + return /** @type{?proto.tensorflow.CollectionDef.AnyList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.CollectionDef.AnyList, 5)); +}; + + +/** @param {?proto.tensorflow.CollectionDef.AnyList|undefined} value */ +proto.tensorflow.CollectionDef.prototype.setAnyList = function(value) { + jspb.Message.setOneofWrapperField(this, 5, proto.tensorflow.CollectionDef.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.CollectionDef.prototype.clearAnyList = function() { + this.setAnyList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.CollectionDef.prototype.hasAnyList = function() { + return jspb.Message.getField(this, 5) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.SaverDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.SaverDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.SaverDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SaverDef.toObject = function(includeInstance, msg) { + var f, obj = { + filenameTensorName: jspb.Message.getFieldWithDefault(msg, 1, ""), + saveTensorName: jspb.Message.getFieldWithDefault(msg, 2, ""), + restoreOpName: jspb.Message.getFieldWithDefault(msg, 3, ""), + maxToKeep: jspb.Message.getFieldWithDefault(msg, 4, 0), + sharded: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + keepCheckpointEveryNHours: jspb.Message.getFloatingPointFieldWithDefault(msg, 6, 0.0), + version: jspb.Message.getFieldWithDefault(msg, 7, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.SaverDef} + */ +proto.tensorflow.SaverDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.SaverDef; + return proto.tensorflow.SaverDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.SaverDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.SaverDef} + */ +proto.tensorflow.SaverDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setFilenameTensorName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setSaveTensorName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setRestoreOpName(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt32()); + msg.setMaxToKeep(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setSharded(value); + break; + case 6: + var value = /** @type {number} */ (reader.readFloat()); + msg.setKeepCheckpointEveryNHours(value); + break; + case 7: + var value = /** @type {!proto.tensorflow.SaverDef.CheckpointFormatVersion} */ (reader.readEnum()); + msg.setVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.SaverDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.SaverDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.SaverDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SaverDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFilenameTensorName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getSaveTensorName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getRestoreOpName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } + f = message.getMaxToKeep(); + if (f !== 0) { + writer.writeInt32( + 4, + f + ); + } + f = message.getSharded(); + if (f) { + writer.writeBool( + 5, + f + ); + } + f = message.getKeepCheckpointEveryNHours(); + if (f !== 0.0) { + writer.writeFloat( + 6, + f + ); + } + f = message.getVersion(); + if (f !== 0.0) { + writer.writeEnum( + 7, + f + ); + } +}; + + +/** + * @enum {number} + */ +proto.tensorflow.SaverDef.CheckpointFormatVersion = { + LEGACY: 0, + V1: 1, + V2: 2 +}; + +/** + * optional string filename_tensor_name = 1; + * @return {string} + */ +proto.tensorflow.SaverDef.prototype.getFilenameTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.SaverDef.prototype.setFilenameTensorName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string save_tensor_name = 2; + * @return {string} + */ +proto.tensorflow.SaverDef.prototype.getSaveTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.SaverDef.prototype.setSaveTensorName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string restore_op_name = 3; + * @return {string} + */ +proto.tensorflow.SaverDef.prototype.getRestoreOpName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.SaverDef.prototype.setRestoreOpName = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional int32 max_to_keep = 4; + * @return {number} + */ +proto.tensorflow.SaverDef.prototype.getMaxToKeep = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.SaverDef.prototype.setMaxToKeep = function(value) { + jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional bool sharded = 5; + * @return {boolean} + */ +proto.tensorflow.SaverDef.prototype.getSharded = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.SaverDef.prototype.setSharded = function(value) { + jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +/** + * optional float keep_checkpoint_every_n_hours = 6; + * @return {number} + */ +proto.tensorflow.SaverDef.prototype.getKeepCheckpointEveryNHours = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 6, 0.0)); +}; + + +/** @param {number} value */ +proto.tensorflow.SaverDef.prototype.setKeepCheckpointEveryNHours = function(value) { + jspb.Message.setProto3FloatField(this, 6, value); +}; + + +/** + * optional CheckpointFormatVersion version = 7; + * @return {!proto.tensorflow.SaverDef.CheckpointFormatVersion} + */ +proto.tensorflow.SaverDef.prototype.getVersion = function() { + return /** @type {!proto.tensorflow.SaverDef.CheckpointFormatVersion} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** @param {!proto.tensorflow.SaverDef.CheckpointFormatVersion} value */ +proto.tensorflow.SaverDef.prototype.setVersion = function(value) { + jspb.Message.setProto3EnumField(this, 7, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.tensorflow.TensorInfo.oneofGroups_ = [[1,4]]; + +/** + * @enum {number} + */ +proto.tensorflow.TensorInfo.EncodingCase = { + ENCODING_NOT_SET: 0, + NAME: 1, + COO_SPARSE: 4 +}; + +/** + * @return {proto.tensorflow.TensorInfo.EncodingCase} + */ +proto.tensorflow.TensorInfo.prototype.getEncodingCase = function() { + return /** @type {proto.tensorflow.TensorInfo.EncodingCase} */(jspb.Message.computeOneofCase(this, proto.tensorflow.TensorInfo.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.TensorInfo.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.TensorInfo.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.TensorInfo} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorInfo.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + cooSparse: (f = msg.getCooSparse()) && proto.tensorflow.TensorInfo.CooSparse.toObject(includeInstance, f), + dtype: jspb.Message.getFieldWithDefault(msg, 2, 0), + tensorShape: (f = msg.getTensorShape()) && proto.tensorflow.TensorShape.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.TensorInfo} + */ +proto.tensorflow.TensorInfo.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.TensorInfo; + return proto.tensorflow.TensorInfo.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.TensorInfo} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.TensorInfo} + */ +proto.tensorflow.TensorInfo.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 4: + var value = new proto.tensorflow.TensorInfo.CooSparse; + reader.readMessage(value,proto.tensorflow.TensorInfo.CooSparse.deserializeBinaryFromReader); + msg.setCooSparse(value); + break; + case 2: + var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); + msg.setDtype(value); + break; + case 3: + var value = new proto.tensorflow.TensorShape; + reader.readMessage(value,proto.tensorflow.TensorShape.deserializeBinaryFromReader); + msg.setTensorShape(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.TensorInfo.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.TensorInfo.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.TensorInfo} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorInfo.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = /** @type {string} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeString( + 1, + f + ); + } + f = message.getCooSparse(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.tensorflow.TensorInfo.CooSparse.serializeBinaryToWriter + ); + } + f = message.getDtype(); + if (f !== 0.0) { + writer.writeEnum( + 2, + f + ); + } + f = message.getTensorShape(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.TensorShape.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.TensorInfo.CooSparse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.TensorInfo.CooSparse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorInfo.CooSparse.toObject = function(includeInstance, msg) { + var f, obj = { + valuesTensorName: jspb.Message.getFieldWithDefault(msg, 1, ""), + indicesTensorName: jspb.Message.getFieldWithDefault(msg, 2, ""), + denseShapeTensorName: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.TensorInfo.CooSparse} + */ +proto.tensorflow.TensorInfo.CooSparse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.TensorInfo.CooSparse; + return proto.tensorflow.TensorInfo.CooSparse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.TensorInfo.CooSparse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.TensorInfo.CooSparse} + */ +proto.tensorflow.TensorInfo.CooSparse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setValuesTensorName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setIndicesTensorName(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setDenseShapeTensorName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.TensorInfo.CooSparse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.TensorInfo.CooSparse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.TensorInfo.CooSparse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValuesTensorName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getIndicesTensorName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDenseShapeTensorName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * optional string values_tensor_name = 1; + * @return {string} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.getValuesTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorInfo.CooSparse.prototype.setValuesTensorName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string indices_tensor_name = 2; + * @return {string} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.getIndicesTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorInfo.CooSparse.prototype.setIndicesTensorName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string dense_shape_tensor_name = 3; + * @return {string} + */ +proto.tensorflow.TensorInfo.CooSparse.prototype.getDenseShapeTensorName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorInfo.CooSparse.prototype.setDenseShapeTensorName = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.TensorInfo.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.TensorInfo.prototype.setName = function(value) { + jspb.Message.setOneofField(this, 1, proto.tensorflow.TensorInfo.oneofGroups_[0], value); +}; + + +/** + * Clears the field making it undefined. + */ +proto.tensorflow.TensorInfo.prototype.clearName = function() { + jspb.Message.setOneofField(this, 1, proto.tensorflow.TensorInfo.oneofGroups_[0], undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.TensorInfo.prototype.hasName = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional CooSparse coo_sparse = 4; + * @return {?proto.tensorflow.TensorInfo.CooSparse} + */ +proto.tensorflow.TensorInfo.prototype.getCooSparse = function() { + return /** @type{?proto.tensorflow.TensorInfo.CooSparse} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorInfo.CooSparse, 4)); +}; + + +/** @param {?proto.tensorflow.TensorInfo.CooSparse|undefined} value */ +proto.tensorflow.TensorInfo.prototype.setCooSparse = function(value) { + jspb.Message.setOneofWrapperField(this, 4, proto.tensorflow.TensorInfo.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.TensorInfo.prototype.clearCooSparse = function() { + this.setCooSparse(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.TensorInfo.prototype.hasCooSparse = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional DataType dtype = 2; + * @return {!proto.tensorflow.DataType} + */ +proto.tensorflow.TensorInfo.prototype.getDtype = function() { + return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {!proto.tensorflow.DataType} value */ +proto.tensorflow.TensorInfo.prototype.setDtype = function(value) { + jspb.Message.setProto3EnumField(this, 2, value); +}; + + +/** + * optional TensorShape tensor_shape = 3; + * @return {?proto.tensorflow.TensorShape} + */ +proto.tensorflow.TensorInfo.prototype.getTensorShape = function() { + return /** @type{?proto.tensorflow.TensorShape} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorShape, 3)); +}; + + +/** @param {?proto.tensorflow.TensorShape|undefined} value */ +proto.tensorflow.TensorInfo.prototype.setTensorShape = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.TensorInfo.prototype.clearTensorShape = function() { + this.setTensorShape(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.TensorInfo.prototype.hasTensorShape = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.SignatureDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.SignatureDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.SignatureDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SignatureDef.toObject = function(includeInstance, msg) { + var f, obj = { + inputsMap: (f = msg.getInputsMap()) ? f.toObject(includeInstance, proto.tensorflow.TensorInfo.toObject) : [], + outputsMap: (f = msg.getOutputsMap()) ? f.toObject(includeInstance, proto.tensorflow.TensorInfo.toObject) : [], + methodName: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.SignatureDef} + */ +proto.tensorflow.SignatureDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.SignatureDef; + return proto.tensorflow.SignatureDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.SignatureDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.SignatureDef} + */ +proto.tensorflow.SignatureDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getInputsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.TensorInfo.deserializeBinaryFromReader, ""); + }); + break; + case 2: + var value = msg.getOutputsMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.TensorInfo.deserializeBinaryFromReader, ""); + }); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setMethodName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.SignatureDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.SignatureDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.SignatureDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SignatureDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getInputsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.TensorInfo.serializeBinaryToWriter); + } + f = message.getOutputsMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(2, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.TensorInfo.serializeBinaryToWriter); + } + f = message.getMethodName(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * map inputs = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.SignatureDef.prototype.getInputsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.tensorflow.TensorInfo)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.SignatureDef.prototype.clearInputsMap = function() { + this.getInputsMap().clear(); +}; + + +/** + * map outputs = 2; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.SignatureDef.prototype.getOutputsMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 2, opt_noLazyCreate, + proto.tensorflow.TensorInfo)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.SignatureDef.prototype.clearOutputsMap = function() { + this.getOutputsMap().clear(); +}; + + +/** + * optional string method_name = 3; + * @return {string} + */ +proto.tensorflow.SignatureDef.prototype.getMethodName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.SignatureDef.prototype.setMethodName = function(value) { + jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.AssetFileDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.AssetFileDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.AssetFileDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AssetFileDef.toObject = function(includeInstance, msg) { + var f, obj = { + tensorInfo: (f = msg.getTensorInfo()) && proto.tensorflow.TensorInfo.toObject(includeInstance, f), + filename: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.AssetFileDef} + */ +proto.tensorflow.AssetFileDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.AssetFileDef; + return proto.tensorflow.AssetFileDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.AssetFileDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.AssetFileDef} + */ +proto.tensorflow.AssetFileDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.TensorInfo; + reader.readMessage(value,proto.tensorflow.TensorInfo.deserializeBinaryFromReader); + msg.setTensorInfo(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setFilename(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.AssetFileDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.AssetFileDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.AssetFileDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.AssetFileDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTensorInfo(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.TensorInfo.serializeBinaryToWriter + ); + } + f = message.getFilename(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional TensorInfo tensor_info = 1; + * @return {?proto.tensorflow.TensorInfo} + */ +proto.tensorflow.AssetFileDef.prototype.getTensorInfo = function() { + return /** @type{?proto.tensorflow.TensorInfo} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.TensorInfo, 1)); +}; + + +/** @param {?proto.tensorflow.TensorInfo|undefined} value */ +proto.tensorflow.AssetFileDef.prototype.setTensorInfo = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.AssetFileDef.prototype.clearTensorInfo = function() { + this.setTensorInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.AssetFileDef.prototype.hasTensorInfo = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string filename = 2; + * @return {string} + */ +proto.tensorflow.AssetFileDef.prototype.getFilename = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.AssetFileDef.prototype.setFilename = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.OpDef.repeatedFields_ = [2,3,4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + inputArgList: jspb.Message.toObjectList(msg.getInputArgList(), + proto.tensorflow.OpDef.ArgDef.toObject, includeInstance), + outputArgList: jspb.Message.toObjectList(msg.getOutputArgList(), + proto.tensorflow.OpDef.ArgDef.toObject, includeInstance), + attrList: jspb.Message.toObjectList(msg.getAttrList(), + proto.tensorflow.OpDef.AttrDef.toObject, includeInstance), + deprecation: (f = msg.getDeprecation()) && proto.tensorflow.OpDef.OpDeprecation.toObject(includeInstance, f), + summary: jspb.Message.getFieldWithDefault(msg, 5, ""), + description: jspb.Message.getFieldWithDefault(msg, 6, ""), + isCommutative: jspb.Message.getBooleanFieldWithDefault(msg, 18, false), + isAggregate: jspb.Message.getBooleanFieldWithDefault(msg, 16, false), + isStateful: jspb.Message.getBooleanFieldWithDefault(msg, 17, false), + allowsUninitializedInput: jspb.Message.getBooleanFieldWithDefault(msg, 19, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpDef} + */ +proto.tensorflow.OpDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpDef; + return proto.tensorflow.OpDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpDef} + */ +proto.tensorflow.OpDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = new proto.tensorflow.OpDef.ArgDef; + reader.readMessage(value,proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader); + msg.addInputArg(value); + break; + case 3: + var value = new proto.tensorflow.OpDef.ArgDef; + reader.readMessage(value,proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader); + msg.addOutputArg(value); + break; + case 4: + var value = new proto.tensorflow.OpDef.AttrDef; + reader.readMessage(value,proto.tensorflow.OpDef.AttrDef.deserializeBinaryFromReader); + msg.addAttr(value); + break; + case 8: + var value = new proto.tensorflow.OpDef.OpDeprecation; + reader.readMessage(value,proto.tensorflow.OpDef.OpDeprecation.deserializeBinaryFromReader); + msg.setDeprecation(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setSummary(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 18: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsCommutative(value); + break; + case 16: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsAggregate(value); + break; + case 17: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsStateful(value); + break; + case 19: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setAllowsUninitializedInput(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getInputArgList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter + ); + } + f = message.getOutputArgList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter + ); + } + f = message.getAttrList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 4, + f, + proto.tensorflow.OpDef.AttrDef.serializeBinaryToWriter + ); + } + f = message.getDeprecation(); + if (f != null) { + writer.writeMessage( + 8, + f, + proto.tensorflow.OpDef.OpDeprecation.serializeBinaryToWriter + ); + } + f = message.getSummary(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getIsCommutative(); + if (f) { + writer.writeBool( + 18, + f + ); + } + f = message.getIsAggregate(); + if (f) { + writer.writeBool( + 16, + f + ); + } + f = message.getIsStateful(); + if (f) { + writer.writeBool( + 17, + f + ); + } + f = message.getAllowsUninitializedInput(); + if (f) { + writer.writeBool( + 19, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpDef.ArgDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpDef.ArgDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpDef.ArgDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.ArgDef.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + description: jspb.Message.getFieldWithDefault(msg, 2, ""), + type: jspb.Message.getFieldWithDefault(msg, 3, 0), + typeAttr: jspb.Message.getFieldWithDefault(msg, 4, ""), + numberAttr: jspb.Message.getFieldWithDefault(msg, 5, ""), + typeListAttr: jspb.Message.getFieldWithDefault(msg, 6, ""), + isRef: jspb.Message.getBooleanFieldWithDefault(msg, 16, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpDef.ArgDef} + */ +proto.tensorflow.OpDef.ArgDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpDef.ArgDef; + return proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpDef.ArgDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpDef.ArgDef} + */ +proto.tensorflow.OpDef.ArgDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 3: + var value = /** @type {!proto.tensorflow.DataType} */ (reader.readEnum()); + msg.setType(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setTypeAttr(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setNumberAttr(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setTypeListAttr(value); + break; + case 16: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsRef(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpDef.ArgDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpDef.ArgDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.ArgDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getType(); + if (f !== 0.0) { + writer.writeEnum( + 3, + f + ); + } + f = message.getTypeAttr(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getNumberAttr(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getTypeListAttr(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } + f = message.getIsRef(); + if (f) { + writer.writeBool( + 16, + f + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string description = 2; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setDescription = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional DataType type = 3; + * @return {!proto.tensorflow.DataType} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getType = function() { + return /** @type {!proto.tensorflow.DataType} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {!proto.tensorflow.DataType} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setType = function(value) { + jspb.Message.setProto3EnumField(this, 3, value); +}; + + +/** + * optional string type_attr = 4; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getTypeAttr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setTypeAttr = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional string number_attr = 5; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getNumberAttr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setNumberAttr = function(value) { + jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string type_list_attr = 6; + * @return {string} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getTypeListAttr = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setTypeListAttr = function(value) { + jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional bool is_ref = 16; + * @return {boolean} + */ +proto.tensorflow.OpDef.ArgDef.prototype.getIsRef = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 16, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.ArgDef.prototype.setIsRef = function(value) { + jspb.Message.setProto3BooleanField(this, 16, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpDef.AttrDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpDef.AttrDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpDef.AttrDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.AttrDef.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + type: jspb.Message.getFieldWithDefault(msg, 2, ""), + defaultValue: (f = msg.getDefaultValue()) && proto.tensorflow.AttrValue.toObject(includeInstance, f), + description: jspb.Message.getFieldWithDefault(msg, 4, ""), + hasMinimum: jspb.Message.getBooleanFieldWithDefault(msg, 5, false), + minimum: jspb.Message.getFieldWithDefault(msg, 6, 0), + allowedValues: (f = msg.getAllowedValues()) && proto.tensorflow.AttrValue.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpDef.AttrDef} + */ +proto.tensorflow.OpDef.AttrDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpDef.AttrDef; + return proto.tensorflow.OpDef.AttrDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpDef.AttrDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpDef.AttrDef} + */ +proto.tensorflow.OpDef.AttrDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setType(value); + break; + case 3: + var value = new proto.tensorflow.AttrValue; + reader.readMessage(value,proto.tensorflow.AttrValue.deserializeBinaryFromReader); + msg.setDefaultValue(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.setDescription(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setHasMinimum(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt64()); + msg.setMinimum(value); + break; + case 7: + var value = new proto.tensorflow.AttrValue; + reader.readMessage(value,proto.tensorflow.AttrValue.deserializeBinaryFromReader); + msg.setAllowedValues(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpDef.AttrDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpDef.AttrDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpDef.AttrDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.AttrDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getDefaultValue(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.AttrValue.serializeBinaryToWriter + ); + } + f = message.getDescription(); + if (f.length > 0) { + writer.writeString( + 4, + f + ); + } + f = message.getHasMinimum(); + if (f) { + writer.writeBool( + 5, + f + ); + } + f = message.getMinimum(); + if (f !== 0) { + writer.writeInt64( + 6, + f + ); + } + f = message.getAllowedValues(); + if (f != null) { + writer.writeMessage( + 7, + f, + proto.tensorflow.AttrValue.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string type = 2; + * @return {string} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setType = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional AttrValue default_value = 3; + * @return {?proto.tensorflow.AttrValue} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getDefaultValue = function() { + return /** @type{?proto.tensorflow.AttrValue} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.AttrValue, 3)); +}; + + +/** @param {?proto.tensorflow.AttrValue|undefined} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setDefaultValue = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.OpDef.AttrDef.prototype.clearDefaultValue = function() { + this.setDefaultValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.OpDef.AttrDef.prototype.hasDefaultValue = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional string description = 4; + * @return {string} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setDescription = function(value) { + jspb.Message.setProto3StringField(this, 4, value); +}; + + +/** + * optional bool has_minimum = 5; + * @return {boolean} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getHasMinimum = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setHasMinimum = function(value) { + jspb.Message.setProto3BooleanField(this, 5, value); +}; + + +/** + * optional int64 minimum = 6; + * @return {number} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getMinimum = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setMinimum = function(value) { + jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * optional AttrValue allowed_values = 7; + * @return {?proto.tensorflow.AttrValue} + */ +proto.tensorflow.OpDef.AttrDef.prototype.getAllowedValues = function() { + return /** @type{?proto.tensorflow.AttrValue} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.AttrValue, 7)); +}; + + +/** @param {?proto.tensorflow.AttrValue|undefined} value */ +proto.tensorflow.OpDef.AttrDef.prototype.setAllowedValues = function(value) { + jspb.Message.setWrapperField(this, 7, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.OpDef.AttrDef.prototype.clearAllowedValues = function() { + this.setAllowedValues(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.OpDef.AttrDef.prototype.hasAllowedValues = function() { + return jspb.Message.getField(this, 7) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpDef.OpDeprecation.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpDef.OpDeprecation.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpDef.OpDeprecation} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.OpDeprecation.toObject = function(includeInstance, msg) { + var f, obj = { + version: jspb.Message.getFieldWithDefault(msg, 1, 0), + explanation: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpDef.OpDeprecation} + */ +proto.tensorflow.OpDef.OpDeprecation.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpDef.OpDeprecation; + return proto.tensorflow.OpDef.OpDeprecation.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpDef.OpDeprecation} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpDef.OpDeprecation} + */ +proto.tensorflow.OpDef.OpDeprecation.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVersion(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setExplanation(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpDef.OpDeprecation.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpDef.OpDeprecation.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpDef.OpDeprecation} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpDef.OpDeprecation.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getVersion(); + if (f !== 0) { + writer.writeInt32( + 1, + f + ); + } + f = message.getExplanation(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional int32 version = 1; + * @return {number} + */ +proto.tensorflow.OpDef.OpDeprecation.prototype.getVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.OpDef.OpDeprecation.prototype.setVersion = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string explanation = 2; + * @return {string} + */ +proto.tensorflow.OpDef.OpDeprecation.prototype.getExplanation = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.OpDeprecation.prototype.setExplanation = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.tensorflow.OpDef.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * repeated ArgDef input_arg = 2; + * @return {!Array} + */ +proto.tensorflow.OpDef.prototype.getInputArgList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef.ArgDef, 2)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.OpDef.prototype.setInputArgList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.tensorflow.OpDef.ArgDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.OpDef.ArgDef} + */ +proto.tensorflow.OpDef.prototype.addInputArg = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.OpDef.ArgDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.OpDef.prototype.clearInputArgList = function() { + this.setInputArgList([]); +}; + + +/** + * repeated ArgDef output_arg = 3; + * @return {!Array} + */ +proto.tensorflow.OpDef.prototype.getOutputArgList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef.ArgDef, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.OpDef.prototype.setOutputArgList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.tensorflow.OpDef.ArgDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.OpDef.ArgDef} + */ +proto.tensorflow.OpDef.prototype.addOutputArg = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.tensorflow.OpDef.ArgDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.OpDef.prototype.clearOutputArgList = function() { + this.setOutputArgList([]); +}; + + +/** + * repeated AttrDef attr = 4; + * @return {!Array} + */ +proto.tensorflow.OpDef.prototype.getAttrList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef.AttrDef, 4)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.OpDef.prototype.setAttrList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 4, value); +}; + + +/** + * @param {!proto.tensorflow.OpDef.AttrDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.OpDef.AttrDef} + */ +proto.tensorflow.OpDef.prototype.addAttr = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.tensorflow.OpDef.AttrDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.OpDef.prototype.clearAttrList = function() { + this.setAttrList([]); +}; + + +/** + * optional OpDeprecation deprecation = 8; + * @return {?proto.tensorflow.OpDef.OpDeprecation} + */ +proto.tensorflow.OpDef.prototype.getDeprecation = function() { + return /** @type{?proto.tensorflow.OpDef.OpDeprecation} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.OpDef.OpDeprecation, 8)); +}; + + +/** @param {?proto.tensorflow.OpDef.OpDeprecation|undefined} value */ +proto.tensorflow.OpDef.prototype.setDeprecation = function(value) { + jspb.Message.setWrapperField(this, 8, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.OpDef.prototype.clearDeprecation = function() { + this.setDeprecation(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.hasDeprecation = function() { + return jspb.Message.getField(this, 8) != null; +}; + + +/** + * optional string summary = 5; + * @return {string} + */ +proto.tensorflow.OpDef.prototype.getSummary = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.prototype.setSummary = function(value) { + jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string description = 6; + * @return {string} + */ +proto.tensorflow.OpDef.prototype.getDescription = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.OpDef.prototype.setDescription = function(value) { + jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional bool is_commutative = 18; + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.getIsCommutative = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 18, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.prototype.setIsCommutative = function(value) { + jspb.Message.setProto3BooleanField(this, 18, value); +}; + + +/** + * optional bool is_aggregate = 16; + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.getIsAggregate = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 16, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.prototype.setIsAggregate = function(value) { + jspb.Message.setProto3BooleanField(this, 16, value); +}; + + +/** + * optional bool is_stateful = 17; + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.getIsStateful = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 17, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.prototype.setIsStateful = function(value) { + jspb.Message.setProto3BooleanField(this, 17, value); +}; + + +/** + * optional bool allows_uninitialized_input = 19; + * @return {boolean} + */ +proto.tensorflow.OpDef.prototype.getAllowsUninitializedInput = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 19, false)); +}; + + +/** @param {boolean} value */ +proto.tensorflow.OpDef.prototype.setAllowsUninitializedInput = function(value) { + jspb.Message.setProto3BooleanField(this, 19, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.OpList.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.OpList.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.OpList.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.OpList} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpList.toObject = function(includeInstance, msg) { + var f, obj = { + opList: jspb.Message.toObjectList(msg.getOpList(), + proto.tensorflow.OpDef.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.OpList} + */ +proto.tensorflow.OpList.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.OpList; + return proto.tensorflow.OpList.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.OpList} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.OpList} + */ +proto.tensorflow.OpList.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.OpDef; + reader.readMessage(value,proto.tensorflow.OpDef.deserializeBinaryFromReader); + msg.addOp(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.OpList.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.OpList.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.OpList} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.OpList.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getOpList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.tensorflow.OpDef.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated OpDef op = 1; + * @return {!Array} + */ +proto.tensorflow.OpList.prototype.getOpList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.OpDef, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.OpList.prototype.setOpList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.tensorflow.OpDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.OpDef} + */ +proto.tensorflow.OpList.prototype.addOp = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.OpDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.OpList.prototype.clearOpList = function() { + this.setOpList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.MetaGraphDef.repeatedFields_ = [6]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.MetaGraphDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.MetaGraphDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.MetaGraphDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.MetaGraphDef.toObject = function(includeInstance, msg) { + var f, obj = { + metaInfoDef: (f = msg.getMetaInfoDef()) && proto.tensorflow.MetaGraphDef.MetaInfoDef.toObject(includeInstance, f), + graphDef: (f = msg.getGraphDef()) && proto.tensorflow.GraphDef.toObject(includeInstance, f), + saverDef: (f = msg.getSaverDef()) && proto.tensorflow.SaverDef.toObject(includeInstance, f), + collectionDefMap: (f = msg.getCollectionDefMap()) ? f.toObject(includeInstance, proto.tensorflow.CollectionDef.toObject) : [], + signatureDefMap: (f = msg.getSignatureDefMap()) ? f.toObject(includeInstance, proto.tensorflow.SignatureDef.toObject) : [], + assetFileDefList: jspb.Message.toObjectList(msg.getAssetFileDefList(), + proto.tensorflow.AssetFileDef.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.MetaGraphDef} + */ +proto.tensorflow.MetaGraphDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.MetaGraphDef; + return proto.tensorflow.MetaGraphDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.MetaGraphDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.MetaGraphDef} + */ +proto.tensorflow.MetaGraphDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.MetaGraphDef.MetaInfoDef; + reader.readMessage(value,proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinaryFromReader); + msg.setMetaInfoDef(value); + break; + case 2: + var value = new proto.tensorflow.GraphDef; + reader.readMessage(value,proto.tensorflow.GraphDef.deserializeBinaryFromReader); + msg.setGraphDef(value); + break; + case 3: + var value = new proto.tensorflow.SaverDef; + reader.readMessage(value,proto.tensorflow.SaverDef.deserializeBinaryFromReader); + msg.setSaverDef(value); + break; + case 4: + var value = msg.getCollectionDefMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.CollectionDef.deserializeBinaryFromReader, ""); + }); + break; + case 5: + var value = msg.getSignatureDefMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.SignatureDef.deserializeBinaryFromReader, ""); + }); + break; + case 6: + var value = new proto.tensorflow.AssetFileDef; + reader.readMessage(value,proto.tensorflow.AssetFileDef.deserializeBinaryFromReader); + msg.addAssetFileDef(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.MetaGraphDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.MetaGraphDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.MetaGraphDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.MetaGraphDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMetaInfoDef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.MetaGraphDef.MetaInfoDef.serializeBinaryToWriter + ); + } + f = message.getGraphDef(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.GraphDef.serializeBinaryToWriter + ); + } + f = message.getSaverDef(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.SaverDef.serializeBinaryToWriter + ); + } + f = message.getCollectionDefMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.CollectionDef.serializeBinaryToWriter); + } + f = message.getSignatureDefMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.SignatureDef.serializeBinaryToWriter); + } + f = message.getAssetFileDefList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 6, + f, + proto.tensorflow.AssetFileDef.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.repeatedFields_ = [4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.MetaGraphDef.MetaInfoDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.MetaGraphDef.MetaInfoDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.toObject = function(includeInstance, msg) { + var f, obj = { + metaGraphVersion: jspb.Message.getFieldWithDefault(msg, 1, ""), + strippedOpList: (f = msg.getStrippedOpList()) && proto.tensorflow.OpList.toObject(includeInstance, f), + anyInfo: (f = msg.getAnyInfo()) && proto.tensorflow.Any.toObject(includeInstance, f), + tagsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, + tensorflowVersion: jspb.Message.getFieldWithDefault(msg, 5, ""), + tensorflowGitVersion: jspb.Message.getFieldWithDefault(msg, 6, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.MetaGraphDef.MetaInfoDef} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.MetaGraphDef.MetaInfoDef; + return proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.MetaGraphDef.MetaInfoDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.MetaGraphDef.MetaInfoDef} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setMetaGraphVersion(value); + break; + case 2: + var value = new proto.tensorflow.OpList; + reader.readMessage(value,proto.tensorflow.OpList.deserializeBinaryFromReader); + msg.setStrippedOpList(value); + break; + case 3: + var value = new proto.tensorflow.Any; + reader.readMessage(value,proto.tensorflow.Any.deserializeBinaryFromReader); + msg.setAnyInfo(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.addTags(value); + break; + case 5: + var value = /** @type {string} */ (reader.readString()); + msg.setTensorflowVersion(value); + break; + case 6: + var value = /** @type {string} */ (reader.readString()); + msg.setTensorflowGitVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.MetaGraphDef.MetaInfoDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.MetaGraphDef.MetaInfoDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMetaGraphVersion(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getStrippedOpList(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.tensorflow.OpList.serializeBinaryToWriter + ); + } + f = message.getAnyInfo(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.tensorflow.Any.serializeBinaryToWriter + ); + } + f = message.getTagsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 4, + f + ); + } + f = message.getTensorflowVersion(); + if (f.length > 0) { + writer.writeString( + 5, + f + ); + } + f = message.getTensorflowGitVersion(); + if (f.length > 0) { + writer.writeString( + 6, + f + ); + } +}; + + +/** + * optional string meta_graph_version = 1; + * @return {string} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getMetaGraphVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setMetaGraphVersion = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional OpList stripped_op_list = 2; + * @return {?proto.tensorflow.OpList} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getStrippedOpList = function() { + return /** @type{?proto.tensorflow.OpList} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.OpList, 2)); +}; + + +/** @param {?proto.tensorflow.OpList|undefined} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setStrippedOpList = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.clearStrippedOpList = function() { + this.setStrippedOpList(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.hasStrippedOpList = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Any any_info = 3; + * @return {?proto.tensorflow.Any} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getAnyInfo = function() { + return /** @type{?proto.tensorflow.Any} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.Any, 3)); +}; + + +/** @param {?proto.tensorflow.Any|undefined} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setAnyInfo = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.clearAnyInfo = function() { + this.setAnyInfo(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.hasAnyInfo = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * repeated string tags = 4; + * @return {!Array} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getTagsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setTagsList = function(value) { + jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.addTags = function(value, opt_index) { + jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.clearTagsList = function() { + this.setTagsList([]); +}; + + +/** + * optional string tensorflow_version = 5; + * @return {string} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getTensorflowVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setTensorflowVersion = function(value) { + jspb.Message.setProto3StringField(this, 5, value); +}; + + +/** + * optional string tensorflow_git_version = 6; + * @return {string} + */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.getTensorflowGitVersion = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.MetaGraphDef.MetaInfoDef.prototype.setTensorflowGitVersion = function(value) { + jspb.Message.setProto3StringField(this, 6, value); +}; + + +/** + * optional MetaInfoDef meta_info_def = 1; + * @return {?proto.tensorflow.MetaGraphDef.MetaInfoDef} + */ +proto.tensorflow.MetaGraphDef.prototype.getMetaInfoDef = function() { + return /** @type{?proto.tensorflow.MetaGraphDef.MetaInfoDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.MetaGraphDef.MetaInfoDef, 1)); +}; + + +/** @param {?proto.tensorflow.MetaGraphDef.MetaInfoDef|undefined} value */ +proto.tensorflow.MetaGraphDef.prototype.setMetaInfoDef = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.prototype.clearMetaInfoDef = function() { + this.setMetaInfoDef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.prototype.hasMetaInfoDef = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional GraphDef graph_def = 2; + * @return {?proto.tensorflow.GraphDef} + */ +proto.tensorflow.MetaGraphDef.prototype.getGraphDef = function() { + return /** @type{?proto.tensorflow.GraphDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.GraphDef, 2)); +}; + + +/** @param {?proto.tensorflow.GraphDef|undefined} value */ +proto.tensorflow.MetaGraphDef.prototype.setGraphDef = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.prototype.clearGraphDef = function() { + this.setGraphDef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.prototype.hasGraphDef = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional SaverDef saver_def = 3; + * @return {?proto.tensorflow.SaverDef} + */ +proto.tensorflow.MetaGraphDef.prototype.getSaverDef = function() { + return /** @type{?proto.tensorflow.SaverDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.SaverDef, 3)); +}; + + +/** @param {?proto.tensorflow.SaverDef|undefined} value */ +proto.tensorflow.MetaGraphDef.prototype.setSaverDef = function(value) { + jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.MetaGraphDef.prototype.clearSaverDef = function() { + this.setSaverDef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.MetaGraphDef.prototype.hasSaverDef = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * map collection_def = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.MetaGraphDef.prototype.getCollectionDefMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + proto.tensorflow.CollectionDef)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.MetaGraphDef.prototype.clearCollectionDefMap = function() { + this.getCollectionDefMap().clear(); +}; + + +/** + * map signature_def = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.MetaGraphDef.prototype.getSignatureDefMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + proto.tensorflow.SignatureDef)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.MetaGraphDef.prototype.clearSignatureDefMap = function() { + this.getSignatureDefMap().clear(); +}; + + +/** + * repeated AssetFileDef asset_file_def = 6; + * @return {!Array} + */ +proto.tensorflow.MetaGraphDef.prototype.getAssetFileDefList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.AssetFileDef, 6)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.MetaGraphDef.prototype.setAssetFileDefList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 6, value); +}; + + +/** + * @param {!proto.tensorflow.AssetFileDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.AssetFileDef} + */ +proto.tensorflow.MetaGraphDef.prototype.addAssetFileDef = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.tensorflow.AssetFileDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.MetaGraphDef.prototype.clearAssetFileDefList = function() { + this.setAssetFileDefList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.SavedModel.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.SavedModel.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.SavedModel.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.SavedModel} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SavedModel.toObject = function(includeInstance, msg) { + var f, obj = { + savedModelSchemaVersion: jspb.Message.getFieldWithDefault(msg, 1, 0), + metaGraphsList: jspb.Message.toObjectList(msg.getMetaGraphsList(), + proto.tensorflow.MetaGraphDef.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.SavedModel} + */ +proto.tensorflow.SavedModel.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.SavedModel; + return proto.tensorflow.SavedModel.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.SavedModel} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.SavedModel} + */ +proto.tensorflow.SavedModel.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readInt64()); + msg.setSavedModelSchemaVersion(value); + break; + case 2: + var value = new proto.tensorflow.MetaGraphDef; + reader.readMessage(value,proto.tensorflow.MetaGraphDef.deserializeBinaryFromReader); + msg.addMetaGraphs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.SavedModel.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.SavedModel.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.SavedModel} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.SavedModel.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSavedModelSchemaVersion(); + if (f !== 0) { + writer.writeInt64( + 1, + f + ); + } + f = message.getMetaGraphsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.tensorflow.MetaGraphDef.serializeBinaryToWriter + ); + } +}; + + +/** + * optional int64 saved_model_schema_version = 1; + * @return {number} + */ +proto.tensorflow.SavedModel.prototype.getSavedModelSchemaVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.tensorflow.SavedModel.prototype.setSavedModelSchemaVersion = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * repeated MetaGraphDef meta_graphs = 2; + * @return {!Array} + */ +proto.tensorflow.SavedModel.prototype.getMetaGraphsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.MetaGraphDef, 2)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.SavedModel.prototype.setMetaGraphsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.tensorflow.MetaGraphDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.MetaGraphDef} + */ +proto.tensorflow.SavedModel.prototype.addMetaGraphs = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.MetaGraphDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.SavedModel.prototype.clearMetaGraphsList = function() { + this.setMetaGraphsList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.FunctionDefLibrary.repeatedFields_ = [1,2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.FunctionDefLibrary.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.FunctionDefLibrary.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.FunctionDefLibrary} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.FunctionDefLibrary.toObject = function(includeInstance, msg) { + var f, obj = { + functionList: jspb.Message.toObjectList(msg.getFunctionList(), + proto.tensorflow.FunctionDef.toObject, includeInstance), + gradientList: jspb.Message.toObjectList(msg.getGradientList(), + proto.tensorflow.GradientDef.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.FunctionDefLibrary} + */ +proto.tensorflow.FunctionDefLibrary.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.FunctionDefLibrary; + return proto.tensorflow.FunctionDefLibrary.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.FunctionDefLibrary} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.FunctionDefLibrary} + */ +proto.tensorflow.FunctionDefLibrary.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.FunctionDef; + reader.readMessage(value,proto.tensorflow.FunctionDef.deserializeBinaryFromReader); + msg.addFunction(value); + break; + case 2: + var value = new proto.tensorflow.GradientDef; + reader.readMessage(value,proto.tensorflow.GradientDef.deserializeBinaryFromReader); + msg.addGradient(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.FunctionDefLibrary.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.FunctionDefLibrary.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.FunctionDefLibrary} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.FunctionDefLibrary.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFunctionList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.tensorflow.FunctionDef.serializeBinaryToWriter + ); + } + f = message.getGradientList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.tensorflow.GradientDef.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated FunctionDef function = 1; + * @return {!Array} + */ +proto.tensorflow.FunctionDefLibrary.prototype.getFunctionList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.FunctionDef, 1)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.FunctionDefLibrary.prototype.setFunctionList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.tensorflow.FunctionDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.FunctionDef} + */ +proto.tensorflow.FunctionDefLibrary.prototype.addFunction = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.tensorflow.FunctionDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.FunctionDefLibrary.prototype.clearFunctionList = function() { + this.setFunctionList([]); +}; + + +/** + * repeated GradientDef gradient = 2; + * @return {!Array} + */ +proto.tensorflow.FunctionDefLibrary.prototype.getGradientList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.GradientDef, 2)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.FunctionDefLibrary.prototype.setGradientList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.tensorflow.GradientDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.GradientDef} + */ +proto.tensorflow.FunctionDefLibrary.prototype.addGradient = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.tensorflow.GradientDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.FunctionDefLibrary.prototype.clearGradientList = function() { + this.setGradientList([]); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.tensorflow.FunctionDef.repeatedFields_ = [3]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.FunctionDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.FunctionDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.FunctionDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.FunctionDef.toObject = function(includeInstance, msg) { + var f, obj = { + signature: (f = msg.getSignature()) && proto.tensorflow.OpDef.toObject(includeInstance, f), + attrMap: (f = msg.getAttrMap()) ? f.toObject(includeInstance, proto.tensorflow.AttrValue.toObject) : [], + nodeDefList: jspb.Message.toObjectList(msg.getNodeDefList(), + proto.tensorflow.NodeDef.toObject, includeInstance), + retMap: (f = msg.getRetMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.FunctionDef} + */ +proto.tensorflow.FunctionDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.FunctionDef; + return proto.tensorflow.FunctionDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.FunctionDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.FunctionDef} + */ +proto.tensorflow.FunctionDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.tensorflow.OpDef; + reader.readMessage(value,proto.tensorflow.OpDef.deserializeBinaryFromReader); + msg.setSignature(value); + break; + case 5: + var value = msg.getAttrMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readMessage, proto.tensorflow.AttrValue.deserializeBinaryFromReader, ""); + }); + break; + case 3: + var value = new proto.tensorflow.NodeDef; + reader.readMessage(value,proto.tensorflow.NodeDef.deserializeBinaryFromReader); + msg.addNodeDef(value); + break; + case 4: + var value = msg.getRetMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, ""); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.FunctionDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.FunctionDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.FunctionDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.FunctionDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSignature(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.tensorflow.OpDef.serializeBinaryToWriter + ); + } + f = message.getAttrMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.tensorflow.AttrValue.serializeBinaryToWriter); + } + f = message.getNodeDefList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 3, + f, + proto.tensorflow.NodeDef.serializeBinaryToWriter + ); + } + f = message.getRetMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(4, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString); + } +}; + + +/** + * optional OpDef signature = 1; + * @return {?proto.tensorflow.OpDef} + */ +proto.tensorflow.FunctionDef.prototype.getSignature = function() { + return /** @type{?proto.tensorflow.OpDef} */ ( + jspb.Message.getWrapperField(this, proto.tensorflow.OpDef, 1)); +}; + + +/** @param {?proto.tensorflow.OpDef|undefined} value */ +proto.tensorflow.FunctionDef.prototype.setSignature = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.tensorflow.FunctionDef.prototype.clearSignature = function() { + this.setSignature(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.tensorflow.FunctionDef.prototype.hasSignature = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * map attr = 5; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.FunctionDef.prototype.getAttrMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 5, opt_noLazyCreate, + proto.tensorflow.AttrValue)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.FunctionDef.prototype.clearAttrMap = function() { + this.getAttrMap().clear(); +}; + + +/** + * repeated NodeDef node_def = 3; + * @return {!Array} + */ +proto.tensorflow.FunctionDef.prototype.getNodeDefList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.tensorflow.NodeDef, 3)); +}; + + +/** @param {!Array} value */ +proto.tensorflow.FunctionDef.prototype.setNodeDefList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 3, value); +}; + + +/** + * @param {!proto.tensorflow.NodeDef=} opt_value + * @param {number=} opt_index + * @return {!proto.tensorflow.NodeDef} + */ +proto.tensorflow.FunctionDef.prototype.addNodeDef = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 3, opt_value, proto.tensorflow.NodeDef, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.tensorflow.FunctionDef.prototype.clearNodeDefList = function() { + this.setNodeDefList([]); +}; + + +/** + * map ret = 4; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.tensorflow.FunctionDef.prototype.getRetMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 4, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + */ +proto.tensorflow.FunctionDef.prototype.clearRetMap = function() { + this.getRetMap().clear(); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.tensorflow.GradientDef.prototype.toObject = function(opt_includeInstance) { + return proto.tensorflow.GradientDef.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.tensorflow.GradientDef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.GradientDef.toObject = function(includeInstance, msg) { + var f, obj = { + functionName: jspb.Message.getFieldWithDefault(msg, 1, ""), + gradientFunc: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.tensorflow.GradientDef} + */ +proto.tensorflow.GradientDef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.tensorflow.GradientDef; + return proto.tensorflow.GradientDef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.tensorflow.GradientDef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.tensorflow.GradientDef} + */ +proto.tensorflow.GradientDef.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setFunctionName(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setGradientFunc(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.tensorflow.GradientDef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.tensorflow.GradientDef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.tensorflow.GradientDef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.tensorflow.GradientDef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getFunctionName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getGradientFunc(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string function_name = 1; + * @return {string} + */ +proto.tensorflow.GradientDef.prototype.getFunctionName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.GradientDef.prototype.setFunctionName = function(value) { + jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string gradient_func = 2; + * @return {string} + */ +proto.tensorflow.GradientDef.prototype.getGradientFunc = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.tensorflow.GradientDef.prototype.setGradientFunc = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * @enum {number} + */ +proto.tensorflow.DataType = { + DT_INVALID: 0, + DT_FLOAT: 1, + DT_DOUBLE: 2, + DT_INT32: 3, + DT_UINT8: 4, + DT_INT16: 5, + DT_INT8: 6, + DT_STRING: 7, + DT_COMPLEX64: 8, + DT_INT64: 9, + DT_BOOL: 10, + DT_QINT8: 11, + DT_QUINT8: 12, + DT_QINT32: 13, + DT_BFLOAT16: 14, + DT_FLOAT_REF: 101, + DT_DOUBLE_REF: 102, + DT_INT32_REF: 103, + DT_UINT8_REF: 104, + DT_INT16_REF: 105, + DT_INT8_REF: 106, + DT_STRING_REF: 107, + DT_COMPLEX64_REF: 108, + DT_INT64_REF: 109, + DT_BOOL_REF: 110, + DT_QINT8_REF: 111, + DT_QUINT8_REF: 112, + DT_QINT32_REF: 113, + DT_BFLOAT16_REF: 114 +}; + +goog.object.extend(exports, proto.tensorflow); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.d.ts new file mode 100644 index 000000000..cb0ff5c3b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.js new file mode 100644 index 000000000..8c4e4df5a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/register_all_kernels.js @@ -0,0 +1,325 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @license + * Copyright 2020 Google LLC. 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. + * ============================================================================= + */ +// We explicitly import the modular kernels so they get registered in the +// global registry when we compile the library. A modular build would replace +// the contents of this file and import only the kernels that are needed. +var tfjs_1 = require("@tensorflow/tfjs"); +var _FusedMatMul_1 = require("./kernels/_FusedMatMul"); +var Abs_1 = require("./kernels/Abs"); +var Acos_1 = require("./kernels/Acos"); +var Acosh_1 = require("./kernels/Acosh"); +var Add_1 = require("./kernels/Add"); +var AddN_1 = require("./kernels/AddN"); +var All_1 = require("./kernels/All"); +var Any_1 = require("./kernels/Any"); +var ArgMax_1 = require("./kernels/ArgMax"); +var ArgMin_1 = require("./kernels/ArgMin"); +var Asin_1 = require("./kernels/Asin"); +var Asinh_1 = require("./kernels/Asinh"); +var Atan_1 = require("./kernels/Atan"); +var Atan2_1 = require("./kernels/Atan2"); +var Atanh_1 = require("./kernels/Atanh"); +var AvgPool_1 = require("./kernels/AvgPool"); +var AvgPool3D_1 = require("./kernels/AvgPool3D"); +var AvgPool3DGrad_1 = require("./kernels/AvgPool3DGrad"); +var AvgPoolGrad_1 = require("./kernels/AvgPoolGrad"); +var BatchMatMul_1 = require("./kernels/BatchMatMul"); +var BatchToSpaceND_1 = require("./kernels/BatchToSpaceND"); +var Bincount_1 = require("./kernels/Bincount"); +var Cast_1 = require("./kernels/Cast"); +var Ceil_1 = require("./kernels/Ceil"); +var ClipByValue_1 = require("./kernels/ClipByValue"); +var Complex_1 = require("./kernels/Complex"); +var ComplexAbs_1 = require("./kernels/ComplexAbs"); +var Concat_1 = require("./kernels/Concat"); +var Conv2D_1 = require("./kernels/Conv2D"); +var Conv2DBackpropFilter_1 = require("./kernels/Conv2DBackpropFilter"); +var Conv2DBackpropInput_1 = require("./kernels/Conv2DBackpropInput"); +var Conv3D_1 = require("./kernels/Conv3D"); +var Conv3DBackpropFilterV2_1 = require("./kernels/Conv3DBackpropFilterV2"); +var Conv3DBackpropInputV2_1 = require("./kernels/Conv3DBackpropInputV2"); +var Cos_1 = require("./kernels/Cos"); +var Cosh_1 = require("./kernels/Cosh"); +var CropAndResize_1 = require("./kernels/CropAndResize"); +var Cumsum_1 = require("./kernels/Cumsum"); +var DepthToSpace_1 = require("./kernels/DepthToSpace"); +var DepthwiseConv2dNative_1 = require("./kernels/DepthwiseConv2dNative"); +var DepthwiseConv2dNativeBackpropFilter_1 = require("./kernels/DepthwiseConv2dNativeBackpropFilter"); +var DepthwiseConv2dNativeBackpropInput_1 = require("./kernels/DepthwiseConv2dNativeBackpropInput"); +var Diag_1 = require("./kernels/Diag"); +var Dilation2D_1 = require("./kernels/Dilation2D"); +var Dilation2DBackpropFilter_1 = require("./kernels/Dilation2DBackpropFilter"); +var Dilation2DBackpropInput_1 = require("./kernels/Dilation2DBackpropInput"); +var Elu_1 = require("./kernels/Elu"); +var EluGrad_1 = require("./kernels/EluGrad"); +var Equal_1 = require("./kernels/Equal"); +var Erf_1 = require("./kernels/Erf"); +var Exp_1 = require("./kernels/Exp"); +var ExpandDims_1 = require("./kernels/ExpandDims"); +var Expm1_1 = require("./kernels/Expm1"); +var FFT_1 = require("./kernels/FFT"); +var Fill_1 = require("./kernels/Fill"); +var Floor_1 = require("./kernels/Floor"); +var FloorDiv_1 = require("./kernels/FloorDiv"); +var FusedBatchNorm_1 = require("./kernels/FusedBatchNorm"); +var FusedConv2D_1 = require("./kernels/FusedConv2D"); +var FusedDepthwiseConv2D_1 = require("./kernels/FusedDepthwiseConv2D"); +var GatherNd_1 = require("./kernels/GatherNd"); +var GatherV2_1 = require("./kernels/GatherV2"); +var Greater_1 = require("./kernels/Greater"); +var GreaterEqual_1 = require("./kernels/GreaterEqual"); +var Identity_1 = require("./kernels/Identity"); +var IFFT_1 = require("./kernels/IFFT"); +var Imag_1 = require("./kernels/Imag"); +var IsFinite_1 = require("./kernels/IsFinite"); +var IsInf_1 = require("./kernels/IsInf"); +var IsNan_1 = require("./kernels/IsNan"); +var LeakyRelu_1 = require("./kernels/LeakyRelu"); +var Less_1 = require("./kernels/Less"); +var LessEqual_1 = require("./kernels/LessEqual"); +var LinSpace_1 = require("./kernels/LinSpace"); +var Log_1 = require("./kernels/Log"); +var Log1p_1 = require("./kernels/Log1p"); +var LogicalAnd_1 = require("./kernels/LogicalAnd"); +var LogicalNot_1 = require("./kernels/LogicalNot"); +var LogicalOr_1 = require("./kernels/LogicalOr"); +var LRN_1 = require("./kernels/LRN"); +var LRNGrad_1 = require("./kernels/LRNGrad"); +var Max_1 = require("./kernels/Max"); +var Maximum_1 = require("./kernels/Maximum"); +var MaxPool_1 = require("./kernels/MaxPool"); +var MaxPool3D_1 = require("./kernels/MaxPool3D"); +var MaxPool3DGrad_1 = require("./kernels/MaxPool3DGrad"); +var MaxPoolGrad_1 = require("./kernels/MaxPoolGrad"); +var Mean_1 = require("./kernels/Mean"); +var Min_1 = require("./kernels/Min"); +var Minimum_1 = require("./kernels/Minimum"); +var MirrorPad_1 = require("./kernels/MirrorPad"); +var Mod_1 = require("./kernels/Mod"); +var Multinomial_1 = require("./kernels/Multinomial"); +var Multiply_1 = require("./kernels/Multiply"); +var Neg_1 = require("./kernels/Neg"); +var NonMaxSuppressionV3_1 = require("./kernels/NonMaxSuppressionV3"); +var NonMaxSuppressionV4_1 = require("./kernels/NonMaxSuppressionV4"); +var NonMaxSuppressionV5_1 = require("./kernels/NonMaxSuppressionV5"); +var NotEqual_1 = require("./kernels/NotEqual"); +var OneHot_1 = require("./kernels/OneHot"); +var OnesLike_1 = require("./kernels/OnesLike"); +var Pack_1 = require("./kernels/Pack"); +var PadV2_1 = require("./kernels/PadV2"); +var Pow_1 = require("./kernels/Pow"); +var Prelu_1 = require("./kernels/Prelu"); +var Prod_1 = require("./kernels/Prod"); +var Range_1 = require("./kernels/Range"); +var Real_1 = require("./kernels/Real"); +var RealDiv_1 = require("./kernels/RealDiv"); +var Reciprocal_1 = require("./kernels/Reciprocal"); +var Relu_1 = require("./kernels/Relu"); +var Relu6_1 = require("./kernels/Relu6"); +var Reshape_1 = require("./kernels/Reshape"); +var ResizeBilinear_1 = require("./kernels/ResizeBilinear"); +var ResizeBilinearGrad_1 = require("./kernels/ResizeBilinearGrad"); +var ResizeNearestNeighbor_1 = require("./kernels/ResizeNearestNeighbor"); +var ResizeNearestNeighborGrad_1 = require("./kernels/ResizeNearestNeighborGrad"); +var Reverse_1 = require("./kernels/Reverse"); +var Round_1 = require("./kernels/Round"); +var Rsqrt_1 = require("./kernels/Rsqrt"); +var ScatterNd_1 = require("./kernels/ScatterNd"); +var Select_1 = require("./kernels/Select"); +var Selu_1 = require("./kernels/Selu"); +var Sigmoid_1 = require("./kernels/Sigmoid"); +var Sign_1 = require("./kernels/Sign"); +var Sin_1 = require("./kernels/Sin"); +var Sinh_1 = require("./kernels/Sinh"); +var Slice_1 = require("./kernels/Slice"); +var Softmax_1 = require("./kernels/Softmax"); +var Softplus_1 = require("./kernels/Softplus"); +var SpaceToBatchND_1 = require("./kernels/SpaceToBatchND"); +var SparseToDense_1 = require("./kernels/SparseToDense"); +var SplitV_1 = require("./kernels/SplitV"); +var Sqrt_1 = require("./kernels/Sqrt"); +var Square_1 = require("./kernels/Square"); +var SquaredDifference_1 = require("./kernels/SquaredDifference"); +var Step_1 = require("./kernels/Step"); +var StridedSlice_1 = require("./kernels/StridedSlice"); +var Sub_1 = require("./kernels/Sub"); +var Sum_1 = require("./kernels/Sum"); +var Tan_1 = require("./kernels/Tan"); +var Tanh_1 = require("./kernels/Tanh"); +var Tile_1 = require("./kernels/Tile"); +var TopK_1 = require("./kernels/TopK"); +var Transpose_1 = require("./kernels/Transpose"); +var Unpack_1 = require("./kernels/Unpack"); +var UnsortedSegmentSum_1 = require("./kernels/UnsortedSegmentSum"); +var ZerosLike_1 = require("./kernels/ZerosLike"); +// List all kernel configs here +var kernelConfigs = [ + FFT_1.FFTConfig, + IFFT_1.IFFTConfig, + LRN_1.LRNConfig, + LRNGrad_1.LRNGradConfig, + _FusedMatMul_1._fusedMatMulConfig, + Abs_1.absConfig, + Acos_1.acosConfig, + Acosh_1.acoshConfig, + Add_1.addConfig, + AddN_1.addNConfig, + All_1.allConfig, + Any_1.anyConfig, + ArgMax_1.argMaxConfig, + ArgMin_1.argMinConfig, + Asin_1.asinConfig, + Asinh_1.asinhConfig, + Atan2_1.atan2Config, + Atan_1.atanConfig, + Atanh_1.atanhConfig, + AvgPool3D_1.avgPool3DConfig, + AvgPool3DGrad_1.avgPool3DGradConfig, + AvgPool_1.avgPoolConfig, + AvgPoolGrad_1.avgPoolGradConfig, + BatchMatMul_1.batchMatMulConfig, + BatchToSpaceND_1.batchToSpaceNDConfig, + Cast_1.castConfig, + Ceil_1.ceilConfig, + ClipByValue_1.clipByValueConfig, + ComplexAbs_1.complexAbsConfig, + Complex_1.complexConfig, + Concat_1.concatConfig, + Conv2DBackpropFilter_1.conv2DBackpropFilterConfig, + Conv2DBackpropInput_1.conv2DBackpropInputConfig, + Conv2D_1.conv2DConfig, + Conv3DBackpropFilterV2_1.conv3DBackpropFilterV2Config, + Conv3DBackpropInputV2_1.conv3DBackpropInputV2Config, + Conv3D_1.conv3DConfig, + Cos_1.cosConfig, + Cosh_1.coshConfig, + CropAndResize_1.cropAndResizeConfig, + Cumsum_1.cumsumConfig, + Bincount_1.bincountConfig, + DepthToSpace_1.depthToSpaceConfig, + DepthwiseConv2dNativeBackpropFilter_1.depthwiseConv2dNativeBackpropFilterConfig, + DepthwiseConv2dNativeBackpropInput_1.depthwiseConv2dNativeBackpropInputConfig, + DepthwiseConv2dNative_1.depthwiseConv2dNativeConfig, + Diag_1.diagConfig, + Dilation2DBackpropFilter_1.dilation2dBackpropFilterConfig, + Dilation2DBackpropInput_1.dilation2dBackpropInputConfig, + Dilation2D_1.dilation2dConfig, + Elu_1.eluConfig, + EluGrad_1.eluGradConfig, + Equal_1.equalConfig, + Erf_1.erfConfig, + Exp_1.expConfig, + ExpandDims_1.expandDimsConfig, + Expm1_1.expm1Config, + Fill_1.fillConfig, + Floor_1.floorConfig, + FloorDiv_1.floorDivConfig, + FusedBatchNorm_1.fusedBatchNormConfig, + FusedConv2D_1.fusedConv2DConfig, + FusedDepthwiseConv2D_1.fusedDepthwiseConv2DConfig, + GatherNd_1.gatherNdConfig, + GatherV2_1.gatherV2Config, + Greater_1.greaterConfig, + GreaterEqual_1.greaterEqualConfig, + Identity_1.identityConfig, + Imag_1.imagConfig, + IsFinite_1.isFiniteConfig, + IsInf_1.isInfConfig, + IsNan_1.isNanConfig, + LeakyRelu_1.leakyReluConfig, + Less_1.lessConfig, + LessEqual_1.lessEqualConfig, + LinSpace_1.linSpaceConfig, + Log1p_1.log1pConfig, + Log_1.logConfig, + LogicalAnd_1.logicalAndConfig, + LogicalNot_1.logicalNotConfig, + LogicalOr_1.logicalOrConfig, + Max_1.maxConfig, + MaxPool3D_1.maxPool3DConfig, + MaxPool3DGrad_1.maxPool3DGradConfig, + MaxPool_1.maxPoolConfig, + MaxPoolGrad_1.maxPoolGradConfig, + Maximum_1.maximumConfig, + Mean_1.meanConfig, + Min_1.minConfig, + Minimum_1.minimumConfig, + MirrorPad_1.mirrorPadConfig, + Mod_1.modConfig, + Multinomial_1.multinomialConfig, + Multiply_1.multiplyConfig, + Neg_1.negConfig, + NonMaxSuppressionV3_1.nonMaxSuppressionV3Config, + NonMaxSuppressionV4_1.nonMaxSuppressionV4Config, + NonMaxSuppressionV5_1.nonMaxSuppressionV5Config, + NotEqual_1.notEqualConfig, + OneHot_1.oneHotConfig, + OnesLike_1.onesLikeConfig, + Pack_1.packConfig, + PadV2_1.padV2Config, + Pow_1.powConfig, + Prelu_1.preluConfig, + Prod_1.prodConfig, + Range_1.rangeConfig, + Real_1.realConfig, + RealDiv_1.realDivConfig, + Reciprocal_1.reciprocalConfig, + Relu6_1.relu6Config, + Relu_1.reluConfig, + Reshape_1.reshapeConfig, + ResizeBilinear_1.resizeBilinearConfig, + ResizeBilinearGrad_1.resizeBilinearGradConfig, + ResizeNearestNeighbor_1.resizeNearestNeighborConfig, + ResizeNearestNeighborGrad_1.resizeNearestNeighborGradConfig, + Reverse_1.reverseConfig, + Round_1.roundConfig, + Rsqrt_1.rsqrtConfig, + ScatterNd_1.scatterNdConfig, + Select_1.selectConfig, + Selu_1.seluConfig, + Sigmoid_1.sigmoidConfig, + Sign_1.signConfig, + Sin_1.sinConfig, + Sinh_1.sinhConfig, + Slice_1.sliceConfig, + Softmax_1.softmaxConfig, + Softplus_1.softplusConfig, + SpaceToBatchND_1.spaceToBatchNDConfig, + SparseToDense_1.sparseToDenseConfig, + SplitV_1.splitVConfig, + Sqrt_1.sqrtConfig, + Square_1.squareConfig, + SquaredDifference_1.squaredDifferenceConfig, + Step_1.stepConfig, + StridedSlice_1.stridedSliceConfig, + Sub_1.subConfig, + Sum_1.sumConfig, + Tan_1.tanConfig, + Tanh_1.tanhConfig, + Tile_1.tileConfig, + TopK_1.topKConfig, + Transpose_1.transposeConfig, + Unpack_1.unpackConfig, + UnsortedSegmentSum_1.unsortedSegmentSumConfig, + ZerosLike_1.zerosLikeConfig +]; +for (var _i = 0, kernelConfigs_1 = kernelConfigs; _i < kernelConfigs_1.length; _i++) { + var kernelConfig = kernelConfigs_1[_i]; + tfjs_1.registerKernel(kernelConfig); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.d.ts new file mode 100644 index 000000000..7bcbd5871 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.d.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2018 Google LLC. 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 './index'; +import '@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops'; +import '@tensorflow/tfjs-core/dist/register_all_gradients'; +import '@tensorflow/tfjs-core/dist/tests'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.js new file mode 100644 index 000000000..3442d80b5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/run_tests.js @@ -0,0 +1,138 @@ +"use strict"; +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +// We import index.ts so that the Node backend gets registered. +require("./index"); +// tslint:disable-next-line: no-imports-from-dist +require("@tensorflow/tfjs-core/dist/public/chained_ops/register_all_chained_ops"); +// tslint:disable-next-line: no-imports-from-dist +require("@tensorflow/tfjs-core/dist/register_all_gradients"); +var tf = require("@tensorflow/tfjs"); +// tslint:disable-next-line:no-imports-from-dist +var jasmine_util = require("@tensorflow/tfjs-core/dist/jasmine_util"); +var yargs_1 = require("yargs"); +Error.stackTraceLimit = Infinity; +// tslint:disable-next-line:no-require-imports +var jasmineCtor = require('jasmine'); +// tslint:disable-next-line:no-require-imports +process.on('unhandledRejection', function (e) { + throw e; +}); +jasmine_util.setTestEnvs([{ + name: 'test-tensorflow', + backendName: 'tensorflow', + flags: {}, + isDataSync: true + }]); +var IGNORE_LIST = [ + // Always ignore version tests: + 'version version', + 'unreliable is true due to both auto gc and string tensors', + 'unreliable is true due to auto gc', + // See https://github.com/tensorflow/tfjs/issues/161 + 'depthwiseConv2D', + 'separableConv2d', + 'complex64 memory', + // See https://github.com/tensorflow/tfjs-core/pull/1270 + 'depthToSpace test-tensorflow {} throws when blocksize < 2', + // tslint:disable-next-line:max-line-length + 'depthToSpace test-tensorflow {} throws when CPU backend used with data format NCHW', + // See https://github.com/tensorflow/tfjs/issues/806 + 'scatterND test-tensorflow {} should work for 2d', + 'scatterND test-tensorflow {} should work for simple 1d', + 'scatterND test-tensorflow {} should work for multiple 1d', + 'scatterND test-tensorflow {} should sum the duplicated indices', + 'scatterND test-tensorflow {} should work for tensorLike input', + // https://github.com/tensorflow/tfjs/issues/1077 + 'maxPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor', + 'avgPool test-tensorflow {} x=[2,2,3] f=[1,1] s=2 p=1 dimRoundingMode=floor', + // tslint:disable-next-line:max-line-length + 'avgPool3d test-tensorflow {} x=[1,2,2,2,1] f=[2,2,2] s=1 p=1 roundingMode=floor', + // tslint:disable-next-line:max-line-length + 'maxPool3d test-tensorflow {} x=[1,2,2,2,1] f=[2,2,2] s=1 p=1 roundingMode=floor', + // libtensorflow doesn't support 6D ArgMax yet. + 'argmax test-tensorflow {} 6D, axis=0', 'diag test-tensorflow {} complex', + 'diag test-tensorflow {} bool', + // See https://github.com/tensorflow/tfjs/issues/1891 + 'conv2d test-tensorflow {} x=[2,1,2,2] f=[1,1,1,1] s=1 d=1 p=0 NCHW', + 'conv2d test-tensorflow {} x=[1,2,2] f=[2,2,1,1] s=1 d=1 p=explicit NCHW', + 'conv2d test-tensorflow {} x=[1,2,2] f=[2,2,1,1] s=1 d=1 p=same NCHW', + 'conv2d test-tensorflow {} x=[2,2,2] f=[2,2,2,1] s=1 d=1 p=same NCHW', + 'conv2d test-tensorflow {} x=[2,1,2,2] f=[2,2,1,1] s=1 d=1 p=same NCHW', + 'conv2d test-tensorflow {} gradient x=[1,1,3,3] f=[2,2,1,1] s=1 p=0 NCHW', + 'conv2d test-tensorflow {} gradient x=[2,1,3,3] f=[2,2,1,1] s=1 p=0 NCHW', + 'maxPoolWithArgmax', 'rotate', 'flipLeftRight', 'unique', + // libtensorflow does not yet support tf.matmul with broadcast + 'broadcast with unequal batch dims', 'broadcast with unequal ranks', + // tslint:disable-next-line:max-line-length + 'pool test-tensorflow {} max x=[2,2,3] f=[1,1] s=2 p=1 fractional outputs default rounding', + // tslint:disable-next-line:max-line-length + 'pool test-tensorflow {} avg x=[2,2,3] f=[1,1] s=2 p=1 fractional outputs default rounding', + // not available in tf yet. + 'denseBincount', + // only available in tf addon. + 'image.transform', + // Breaking change in NaN processing + // See https://github.com/tensorflow/tfjs/issues/4883 + 'max test-tensorflow {} ignores NaNs', 'min test-tensorflow {} ignores NaNs', + 'sign test-tensorflow {} basic', + 'sign test-tensorflow {} does not propagate NaNs', + 'sign test-tensorflow {} accepts a tensor-like object', + // Node kernel for einsum is yet to be implemented. + // See: ttps://github.com/tensorflow/tfjs/issues/2349 + 'einsum', 'sparseFillEmptyRows', 'sparseReshape' +]; +if (process.platform === 'win32') { + // Ignore tensorboard on windows because tmp folder cleanup used in tests + // fails with tmp folder cleanup: + // https://github.com/tensorflow/tfjs/issues/1692 + IGNORE_LIST.push('tensorboard'); + IGNORE_LIST.push('tensorBoard'); + // Windows has two failing tests: + // https://github.com/tensorflow/tfjs/issues/598 + IGNORE_LIST.push('clip test-tensorflow {} propagates NaNs'); + IGNORE_LIST.push('maxPool test-tensorflow {} [x=[3,3,1] f=[2,2] s=1 ignores NaNs'); +} +var runner = new jasmineCtor(); +runner.loadConfig({ spec_files: ['src/**/*_test.ts'], random: false }); +// Also import tests from core. +// tslint:disable-next-line: no-imports-from-dist +require("@tensorflow/tfjs-core/dist/tests"); +if (process.env.JASMINE_SEED) { + runner.seed(process.env.JASMINE_SEED); +} +var env = jasmine.getEnv(); +var grepRegex = new RegExp(yargs_1.argv.grep); +// Filter method that returns boolean, if a given test should return. +env.specFilter = function (spec) { + // Filter based on the grep flag. + if (!grepRegex.test(spec.getFullName())) { + return false; + } + // Return false (skip the test) if the test is in the ignore list. + for (var i = 0; i < IGNORE_LIST.length; ++i) { + if (spec.getFullName().indexOf(IGNORE_LIST[i]) > -1) { + return false; + } + } + // Otherwise run the test. + return true; +}; +// TODO(kreeger): Consider moving to C-code. +console.log("Running tests against TensorFlow: " + tf.backend().binding.TF_Version); +runner.execute(); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.d.ts new file mode 100644 index 000000000..0a9c6d973 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.d.ts @@ -0,0 +1,158 @@ +/** + * @license + * Copyright 2019 Google LLC. 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 { InferenceModel, MetaGraph, ModelPredictConfig, ModelTensorInfo, NamedTensorMap, SignatureDefEntry, Tensor } from '@tensorflow/tfjs'; +import { NodeJSKernelBackend } from './nodejs_kernel_backend'; +/** + * Get a key in an object by its value. This is used to get protobuf enum value + * from index. + * + * @param object + * @param value + */ +export declare function getEnumKeyFromValue(object: any, value: number): string; +/** + * Read SavedModel proto message from path. + * + * @param path Path to SavedModel folder. + */ +export declare function readSavedModelProto(path: string): Promise; +/** + * Inspect the MetaGraphs of the SavedModel from the provided path. This + * function will return an array of `MetaGraphInfo` objects. + * + * @param path Path to SavedModel folder. + * + * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} + */ +export declare function getMetaGraphsFromSavedModel(path: string): Promise; +/** + * Get SignatureDefEntry from SavedModel metagraphs info. The SignatureDefEntry + * will be used when executing a SavedModel signature. + * + * @param savedModelInfo The MetaGraphInfo array loaded through + * getMetaGraphsFromSavedModel(). + * @param tags The tags of the MetaGraph to get input/output node names from. + * @param signature The signature to get input/output node names from. + */ +export declare function getSignatureDefEntryFromMetaGraphInfo(savedModelInfo: MetaGraph[], tags: string[], signature: string): SignatureDefEntry; +/** + * A `tf.TFSavedModel` is a signature loaded from a SavedModel + * metagraph, and allows inference execution. + * + * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} + */ +export declare class TFSavedModel implements InferenceModel { + private sessionId; + private jsid; + private signature; + private backend; + private disposed; + private outputNodeNames_; + constructor(sessionId: number, jsid: number, signature: SignatureDefEntry, backend: NodeJSKernelBackend); + /** + * Return the array of input tensor info. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + readonly inputs: ModelTensorInfo[]; + /** + * Return the array of output tensor info. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + readonly outputs: ModelTensorInfo[]; + /** + * Delete the SavedModel from nodeBackend and delete corresponding session in + * the C++ backend if the session is only used by this TFSavedModel. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + dispose(): void; + readonly outputNodeNames: { + [key: string]: string; + }; + /** + * Execute the inference for the input tensors. + * + * @param input The input tensors, when there is single input for the model, + * inputs param should be a Tensor. For models with multiple inputs, inputs + * params should be in either Tensor[] if the input order is fixed, or + * otherwise NamedTensorMap format. The keys in the NamedTensorMap are the + * name of input tensors in SavedModel signatureDef. It can be found through + * `tf.node.getMetaGraphsFromSavedModel()`. + * + * For batch inference execution, the tensors for each input need to be + * concatenated together. For example with mobilenet, the required input shape + * is [1, 244, 244, 3], which represents the [batch, height, width, channel]. + * If we are provide a batched data of 100 images, the input tensor should be + * in the shape of [100, 244, 244, 3]. + * + * @param config Prediction configuration for specifying the batch size. + * + * @returns Inference result tensors. The output would be single Tensor if + * model has single output node, otherwise Tensor[] or NamedTensorMap[] will + * be returned for model with multiple outputs. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + predict(inputs: Tensor | Tensor[] | NamedTensorMap, config?: ModelPredictConfig): Tensor | Tensor[] | NamedTensorMap; + /** + * Execute the inference for the input tensors and return activation + * values for specified output node names without batching. + * + * @param input The input tensors, when there is single input for the model, + * inputs param should be a Tensor. For models with multiple inputs, inputs + * params should be in either Tensor[] if the input order is fixed, or + * otherwise NamedTensorMap format. + * + * @param outputs string|string[]. List of output node names to retrieve + * activation from. + * + * @returns Activation values for the output nodes result tensors. The return + * type matches specified parameter outputs type. The output would be single + * Tensor if single output is specified, otherwise Tensor[] for multiple + * outputs. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + execute(inputs: Tensor | Tensor[] | NamedTensorMap, outputs: string | string[]): Tensor | Tensor[]; +} +/** + * Load a TensorFlow SavedModel from disk. TensorFlow SavedModel is different + * from TensorFlow.js model format. A SavedModel is a directory containing + * serialized signatures and the states needed to run them. The directory has a + * saved_model.pb (or saved_model.pbtxt) file storing the actual TensorFlow + * program, or model, and a set of named signatures, each identifying a + * function. The directory also has a variables directory contains a standard + * training checkpoint. The directory may also has a assets directory contains + * files used by the TensorFlow graph, for example text files used to initialize + * vocabulary tables. These are supported datatypes: float32, int32, complex64, + * string.For more information, see this guide: + * https://www.tensorflow.org/guide/saved_model. + * + * @param path The path to the SavedModel. + * @param tags The tags of the MetaGraph to load. The available tags of a + * SavedModel can be retrieved through tf.node.getMetaGraphsFromSavedModel() + * API. Defaults to ['serve']. + * @param signature The name of the SignatureDef to load. The available + * SignatureDefs of a SavedModel can be retrieved through + * tf.node.getMetaGraphsFromSavedModel() API. Defaults to 'serving_default'. + * + * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} + */ +export declare function loadSavedModel(path: string, tags?: string[], signature?: string): Promise; +export declare function getNumOfSavedModels(): number; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.js new file mode 100644 index 000000000..19ed851ab --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model.js @@ -0,0 +1,493 @@ +"use strict"; +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var fs = require("fs"); +var util_1 = require("util"); +var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); +var readFile = util_1.promisify(fs.readFile); +// tslint:disable-next-line:no-require-imports +var messages = require('./proto/api_pb'); +var SAVED_MODEL_FILE_NAME = '/saved_model.pb'; +var SAVED_MODEL_INIT_OP_KEY = '__saved_model_init_op'; +// This map is used to keep track of loaded SavedModel metagraph mapping +// information. The map key is TFSavedModel id in JavaScript, value is +// an object of path to the SavedModel, metagraph tags, and loaded Session ID in +// the c++ bindings. When user loads a SavedModel signature, it will go through +// entries in this map to find if the corresponding SavedModel session has +// already been loaded in C++ addon and will reuse it if existing. +var loadedSavedModelPathMap = new Map(); +// The ID of loaded TFSavedModel. This ID is used to keep track of loaded +// TFSavedModel, so the loaded session in c++ bindings for the corresponding +// TFSavedModel can be properly reused/disposed. +var nextTFSavedModelId = 0; +/** + * Get a key in an object by its value. This is used to get protobuf enum value + * from index. + * + * @param object + * @param value + */ +// tslint:disable-next-line:no-any +function getEnumKeyFromValue(object, value) { + return Object.keys(object).find(function (key) { return object[key] === value; }); +} +exports.getEnumKeyFromValue = getEnumKeyFromValue; +/** + * Read SavedModel proto message from path. + * + * @param path Path to SavedModel folder. + */ +function readSavedModelProto(path) { + return __awaiter(this, void 0, void 0, function () { + var modelFile, array; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + // Load the SavedModel pb file and deserialize it into message. + try { + fs.accessSync(path + SAVED_MODEL_FILE_NAME, fs.constants.R_OK); + } + catch (error) { + throw new Error('There is no saved_model.pb file in the directory: ' + path); + } + return [4 /*yield*/, readFile(path + SAVED_MODEL_FILE_NAME)]; + case 1: + modelFile = _a.sent(); + array = new Uint8Array(modelFile); + return [2 /*return*/, messages.SavedModel.deserializeBinary(array)]; + } + }); + }); +} +exports.readSavedModelProto = readSavedModelProto; +/** + * Inspect the MetaGraphs of the SavedModel from the provided path. This + * function will return an array of `MetaGraphInfo` objects. + * + * @param path Path to SavedModel folder. + * + * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} + */ +function getMetaGraphsFromSavedModel(path) { + return __awaiter(this, void 0, void 0, function () { + var result, modelMessage, metaGraphList, i, metaGraph, tags, signatureDef, signatureDefMap, signatureDefKeys, key, signatureDefEntry, inputsMapMessage, inputsMapKeys, inputs, inputsMapKey, inputTensor, inputTensorInfo, dtype, outputsMapMessage, outputsMapKeys, outputs, outputsMapKey, outputTensor, outputTensorInfo, dtype; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + result = []; + return [4 /*yield*/, readSavedModelProto(path)]; + case 1: + modelMessage = _a.sent(); + metaGraphList = modelMessage.getMetaGraphsList(); + for (i = 0; i < metaGraphList.length; i++) { + metaGraph = {}; + tags = metaGraphList[i].getMetaInfoDef().getTagsList(); + metaGraph.tags = tags; + signatureDef = {}; + signatureDefMap = metaGraphList[i].getSignatureDefMap(); + signatureDefKeys = signatureDefMap.keys(); + // Go through all signatureDefs + while (true) { + key = signatureDefKeys.next(); + if (key.done) { + break; + } + // Skip TensorFlow internal Signature '__saved_model_init_op'. + if (key.value === SAVED_MODEL_INIT_OP_KEY) { + continue; + } + signatureDefEntry = signatureDefMap.get(key.value); + inputsMapMessage = signatureDefEntry.getInputsMap(); + inputsMapKeys = inputsMapMessage.keys(); + inputs = {}; + while (true) { + inputsMapKey = inputsMapKeys.next(); + if (inputsMapKey.done) { + break; + } + inputTensor = inputsMapMessage.get(inputsMapKey.value); + inputTensorInfo = {}; + dtype = getEnumKeyFromValue(messages.DataType, inputTensor.getDtype()); + inputTensorInfo.dtype = mapTFDtypeToJSDtype(dtype); + inputTensorInfo.tfDtype = dtype; + inputTensorInfo.name = inputTensor.getName(); + inputTensorInfo.shape = inputTensor.getTensorShape().getDimList(); + inputs[inputsMapKey.value] = inputTensorInfo; + } + outputsMapMessage = signatureDefEntry.getOutputsMap(); + outputsMapKeys = outputsMapMessage.keys(); + outputs = {}; + while (true) { + outputsMapKey = outputsMapKeys.next(); + if (outputsMapKey.done) { + break; + } + outputTensor = outputsMapMessage.get(outputsMapKey.value); + outputTensorInfo = {}; + dtype = getEnumKeyFromValue(messages.DataType, outputTensor.getDtype()); + outputTensorInfo.dtype = mapTFDtypeToJSDtype(dtype); + outputTensorInfo.tfDtype = dtype; + outputTensorInfo.name = outputTensor.getName(); + outputTensorInfo.shape = outputTensor.getTensorShape().getDimList(); + outputs[outputsMapKey.value] = outputTensorInfo; + } + signatureDef[key.value] = { inputs: inputs, outputs: outputs }; + } + metaGraph.signatureDefs = signatureDef; + result.push(metaGraph); + } + return [2 /*return*/, result]; + } + }); + }); +} +exports.getMetaGraphsFromSavedModel = getMetaGraphsFromSavedModel; +/** + * Get SignatureDefEntry from SavedModel metagraphs info. The SignatureDefEntry + * will be used when executing a SavedModel signature. + * + * @param savedModelInfo The MetaGraphInfo array loaded through + * getMetaGraphsFromSavedModel(). + * @param tags The tags of the MetaGraph to get input/output node names from. + * @param signature The signature to get input/output node names from. + */ +function getSignatureDefEntryFromMetaGraphInfo(savedModelInfo, tags, signature) { + for (var i = 0; i < savedModelInfo.length; i++) { + var metaGraphInfo = savedModelInfo[i]; + if (stringArraysHaveSameElements(tags, metaGraphInfo.tags)) { + if (metaGraphInfo.signatureDefs[signature] == null) { + throw new Error('The SavedModel does not have signature: ' + signature); + } + return metaGraphInfo.signatureDefs[signature]; + } + } + throw new Error("The SavedModel does not have tags: " + tags); +} +exports.getSignatureDefEntryFromMetaGraphInfo = getSignatureDefEntryFromMetaGraphInfo; +/** + * A `tf.TFSavedModel` is a signature loaded from a SavedModel + * metagraph, and allows inference execution. + * + * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} + */ +var TFSavedModel = /** @class */ (function () { + function TFSavedModel(sessionId, jsid, signature, backend) { + this.sessionId = sessionId; + this.jsid = jsid; + this.signature = signature; + this.backend = backend; + this.disposed = false; + } + Object.defineProperty(TFSavedModel.prototype, "inputs", { + /** + * Return the array of input tensor info. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + get: function () { + var entries = this.signature.inputs; + var results = Object.keys(entries).map(function (key) { return entries[key]; }); + results.forEach(function (info) { + info.name = info.name.replace(/:0$/, ''); + }); + return results; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TFSavedModel.prototype, "outputs", { + /** + * Return the array of output tensor info. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + get: function () { + var entries = this.signature.outputs; + var results = Object.keys(entries).map(function (key) { return entries[key]; }); + results.forEach(function (info) { + info.name = info.name.replace(/:0$/, ''); + }); + return results; + }, + enumerable: true, + configurable: true + }); + /** + * Delete the SavedModel from nodeBackend and delete corresponding session in + * the C++ backend if the session is only used by this TFSavedModel. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + TFSavedModel.prototype.dispose = function () { + if (!this.disposed) { + this.disposed = true; + loadedSavedModelPathMap.delete(this.jsid); + for (var _i = 0, _a = Array.from(loadedSavedModelPathMap.keys()); _i < _a.length; _i++) { + var id = _a[_i]; + var value = loadedSavedModelPathMap.get(id); + if (value.sessionId === this.sessionId) { + return; + } + } + this.backend.deleteSavedModel(this.sessionId); + } + else { + throw new Error('This SavedModel has already been deleted.'); + } + }; + Object.defineProperty(TFSavedModel.prototype, "outputNodeNames", { + get: function () { + var _this = this; + if (this.outputNodeNames_ != null) { + return this.outputNodeNames_; + } + this.outputNodeNames_ = + Object.keys(this.signature.outputs) + .reduce(function (names, key) { + names[key] = _this.signature.outputs[key].name; + return names; + }, {}); + return this.outputNodeNames_; + }, + enumerable: true, + configurable: true + }); + /** + * Execute the inference for the input tensors. + * + * @param input The input tensors, when there is single input for the model, + * inputs param should be a Tensor. For models with multiple inputs, inputs + * params should be in either Tensor[] if the input order is fixed, or + * otherwise NamedTensorMap format. The keys in the NamedTensorMap are the + * name of input tensors in SavedModel signatureDef. It can be found through + * `tf.node.getMetaGraphsFromSavedModel()`. + * + * For batch inference execution, the tensors for each input need to be + * concatenated together. For example with mobilenet, the required input shape + * is [1, 244, 244, 3], which represents the [batch, height, width, channel]. + * If we are provide a batched data of 100 images, the input tensor should be + * in the shape of [100, 244, 244, 3]. + * + * @param config Prediction configuration for specifying the batch size. + * + * @returns Inference result tensors. The output would be single Tensor if + * model has single output node, otherwise Tensor[] or NamedTensorMap[] will + * be returned for model with multiple outputs. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + TFSavedModel.prototype.predict = function (inputs, config) { + var _this = this; + if (this.disposed) { + throw new Error('The TFSavedModel has already been deleted!'); + } + else { + var inputTensors = []; + if (inputs instanceof tfjs_1.Tensor) { + inputTensors.push(inputs); + var result = this.backend.runSavedModel(this.sessionId, inputTensors, Object.values(this.signature.inputs), Object.values(this.outputNodeNames)); + return result.length > 1 ? result : result[0]; + } + else if (Array.isArray(inputs)) { + inputTensors = inputs; + return this.backend.runSavedModel(this.sessionId, inputTensors, Object.values(this.signature.inputs), Object.values(this.outputNodeNames)); + } + else { + var inputTensorNames = Object.keys(this.signature.inputs); + var providedInputNames = Object.keys(inputs); + if (!stringArraysHaveSameElements(inputTensorNames, providedInputNames)) { + throw new Error("The model signatureDef input names are " + inputTensorNames.join() + ", however the provided input names are " + providedInputNames.join() + "."); + } + var inputNodeNamesArray = []; + for (var i = 0; i < inputTensorNames.length; i++) { + inputTensors.push(inputs[inputTensorNames[i]]); + inputNodeNamesArray.push(this.signature.inputs[inputTensorNames[i]]); + } + var outputTensorNames = Object.keys(this.outputNodeNames); + var outputNodeNamesArray = []; + for (var i = 0; i < outputTensorNames.length; i++) { + outputNodeNamesArray.push(this.outputNodeNames[outputTensorNames[i]]); + } + var outputTensors_1 = this.backend.runSavedModel(this.sessionId, inputTensors, inputNodeNamesArray, outputNodeNamesArray); + tfjs_1.util.assert(outputTensors_1.length === outputNodeNamesArray.length, function () { return 'Output tensors do not match output node names, ' + + ("receive " + outputTensors_1.length + ") output tensors but ") + + ("there are " + _this.outputNodeNames.length + " output nodes."); }); + var outputMap = {}; + for (var i = 0; i < outputTensorNames.length; i++) { + outputMap[outputTensorNames[i]] = outputTensors_1[i]; + } + return outputMap; + } + } + }; + /** + * Execute the inference for the input tensors and return activation + * values for specified output node names without batching. + * + * @param input The input tensors, when there is single input for the model, + * inputs param should be a Tensor. For models with multiple inputs, inputs + * params should be in either Tensor[] if the input order is fixed, or + * otherwise NamedTensorMap format. + * + * @param outputs string|string[]. List of output node names to retrieve + * activation from. + * + * @returns Activation values for the output nodes result tensors. The return + * type matches specified parameter outputs type. The output would be single + * Tensor if single output is specified, otherwise Tensor[] for multiple + * outputs. + * + * @doc {heading: 'Models', subheading: 'SavedModel'} + */ + TFSavedModel.prototype.execute = function (inputs, outputs) { + throw new Error('execute() of TFSavedModel is not supported yet.'); + }; + return TFSavedModel; +}()); +exports.TFSavedModel = TFSavedModel; +/** + * Load a TensorFlow SavedModel from disk. TensorFlow SavedModel is different + * from TensorFlow.js model format. A SavedModel is a directory containing + * serialized signatures and the states needed to run them. The directory has a + * saved_model.pb (or saved_model.pbtxt) file storing the actual TensorFlow + * program, or model, and a set of named signatures, each identifying a + * function. The directory also has a variables directory contains a standard + * training checkpoint. The directory may also has a assets directory contains + * files used by the TensorFlow graph, for example text files used to initialize + * vocabulary tables. These are supported datatypes: float32, int32, complex64, + * string.For more information, see this guide: + * https://www.tensorflow.org/guide/saved_model. + * + * @param path The path to the SavedModel. + * @param tags The tags of the MetaGraph to load. The available tags of a + * SavedModel can be retrieved through tf.node.getMetaGraphsFromSavedModel() + * API. Defaults to ['serve']. + * @param signature The name of the SignatureDef to load. The available + * SignatureDefs of a SavedModel can be retrieved through + * tf.node.getMetaGraphsFromSavedModel() API. Defaults to 'serving_default'. + * + * @doc {heading: 'Models', subheading: 'SavedModel', namespace: 'node'} + */ +function loadSavedModel(path, tags, signature) { + if (tags === void 0) { tags = ['serve']; } + if (signature === void 0) { signature = 'serving_default'; } + return __awaiter(this, void 0, void 0, function () { + var backend, savedModelInfo, signatureDefEntry, sessionId, _i, _a, id_1, modelInfo, tagsString, id, savedModel; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + nodejs_kernel_backend_1.ensureTensorflowBackend(); + backend = nodejs_kernel_backend_1.nodeBackend(); + return [4 /*yield*/, getMetaGraphsFromSavedModel(path)]; + case 1: + savedModelInfo = _b.sent(); + signatureDefEntry = getSignatureDefEntryFromMetaGraphInfo(savedModelInfo, tags, signature); + for (_i = 0, _a = Array.from(loadedSavedModelPathMap.keys()); _i < _a.length; _i++) { + id_1 = _a[_i]; + modelInfo = loadedSavedModelPathMap.get(id_1); + if (modelInfo.path === path && + stringArraysHaveSameElements(modelInfo.tags, tags)) { + sessionId = modelInfo.sessionId; + } + } + if (sessionId == null) { + tagsString = tags.join(','); + sessionId = backend.loadSavedModelMetaGraph(path, tagsString); + } + id = nextTFSavedModelId++; + savedModel = new TFSavedModel(sessionId, id, signatureDefEntry, backend); + loadedSavedModelPathMap.set(id, { path: path, tags: tags, sessionId: sessionId }); + return [2 /*return*/, savedModel]; + } + }); + }); +} +exports.loadSavedModel = loadSavedModel; +/** + * Compare if two unsorted arrays of string have the same elements. + * @param arrayA + * @param arrayB + */ +function stringArraysHaveSameElements(arrayA, arrayB) { + if (arrayA.length === arrayB.length && + arrayA.sort().join() === arrayB.sort().join()) { + return true; + } + return false; +} +function mapTFDtypeToJSDtype(tfDtype) { + switch (tfDtype) { + case 'DT_FLOAT': + return 'float32'; + case 'DT_INT64': + case 'DT_INT32': + case 'DT_UINT8': + return 'int32'; + case 'DT_BOOL': + return 'bool'; + case 'DT_COMPLEX64': + return 'complex64'; + case 'DT_STRING': + return 'string'; + default: + throw new Error('Unsupported tensor DataType: ' + tfDtype + + ', try to modify the model in python to convert the datatype'); + } +} +function getNumOfSavedModels() { + nodejs_kernel_backend_1.ensureTensorflowBackend(); + var backend = nodejs_kernel_backend_1.nodeBackend(); + return backend.getNumOfSavedModels(); +} +exports.getNumOfSavedModels = getNumOfSavedModels; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.d.ts new file mode 100644 index 000000000..1c3c75a12 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.d.ts @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ +export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.js new file mode 100644 index 000000000..59abe285f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/saved_model_test.js @@ -0,0 +1,700 @@ +"use strict"; +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var tf = require("./index"); +var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); +var saved_model_1 = require("./saved_model"); +// tslint:disable-next-line:no-require-imports +var messages = require('./proto/api_pb'); +describe('SavedModel', function () { + it('deserialize SavedModel pb file', function () { return __awaiter(_this, void 0, void 0, function () { + var modelMessage, signatureDefMapMessage, inputsMapMessage, inputsMapKeys, inputsMapKey1, inputTensorMessage, outputsMapMessage, outputsMapKeys, outputsMapKey1, outputTensorMessage; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, saved_model_1.readSavedModelProto('./test_objects/saved_model/times_three_float')]; + case 1: + modelMessage = _a.sent(); + // This SavedModel has one MetaGraph with tag serve + expect(modelMessage.getMetaGraphsList().length).toBe(1); + expect(modelMessage.getMetaGraphsList()[0] + .getMetaInfoDef() + .getTagsList() + .length) + .toBe(1); + expect(modelMessage.getMetaGraphsList()[0].getMetaInfoDef().getTagsList()[0]) + .toBe('serve'); + signatureDefMapMessage = modelMessage.getMetaGraphsList()[0].getSignatureDefMap(); + expect(signatureDefMapMessage.has('serving_default')); + inputsMapMessage = signatureDefMapMessage.get('serving_default').getInputsMap(); + expect(inputsMapMessage.getLength()).toBe(1); + inputsMapKeys = inputsMapMessage.keys(); + inputsMapKey1 = inputsMapKeys.next(); + expect(inputsMapKey1.done).toBe(false); + expect(inputsMapKey1.value).toBe('x'); + inputTensorMessage = inputsMapMessage.get(inputsMapKey1.value); + expect(inputTensorMessage.getName()).toBe('serving_default_x:0'); + expect(saved_model_1.getEnumKeyFromValue(messages.DataType, inputTensorMessage.getDtype())) + .toBe('DT_FLOAT'); + outputsMapMessage = signatureDefMapMessage.get('serving_default').getOutputsMap(); + expect(outputsMapMessage.getLength()).toBe(1); + outputsMapKeys = outputsMapMessage.keys(); + outputsMapKey1 = outputsMapKeys.next(); + expect(outputsMapKey1.done).toBe(false); + expect(outputsMapKey1.value).toBe('output_0'); + outputTensorMessage = outputsMapMessage.get(outputsMapKey1.value); + expect(outputTensorMessage.getName()).toBe('StatefulPartitionedCall:0'); + expect(saved_model_1.getEnumKeyFromValue(messages.DataType, outputTensorMessage.getDtype())) + .toBe('DT_FLOAT'); + return [2 /*return*/]; + } + }); + }); }); + it('get enum key based on value', function () { + var DataType = messages.DataType; + var enumKey0 = saved_model_1.getEnumKeyFromValue(DataType, 0); + expect(enumKey0).toBe('DT_INVALID'); + var enumKey1 = saved_model_1.getEnumKeyFromValue(DataType, 1); + expect(enumKey1).toBe('DT_FLOAT'); + var enumKey2 = saved_model_1.getEnumKeyFromValue(DataType, 2); + expect(enumKey2).toBe('DT_DOUBLE'); + }); + it('read non-exist file', function (done) { return __awaiter(_this, void 0, void 0, function () { + var err_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, saved_model_1.readSavedModelProto('/not-exist')]; + case 1: + _a.sent(); + done.fail(); + return [3 /*break*/, 3]; + case 2: + err_1 = _a.sent(); + expect(err_1.message) + .toBe("There is no saved_model.pb file in the directory: /not-exist"); + done(); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); }); + it('inspect SavedModel metagraphs', function () { return __awaiter(_this, void 0, void 0, function () { + var modelInfo; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, tf.node.getMetaGraphsFromSavedModel('./test_objects/saved_model/times_three_float')]; + case 1: + modelInfo = _a.sent(); + /** + * The inspection output should be + * [{ + * 'tags': ['serve'], + * 'signatureDefs': { + * '__saved_model_init_op': { + * 'inputs': {}, + * 'outputs': { + * '__saved_model_init_op': { + * 'dtype': 'DT_INVALID', + * 'name': 'NoOp', + * 'shape': [] + * } + * } + * }, + * 'serving_default': { + * 'inputs': { + * 'x': { + * 'dtype': 'DT_FLOAT', + * 'name': 'serving_default_x:0', + * 'shape':[] + * } + * }, + * 'outputs': { + * 'output_0': { + * 'dtype': 'DT_FLOAT', + * 'name': 'StatefulPartitionedCall:0', + * 'shape': [] + * } + * } + * } + * } + * }] + */ + expect(modelInfo.length).toBe(1); + expect(modelInfo[0].tags.length).toBe(1); + expect(modelInfo[0].tags[0]).toBe('serve'); + expect(Object.keys(modelInfo[0].signatureDefs).length).toBe(1); + expect(Object.keys(modelInfo[0].signatureDefs)[0]).toBe('serving_default'); + expect(Object.keys(modelInfo[0].signatureDefs['serving_default'].inputs) + .length) + .toBe(1); + expect(modelInfo[0].signatureDefs['serving_default'].inputs['x'].name) + .toBe('serving_default_x:0'); + expect(modelInfo[0].signatureDefs['serving_default'].inputs['x'].dtype) + .toBe('float32'); + expect(Object.keys(modelInfo[0].signatureDefs['serving_default'].outputs) + .length) + .toBe(1); + expect(modelInfo[0].signatureDefs['serving_default'].outputs['output_0'].name) + .toBe('StatefulPartitionedCall:0'); + expect(modelInfo[0].signatureDefs['serving_default'].outputs['output_0'].dtype) + .toBe('float32'); + return [2 /*return*/]; + } + }); + }); }); + it('get input and output node names from SavedModel metagraphs', function () { return __awaiter(_this, void 0, void 0, function () { + var modelInfo, signature; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, tf.node.getMetaGraphsFromSavedModel('./test_objects/saved_model/times_three_float')]; + case 1: + modelInfo = _a.sent(); + signature = saved_model_1.getSignatureDefEntryFromMetaGraphInfo(modelInfo, ['serve'], 'serving_default'); + expect(Object.keys(signature).length).toBe(2); + expect(signature.inputs['x'].name).toBe('serving_default_x:0'); + expect(signature.outputs['output_0'].name) + .toBe('StatefulPartitionedCall:0'); + return [2 /*return*/]; + } + }); + }); }); + it('load TFSavedModel', function () { return __awaiter(_this, void 0, void 0, function () { + var loadSavedModelMetaGraphSpy, model; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + loadSavedModelMetaGraphSpy = spyOn(nodejs_kernel_backend_1.nodeBackend(), 'loadSavedModelMetaGraph').and.callThrough(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(0); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; + case 1: + model = _a.sent(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('load TFSavedModel with wrong tags throw exception', function (done) { return __awaiter(_this, void 0, void 0, function () { + var error_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve', 'gpu'], 'serving_default')]; + case 1: + _a.sent(); + done.fail(); + return [3 /*break*/, 3]; + case 2: + error_1 = _a.sent(); + expect(error_1.message) + .toBe('The SavedModel does not have tags: serve,gpu'); + done(); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); }); + it('load TFSavedModel with wrong signature throw exception', function (done) { return __awaiter(_this, void 0, void 0, function () { + var error_2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'wrong_signature')]; + case 1: + _a.sent(); + done.fail(); + return [3 /*break*/, 3]; + case 2: + error_2 = _a.sent(); + expect(error_2.message) + .toBe('The SavedModel does not have signature: wrong_signature'); + done(); + return [3 /*break*/, 3]; + case 3: return [2 /*return*/]; + } + }); + }); }); + it('load TFSavedModel and delete', function () { return __awaiter(_this, void 0, void 0, function () { + var loadSavedModelMetaGraphSpy, deleteSavedModelSpy, model; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + expect(tf.node.getNumOfSavedModels()).toBe(0); + loadSavedModelMetaGraphSpy = spyOn(nodejs_kernel_backend_1.nodeBackend(), 'loadSavedModelMetaGraph').and.callThrough(); + deleteSavedModelSpy = spyOn(nodejs_kernel_backend_1.nodeBackend(), 'deleteSavedModel').and.callThrough(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(0); + expect(deleteSavedModelSpy).toHaveBeenCalledTimes(0); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; + case 1: + model = _a.sent(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + expect(deleteSavedModelSpy).toHaveBeenCalledTimes(0); + expect(tf.node.getNumOfSavedModels()).toBe(1); + model.dispose(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + expect(deleteSavedModelSpy).toHaveBeenCalledTimes(1); + expect(tf.node.getNumOfSavedModels()).toBe(0); + return [2 /*return*/]; + } + }); + }); }); + it('delete TFSavedModel multiple times throw exception', function (done) { return __awaiter(_this, void 0, void 0, function () { + var model; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; + case 1: + model = _a.sent(); + model.dispose(); + try { + model.dispose(); + done.fail(); + } + catch (error) { + expect(error.message).toBe('This SavedModel has already been deleted.'); + done(); + } + return [2 /*return*/]; + } + }); + }); }); + it('load multiple signatures from the same metagraph only call binding once', function () { return __awaiter(_this, void 0, void 0, function () { + var backend, loadSavedModelMetaGraphSpy, model1, model2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + expect(tf.node.getNumOfSavedModels()).toBe(0); + backend = nodejs_kernel_backend_1.nodeBackend(); + loadSavedModelMetaGraphSpy = spyOn(backend, 'loadSavedModelMetaGraph').and.callThrough(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(0); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'serving_default')]; + case 1: + model1 = _a.sent(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + expect(tf.node.getNumOfSavedModels()).toBe(1); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'timestwo')]; + case 2: + model2 = _a.sent(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + expect(tf.node.getNumOfSavedModels()).toBe(1); + model1.dispose(); + expect(tf.node.getNumOfSavedModels()).toBe(1); + model2.dispose(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + expect(tf.node.getNumOfSavedModels()).toBe(0); + return [2 /*return*/]; + } + }); + }); }); + it('load signature after delete call binding', function () { return __awaiter(_this, void 0, void 0, function () { + var backend, spyOnCallBindingLoad, spyOnNodeBackendDelete, model1, model2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + backend = nodejs_kernel_backend_1.nodeBackend(); + spyOnCallBindingLoad = spyOn(backend, 'loadSavedModelMetaGraph').and.callThrough(); + spyOnNodeBackendDelete = spyOn(backend, 'deleteSavedModel').and.callThrough(); + expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(0); + expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(0); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'serving_default')]; + case 1: + model1 = _a.sent(); + expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(1); + expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(0); + model1.dispose(); + expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(1); + expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(1); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'timestwo')]; + case 2: + model2 = _a.sent(); + expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(2); + expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(1); + model2.dispose(); + expect(spyOnCallBindingLoad).toHaveBeenCalledTimes(2); + expect(spyOnNodeBackendDelete).toHaveBeenCalledTimes(2); + return [2 /*return*/]; + } + }); + }); }); + it('throw error when input tensors do not match input ops', function (done) { return __awaiter(_this, void 0, void 0, function () { + var model, input1, input2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; + case 1: + model = _a.sent(); + input1 = tf.tensor1d([1.0, 2, 3]); + input2 = tf.tensor1d([1.0, 2, 3]); + try { + model.predict([input1, input2]); + done.fail(); + } + catch (error) { + expect(error.message) + .toBe('Length of input op names (1) does not match the ' + + 'length of input tensors (2).'); + model.dispose(); + done(); + } + return [2 /*return*/]; + } + }); + }); }); + it('execute model float times three', function () { return __awaiter(_this, void 0, void 0, function () { + var model, input, output, _a, _b, _c; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; + case 1: + model = _d.sent(); + input = tf.tensor1d([1.0, 2, 3]); + output = model.predict(input); + expect(output.shape).toEqual(input.shape); + expect(output.dtype).toBe(input.dtype); + expect(output.dtype).toBe('float32'); + _b = (_a = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output.data()]; + case 2: + _c = [_d.sent()]; + return [4 /*yield*/, input.mul(3).data()]; + case 3: + _b.apply(_a, _c.concat([_d.sent()])); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('execute model with tensor array as input', function () { return __awaiter(_this, void 0, void 0, function () { + var model, input, outputArray, output, _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; + case 1: + model = _c.sent(); + input = tf.tensor1d([1.0, 2, 3]); + outputArray = model.predict([input]); + expect(outputArray.length).toBe(1); + output = outputArray[0]; + expect(output.shape).toEqual(input.shape); + expect(output.dtype).toBe(input.dtype); + expect(output.dtype).toBe('float32'); + _b = (_a = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output.data()]; + case 2: + _b.apply(_a, [_c.sent(), [3.0, 6.0, 9.0]]); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('execute model with tensor map as input', function () { return __awaiter(_this, void 0, void 0, function () { + var model, input, outputMap, output, _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; + case 1: + model = _c.sent(); + input = tf.tensor1d([1.0, 2, 3]); + outputMap = model.predict({ 'x': input }); + output = outputMap['output_0']; + expect(output.shape).toEqual(input.shape); + expect(output.dtype).toBe(input.dtype); + expect(output.dtype).toBe('float32'); + _b = (_a = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output.data()]; + case 2: + _b.apply(_a, [_c.sent(), [3.0, 6.0, 9.0]]); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('execute model with wrong tensor name', function (done) { return __awaiter(_this, void 0, void 0, function () { + var model, input; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_three_float', ['serve'], 'serving_default')]; + case 1: + model = _a.sent(); + input = tf.tensor1d([1.0, 2, 3]); + try { + model.predict({ 'xyz': input }); + done.fail(); + } + catch (error) { + expect(error.message) + .toBe('The model signatureDef input names are x, however ' + + 'the provided input names are xyz.'); + model.dispose(); + done(); + } + return [2 /*return*/]; + } + }); + }); }); + it('execute model with uint8 input', function () { return __awaiter(_this, void 0, void 0, function () { + var model, input, output, _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/uint8_multiply', ['serve'], 'serving_default')]; + case 1: + model = _c.sent(); + input = tf.scalar(3, 'int32'); + output = model.predict(input); + expect(output.shape).toEqual([]); + expect(output.dtype).toBe('int32'); + _b = (_a = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output.data()]; + case 2: + _b.apply(_a, [_c.sent(), [18]]); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('execute model with int64 input', function () { return __awaiter(_this, void 0, void 0, function () { + var model, input, output, data; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/int64_multiply', ['serve'], 'serving_default')]; + case 1: + model = _a.sent(); + input = tf.tensor1d([3, 4], 'int32'); + output = model.predict(input); + expect(output.shape).toEqual([2]); + expect(output.dtype).toBe('int32'); + return [4 /*yield*/, output.data()]; + case 2: + data = _a.sent(); + expect(Number(data[0])).toEqual(18); + expect(Number(data[1])).toEqual(24); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('execute model int times two', function () { return __awaiter(_this, void 0, void 0, function () { + var model, input, output, _a, _b; + return __generator(this, function (_c) { + switch (_c.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/times_two_int', ['serve'], 'serving_default')]; + case 1: + model = _c.sent(); + input = tf.tensor1d([1, 2, 3], 'int32'); + output = model.predict(input); + expect(output.shape).toEqual(input.shape); + expect(output.dtype).toBe(input.dtype); + _b = (_a = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output.data()]; + case 2: + _b.apply(_a, [_c.sent(), [2, 4, 6]]); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('execute multiple signatures from the same model', function () { return __awaiter(_this, void 0, void 0, function () { + var backend, loadSavedModelMetaGraphSpy, model1, input1, output1, _a, _b, model2, input2, output2, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: + backend = nodejs_kernel_backend_1.nodeBackend(); + loadSavedModelMetaGraphSpy = spyOn(backend, 'loadSavedModelMetaGraph').and.callThrough(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(0); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'serving_default')]; + case 1: + model1 = _e.sent(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + input1 = tf.tensor1d([1, 2, 3]); + output1 = model1.predict(input1); + expect(output1.shape).toEqual(input1.shape); + expect(output1.dtype).toBe(input1.dtype); + _b = (_a = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output1.data()]; + case 2: + _b.apply(_a, [_e.sent(), [3.0, 6.0, 9.0]]); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'timestwo')]; + case 3: + model2 = _e.sent(); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + input2 = tf.tensor1d([1, 2, 3]); + output2 = model2.predict(input2); + expect(output2.shape).toEqual(input2.shape); + expect(output2.dtype).toBe(input2.dtype); + _d = (_c = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output2.data()]; + case 4: + _d.apply(_c, [_e.sent(), [2.0, 4.0, 6.0]]); + expect(loadSavedModelMetaGraphSpy).toHaveBeenCalledTimes(1); + model1.dispose(); + model2.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('execute model with single input and multiple outputs', function () { return __awaiter(_this, void 0, void 0, function () { + var model, input, output, output1, output2, _a, _b, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/model_single_input_multi_output', ['serve'], 'serving_default')]; + case 1: + model = _e.sent(); + input = tf.tensor1d([1, 2, 3], 'int32'); + output = model.predict(input); + output1 = output[0]; + output2 = output[1]; + expect(output1.shape).toEqual(input.shape); + expect(output1.dtype).toBe(input.dtype); + expect(output2.shape).toEqual(input.shape); + expect(output2.dtype).toBe(input.dtype); + _b = (_a = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output1.data()]; + case 2: + _b.apply(_a, [_e.sent(), [2, 4, 6]]); + _d = (_c = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output2.data()]; + case 3: + _d.apply(_c, [_e.sent(), [1, 2, 3]]); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('execute model with multiple inputs and multiple outputs', function () { return __awaiter(_this, void 0, void 0, function () { + var model, input1, input2, output, output1, output2, _a, _b, _c, _d; + return __generator(this, function (_e) { + switch (_e.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/model_multi_output', ['serve'], 'serving_default')]; + case 1: + model = _e.sent(); + input1 = tf.tensor1d([1, 2, 3], 'int32'); + input2 = tf.tensor1d([1, 2, 3], 'int32'); + output = model.predict({ 'x': input1, 'y': input2 }); + output1 = output['output_0']; + output2 = output['output_1']; + expect(output1.shape).toEqual(input1.shape); + expect(output1.dtype).toBe(input1.dtype); + expect(output2.shape).toEqual(input2.shape); + expect(output2.dtype).toBe(input2.dtype); + _b = (_a = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output1.data()]; + case 2: + _b.apply(_a, [_e.sent(), [2, 4, 6]]); + _d = (_c = tfjs_1.test_util).expectArraysClose; + return [4 /*yield*/, output2.data()]; + case 3: + _d.apply(_c, [_e.sent(), [1, 2, 3]]); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); + it('load multiple models', function () { return __awaiter(_this, void 0, void 0, function () { + var model1, model2; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + expect(tf.node.getNumOfSavedModels()).toBe(0); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/module_with_multiple_signatures', ['serve'], 'serving_default')]; + case 1: + model1 = _a.sent(); + expect(tf.node.getNumOfSavedModels()).toBe(1); + return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/model_multi_output', ['serve'], 'serving_default')]; + case 2: + model2 = _a.sent(); + expect(tf.node.getNumOfSavedModels()).toBe(2); + model1.dispose(); + expect(tf.node.getNumOfSavedModels()).toBe(1); + model2.dispose(); + expect(tf.node.getNumOfSavedModels()).toBe(0); + return [2 /*return*/]; + } + }); + }); }); + it('return inputs and outputs', function () { return __awaiter(_this, void 0, void 0, function () { + var model; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, tf.node.loadSavedModel('./test_objects/saved_model/model_multi_output', ['serve'], 'serving_default')]; + case 1: + model = _a.sent(); + expect(model.inputs.length).toBe(2); + expect(model.outputs.length).toBe(2); + expect(model.inputs[0].name).toBe('serving_default_x'); + expect(model.inputs[0].dtype).toBe('int32'); + expect(model.inputs[0].tfDtype).toBe('DT_INT32'); + expect(model.inputs[0].shape.length).toBe(0); + expect(model.inputs[1].name).toBe('serving_default_y'); + expect(model.inputs[1].dtype).toBe('int32'); + expect(model.inputs[1].tfDtype).toBe('DT_INT32'); + expect(model.inputs[1].shape.length).toBe(0); + expect(model.outputs[0].name).toBe('StatefulPartitionedCall'); + expect(model.outputs[0].dtype).toBe('int32'); + expect(model.outputs[0].tfDtype).toBe('DT_INT32'); + expect(model.outputs[0].shape.length).toBe(0); + expect(model.outputs[1].name).toBe('StatefulPartitionedCall:1'); + expect(model.outputs[1].dtype).toBe('int32'); + expect(model.outputs[1].tfDtype).toBe('DT_INT32'); + expect(model.outputs[1].shape.length).toBe(0); + model.dispose(); + return [2 /*return*/]; + } + }); + }); }); +}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.d.ts new file mode 100644 index 000000000..bf9c718cd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.d.ts @@ -0,0 +1,64 @@ +/** + * @license + * Copyright 2019 Google LLC. 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 { Scalar, Tensor } from '@tensorflow/tfjs'; +import { NodeJSKernelBackend } from './nodejs_kernel_backend'; +export declare class SummaryFileWriter { + private readonly resourceHandle; + backend: NodeJSKernelBackend; + constructor(resourceHandle: Tensor); + /** + * Write a scalar summary. + * + * @param name A name of the summary. The summary tag for TensorBoard will be + * this name. + * @param value A real numeric scalar value, as `tf.Scalar` or a JavaScript + * `number`. + * @param step Required `int64`-castable, monotically-increasing step value. + * @param description Optinal long-form description for this summary, as a + * `string`. *Not implemented yet*. + */ + scalar(name: string, value: Scalar | number, step: number, description?: string): void; + /** + * Force summary writer to send all buffered data to storage. + */ + flush(): void; +} +/** + * Create a summary file writer for TensorBoard. + * + * Example: + * ```js + * const tf = require('@tensorflow/tfjs-node'); + * + * const summaryWriter = tf.node.summaryFileWriter('/tmp/tfjs_tb_logdir'); + * + * for (let step = 0; step < 100; ++step) { + * summaryWriter.scalar('dummyValue', Math.sin(2 * Math.PI * step / 8), step); + * } + * ``` + * + * @param logdir Log directory in which the summary data will be written. + * @param maxQueue Maximum queue length (default: `10`). + * @param flushMillis Flush every __ milliseconds (default: `120e3`, i.e, + * `120` seconds). + * @param filenameSuffix Suffix of the protocol buffer file names to be + * written in the `logdir` (default: `.v2`). + * @returns An instance of `SummaryFileWriter`. + * + * @doc {heading: 'TensorBoard', namespace: 'node'} + */ +export declare function summaryFileWriter(logdir: string, maxQueue?: number, flushMillis?: number, filenameSuffix?: string): SummaryFileWriter; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.js new file mode 100644 index 000000000..09d6718ff --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard.js @@ -0,0 +1,102 @@ +"use strict"; +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var nodejs_kernel_backend_1 = require("./nodejs_kernel_backend"); +var SummaryFileWriter = /** @class */ (function () { + function SummaryFileWriter(resourceHandle) { + this.resourceHandle = resourceHandle; + nodejs_kernel_backend_1.ensureTensorflowBackend(); + this.backend = nodejs_kernel_backend_1.nodeBackend(); + } + /** + * Write a scalar summary. + * + * @param name A name of the summary. The summary tag for TensorBoard will be + * this name. + * @param value A real numeric scalar value, as `tf.Scalar` or a JavaScript + * `number`. + * @param step Required `int64`-castable, monotically-increasing step value. + * @param description Optinal long-form description for this summary, as a + * `string`. *Not implemented yet*. + */ + SummaryFileWriter.prototype.scalar = function (name, value, step, description) { + // N.B.: Unlike the Python TensorFlow API, step is a required parameter, + // because the construct of global step does not exist in TensorFlow.js. + if (description != null) { + throw new Error('scalar() does not support description yet'); + } + this.backend.writeScalarSummary(this.resourceHandle, step, name, value); + }; + /** + * Force summary writer to send all buffered data to storage. + */ + SummaryFileWriter.prototype.flush = function () { + this.backend.flushSummaryWriter(this.resourceHandle); + }; + return SummaryFileWriter; +}()); +exports.SummaryFileWriter = SummaryFileWriter; +/** + * Use a cache for `SummaryFileWriter` instance. + * + * Using multiple instances of `SummaryFileWriter` pointing to the same + * logdir has potential problems. Using this cache avoids those problems. + */ +var summaryFileWriterCache = {}; +/** + * Create a summary file writer for TensorBoard. + * + * Example: + * ```js + * const tf = require('@tensorflow/tfjs-node'); + * + * const summaryWriter = tf.node.summaryFileWriter('/tmp/tfjs_tb_logdir'); + * + * for (let step = 0; step < 100; ++step) { + * summaryWriter.scalar('dummyValue', Math.sin(2 * Math.PI * step / 8), step); + * } + * ``` + * + * @param logdir Log directory in which the summary data will be written. + * @param maxQueue Maximum queue length (default: `10`). + * @param flushMillis Flush every __ milliseconds (default: `120e3`, i.e, + * `120` seconds). + * @param filenameSuffix Suffix of the protocol buffer file names to be + * written in the `logdir` (default: `.v2`). + * @returns An instance of `SummaryFileWriter`. + * + * @doc {heading: 'TensorBoard', namespace: 'node'} + */ +function summaryFileWriter(logdir, maxQueue, flushMillis, filenameSuffix) { + if (maxQueue === void 0) { maxQueue = 10; } + if (flushMillis === void 0) { flushMillis = 120000; } + if (filenameSuffix === void 0) { filenameSuffix = '.v2'; } + tfjs_1.util.assert(logdir != null && typeof logdir === 'string' && logdir.length > 0, function () { + return "Invalid logdir: " + logdir + ". Expected a non-empty string for logdir."; + }); + if (!(logdir in summaryFileWriterCache)) { + nodejs_kernel_backend_1.ensureTensorflowBackend(); + var backend = nodejs_kernel_backend_1.nodeBackend(); + var writerResource = backend.summaryWriter(logdir); + backend.createSummaryFileWriter(writerResource, logdir, maxQueue, flushMillis, filenameSuffix); + summaryFileWriterCache[logdir] = new SummaryFileWriter(writerResource); + } + return summaryFileWriterCache[logdir]; +} +exports.summaryFileWriter = summaryFileWriter; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.d.ts new file mode 100644 index 000000000..4a6d69728 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.d.ts @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.js new file mode 100644 index 000000000..922f9122c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tensorboard_test.js @@ -0,0 +1,390 @@ +"use strict"; +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var _this = this; +Object.defineProperty(exports, "__esModule", { value: true }); +var tfjs_1 = require("@tensorflow/tfjs"); +var fs = require("fs"); +var path = require("path"); +var util_1 = require("util"); +var tfn = require("./index"); +// tslint:disable-next-line:no-require-imports +var rimraf = require('rimraf'); +// tslint:disable-next-line:no-require-imports +var tmp = require('tmp'); +var rimrafPromise = util_1.promisify(rimraf); +describe('tensorboard', function () { + var tmpLogDir; + beforeEach(function () { + tmpLogDir = tmp.dirSync().name; + }); + afterEach(function () { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(tmpLogDir != null)) return [3 /*break*/, 2]; + return [4 /*yield*/, rimrafPromise(tmpLogDir)]; + case 1: + _a.sent(); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); }); + it('Create summaryFileWriter and write scalar', function () { + var writer = tfn.node.summaryFileWriter(tmpLogDir); + writer.scalar('foo', 42, 0); + writer.flush(); + // Currently, we only verify that the file exists and the size + // increases in a sensible way as we write more scalars to it. + // The difficulty is in reading the protobuf contents of the event + // file in JavaScript/TypeScript. + var fileNames = fs.readdirSync(tmpLogDir); + expect(fileNames.length).toEqual(1); + var eventFilePath = path.join(tmpLogDir, fileNames[0]); + var fileSize0 = fs.statSync(eventFilePath).size; + writer.scalar('foo', 43, 1); + writer.flush(); + var fileSize1 = fs.statSync(eventFilePath).size; + var incrementPerScalar = fileSize1 - fileSize0; + expect(incrementPerScalar).toBeGreaterThan(0); + writer.scalar('foo', 44, 2); + writer.scalar('foo', 45, 3); + writer.flush(); + var fileSize2 = fs.statSync(eventFilePath).size; + expect(fileSize2 - fileSize1).toEqual(2 * incrementPerScalar); + }); + it('Writing tf.Scalar works', function () { + var writer = tfn.node.summaryFileWriter(tmpLogDir); + writer.scalar('foo', tfjs_1.scalar(42), 0); + writer.flush(); + // Currently, we only verify that the file exists and the size + // increases in a sensible way as we write more scalars to it. + // The difficulty is in reading the protobuf contents of the event + // file in JavaScript/TypeScript. + var fileNames = fs.readdirSync(tmpLogDir); + expect(fileNames.length).toEqual(1); + }); + it('No crosstalk between two summary writers', function () { + var logDir1 = path.join(tmpLogDir, '1'); + var writer1 = tfn.node.summaryFileWriter(logDir1); + writer1.scalar('foo', 42, 0); + writer1.flush(); + var logDir2 = path.join(tmpLogDir, '2'); + var writer2 = tfn.node.summaryFileWriter(logDir2); + writer2.scalar('foo', 1.337, 0); + writer2.flush(); + // Currently, we only verify that the file exists and the size + // increases in a sensible way as we write more scalars to it. + // The difficulty is in reading the protobuf contents of the event + // file in JavaScript/TypeScript. + var fileNames = fs.readdirSync(logDir1); + expect(fileNames.length).toEqual(1); + var eventFilePath1 = path.join(logDir1, fileNames[0]); + var fileSize1Num0 = fs.statSync(eventFilePath1).size; + fileNames = fs.readdirSync(logDir2); + expect(fileNames.length).toEqual(1); + var eventFilePath2 = path.join(logDir2, fileNames[0]); + var fileSize2Num0 = fs.statSync(eventFilePath2).size; + expect(fileSize2Num0).toBeGreaterThan(0); + writer1.scalar('foo', 43, 1); + writer1.flush(); + var fileSize1Num1 = fs.statSync(eventFilePath1).size; + var incrementPerScalar = fileSize1Num1 - fileSize1Num0; + expect(incrementPerScalar).toBeGreaterThan(0); + writer1.scalar('foo', 44, 2); + writer1.scalar('foo', 45, 3); + writer1.flush(); + var fileSize1Num2 = fs.statSync(eventFilePath1).size; + expect(fileSize1Num2 - fileSize1Num1).toEqual(2 * incrementPerScalar); + var fileSize2Num1 = fs.statSync(eventFilePath2).size; + expect(fileSize2Num1).toEqual(fileSize2Num0); + writer2.scalar('foo', 1.336, 1); + writer2.scalar('foo', 1.335, 2); + writer2.flush(); + var fileSize1Num3 = fs.statSync(eventFilePath1).size; + expect(fileSize1Num3).toEqual(fileSize1Num2); + var fileSize2Num2 = fs.statSync(eventFilePath2).size; + expect(fileSize2Num2 - fileSize2Num1).toEqual(2 * incrementPerScalar); + }); + it('Writing into existing directory works', function () { + fs.mkdirSync(tmpLogDir, { recursive: true }); + var writer = tfn.node.summaryFileWriter(path.join(tmpLogDir, '22')); + writer.scalar('foo', 42, 0); + writer.flush(); + var fileNames = fs.readdirSync(tmpLogDir); + expect(fileNames.length).toEqual(1); + }); + it('empty logdir leads to error', function () { + expect(function () { return tfn.node.summaryFileWriter(''); }).toThrowError(/empty string/); + }); +}); +describe('tensorBoard callback', function () { + var tmpLogDir; + beforeEach(function () { + tmpLogDir = tmp.dirSync().name; + }); + afterEach(function () { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!(tmpLogDir != null)) return [3 /*break*/, 2]; + return [4 /*yield*/, rimrafPromise(tmpLogDir)]; + case 1: + _a.sent(); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); }); + function createModelForTest() { + var model = tfn.sequential(); + model.add(tfn.layers.dense({ units: 5, activation: 'relu', inputShape: [10] })); + model.add(tfn.layers.dense({ units: 1 })); + model.compile({ loss: 'meanSquaredError', optimizer: 'sgd', metrics: ['MAE'] }); + return model; + } + it('fit(): default epoch updateFreq, with validation', function () { return __awaiter(_this, void 0, void 0, function () { + var model, xs, ys, valXs, valYs, subDirs, trainLogDir, trainFiles, trainFileSize0, valLogDir, valFiles, valFileSize0, history, trainFileSize1, valFileSize1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + model = createModelForTest(); + xs = tfn.randomUniform([100, 10]); + ys = tfn.randomUniform([100, 1]); + valXs = tfn.randomUniform([10, 10]); + valYs = tfn.randomUniform([10, 1]); + // Warm-up training. + return [4 /*yield*/, model.fit(xs, ys, { + epochs: 1, + verbose: 0, + validationData: [valXs, valYs], + callbacks: tfn.node.tensorBoard(tmpLogDir) + })]; + case 1: + // Warm-up training. + _a.sent(); + subDirs = fs.readdirSync(tmpLogDir); + expect(subDirs).toContain('train'); + expect(subDirs).toContain('val'); + trainLogDir = path.join(tmpLogDir, 'train'); + trainFiles = fs.readdirSync(trainLogDir); + trainFileSize0 = fs.statSync(path.join(trainLogDir, trainFiles[0])).size; + expect(trainFileSize0).toBeGreaterThan(0); + valLogDir = path.join(tmpLogDir, 'val'); + valFiles = fs.readdirSync(valLogDir); + valFileSize0 = fs.statSync(path.join(valLogDir, valFiles[0])).size; + expect(valFileSize0).toBeGreaterThan(0); + // With updateFreq === epoch, the train and val subset should have generated + // the same amount of logs. + expect(valFileSize0).toEqual(trainFileSize0); + return [4 /*yield*/, model.fit(xs, ys, { + epochs: 3, + verbose: 0, + validationData: [valXs, valYs], + callbacks: tfn.node.tensorBoard(tmpLogDir) + })]; + case 2: + history = _a.sent(); + expect(history.history.loss.length).toEqual(3); + expect(history.history.val_loss.length).toEqual(3); + expect(history.history.MAE.length).toEqual(3); + expect(history.history.val_MAE.length).toEqual(3); + trainFileSize1 = fs.statSync(path.join(trainLogDir, trainFiles[0])).size; + valFileSize1 = fs.statSync(path.join(valLogDir, valFiles[0])).size; + // We currently only assert that new content has been written to the log + // file. + expect(trainFileSize1).toBeGreaterThan(trainFileSize0); + expect(valFileSize1).toBeGreaterThan(valFileSize0); + // With updateFreq === epoch, the train and val subset should have generated + // the same amount of logs. + expect(valFileSize1).toEqual(trainFileSize1); + return [2 /*return*/]; + } + }); + }); }); + it('fit(): batch updateFreq, with validation', function () { return __awaiter(_this, void 0, void 0, function () { + var model, xs, ys, valXs, valYs, subDirs, trainLogDir, trainFiles, trainFileSize0, valLogDir, valFiles, valFileSize0, history, trainFileSize1, valFileSize1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + model = createModelForTest(); + xs = tfn.randomUniform([100, 10]); + ys = tfn.randomUniform([100, 1]); + valXs = tfn.randomUniform([10, 10]); + valYs = tfn.randomUniform([10, 1]); + // Warm-up training. + return [4 /*yield*/, model.fit(xs, ys, { + epochs: 1, + verbose: 0, + validationData: [valXs, valYs], + // Use batch updateFreq here. + callbacks: tfn.node.tensorBoard(tmpLogDir, { updateFreq: 'batch' }) + })]; + case 1: + // Warm-up training. + _a.sent(); + subDirs = fs.readdirSync(tmpLogDir); + expect(subDirs).toContain('train'); + expect(subDirs).toContain('val'); + trainLogDir = path.join(tmpLogDir, 'train'); + trainFiles = fs.readdirSync(trainLogDir); + trainFileSize0 = fs.statSync(path.join(trainLogDir, trainFiles[0])).size; + expect(trainFileSize0).toBeGreaterThan(0); + valLogDir = path.join(tmpLogDir, 'val'); + valFiles = fs.readdirSync(valLogDir); + valFileSize0 = fs.statSync(path.join(valLogDir, valFiles[0])).size; + expect(valFileSize0).toBeGreaterThan(0); + // The train subset should have generated more logs than the val subset, + // because the train subset gets logged every batch, while the val subset + // gets logged every epoch. + expect(trainFileSize0).toBeGreaterThan(valFileSize0); + return [4 /*yield*/, model.fit(xs, ys, { + epochs: 3, + verbose: 0, + validationData: [valXs, valYs], + callbacks: tfn.node.tensorBoard(tmpLogDir) + })]; + case 2: + history = _a.sent(); + expect(history.history.loss.length).toEqual(3); + expect(history.history.val_loss.length).toEqual(3); + expect(history.history.MAE.length).toEqual(3); + expect(history.history.val_MAE.length).toEqual(3); + trainFileSize1 = fs.statSync(path.join(trainLogDir, trainFiles[0])).size; + valFileSize1 = fs.statSync(path.join(valLogDir, valFiles[0])).size; + // We currently only assert that new content has been written to the log + // file. + expect(trainFileSize1).toBeGreaterThan(trainFileSize0); + expect(valFileSize1).toBeGreaterThan(valFileSize0); + // The train subset should have generated more logs than the val subset, + // because the train subset gets logged every batch, while the val subset + // gets logged every epoch. + expect(trainFileSize1).toBeGreaterThan(valFileSize1); + return [2 /*return*/]; + } + }); + }); }); + it('fit(): with initialEpoch', function () { return __awaiter(_this, void 0, void 0, function () { + var model, xs, ys, valXs, valYs, callback, trainWriterScalarSpy, valWriterScalarSpy, trainCallArgs, valCallArgs; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + model = createModelForTest(); + xs = tfn.randomUniform([100, 10]); + ys = tfn.randomUniform([100, 1]); + valXs = tfn.randomUniform([10, 10]); + valYs = tfn.randomUniform([10, 1]); + // Warm-up training. Also ensures that `callback.trainWriter` and + // `callback.valWriter` are created. + return [4 /*yield*/, model.fit(xs, ys, { + epochs: 2, + validationData: [valXs, valYs], + verbose: 0, + })]; + case 1: + // Warm-up training. Also ensures that `callback.trainWriter` and + // `callback.valWriter` are created. + _a.sent(); + callback = tfn.node.tensorBoard(tmpLogDir, { updateFreq: 'epoch' }); + // tslint:disable-next-line:no-any + callback.ensureTrainWriterCreated(); + // tslint:disable-next-line:no-any + callback.ensureValWriterCreated(); + trainWriterScalarSpy = spyOn(callback.trainWriter, 'scalar'); + valWriterScalarSpy = spyOn(callback.valWriter, 'scalar'); + // Train for 2 more epochs, using initialEpoch and callback. + return [4 /*yield*/, model.fit(xs, ys, { + epochs: 4, + initialEpoch: 2, + validationData: [valXs, valYs], + callbacks: [callback], + })]; + case 2: + // Train for 2 more epochs, using initialEpoch and callback. + _a.sent(); + expect(trainWriterScalarSpy).toHaveBeenCalledTimes(4); + trainCallArgs = trainWriterScalarSpy.calls.allArgs(); + // Assert that the epoch numbers used to log the epoch-end loss and metric + // reflect initialEpoch. + expect(trainCallArgs[0][0]).toEqual('epoch_loss'); + expect(trainCallArgs[0][2]).toEqual(3); + expect(trainCallArgs[1][0]).toEqual('epoch_MAE'); + expect(trainCallArgs[1][2]).toEqual(3); + expect(trainCallArgs[2][0]).toEqual('epoch_loss'); + expect(trainCallArgs[2][2]).toEqual(4); + expect(trainCallArgs[3][0]).toEqual('epoch_MAE'); + expect(trainCallArgs[3][2]).toEqual(4); + expect(valWriterScalarSpy).toHaveBeenCalledTimes(4); + valCallArgs = valWriterScalarSpy.calls.allArgs(); + expect(valCallArgs[0][0]).toEqual('epoch_loss'); + expect(valCallArgs[0][2]).toEqual(3); + expect(valCallArgs[1][0]).toEqual('epoch_MAE'); + expect(valCallArgs[1][2]).toEqual(3); + expect(valCallArgs[2][0]).toEqual('epoch_loss'); + expect(valCallArgs[2][2]).toEqual(4); + expect(valCallArgs[3][0]).toEqual('epoch_MAE'); + expect(valCallArgs[3][2]).toEqual(4); + return [2 /*return*/]; + } + }); + }); }); + it('Invalid updateFreq value causes error', function () { return __awaiter(_this, void 0, void 0, function () { + return __generator(this, function (_a) { + expect(function () { return tfn.node.tensorBoard(tmpLogDir, { + // tslint:disable-next-line:no-any + updateFreq: 'foo' + }); }).toThrowError(/Expected updateFreq/); + return [2 /*return*/]; + }); + }); }); +}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.d.ts new file mode 100644 index 000000000..9fd4bb199 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.d.ts @@ -0,0 +1,56 @@ +/** + * @license + * Copyright 2018 Google LLC. 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 { backend_util } from '@tensorflow/tfjs'; +export declare class TensorMetadata { + id: number; + shape: number[]; + dtype: number; +} +export declare class TFEOpAttr { + name: string; + type: number; + value: boolean | number | object | string | number[]; +} +export interface TFJSBinding { + TensorMetadata: typeof TensorMetadata; + TFEOpAttr: typeof TFEOpAttr; + createTensor(shape: number[], dtype: number, buffer: backend_util.BackendValues): number; + deleteTensor(tensorId: number): void; + tensorDataSync(tensorId: number): Float32Array | Int32Array | Uint8Array; + executeOp(opName: string, opAttrs: TFEOpAttr[], inputTensorIds: number[], numOutputs: number): TensorMetadata[]; + loadSavedModel(exportDir: string, tags: string): number; + deleteSavedModel(savedModelId: number): void; + runSavedModel(savedModelId: number, inputTensorIds: number[], inputOpNames: string, outputOpNames: string): TensorMetadata[]; + getNumOfSavedModels(): number; + isUsingGpuDevice(): boolean; + TF_FLOAT: number; + TF_INT32: number; + TF_INT64: number; + TF_BOOL: number; + TF_COMPLEX64: number; + TF_STRING: number; + TF_RESOURCE: number; + TF_UINT8: number; + TF_ATTR_STRING: number; + TF_ATTR_INT: number; + TF_ATTR_FLOAT: number; + TF_ATTR_BOOL: number; + TF_ATTR_TYPE: number; + TF_ATTR_SHAPE: number; + TF_ATTR_RESOURCE: number; + TF_Version: string; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.js new file mode 100644 index 000000000..7c826123e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding.js @@ -0,0 +1,18 @@ +"use strict"; +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.d.ts new file mode 100644 index 000000000..4a6d69728 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.d.ts @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +export {}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.js new file mode 100644 index 000000000..84e44ffea --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/tfjs_binding_test.js @@ -0,0 +1,255 @@ +"use strict"; +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +// tslint:disable-next-line:no-require-imports +var binary = require('node-pre-gyp'); +var bindingPath = binary.find(path.resolve(path.join(__dirname, '../package.json'))); +// tslint:disable-next-line:no-require-imports +var bindings = require(bindingPath); +var binding = bindings; +describe('Exposes TF_DataType enum values', function () { + it('contains TF_FLOAT', function () { + expect(binding.TF_FLOAT).toEqual(1); + }); + it('contains TF_INT32', function () { + expect(binding.TF_INT32).toEqual(3); + }); + it('contains TF_BOOL', function () { + expect(binding.TF_BOOL).toEqual(10); + }); + it('contains TF_COMPLEX64', function () { + expect(binding.TF_COMPLEX64).toEqual(8); + }); + it('contains TF_STRING', function () { + expect(binding.TF_STRING).toEqual(7); + }); +}); +describe('Exposes TF_AttrType enum values', function () { + it('contains TF_ATTR_STRING', function () { + expect(binding.TF_ATTR_STRING).toEqual(0); + }); + it('contains TF_ATTR_INT', function () { + expect(binding.TF_ATTR_INT).toEqual(1); + }); + it('contains TF_ATTR_FLOAT', function () { + expect(binding.TF_ATTR_FLOAT).toEqual(2); + }); + it('contains TF_ATTR_BOOL', function () { + expect(binding.TF_ATTR_BOOL).toEqual(3); + }); + it('contains TF_ATTR_TYPE', function () { + expect(binding.TF_ATTR_TYPE).toEqual(4); + }); + it('contains TF_ATTR_SHAPE', function () { + expect(binding.TF_ATTR_SHAPE).toEqual(5); + }); +}); +describe('Exposes TF Version', function () { + it('contains a version string', function () { + expect(binding.TF_Version).toBeDefined(); + }); +}); +describe('tensor management', function () { + it('Creates and deletes a valid tensor', function () { + var values = new Int32Array([1, 2]); + var id = binding.createTensor([2], binding.TF_INT32, values); + expect(id).toBeDefined(); + binding.deleteTensor(id); + }); + it('throws exception when shape does not match data', function () { + expect(function () { + binding.createTensor([2], binding.TF_INT32, new Int32Array([1, 2, 3])); + }).toThrowError(); + expect(function () { + binding.createTensor([4], binding.TF_INT32, new Int32Array([1, 2, 3])); + }).toThrowError(); + }); + it('throws exception with invalid dtype', function () { + expect(function () { + // tslint:disable-next-line:no-unused-expression + binding.createTensor([1], 1000, new Int32Array([1])); + }).toThrowError(); + }); + it('works with 0-dim tensors', function () { + // Reduce op (e.g 'Max') will produce a 0-dim TFE_Tensor. + var inputId = binding.createTensor([3], binding.TF_INT32, new Int32Array([1, 2, 3])); + var axesId = binding.createTensor([1], binding.TF_INT32, new Int32Array([0])); + var attrs = [ + { name: 'keep_dims', type: binding.TF_ATTR_BOOL, value: false }, + { name: 'T', type: binding.TF_ATTR_TYPE, value: binding.TF_INT32 }, + { name: 'Tidx', type: binding.TF_ATTR_TYPE, value: binding.TF_INT32 } + ]; + var outputMetadata = binding.executeOp('Max', attrs, [inputId, axesId], 1); + expect(outputMetadata.length).toBe(1); + expect(outputMetadata[0].id).toBeDefined(); + expect(outputMetadata[0].shape).toEqual([]); + expect(outputMetadata[0].dtype).toEqual(binding.TF_INT32); + expect(binding.tensorDataSync(outputMetadata[0].id)) + .toEqual(new Int32Array([3])); + }); +}); +describe('executeOp', function () { + var name = 'MatMul'; + var matMulOpAttrs = [ + { name: 'transpose_a', type: binding.TF_ATTR_BOOL, value: false }, + { name: 'transpose_b', type: binding.TF_ATTR_BOOL, value: false }, + { name: 'T', type: binding.TF_ATTR_TYPE, value: binding.TF_FLOAT } + ]; + var aId = binding.createTensor([2, 2], binding.TF_FLOAT, new Float32Array([1, 2, 3, 4])); + var bId = binding.createTensor([2, 2], binding.TF_FLOAT, new Float32Array([4, 3, 2, 1])); + var matMulInput = [aId, bId]; + it('throws exception with invalid Op Name', function () { + expect(function () { + binding.executeOp(null, [], [], null); + }).toThrowError(); + }); + it('throws exception with invalid TFEOpAttr', function () { + expect(function () { + binding.executeOp('Equal', null, [], null); + }).toThrowError(); + }); + it('throws excpetion with invalid inputs', function () { + expect(function () { + binding.executeOp(name, matMulOpAttrs, [], null); + }).toThrowError(); + }); + it('throws exception with invalid output number', function () { + expect(function () { + binding.executeOp(name, matMulOpAttrs, matMulInput, null); + }).toThrowError(); + }); + it('throws exception with invalid TF_ATTR_STRING op attr', function () { + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: null }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: false }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: 1 }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: new Object() }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_STRING, value: [1, 2, 3] }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + }); + it('throws exception with invalid TF_ATTR_INT op attr', function () { + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_INT, value: null }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_INT, value: false }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_INT, value: new Object() }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_INT, value: 'test' }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + }); + it('throws exception with invalid TF_ATTR_FLOAT op attr', function () { + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_FLOAT, value: null }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_FLOAT, value: false }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_FLOAT, value: new Object() }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_FLOAT, value: 'test' }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + }); + it('throws exception with invalid TF_ATTR_BOOL op attr', function () { + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: null }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: 10 }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: new Object() }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: 'test' }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_BOOL, value: [1, 2, 3] }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + }); + it('throws exception with invalid TF_ATTR_TYPE op attr', function () { + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: null }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: new Object() }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: 'test' }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: [1, 2, 3] }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + }); + it('throws exception with invalid TF_ATTR_SHAPE op attr', function () { + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: null }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: new Object() }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + expect(function () { + var badOpAttrs = [{ name: 'T', type: binding.TF_ATTR_TYPE, value: 'test' }]; + binding.executeOp(name, badOpAttrs, matMulInput, 1); + }).toThrowError(); + }); + it('should work for matmul', function () { + var output = binding.executeOp(name, matMulOpAttrs, matMulInput, 1); + expect(binding.tensorDataSync(output[0].id)).toEqual(new Float32Array([ + 8, 5, 20, 13 + ])); + }); +}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.d.ts new file mode 100644 index 000000000..35cb42ada --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.d.ts @@ -0,0 +1,3 @@ +/** @license See the LICENSE file. */ +declare const version = "3.6.1"; +export { version }; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.js new file mode 100644 index 000000000..6ec1b9a17 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/dist/version.js @@ -0,0 +1,6 @@ +"use strict"; +/** @license See the LICENSE file. */ +Object.defineProperty(exports, "__esModule", { value: true }); +// This code is auto-generated, do not modify this file! +var version = '3.6.1'; +exports.version = version; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node new file mode 100755 index 000000000..a656bb9ca Binary files /dev/null and b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node differ diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/package.json new file mode 100644 index 000000000..98daf908d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/package.json @@ -0,0 +1,129 @@ +{ + "_from": "@tensorflow/tfjs-node", + "_id": "@tensorflow/tfjs-node@3.6.1", + "_inBundle": false, + "_integrity": "sha512-JA6GE7AYx+zoXiKQmEdMc848HDOurrI3vFyiLk/8bXJDEv7L7oW5y6Q1Ja+Bz5ul7UmOxNG89hyYhfGqJK8qKw==", + "_location": "/@tensorflow/tfjs-node", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "@tensorflow/tfjs-node", + "name": "@tensorflow/tfjs-node", + "escapedName": "@tensorflow%2ftfjs-node", + "scope": "@tensorflow", + "rawSpec": "", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/@tensorflow/tfjs-node/-/tfjs-node-3.6.1.tgz", + "_shasum": "a1452076fe6da48f5648ca33f85d1127e6881244", + "_spec": "@tensorflow/tfjs-node", + "_where": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning", + "binary": { + "module_name": "tfjs_binding", + "module_path": "./lib/napi-v{napi_build_version}", + "host": "https://storage.googleapis.com/tf-builds/pre-built-binary", + "remote_path": "./napi-v{napi_build_version}/{version}/", + "napi_versions": [ + 3, + 4, + 5, + 6, + 7, + 8 + ] + }, + "bugs": { + "url": "https://github.com/tensorflow/tfjs/issues" + }, + "bundleDependencies": false, + "dependencies": { + "@tensorflow/tfjs": "3.6.0", + "adm-zip": "^0.4.11", + "google-protobuf": "^3.9.2", + "https-proxy-agent": "^2.2.1", + "node-pre-gyp": "0.14.0", + "progress": "^2.0.0", + "rimraf": "^2.6.2", + "tar": "^4.4.6" + }, + "deprecated": false, + "description": "This repository provides native TensorFlow execution in backend JavaScript applications under the Node.js runtime, accelerated by the TensorFlow C binary under the hood. It provides the same API as [TensorFlow.js](https://js.tensorflow.org/api/latest/).", + "devDependencies": { + "@tensorflow/tfjs-core": "3.6.0", + "@types/jasmine": "~2.8.6", + "@types/node": "^10.5.1", + "@types/progress": "^2.0.1", + "@types/rimraf": "~2.0.2", + "@types/yargs": "^13.0.3", + "clang-format": "~1.2.2", + "jasmine": "~3.1.0", + "node-fetch": "~2.6.1", + "nyc": "^15.1.0", + "tmp": "^0.0.33", + "ts-node": "^5.0.1", + "tslint": "~6.1.3", + "tslint-no-circular-imports": "^0.7.0", + "typescript": "3.5.3", + "yalc": "~1.0.0-pre.50", + "yargs": "^16.2.0" + }, + "engines": { + "node": ">=8.11.0" + }, + "gypfile": true, + "homepage": "https://github.com/tensorflow/tfjs#readme", + "license": "Apache-2.0", + "main": "dist/index.js", + "name": "@tensorflow/tfjs-node", + "repository": { + "type": "git", + "url": "git+https://github.com/tensorflow/tfjs.git" + }, + "scripts": { + "build": "tsc && npx mkdirp dist/proto && cp src/proto/api_pb.js dist/proto/api_pb.js", + "build-addon": "./scripts/build-and-upload-addon.sh", + "build-addon-from-source": "node-pre-gyp install --build-from-source", + "build-backend-cpu": "cd ../tfjs-backend-cpu && yarn && yarn build", + "build-backend-cpu-ci": "cd ../tfjs-backend-cpu && yarn && yarn build-ci", + "build-backend-webgl": "cd ../tfjs-backend-webgl && yarn && yarn build", + "build-backend-webgl-ci": "cd ../tfjs-backend-webgl && yarn && yarn build-ci", + "build-ci": "tsc && npx mkdirp dist/proto && cp src/proto/api_pb.js dist/proto/api_pb.js", + "build-converter": "cd ../tfjs-converter && yarn && yarn build", + "build-converter-ci": "cd ../tfjs-converter && yarn && yarn build-ci", + "build-core": "cd ../tfjs-core && yarn && yarn build", + "build-core-ci": "cd ../tfjs-core && yarn && yarn build-ci", + "build-data": "cd ../tfjs-data && yarn && yarn build", + "build-data-ci": "cd ../tfjs-data && yarn && yarn build-ci", + "build-deps": "yarn build-core && yarn build-backend-cpu && yarn build-backend-webgl && yarn build-layers && yarn build-converter && yarn build-data && yarn build-union", + "build-deps-ci": "yarn build-core-ci && yarn build-backend-cpu-ci && yarn build-backend-webgl-ci && yarn build-layers-ci && yarn build-converter-ci && yarn build-data-ci && yarn build-union-ci", + "build-layers": "cd ../tfjs-layers && yarn && yarn build", + "build-layers-ci": "cd ../tfjs-layers && yarn && yarn build-ci", + "build-npm": "./scripts/build-npm.sh", + "build-union": "cd ../tfjs && yarn && yarn build", + "build-union-ci": "cd ../tfjs && yarn && yarn build-ci", + "clean-deps": "rm -rf deps && rm -rf lib", + "coverage": "nyc yarn ts-node -P tsconfig.test.json src/run_tests.ts", + "enable-gpu": "node scripts/install.js gpu download && yarn && yarn build-addon-from-source", + "ensure-cpu-gpu-packages-align": "node scripts/ensure-cpu-gpu-packages-align.js", + "format": "clang-format -i -style=Google binding/*.cc binding/*.h", + "install": "node scripts/install.js", + "install-from-source": "yarn clean-deps && yarn && yarn build-addon-from-source", + "link-local": "yalc link", + "lint": "tslint -p . -t verbose", + "prep": "cd node_modules/@tensorflow/tfjs-core && yarn && yarn build", + "publish-local": "yarn prep && yalc push", + "publish-npm": "npm publish", + "test": "yarn && yarn build-deps && yarn build && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts", + "test-ci": "ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/run_tests.ts", + "test-dev": "tsc && ts-node --transpile-only -P tsconfig.test.json src/run_tests.ts", + "upload-windows-addon": "./scripts/build-and-upload-windows-addon.bat" + }, + "types": "dist/index.d.ts", + "version": "3.6.1" +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/int64_model.py b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/int64_model.py new file mode 100644 index 000000000..827f88a0a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/int64_model.py @@ -0,0 +1,36 @@ + # Copyright 2020 Google LLC +# +# 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. +# ============================================================================== +"""Python script for creating Tensorflow SavedModel with UINT64 input.""" + +import os + +import tensorflow as tf +from tensorflow.python.eager import def_function +from tensorflow.python.framework import constant_op +from tensorflow.python.framework import dtypes +from tensorflow.python.ops import variables +from tensorflow.python.training.tracking import tracking +from tensorflow.python.saved_model.save import save + +"""Test a basic model with functions to make sure functions are inlined.""" +input_data = constant_op.constant(1, shape=[2], dtype=tf.int64) +root = tracking.AutoTrackable() +root.v1 = variables.Variable(3, dtype=tf.int64) +root.v2 = variables.Variable(2, dtype=tf.int64) +root.f = def_function.function(lambda x: root.v1 * root.v2 * x) +to_save = root.f.get_concrete_function(input_data) + +save_dir = os.path.join('..', 'test_objects', 'saved_model', 'int64_multiply') +save(root, save_dir, to_save) diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/unint8_model.py b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/unint8_model.py new file mode 100644 index 000000000..733e68fc2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/python/unint8_model.py @@ -0,0 +1,35 @@ + # Copyright 2020 Google LLC +# +# 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. +# ============================================================================== +"""Python script for creating Tensorflow SavedModel with UINT8 input.""" + +import os + +import tensorflow as tf +from tensorflow.python.eager import def_function +from tensorflow.python.framework import constant_op +from tensorflow.python.ops import variables +from tensorflow.python.training.tracking import tracking +from tensorflow.python.saved_model.save import save + +"""Test a basic model with functions to make sure functions are inlined.""" +input_data = constant_op.constant(1, shape=[1], dtype=tf.uint8) +root = tracking.AutoTrackable() +root.v1 = variables.Variable(3) +root.v2 = variables.Variable(2) +root.f = def_function.function(lambda x: root.v1 * root.v2 * tf.cast(x, tf.int32)) +to_save = root.f.get_concrete_function(input_data) + +save_dir = os.path.join('..', 'test_objects', 'saved_model', 'uint8_multiply') +save(root, save_dir, to_save) diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/build-and-upload-addon.sh b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/build-and-upload-addon.sh new file mode 100755 index 000000000..a1ac2e4b3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/build-and-upload-addon.sh @@ -0,0 +1,37 @@ +# Copyright 2019 Google LLC. 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. +# ============================================================================= + +# The following commands do these steps: +# 1) Remove the existing pre-built addon tarball. +# 2) Run `yarn install-from-source` to build binding from source +# 3) Compress and upload the pre-built addon tarball. +# Please read DEVELOPMENT.md before developing and publishing. + +set -e + +# get package name based on os and processor +PACKAGE_NAME=$(node scripts/get-addon-name.js) +# get NAPI version +NAPI_VERSION=`node -p "process.versions.napi"` +# remove the pre-built addon tarball if it already exist +rm -f $PACKAGE_NAME +yarn install-from-source +if [ "$1" = "for-publish" ]; then + # build a new pre-built addon tarball + tar -czvf $PACKAGE_NAME -C lib napi-v$NAPI_VERSION/tfjs_binding.node + # upload pre-built addon tarball to gcloud + PACKAGE_HOST=`node -p "require('./package.json').binary.host.split('.com/')[1] + '/napi-v' + process.versions.napi + '/' + require('./package.json').version + '/'"` + gsutil cp $PACKAGE_NAME gs://$PACKAGE_HOST +fi diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/custom-binary.sample.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/custom-binary.sample.json new file mode 100644 index 000000000..1e1eee11d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/custom-binary.sample.json @@ -0,0 +1,8 @@ +{ + "tf-lib": "url-to-download-customized-binary", + "addon": { + "host": "host-of-pre-compiled-addon", + "remote_path": "remote-path-of-pre-compiled-addon", + "package_name": "file-name-of-pre-compile-addon" + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js new file mode 100644 index 000000000..f9d28d7eb --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-constants.js @@ -0,0 +1,121 @@ +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +const os = require('os'); +const fs = require('fs'); +const join = require('path').join; +const module_path_napi = require('../package.json').binary.module_path; +const modulePath = + module_path_napi.replace('{napi_build_version}', process.versions.napi); + +/** Version of the libtensorflow shared library to depend on. */ +const LIBTENSORFLOW_VERSION = '2.4.1'; + +/** Map the os.arch() to arch string in a file name */ +const ARCH_MAPPING = { + 'x64': 'x86_64' +}; +/** Map the os.platform() to the platform value in a file name */ +const PLATFORM_MAPPING = { + 'darwin': 'darwin', + 'linux': 'linux', + 'win32': 'windows' +}; +/** The extension of a compressed file */ +const PLATFORM_EXTENSION = os.platform() === 'win32' ? 'zip' : 'tar.gz'; +/** + * Current supported type, platform and architecture combinations + * `tf-lib` represents tensorflow shared libraries and `binding` represents + * node binding. + */ +const ALL_SUPPORTED_COMBINATION = [ + 'cpu-darwin-x86_64', 'gpu-linux-x86_64', 'cpu-linux-x86_64', + 'cpu-windows-x86_64', 'gpu-windows-x86_64' +]; + +/** Get the MAJOR.MINOR-only version of libtensorflow. */ +function getLibTensorFlowMajorDotMinorVersion() { + const items = LIBTENSORFLOW_VERSION.split('.'); + if (items.length < 3) { + throw new Error( + `Invalid version string for libtensorflow: ${LIBTENSORFLOW_VERSION}`); + } + return `${items[0]}.${items[1]}`; +} + +// Determine constants for deps folder names and destination (build) path names. +let depsLibTensorFlowName = 'libtensorflow'; +let depsLibTensorFlowFrameworkName = 'libtensorflow_framework'; + +let destLibTensorFlowName = depsLibTensorFlowName; +let destLibTensorFlowFrameworkName = depsLibTensorFlowFrameworkName; + +if (os.platform() === 'win32') { + depsLibTensorFlowName = 'tensorflow.dll'; + depsLibTensorFlowFrameworkName = ''; // Not supported on Windows + + destLibTensorFlowName = depsLibTensorFlowName; + destLibTensorFlowFrameworkName = ''; // Not supported on Windows +} else if (os.platform() === 'darwin') { + depsLibTensorFlowName += '.dylib'; + depsLibTensorFlowFrameworkName += '.dylib'; + + destLibTensorFlowName = depsLibTensorFlowName; + destLibTensorFlowFrameworkName = depsLibTensorFlowFrameworkName; +} else if (os.platform() === 'linux') { + // Linux has a hard-coded version number, make the destination name simpler: + depsLibTensorFlowName += `.so.${LIBTENSORFLOW_VERSION}`; + depsLibTensorFlowFrameworkName += `.so.${LIBTENSORFLOW_VERSION}`; + destLibTensorFlowName += '.so'; + destLibTensorFlowFrameworkName += '.so'; +} else { + throw Exception('Unsupported platform: ' + os.platform()); +} + +const depsPath = join(__dirname, '..', 'deps'); +const depsLibPath = join(depsPath, 'lib'); + +const depsLibTensorFlowPath = join(depsLibPath, depsLibTensorFlowName); +const depsLibTensorFlowFrameworkPath = + join(depsLibPath, depsLibTensorFlowFrameworkName); + +// Get information for custom binary +const CUSTOM_BINARY_FILENAME = 'custom-binary.json'; +function loadCustomBinary() { + const cfg = join(__dirname, CUSTOM_BINARY_FILENAME); + return fs.existsSync(cfg) ? require(cfg) : {}; +} +const customBinaries = loadCustomBinary(); + +module.exports = { + depsPath, + depsLibPath, + depsLibTensorFlowFrameworkName, + depsLibTensorFlowFrameworkPath, + depsLibTensorFlowName, + depsLibTensorFlowPath, + destLibTensorFlowFrameworkName, + destLibTensorFlowName, + getLibTensorFlowMajorDotMinorVersion, + modulePath, + LIBTENSORFLOW_VERSION, + ARCH_MAPPING, + PLATFORM_MAPPING, + PLATFORM_EXTENSION, + ALL_SUPPORTED_COMBINATION, + customTFLibUri: customBinaries['tf-lib'], + customAddon: customBinaries['addon'] +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-stage.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-stage.js new file mode 100644 index 000000000..a9e146b1f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/deps-stage.js @@ -0,0 +1,97 @@ +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ +const fs = require('fs'); +const path = require('path'); +const util = require('util'); + +const copy = util.promisify(fs.copyFile); +const os = require('os'); +const rename = util.promisify(fs.rename); +const symlink = util.promisify(fs.symlink); +const { + depsLibTensorFlowFrameworkPath, + depsLibTensorFlowPath, + destLibTensorFlowFrameworkName, + destLibTensorFlowName +} = require('./deps-constants.js'); + +const action = process.argv[2]; +let targetDir = process.argv[3]; + +// This file is Windows only - the libraries must be placed in the correct +// directory to work. +if (os.platform() !== 'win32') { + throw new Exception('Dep staging is only supported on Windows'); +} + +// Some windows machines contain a trailing " char: +if (targetDir != undefined && targetDir.endsWith('"')) { + targetDir = targetDir.substr(0, targetDir.length - 1); +} + +// Setup dest binary paths: +const destLibTensorFlowPath = path.join(targetDir, destLibTensorFlowName); +const destLibTensorFlowFrameworkPath = + path.join(targetDir, destLibTensorFlowFrameworkName); + +/** + * Symlinks the extracted libtensorflow library to the destination path. If the + * symlink fails, a copy is made. + */ +async function symlinkDepsLib() { + if (destLibTensorFlowPath === undefined) { + throw new Error('Destination path not supplied!'); + } + try { + await symlink( + path.relative( + path.dirname(destLibTensorFlowPath), depsLibTensorFlowPath), + destLibTensorFlowPath); + } catch (e) { + console.error(` * Symlink of ${ + destLibTensorFlowPath} failed, creating a copy on disk.`); + await copy(depsLibTensorFlowPath, destLibTensorFlowPath); + } +} + +/** + * Moves the deps library path to the destination path. + */ +async function moveDepsLib() { + await rename(depsLibTensorFlowPath, destLibTensorFlowPath); + if (os.platform() !== 'win32') { + await rename( + depsLibTensorFlowFrameworkPath, destLibTensorFlowFrameworkPath); + } +} + +/** + * Symlink or move libtensorflow for building the binding. + */ +async function run(action) { + if (action.endsWith('symlink')) { + // Symlink will happen during `node-gyp rebuild` + await symlinkDepsLib(); + } else if (action.endsWith('move')) { + // Move action is used when installing this module as a package. + await moveDepsLib(); + } else { + throw new Error('Invalid action: ' + action); + } +} + +run(action); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/ensure-cpu-gpu-packages-align.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/ensure-cpu-gpu-packages-align.js new file mode 100644 index 000000000..f28de82a3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/ensure-cpu-gpu-packages-align.js @@ -0,0 +1,79 @@ +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ + +/** + * Ensures that the GPU and CPU packages align. + */ +const fs = require('fs'); +const cpuPackage = require('../../tfjs-node/package.json'); +const gpuPackage = require('../../tfjs-node-gpu/package.json'); + +process.on('unhandledRejection', e => { + throw e; +}); + +/** + * Ensure package.json aligns. + */ +const FIELDS_TO_IGNORE = [ + 'name', 'scripts/install', 'scripts/test', 'scripts/prepare', 'scripts/prep', + 'scripts/upload-windows-addon', 'scripts/build-npm', + 'scripts/prep-gpu-windows' +]; + +const cpuPackageKeys = Object.keys(cpuPackage); +const gpuPackageKeys = Object.keys(gpuPackage); +cpuPackageKeys.forEach((key, i) => { + if (gpuPackageKeys[i] != cpuPackageKeys[i]) { + throw new Error( + `CPU and GPU package have different keys: ` + + `${gpuPackageKeys[i]} and ${cpuPackageKeys[i]}.`); + } +}); +if (cpuPackageKeys.length != gpuPackageKeys.length) { + throw new Error(`CPU and GPU package.jsons have different top-level fields.`); +} + +// Ensure the cpu and gpu packages have the same keys. +cpuPackageKeys.forEach(key => { + const cpuPackageValue = cpuPackage[key]; + const gpuPackageValue = gpuPackage[key]; + + if (typeof cpuPackageValue !== 'object') { + if (cpuPackageValue != gpuPackageValue && + FIELDS_TO_IGNORE.indexOf(key) === -1) { + throw new Error( + `CPU package key '${key}' with value ` + + `${JSON.stringify(cpuPackageValue)} does not match GPU value ` + + `${JSON.stringify(gpuPackageValue)}.`); + } + } else { + const cpuFieldKeys = Object.keys(cpuPackageValue); + cpuFieldKeys.forEach(fieldKey => { + const cpuFieldValue = '' + cpuPackageValue[fieldKey]; + const gpuFieldValue = '' + gpuPackageValue[fieldKey]; + const deepKey = `${key}/${fieldKey}`; + if (cpuFieldValue !== gpuFieldValue && + FIELDS_TO_IGNORE.indexOf(deepKey) === -1) { + throw new Error( + `CPU package key '${deepKey}' with value ` + + `${JSON.stringify(cpuFieldValue)} does not match GPU value ` + + `${JSON.stringify(gpuFieldValue)}.`); + } + }); + } +}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/get-addon-name.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/get-addon-name.js new file mode 100644 index 000000000..65066599f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/get-addon-name.js @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ +const os = require('os'); +const name = require('../package.json').name; +const version = require('../package.json').version; + +const platform = os.platform(); + +const {PLATFORM_MAPPING, PLATFORM_EXTENSION} = require('./deps-constants.js'); + +const type = name.includes('gpu') ? 'GPU' : 'CPU'; +const addonName = `${type}-${PLATFORM_MAPPING[platform]}-` + + `${version}.${PLATFORM_EXTENSION}`; + +// Print out the addon tarball name so that it can be used in bash script when +// uploading the tarball to GCP bucket. +console.log(addonName); + +module.exports = { + addonName: addonName +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/install.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/install.js new file mode 100644 index 000000000..17352d547 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/install.js @@ -0,0 +1,207 @@ +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ + +const fs = require('fs'); +let path = require('path'); +const rimraf = require('rimraf'); +const util = require('util'); +const cp = require('child_process'); +const os = require('os'); +const { + depsPath, + depsLibPath, + depsLibTensorFlowPath, + LIBTENSORFLOW_VERSION, + PLATFORM_MAPPING, + ARCH_MAPPING, + PLATFORM_EXTENSION, + ALL_SUPPORTED_COMBINATION, + modulePath, + customTFLibUri, + customAddon +} = require('./deps-constants.js'); +const resources = require('./resources'); +const {addonName} = require('./get-addon-name.js'); + +const exists = util.promisify(fs.exists); +const mkdir = util.promisify(fs.mkdir); +const rename = util.promisify(fs.rename); +const rimrafPromise = util.promisify(rimraf); + +const CDN_STORAGE = process.env.TFJS_NODE_CDN_STORAGE || process.env.npm_config_TFJS_NODE_CDN_STORAGE + || process.env.CDN_STORAGE; +const BASE_HOST = CDN_STORAGE || 'https://storage.googleapis.com/'; +const BASE_URI = process.env.TFJS_NODE_BASE_URI || process.env.npm_config_TFJS_NODE_BASE_URI + || `${BASE_HOST}tensorflow/libtensorflow/libtensorflow-`; + +const platform = os.platform(); +// Use windows path +if (platform === 'win32') { + path = path.win32; +} +let libType = process.argv[2] === undefined ? 'cpu' : process.argv[2]; +let system = `${libType}-${PLATFORM_MAPPING[platform]}-` + + `${ARCH_MAPPING[os.arch()]}`; +let forceDownload = process.argv[3] === undefined ? undefined : process.argv[3]; + +let packageJsonFile; + +function setPackageJsonFile() { + packageJsonFile = + JSON.parse(fs.readFileSync(`${__dirname}/../package.json`).toString()); +} + +function updateAddonName() { + if (customAddon !== undefined) { + Object.assign(packageJsonFile['binary'], customAddon); + } else { + packageJsonFile['binary']['package_name'] = addonName; + } + const stringFile = JSON.stringify(packageJsonFile, null, 2); + fs.writeFileSync((`${__dirname}/../package.json`), stringFile); +} + +function revertAddonName(orig) { + packageJsonFile['binary'] = orig; + const stringFile = JSON.stringify(packageJsonFile, null, 2).concat('\n'); + fs.writeFileSync((`${__dirname}/../package.json`), stringFile); +} + +/** + * Returns the libtensorflow hosted path of the current platform. + */ +function getPlatformLibtensorflowUri() { + // Exception for mac+gpu user + if (platform === 'darwin') { + system = `cpu-${PLATFORM_MAPPING[platform]}-${ARCH_MAPPING[os.arch()]}`; + } + + if (customTFLibUri !== undefined) { + return customTFLibUri; + } + + if (platform === 'linux' && os.arch() === 'arm') { + return `${BASE_HOST}tf-builds/libtensorflow_r1_14_linux_arm.tar.gz`; + } + + if (ALL_SUPPORTED_COMBINATION.indexOf(system) === -1) { + throw new Error(`Unsupported system: ${libType}-${platform}-${os.arch()}`); + } + + return `${BASE_URI}${system}-${LIBTENSORFLOW_VERSION}.${PLATFORM_EXTENSION}`; +} + +/** + * Ensures a directory exists, creates as needed. + */ +async function ensureDir(dirPath) { + if (!await exists(dirPath)) { + await mkdir(dirPath); + } +} + +/** + * Deletes the deps directory if it exists, and creates a fresh deps folder. + */ +async function cleanDeps() { + if (await exists(depsPath)) { + await rimrafPromise(depsPath); + } + await mkdir(depsPath); +} + +/** + * Downloads libtensorflow and notifies via a callback when unpacked. + */ +async function downloadLibtensorflow(callback) { + // Ensure dependencies staged directory is available: + await ensureDir(depsPath); + + console.warn('* Downloading libtensorflow'); + resources.downloadAndUnpackResource( + getPlatformLibtensorflowUri(), depsPath, async () => { + if (platform === 'win32') { + // Some windows libtensorflow zip files are missing structure and the + // eager headers. Check, restructure, and download resources as + // needed. + if (!await exists(depsLibTensorFlowPath)) { + // Verify that tensorflow.dll exists + const libtensorflowDll = path.join(depsPath, 'tensorflow.dll'); + if (!await exists(libtensorflowDll)) { + throw new Error('Could not find libtensorflow.dll'); + } + + await ensureDir(depsLibPath); + await rename(libtensorflowDll, depsLibTensorFlowPath); + } + } + // No other work is required on other platforms. + if (callback !== undefined) { + callback(); + } + }); +} + +/** + * Calls node-gyp for Node.js Tensorflow binding after lib is downloaded. + */ +async function build() { + // Load package.json file + setPackageJsonFile(); + // Update addon name in package.json file + const origBinary = JSON.parse(JSON.stringify(packageJsonFile['binary'])); + updateAddonName(); + console.error('* Building TensorFlow Node.js bindings'); + let buildOption = '--fallback-to-build'; + if (customTFLibUri !== undefined && customAddon === undefined) { + // Has custom tensorflow shared libs but no addon. Then build it from source + buildOption = '--build-from-source'; + } + cp.exec(`node-pre-gyp install ${buildOption}`, (err) => { + if (err) { + console.log('node-pre-gyp install failed with error: ' + err); + process.exit(1); + } + if (platform === 'win32') { + // Move libtensorflow to module path, where tfjs_binding.node locates. + cp.exec('node scripts/deps-stage.js symlink ' + modulePath, (error) => { + if (error) { + console.error('symlink ' + modulePath + ' failed: ', error); + process.exit(1); + } + }); + } + revertAddonName(origBinary); + }); +} + +/** + * Ensures libtensorflow requirements are met for building the binding. + */ +async function run() { + // First check if deps library exists: + if (forceDownload !== 'download' && await exists(depsLibTensorFlowPath)) { + // Library has already been downloaded, then compile and simlink: + await build(); + } else { + // Library has not been downloaded, download, then compile and symlink: + await cleanDeps(); + await downloadLibtensorflow(build); + } +} + +run(); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/print-full-package-host.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/print-full-package-host.js new file mode 100644 index 000000000..0447d63cd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/print-full-package-host.js @@ -0,0 +1,9 @@ +// This file generate and print out the full path of the pre-compiled addon in +// GCP bucket. It is used by bash script when uploading pre-compiled addon to +// GCP bucket. +console.log( + require('../package.json').binary.host.split('.com/')[1] + + '/napi-v' + + process.versions.napi + + '/' + + require('../package.json').version + '/'); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/publish-npm-gpu.sh b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/publish-npm-gpu.sh new file mode 100755 index 000000000..b621ab347 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/publish-npm-gpu.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash +# Copyright 2017 Google LLC. 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. +# ============================================================================= + +# Before you run this script, do this: +# 1) Update the version in package.json +# 2) Run ./scripts/make-version from the base dir of the project. +# 3) Run `yarn` to update `yarn.lock`, in case you updated dependencies +# 4) Commit to the master branch. + +# Then: +# 5) Checkout the master branch of this repo. +# 6) Run this script as `./scripts/publish-npm-gpu.sh` from the project base dir. + +set -e + +BRANCH=`git rev-parse --abbrev-ref HEAD` +ORIGIN=`git config --get remote.origin.url` + +if [ "$BRANCH" != "master" ] && [ "$BRANCH" != "0.3.x" ]; then + echo "Error: Switch to the master or a release branch before publishing." + exit +fi + +if ! [[ "$ORIGIN" =~ tensorflow/tfjs-node ]]; then + echo "Error: Switch to the main repo (tensorflow/tfjs-node) before publishing." + exit +fi + +./scripts/make-version # This is for safety in case you forgot to do 2). +yarn build-npm-gpu upload + +GPU_TARBALLS=$(ls tensorflow-tfjs-node-gpu*.tgz) +GPU_TARBALL_COUNT=$(echo $GPU_TARBALLS | wc -w | xargs) +if [ "$GPU_TARBALL_COUNT" != "1" ]; then + echo "Error: Please make sure there is exactly one GPU tarball, found:" + echo $GPU_TARBALLS + exit +fi + +# Publish the GPU package +npm publish $GPU_TARBALLS + +# Cleanup +git checkout . + +echo 'Yay! Published the tfjs-node-gpu package to npm.' diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/resources.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/resources.js new file mode 100644 index 000000000..817486335 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/resources.js @@ -0,0 +1,93 @@ +/** + * @license + * Copyright 2019 Google LLC. 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. + * ============================================================================= + */ + +const fs = require('fs'); +const https = require('https'); +const HttpsProxyAgent = require('https-proxy-agent'); +const path = require('os').platform() === 'win32' ? require('path') : + require('path').win32; +const ProgressBar = require('progress'); +const tar = require('tar'); +const url = require('url'); +const util = require('util'); +const zip = require('adm-zip'); + +const unlink = util.promisify(fs.unlink); + +/** + * Downloads and unpacks a given tarball or zip file at a given path. + * @param {string} uri The path of the compressed file to download and extract. + * @param {string} destPath The destination path for the compressed content. + * @param {Function} callback Handler for when downloading and extraction is + * complete. + */ +async function downloadAndUnpackResource(uri, destPath, callback) { + // If HTTPS_PROXY, https_proxy, HTTP_PROXY, or http_proxy is set + const proxy = process.env['HTTPS_PROXY'] || process.env['https_proxy'] || + process.env['HTTP_PROXY'] || process.env['http_proxy'] || ''; + + // Using object destructuring to construct the options object for the + // http request. the '...url.parse(targetUri)' part fills in the host, + // path, protocol, etc from the targetUri and then we set the agent to the + // default agent which is overridden a few lines down if there is a proxy + const options = {...url.parse(uri), agent: https.globalAgent}; + + if (proxy !== '') { + options.agent = new HttpsProxyAgent(proxy); + } + + const request = https.get(options, response => { + const bar = new ProgressBar('[:bar] :rate/bps :percent :etas', { + complete: '=', + incomplete: ' ', + width: 30, + total: parseInt(response.headers['content-length'], 10) + }); + + if (uri.endsWith('.zip')) { + // Save zip file to disk, extract, and delete the downloaded zip file. + const tempFileName = path.join(__dirname, '_tmp.zip'); + const outputFile = fs.createWriteStream(tempFileName); + + response.on('data', chunk => bar.tick(chunk.length)) + .pipe(outputFile) + .on('close', async () => { + const zipFile = new zip(tempFileName); + zipFile.extractAllTo(destPath, true /* overwrite */); + + await unlink(tempFileName); + + if (callback !== undefined) { + callback(); + } + }); + } else if (uri.endsWith('.tar.gz')) { + response.on('data', chunk => bar.tick(chunk.length)) + .pipe(tar.x({C: destPath, strict: true})) + .on('close', () => { + if (callback !== undefined) { + callback(); + } + }); + } else { + throw new Error(`Unsupported packed resource: ${uri}`); + } + }); + request.end(); +} + +module.exports = {downloadAndUnpackResource}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/tsconfig.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/tsconfig.json new file mode 100644 index 000000000..c5e8c9340 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/scripts/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../tsconfig.test", + "compilerOptions": { + "module": "commonjs" + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/callbacks.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/callbacks.ts new file mode 100644 index 000000000..532681568 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/callbacks.ts @@ -0,0 +1,325 @@ +/** + * @license + * Copyright 2018 Google LLC. 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 {CustomCallback, Logs, nextFrame, util} from '@tensorflow/tfjs'; +import * as path from 'path'; +import * as ProgressBar from 'progress'; + +import {summaryFileWriter, SummaryFileWriter} from './tensorboard'; + +// A helper class created for testing with the jasmine `spyOn` method, which +// operates only on member methods of objects. +// tslint:disable-next-line:no-any +export const progressBarHelper: {ProgressBar: any, log: Function} = { + ProgressBar, + log: console.log +}; + +/** + * Terminal-based progress bar callback for tf.Model.fit(). + */ +export class ProgbarLogger extends CustomCallback { + private numTrainBatchesPerEpoch: number; + private progressBar: ProgressBar; + private currentEpochBegin: number; + private epochDurationMillis: number; + private usPerStep: number; + private batchesInLatestEpoch: number; + + private terminalWidth: number; + + private readonly RENDER_THROTTLE_MS = 50; + + /** + * Construtor of LoggingCallback. + */ + constructor() { + super({ + onTrainBegin: async (logs?: Logs) => { + const samples = this.params.samples as number; + const batchSize = this.params.batchSize as number; + const steps = this.params.steps as number; + if (samples != null || steps != null) { + this.numTrainBatchesPerEpoch = + samples != null ? Math.ceil(samples / batchSize) : steps; + } else { + // Undetermined number of batches per epoch, e.g., due to + // `fitDataset()` without `batchesPerEpoch`. + this.numTrainBatchesPerEpoch = 0; + } + }, + onEpochBegin: async (epoch: number, logs?: Logs) => { + progressBarHelper.log(`Epoch ${epoch + 1} / ${this.params.epochs}`); + this.currentEpochBegin = util.now(); + this.epochDurationMillis = null; + this.usPerStep = null; + this.batchesInLatestEpoch = 0; + this.terminalWidth = process.stderr.columns; + }, + onBatchEnd: async (batch: number, logs?: Logs) => { + this.batchesInLatestEpoch++; + if (batch === 0) { + this.progressBar = new progressBarHelper.ProgressBar( + 'eta=:eta :bar :placeholderForLossesAndMetrics', { + width: Math.floor(0.5 * this.terminalWidth), + total: this.numTrainBatchesPerEpoch + 1, + head: `>`, + renderThrottle: this.RENDER_THROTTLE_MS + }); + } + const maxMetricsStringLength = + Math.floor(this.terminalWidth * 0.5 - 12); + const tickTokens = { + placeholderForLossesAndMetrics: + this.formatLogsAsMetricsContent(logs, maxMetricsStringLength) + }; + if (this.numTrainBatchesPerEpoch === 0) { + // Undetermined number of batches per epoch. + this.progressBar.tick(0, tickTokens); + } else { + this.progressBar.tick(tickTokens); + } + await nextFrame(); + if (batch === this.numTrainBatchesPerEpoch - 1) { + this.epochDurationMillis = util.now() - this.currentEpochBegin; + this.usPerStep = this.params.samples != null ? + this.epochDurationMillis / (this.params.samples as number) * 1e3 : + this.epochDurationMillis / this.batchesInLatestEpoch * 1e3; + } + }, + onEpochEnd: async (epoch: number, logs?: Logs) => { + if (this.epochDurationMillis == null) { + // In cases where the number of batches per epoch is not determined, + // the calculation of the per-step duration is done at the end of the + // epoch. N.B., this includes the time spent on validation. + this.epochDurationMillis = util.now() - this.currentEpochBegin; + this.usPerStep = + this.epochDurationMillis / this.batchesInLatestEpoch * 1e3; + } + this.progressBar.tick({placeholderForLossesAndMetrics: ''}); + const lossesAndMetricsString = this.formatLogsAsMetricsContent(logs); + progressBarHelper.log( + `${this.epochDurationMillis.toFixed(0)}ms ` + + `${this.usPerStep.toFixed(0)}us/step - ` + + `${lossesAndMetricsString}`); + await nextFrame(); + }, + }); + } + + private formatLogsAsMetricsContent(logs: Logs, maxMetricsLength?: number): + string { + let metricsContent = ''; + const keys = Object.keys(logs).sort(); + for (const key of keys) { + if (this.isFieldRelevant(key)) { + const value = logs[key]; + metricsContent += `${key}=${getSuccinctNumberDisplay(value)} `; + } + } + + if (maxMetricsLength != null && metricsContent.length > maxMetricsLength) { + // Cut off metrics strings that are too long to avoid new lines being + // constantly created. + metricsContent = metricsContent.slice(0, maxMetricsLength - 3) + '...'; + } + return metricsContent; + } + + private isFieldRelevant(key: string) { + return key !== 'batch' && key !== 'size'; + } +} + +const BASE_NUM_DIGITS = 2; +const MAX_NUM_DECIMAL_PLACES = 4; + +/** + * Get a succint string representation of a number. + * + * Uses decimal notation if the number isn't too small. + * Otherwise, use engineering notation. + * + * @param x Input number. + * @return Succinct string representing `x`. + */ +export function getSuccinctNumberDisplay(x: number): string { + const decimalPlaces = getDisplayDecimalPlaces(x); + return decimalPlaces > MAX_NUM_DECIMAL_PLACES ? + x.toExponential(BASE_NUM_DIGITS) : + x.toFixed(decimalPlaces); +} + +/** + * Determine the number of decimal places to display. + * + * @param x Number to display. + * @return Number of decimal places to display for `x`. + */ +export function getDisplayDecimalPlaces(x: number): number { + if (!Number.isFinite(x) || x === 0 || x > 1 || x < -1) { + return BASE_NUM_DIGITS; + } else { + return BASE_NUM_DIGITS - Math.floor(Math.log10(Math.abs(x))); + } +} + +export interface TensorBoardCallbackArgs { + /** + * The frequency at which loss and metric values are written to logs. + * + * Currently supported options are: + * + * - 'batch': Write logs at the end of every batch of training, in addition + * to the end of every epoch of training. + * - 'epoch': Write logs at the end of every epoch of training. + * + * Note that writing logs too often slows down the training. + * + * Default: 'epoch'. + */ + updateFreq?: 'batch'|'epoch'; +} + +/** + * Callback for logging to TensorBoard during training. + * + * Users are expected to access this class through the `tensorBoardCallback()` + * factory method instead. + */ +export class TensorBoardCallback extends CustomCallback { + private trainWriter: SummaryFileWriter; + private valWriter: SummaryFileWriter; + private batchesSeen: number; + private readonly args: TensorBoardCallbackArgs; + + constructor(readonly logdir = './logs', args?: TensorBoardCallbackArgs) { + super({ + onBatchEnd: async (batch: number, logs?: Logs) => { + this.batchesSeen++; + if (this.args.updateFreq !== 'epoch') { + this.logMetrics(logs, 'batch_', this.batchesSeen); + } + }, + onEpochEnd: async (epoch: number, logs?: Logs) => { + this.logMetrics(logs, 'epoch_', epoch + 1); + }, + onTrainEnd: async (logs?: Logs) => { + if (this.trainWriter != null) { + this.trainWriter.flush(); + } + if (this.valWriter != null) { + this.valWriter.flush(); + } + } + }); + + this.args = args == null ? {} : args; + if (this.args.updateFreq == null) { + this.args.updateFreq = 'epoch'; + } + util.assert( + ['batch', 'epoch'].indexOf(this.args.updateFreq) !== -1, + () => `Expected updateFreq to be 'batch' or 'epoch', but got ` + + `${this.args.updateFreq}`); + this.batchesSeen = 0; + } + + private logMetrics(logs: Logs, prefix: string, step: number) { + for (const key in logs) { + if (key === 'batch' || key === 'size' || key === 'num_steps') { + continue; + } + + const VAL_PREFIX = 'val_'; + if (key.startsWith(VAL_PREFIX)) { + this.ensureValWriterCreated(); + const scalarName = prefix + key.slice(VAL_PREFIX.length); + this.valWriter.scalar(scalarName, logs[key], step); + } else { + this.ensureTrainWriterCreated(); + this.trainWriter.scalar(`${prefix}${key}`, logs[key], step); + } + } + } + + private ensureTrainWriterCreated() { + this.trainWriter = summaryFileWriter(path.join(this.logdir, 'train')); + } + + private ensureValWriterCreated() { + this.valWriter = summaryFileWriter(path.join(this.logdir, 'val')); + } +} + +/** + * Callback for logging to TensorBoard during training. + * + * Writes the loss and metric values (if any) to the specified log directory + * (`logdir`) which can be ingested and visualized by TensorBoard. + * This callback is usually passed as a callback to `tf.Model.fit()` or + * `tf.Model.fitDataset()` calls during model training. The frequency at which + * the values are logged can be controlled with the `updateFreq` field of the + * configuration object (2nd argument). + * + * Usage example: + * ```js + * // Constructor a toy multilayer-perceptron regressor for demo purpose. + * const model = tf.sequential(); + * model.add( + * tf.layers.dense({units: 100, activation: 'relu', inputShape: [200]})); + * model.add(tf.layers.dense({units: 1})); + * model.compile({ + * loss: 'meanSquaredError', + * optimizer: 'sgd', + * metrics: ['MAE'] + * }); + * + * // Generate some random fake data for demo purpose. + * const xs = tf.randomUniform([10000, 200]); + * const ys = tf.randomUniform([10000, 1]); + * const valXs = tf.randomUniform([1000, 200]); + * const valYs = tf.randomUniform([1000, 1]); + * + * // Start model training process. + * await model.fit(xs, ys, { + * epochs: 100, + * validationData: [valXs, valYs], + * // Add the tensorBoard callback here. + * callbacks: tf.node.tensorBoard('/tmp/fit_logs_1') + * }); + * ``` + * + * Then you can use the following commands to point tensorboard + * to the logdir: + * + * ```sh + * pip install tensorboard # Unless you've already installed it. + * tensorboard --logdir /tmp/fit_logs_1 + * ``` + * + * @param logdir Directory to which the logs will be written. + * @param args Optional configuration arguments. + * @returns An instance of `TensorBoardCallback`, which is a subclass of + * `tf.CustomCallback`. + * + * @doc {heading: 'TensorBoard', namespace: 'node'} + */ +export function tensorBoard( + logdir = './logs', args?: TensorBoardCallbackArgs): TensorBoardCallback { + return new TensorBoardCallback(logdir, args); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/image.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/image.ts new file mode 100644 index 000000000..2d40ece62 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/image.ts @@ -0,0 +1,299 @@ +/** + * @license + * Copyright 2019 Google LLC. 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 {Tensor, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs'; +import {ensureTensorflowBackend, nodeBackend} from './nodejs_kernel_backend'; + +export enum ImageType { + JPEG = 'jpeg', + PNG = 'png', + GIF = 'gif', + BMP = 'BMP' +} + +/** + * Decode a JPEG-encoded image to a 3D Tensor of dtype `int32`. + * + * @param contents The JPEG-encoded image in an Uint8Array. + * @param channels An optional int. Defaults to 0. Accepted values are + * 0: use the number of channels in the JPEG-encoded image. + * 1: output a grayscale image. + * 3: output an RGB image. + * @param ratio An optional int. Defaults to 1. Downscaling ratio. It is used + * when image is type Jpeg. + * @param fancyUpscaling An optional bool. Defaults to True. If true use a + * slower but nicer upscaling of the chroma planes. It is used when image is + * type Jpeg. + * @param tryRecoverTruncated An optional bool. Defaults to False. If true try + * to recover an image from truncated input. It is used when image is type + * Jpeg. + * @param acceptableFraction An optional float. Defaults to 1. The minimum + * required fraction of lines before a truncated input is accepted. It is + * used when image is type Jpeg. + * @param dctMethod An optional string. Defaults to "". string specifying a hint + * about the algorithm used for decompression. Defaults to "" which maps to + * a system-specific default. Currently valid values are ["INTEGER_FAST", + * "INTEGER_ACCURATE"]. The hint may be ignored (e.g., the internal jpeg + * library changes to a version that does not have that specific option.) It + * is used when image is type Jpeg. + * @returns A 3D Tensor of dtype `int32` with shape [height, width, 1/3]. + * + * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} + */ +export function decodeJpeg( + contents: Uint8Array, channels = 0, ratio = 1, fancyUpscaling = true, + tryRecoverTruncated = false, acceptableFraction = 1, + dctMethod = ''): Tensor3D { + ensureTensorflowBackend(); + return tidy(() => { + return nodeBackend() + .decodeJpeg( + contents, channels, ratio, fancyUpscaling, tryRecoverTruncated, + acceptableFraction, dctMethod) + .toInt(); + }); +} + +/** + * Decode a PNG-encoded image to a 3D Tensor of dtype `int32`. + * + * @param contents The PNG-encoded image in an Uint8Array. + * @param channels An optional int. Defaults to 0. Accepted values are + * 0: use the number of channels in the PNG-encoded image. + * 1: output a grayscale image. + * 3: output an RGB image. + * 4: output an RGBA image. + * @param dtype The data type of the result. Only `int32` is supported at this + * time. + * @returns A 3D Tensor of dtype `int32` with shape [height, width, 1/3/4]. + * + * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} + */ +export function decodePng( + contents: Uint8Array, channels = 0, dtype = 'int32'): Tensor3D { + util.assert( + dtype === 'int32', + () => 'decodeImage could only return Tensor of type `int32` for now.'); + ensureTensorflowBackend(); + return tidy(() => { + return nodeBackend().decodePng(contents, channels).toInt(); + }); +} + +/** + * Decode the first frame of a BMP-encoded image to a 3D Tensor of dtype + * `int32`. + * + * @param contents The BMP-encoded image in an Uint8Array. + * @param channels An optional int. Defaults to 0. Accepted values are + * 0: use the number of channels in the BMP-encoded image. + * 3: output an RGB image. + * 4: output an RGBA image. + * @returns A 3D Tensor of dtype `int32` with shape [height, width, 3/4]. + * + * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} + */ +export function decodeBmp(contents: Uint8Array, channels = 0): Tensor3D { + ensureTensorflowBackend(); + return tidy(() => { + return nodeBackend().decodeBmp(contents, channels).toInt(); + }); +} + +/** + * Decode the frame(s) of a GIF-encoded image to a 4D Tensor of dtype `int32`. + * + * @param contents The GIF-encoded image in an Uint8Array. + * @returns A 4D Tensor of dtype `int32` with shape [num_frames, height, width, + * 3]. RGB channel order. + * + * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} + */ +export function decodeGif(contents: Uint8Array): Tensor4D { + ensureTensorflowBackend(); + return tidy(() => { + return nodeBackend().decodeGif(contents).toInt(); + }); +} + +/** + * Given the encoded bytes of an image, it returns a 3D or 4D tensor of the + * decoded image. Supports BMP, GIF, JPEG and PNG formats. + * + * @param content The encoded image in an Uint8Array. + * @param channels An optional int. Defaults to 0, use the number of channels in + * the image. Number of color channels for the decoded image. It is used + * when image is type Png, Bmp, or Jpeg. + * @param dtype The data type of the result. Only `int32` is supported at this + * time. + * @param expandAnimations A boolean which controls the shape of the returned + * op's output. If True, the returned op will produce a 3-D tensor for PNG, + * JPEG, and BMP files; and a 4-D tensor for all GIFs, whether animated or + * not. If, False, the returned op will produce a 3-D tensor for all file + * types and will truncate animated GIFs to the first frame. + * @returns A Tensor with dtype `int32` and a 3- or 4-dimensional shape, + * depending on the file type. For gif file the returned Tensor shape is + * [num_frames, height, width, 3], and for jpeg/png/bmp the returned Tensor + * shape is [height, width, channels] + * + * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} + */ +export function decodeImage( + content: Uint8Array, channels = 0, dtype = 'int32', + expandAnimations = true): Tensor3D|Tensor4D { + util.assert( + dtype === 'int32', + () => 'decodeImage could only return Tensor of type `int32` for now.'); + + const imageType = getImageType(content); + + // The return tensor has dtype uint8, which is not supported in + // TensorFlow.js, casting it to int32 which is the default dtype for image + // tensor. If the image is BMP, JPEG or PNG type, expanding the tensors + // shape so it becomes Tensor4D, which is the default tensor shape for image + // ([batch,imageHeight,imageWidth, depth]). + switch (imageType) { + case ImageType.JPEG: + return decodeJpeg(content, channels); + case ImageType.PNG: + return decodePng(content, channels); + case ImageType.GIF: + // If not to expand animations, take first frame of the gif and return + // as a 3D tensor. + return tidy(() => { + const img = decodeGif(content); + return expandAnimations ? img : img.slice(0, 1).squeeze([0]); + }); + case ImageType.BMP: + return decodeBmp(content, channels); + default: + return null; + } +} + +/** + * Encodes an image tensor to JPEG. + * + * @param image A 3-D uint8 Tensor of shape [height, width, channels]. + * @param format An optional string from: "", "grayscale", "rgb". + * Defaults to "". Per pixel image format. + * - '': Use a default format based on the number of channels in the image. + * - grayscale: Output a grayscale JPEG image. The channels dimension of + * image must be 1. + * - rgb: Output an RGB JPEG image. The channels dimension of image must + * be 3. + * @param quality An optional int. Defaults to 95. Quality of the compression + * from 0 to 100 (higher is better and slower). + * @param progressive An optional bool. Defaults to False. If True, create a + * JPEG that loads progressively (coarse to fine). + * @param optimizeSize An optional bool. Defaults to False. If True, spend + * CPU/RAM to reduce size with no quality change. + * @param chromaDownsampling An optional bool. Defaults to True. + * See http://en.wikipedia.org/wiki/Chroma_subsampling. + * @param densityUnit An optional string from: "in", "cm". Defaults to "in". + * Unit used to specify x_density and y_density: pixels per inch ('in') or + * centimeter ('cm'). + * @param xDensity An optional int. Defaults to 300. Horizontal pixels per + * density unit. + * @param yDensity An optional int. Defaults to 300. Vertical pixels per + * density unit. + * @param xmpMetadata An optional string. Defaults to "". If not empty, embed + * this XMP metadata in the image header. + * @returns The JPEG encoded data as an Uint8Array. + * + * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} + */ +export async function encodeJpeg( + image: Tensor3D, format: ''|'grayscale'|'rgb' = '', quality = 95, + progressive = false, optimizeSize = false, chromaDownsampling = true, + densityUnit: 'in'|'cm' = 'in', xDensity = 300, yDensity = 300, + xmpMetadata = ''): Promise { + ensureTensorflowBackend(); + + const backendEncodeImage = (imageData: Uint8Array) => + nodeBackend().encodeJpeg( + imageData, image.shape, format, quality, progressive, optimizeSize, + chromaDownsampling, densityUnit, xDensity, yDensity, xmpMetadata); + + return encodeImage(image, backendEncodeImage); +} + +/** + * Encodes an image tensor to PNG. + * + * @param image A 3-D uint8 Tensor of shape [height, width, channels]. + * @param compression An optional int. Defaults to 1. Compression level. + * @returns The PNG encoded data as an Uint8Array. + * + * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} + */ +export async function encodePng( + image: Tensor3D, compression = 1): Promise { + ensureTensorflowBackend(); + + const backendEncodeImage = (imageData: Uint8Array) => + nodeBackend().encodePng(imageData, image.shape, compression); + return encodeImage(image, backendEncodeImage); +} + +async function encodeImage( + image: Tensor3D, backendEncodeImage: (imageData: Uint8Array) => Tensor): + Promise { + const encodedDataTensor = + backendEncodeImage(new Uint8Array(await image.data())); + + const encodedPngData = + ( + // tslint:disable-next-line:no-any + await encodedDataTensor.data())[0] as any as Uint8Array; + encodedDataTensor.dispose(); + return encodedPngData; +} + +/** + * Helper function to get image type based on starting bytes of the image file. + */ +export function getImageType(content: Uint8Array): string { + // Classify the contents of a file based on starting bytes (aka magic number: + // https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) + // This aligns with TensorFlow Core code: + // https://github.com/tensorflow/tensorflow/blob/4213d5c1bd921f8d5b7b2dc4bbf1eea78d0b5258/tensorflow/core/kernels/decode_image_op.cc#L44 + if (content.length > 3 && content[0] === 255 && content[1] === 216 && + content[2] === 255) { + // JPEG byte chunk starts with `ff d8 ff` + return ImageType.JPEG; + } else if ( + content.length > 4 && content[0] === 71 && content[1] === 73 && + content[2] === 70 && content[3] === 56) { + // GIF byte chunk starts with `47 49 46 38` + return ImageType.GIF; + } else if ( + content.length > 8 && content[0] === 137 && content[1] === 80 && + content[2] === 78 && content[3] === 71 && content[4] === 13 && + content[5] === 10 && content[6] === 26 && content[7] === 10) { + // PNG byte chunk starts with `\211 P N G \r \n \032 \n (89 50 4E 47 0D 0A + // 1A 0A)` + return ImageType.PNG; + } else if (content.length > 3 && content[0] === 66 && content[1] === 77) { + // BMP byte chunk starts with `42 4d` + return ImageType.BMP; + } else { + throw new Error( + 'Expected image (BMP, JPEG, PNG, or GIF), but got unsupported ' + + 'image type'); + } +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/index.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/index.ts new file mode 100644 index 000000000..9756a5a7b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/index.ts @@ -0,0 +1,86 @@ +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ + +// Register all kernels. +import './register_all_kernels'; + +import * as tf from '@tensorflow/tfjs'; +import * as path from 'path'; + +import {ProgbarLogger} from './callbacks'; +import {nodeFileSystemRouter} from './io/file_system'; +import * as nodeIo from './io/index'; +import {NodeJSKernelBackend} from './nodejs_kernel_backend'; +import {TFJSBinding} from './tfjs_binding'; +import * as nodeVersion from './version'; + +// tslint:disable-next-line:no-require-imports +const binary = require('node-pre-gyp'); +const bindingPath = + binary.find(path.resolve(path.join(__dirname, '/../package.json'))); + +// Check if the node native addon module exists. +// tslint:disable-next-line:no-require-imports +const fs = require('fs'); +if (!fs.existsSync(bindingPath)) { + throw new Error( + `The Node.js native addon module (tfjs_binding.node) can not ` + + `be found at path: ` + String(bindingPath) + `. \nPlease run command ` + + `'npm rebuild @tensorflow/tfjs-node`+ + (String(bindingPath).indexOf('tfjs-node-gpu') > 0 ? `-gpu` : ``) + + ` --build-addon-from-source' to ` + + `rebuild the native addon module. \nIf you have problem with building ` + + `the addon module, please check ` + + `https://github.com/tensorflow/tfjs/blob/master/tfjs-node/` + + `WINDOWS_TROUBLESHOOTING.md or file an issue.`); +} +// tslint:disable-next-line:no-require-imports +const bindings = require(bindingPath); + +// Merge version and io namespaces. +export const version = { + ...tf.version, + 'tfjs-node': nodeVersion.version +}; +export const io = { + ...tf.io, + ...nodeIo +}; + +// Export all union package symbols +export * from '@tensorflow/tfjs'; +export * from './node'; + +// tslint:disable-next-line:no-require-imports +const pjson = require('../package.json'); + +// Side effects for default initialization of Node backend. +tf.registerBackend('tensorflow', () => { + return new NodeJSKernelBackend(bindings as TFJSBinding, pjson.name); +}, 3 /* priority */); + +const success = tf.setBackend('tensorflow'); +if (!success) { + throw new Error(`Could not initialize TensorFlow backend.`); +} + +// Register the model saving and loading handlers for the 'file://' URL scheme. +tf.io.registerLoadRouter(nodeFileSystemRouter); +tf.io.registerSaveRouter(nodeFileSystemRouter); + +// Register the ProgbarLogger for Model.fit() at verbosity level 1. +tf.registerCallbackConstructor(1, ProgbarLogger); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/int64_tensors.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/int64_tensors.ts new file mode 100644 index 000000000..406d9ccbd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/int64_tensors.ts @@ -0,0 +1,102 @@ +/** + * @license + * Copyright 2018 Google LLC. 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 {Shape, util} from '@tensorflow/tfjs'; +import {endianness} from 'os'; + +const INT32_MAX = 2147483648; + +/** + * Node.js-specific tensor type: int64-type scalar. + * + * This class is created for a specific purpose: to support + * writing `step`s to TensorBoard via op-kernel bindings. + * `step` is required to have an int64 dtype, but TensorFlow.js + * (tfjs-core) doesn't have a built-in int64 dtype. This is + * related to a lack of `Int64Array` or `Uint64Array` typed + * array in basic JavaScript. + * + * This class is introduced as a workaround. + */ +export class Int64Scalar { + readonly dtype: string = 'int64'; + readonly rank: number = 1; + private valueArray_: Int32Array; + + private static endiannessOkay_: boolean; + + constructor(readonly value: number) { + // The reason why we need to check endianness of the machine here is + // negative int64 values and the way in which we represent them + // using Int32Arrays in JavaScript. We represent each int64 value with + // two consecutive elements of an Int32Array. For positive values, + // the high part is simply zero; for negative values, the high part + // should be -1. The ordering of the low and high parts assumes + // little endian (i.e., least significant digits appear first). + // This assumption is checked by the lines below. + if (Int64Scalar.endiannessOkay_ == null) { + if (endianness() !== 'LE') { + throw new Error( + `Int64Scalar does not support endianness of this machine: ` + + `${endianness()}`); + } + Int64Scalar.endiannessOkay_ = true; + } + + util.assert( + value > -INT32_MAX && value < INT32_MAX - 1, + () => + `Got a value outside of the bound of values supported for int64 ` + + `dtype ([-${INT32_MAX}, ${INT32_MAX - 1}]): ${value}`); + util.assert( + Number.isInteger(value), + () => `Expected value to be an integer, but got ${value}`); + + // We use two int32 elements to represent a int64 value. This assumes + // little endian, which is checked above. + const highPart = value >= 0 ? 0 : -1; + const lowPart = value % INT32_MAX; + this.valueArray_ = new Int32Array([lowPart, highPart]); + } + + get shape(): Shape { + return []; + } + + /** Get the Int32Array that represents the int64 value. */ + get valueArray(): Int32Array { + return this.valueArray_; + } +} + +/** + * This method encodes a Int32Array as Int64 layout in order to create TF_INT64 + * tensor through binding. + */ +export function encodeInt32ArrayAsInt64(value: Int32Array): Int32Array { + if (endianness() !== 'LE') { + throw new Error( + `Int64Scalar does not support endianness of this machine: ` + + `${endianness()}`); + } + + const buffer = new Int32Array(value.length * 2); + for (let i = 0; i < value.length; i++) { + buffer[i * 2] = value[i]; + } + return buffer; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/file_system.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/file_system.ts new file mode 100644 index 000000000..4d2d33276 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/file_system.ts @@ -0,0 +1,288 @@ +/** + * @license + * Copyright 2018 Google LLC. 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 * as tf from '@tensorflow/tfjs'; +import * as fs from 'fs'; +import {dirname, join, resolve} from 'path'; +import {promisify} from 'util'; + +import {getModelArtifactsInfoForJSON, toArrayBuffer} from './io_utils'; + +const stat = promisify(fs.stat); +const writeFile = promisify(fs.writeFile); +const readFile = promisify(fs.readFile); +const mkdir = promisify(fs.mkdir); + +function doesNotExistHandler(name: string): (e: NodeJS.ErrnoException) => + never { + return e => { + switch (e.code) { + case 'ENOENT': + throw new Error(`${name} ${e.path} does not exist: loading failed`); + default: + throw e; + } + }; +} + +export class NodeFileSystem implements tf.io.IOHandler { + static readonly URL_SCHEME = 'file://'; + + protected readonly path: string|string[]; + + readonly MODEL_JSON_FILENAME = 'model.json'; + readonly WEIGHTS_BINARY_FILENAME = 'weights.bin'; + readonly MODEL_BINARY_FILENAME = 'tensorflowjs.pb'; + + /** + * Constructor of the NodeFileSystem IOHandler. + * @param path A single path or an Array of paths. + * For saving: expects a single path pointing to an existing or nonexistent + * directory. If the directory does not exist, it will be + * created. + * For loading: + * - If the model has JSON topology (e.g., `tf.Model`), a single path + * pointing to the JSON file (usually named `model.json`) is expected. + * The JSON file is expected to contain `modelTopology` and/or + * `weightsManifest`. If `weightManifest` exists, the values of the + * weights will be loaded from relative paths (relative to the directory + * of `model.json`) as contained in `weightManifest`. + * - If the model has binary (protocol buffer GraphDef) topology, + * an Array of two paths is expected: the first path should point to the + * .pb file and the second path should point to the weight manifest + * JSON file. + */ + constructor(path: string|string[]) { + if (Array.isArray(path)) { + tf.util.assert( + path.length === 2, + () => 'file paths must have a length of 2, ' + + `(actual length is ${path.length}).`); + this.path = path.map(p => resolve(p)); + } else { + this.path = resolve(path); + } + } + + async save(modelArtifacts: tf.io.ModelArtifacts): Promise { + if (Array.isArray(this.path)) { + throw new Error('Cannot perform saving to multiple paths.'); + } + + await this.createOrVerifyDirectory(); + + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error( + 'NodeFileSystem.save() does not support saving model topology ' + + 'in binary format yet.'); + // TODO(cais, nkreeger): Implement this. See + // https://github.com/tensorflow/tfjs/issues/343 + } else { + const weightsBinPath = join(this.path, this.WEIGHTS_BINARY_FILENAME); + const weightsManifest = [{ + paths: [this.WEIGHTS_BINARY_FILENAME], + weights: modelArtifacts.weightSpecs + }]; + const modelJSON: tf.io.ModelJSON = { + modelTopology: modelArtifacts.modelTopology, + weightsManifest, + format: modelArtifacts.format, + generatedBy: modelArtifacts.generatedBy, + convertedBy: modelArtifacts.convertedBy + }; + if (modelArtifacts.trainingConfig != null) { + modelJSON.trainingConfig = modelArtifacts.trainingConfig; + } + if (modelArtifacts.signature != null) { + modelJSON.signature = modelArtifacts.signature; + } + if (modelArtifacts.userDefinedMetadata != null) { + modelJSON.userDefinedMetadata = modelArtifacts.userDefinedMetadata; + } + const modelJSONPath = join(this.path, this.MODEL_JSON_FILENAME); + await writeFile(modelJSONPath, JSON.stringify(modelJSON), 'utf8'); + await writeFile( + weightsBinPath, Buffer.from(modelArtifacts.weightData), 'binary'); + + return { + // TODO(cais): Use explicit tf.io.ModelArtifactsInfo type below once it + // is available. + // tslint:disable-next-line:no-any + modelArtifactsInfo: getModelArtifactsInfoForJSON(modelArtifacts) as any + }; + } + } + async load(): Promise { + return Array.isArray(this.path) ? this.loadBinaryModel() : + this.loadJSONModel(); + } + + protected async loadBinaryModel(): Promise { + const topologyPath = this.path[0]; + const weightManifestPath = this.path[1]; + const topology = + await stat(topologyPath).catch(doesNotExistHandler('Topology Path')); + const weightManifest = + await stat(weightManifestPath) + .catch(doesNotExistHandler('Weight Manifest Path')); + + // `this.path` can be either a directory or a file. If it is a file, assume + // it is model.json file. + if (!topology.isFile()) { + throw new Error('File specified for topology is not a file!'); + } + if (!weightManifest.isFile()) { + throw new Error('File specified for the weight manifest is not a file!'); + } + + const modelTopology = await readFile(this.path[0]); + const weightsManifest = JSON.parse(await readFile(this.path[1], 'utf8')); + + const modelArtifacts: tf.io.ModelArtifacts = { + modelTopology, + }; + const [weightSpecs, weightData] = + await this.loadWeights(weightsManifest, this.path[1]); + + modelArtifacts.weightSpecs = weightSpecs; + modelArtifacts.weightData = weightData; + + return modelArtifacts; + } + + protected async loadJSONModel(): Promise { + const path = this.path as string; + const info = await stat(path).catch(doesNotExistHandler('Path')); + + // `path` can be either a directory or a file. If it is a file, assume + // it is model.json file. + if (info.isFile()) { + const modelJSON = JSON.parse(await readFile(path, 'utf8')); + + const modelArtifacts: tf.io.ModelArtifacts = { + modelTopology: modelJSON.modelTopology, + format: modelJSON.format, + generatedBy: modelJSON.generatedBy, + convertedBy: modelJSON.convertedBy + }; + if (modelJSON.weightsManifest != null) { + const [weightSpecs, weightData] = + await this.loadWeights(modelJSON.weightsManifest, path); + modelArtifacts.weightSpecs = weightSpecs; + modelArtifacts.weightData = weightData; + } + if (modelJSON.trainingConfig != null) { + modelArtifacts.trainingConfig = modelJSON.trainingConfig; + } + if (modelJSON.signature != null) { + modelArtifacts.signature = modelJSON.signature; + } + if (modelJSON.userDefinedMetadata != null) { + modelArtifacts.userDefinedMetadata = modelJSON.userDefinedMetadata; + } + return modelArtifacts; + } else { + throw new Error( + 'The path to load from must be a file. Loading from a directory ' + + 'is not supported.'); + } + } + + private async loadWeights( + weightsManifest: tf.io.WeightsManifestConfig, + path: string): Promise<[tf.io.WeightsManifestEntry[], ArrayBuffer]> { + const dirName = dirname(path); + const buffers: Buffer[] = []; + const weightSpecs: tf.io.WeightsManifestEntry[] = []; + for (const group of weightsManifest) { + for (const path of group.paths) { + const weightFilePath = join(dirName, path); + const buffer = await readFile(weightFilePath) + .catch(doesNotExistHandler('Weight file')); + buffers.push(buffer); + } + weightSpecs.push(...group.weights); + } + return [weightSpecs, toArrayBuffer(buffers)]; + } + + /** + * For each item in `this.path`, creates a directory at the path or verify + * that the path exists as a directory. + */ + protected async createOrVerifyDirectory() { + const paths = Array.isArray(this.path) ? this.path : [this.path]; + for (const path of paths) { + try { + await mkdir(path); + } catch (e) { + if (e.code === 'EEXIST') { + if ((await stat(path)).isFile()) { + throw new Error( + `Path ${path} exists as a file. The path must be ` + + `nonexistent or point to a directory.`); + } + // else continue, the directory exists + } else { + throw e; + } + } + } + } +} + +export const nodeFileSystemRouter = (url: string|string[]) => { + if (Array.isArray(url)) { + if (url.every( + urlElement => urlElement.startsWith(NodeFileSystem.URL_SCHEME))) { + return new NodeFileSystem(url.map( + urlElement => urlElement.slice(NodeFileSystem.URL_SCHEME.length))); + } else { + return null; + } + } else { + if (url.startsWith(NodeFileSystem.URL_SCHEME)) { + return new NodeFileSystem(url.slice(NodeFileSystem.URL_SCHEME.length)); + } else { + return null; + } + } +}; +// Registration of `nodeFileSystemRouter` is done in index.ts. + +/** + * Factory function for Node.js native file system IO Handler. + * + * @param path A single path or an Array of paths. + * For saving: expects a single path pointing to an existing or nonexistent + * directory. If the directory does not exist, it will be + * created. + * For loading: + * - If the model has JSON topology (e.g., `tf.Model`), a single path + * pointing to the JSON file (usually named `model.json`) is expected. + * The JSON file is expected to contain `modelTopology` and/or + * `weightsManifest`. If `weightManifest` exists, the values of the + * weights will be loaded from relative paths (relative to the directory + * of `model.json`) as contained in `weightManifest`. + * - If the model has binary (protocol buffer GraphDef) topology, + * an Array of two paths is expected: the first path should point to the + * .pb file and the second path should point to the weight manifest + * JSON file. + */ +export function fileSystem(path: string|string[]): NodeFileSystem { + return new NodeFileSystem(path); +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/index.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/index.ts new file mode 100644 index 000000000..019ea6a45 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/index.ts @@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2018 Google LLC. 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. + * ============================================================================= + */ + +/** + * Public exports from the `io` module. + */ + +export {fileSystem} from './file_system'; +export {nodeHTTPRequest} from './node_http'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/io_utils.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/io_utils.ts new file mode 100644 index 000000000..74582196e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/io_utils.ts @@ -0,0 +1,80 @@ +/** + * @license + * Copyright 2018 Google LLC. 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 * as tf from '@tensorflow/tfjs'; + +/** + * Convert an ArrayBuffer to a Buffer. + */ +export function toBuffer(ab: ArrayBuffer): Buffer { + const view = new Uint8Array(ab); + return Buffer.from(view); // copies data +} + +/** + * Convert a Buffer or an Array of Buffers to an ArrayBuffer. + * + * If the input is an Array of Buffers, they will be concatenated in the + * specified order to form the output ArrayBuffer. + */ +export function toArrayBuffer(buf: Buffer|Buffer[]): ArrayBuffer { + if (Array.isArray(buf)) { + // An Array of Buffers. + let totalLength = 0; + for (const buffer of buf) { + totalLength += buffer.length; + } + + const ab = new ArrayBuffer(totalLength); + const view = new Uint8Array(ab); + let pos = 0; + for (const buffer of buf) { + pos += buffer.copy(view, pos); + } + return ab; + } else { + // A single Buffer. Return a copy of the underlying ArrayBuffer slice. + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + } +} + +// TODO(cais): Use explicit tf.io.ModelArtifactsInfo return type below once it +// is available. +/** + * Populate ModelArtifactsInfo fields for a model with JSON topology. + * @param modelArtifacts + * @returns A ModelArtifactsInfo object. + */ +export function getModelArtifactsInfoForJSON( + modelArtifacts: tf.io.ModelArtifacts) { + if (modelArtifacts.modelTopology instanceof ArrayBuffer) { + throw new Error('Expected JSON model topology, received ArrayBuffer.'); + } + return { + dateSaved: new Date(), + modelTopologyType: 'JSON', + modelTopologyBytes: modelArtifacts.modelTopology == null ? + 0 : + Buffer.byteLength(JSON.stringify(modelArtifacts.modelTopology), 'utf8'), + weightSpecsBytes: modelArtifacts.weightSpecs == null ? + 0 : + Buffer.byteLength(JSON.stringify(modelArtifacts.weightSpecs), 'utf8'), + weightDataBytes: modelArtifacts.weightData == null ? + 0 : + modelArtifacts.weightData.byteLength, + }; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/node_http.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/node_http.ts new file mode 100644 index 000000000..5fef3dbdd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/io/node_http.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2018 Google LLC. 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 {io} from '@tensorflow/tfjs'; + +/** + * Factory function for HTTP IO Handler in Node.js. + * + * @param path URL path or an array of them. + * @param requestInit Request init for the HTTP IOHandler. May include fields + * such as "credentials" and "cache". (Optional) + * @param weightPathPrefix A path prefix for weight loading . (Optional). + */ +export function nodeHTTPRequest( + path: string, requestInit?: RequestInit, + weightPathPrefix?: string): io.IOHandler { + return io.browserHTTPRequest(path, {requestInit, weightPathPrefix}); +} + +export const nodeHTTPRequestRouter = (url: string) => { + let isHTTP = true; + if (Array.isArray(url)) { + isHTTP = url.every(urlItem => io.isHTTPScheme(urlItem)); + } else { + isHTTP = io.isHTTPScheme(url); + } + if (isHTTP) { + return nodeHTTPRequest(url); + } + return null; +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Abs.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Abs.ts new file mode 100644 index 000000000..074618e4c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Abs.ts @@ -0,0 +1,38 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Abs, AbsInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const absConfig: KernelConfig = { + kernelName: Abs, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AbsInputs; + const backend = args.backend as NodeJSKernelBackend; + + if (x.dtype === 'complex64') { + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tout', 'float32') + ]; + return backend.executeSingleOutput('ComplexAbs', opAttrs, [x]); + } + return backend.executeSingleInput(Abs, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acos.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acos.ts new file mode 100644 index 000000000..6beea67e0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acos.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Acos, AcosInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const acosConfig: KernelConfig = { + kernelName: Acos, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AcosInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Acos, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acosh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acosh.ts new file mode 100644 index 000000000..47de82f80 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Acosh.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Acosh, AcoshInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const acoshConfig: KernelConfig = { + kernelName: Acosh, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AcoshInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Acosh, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Add.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Add.ts new file mode 100644 index 000000000..d08ecf9e4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Add.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Add, AddInputs, backend_util, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const addConfig: KernelConfig = { + kernelName: Add, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as AddInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Add, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AddN.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AddN.ts new file mode 100644 index 000000000..b628fb1c0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AddN.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {AddN, AddNInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const addNConfig: KernelConfig = { + kernelName: AddN, + backendName: 'tensorflow', + kernelFunc: (args) => { + const tensors = args.inputs as {} as AddNInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', tensors[0].dtype), + {name: 'N', type: backend.binding.TF_ATTR_INT, value: tensors.length} + ]; + return backend.executeSingleOutput(AddN, opAttrs, tensors); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/All.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/All.ts new file mode 100644 index 000000000..69e19ed70 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/All.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {All, AllAttrs, AllInputs, KernelConfig, tensor1d, util} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const allConfig: KernelConfig = { + kernelName: All, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AllInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as AllAttrs; + + const origAxes = util.parseAxisParam(axis, x.shape); + const opAttrs = [ + {name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims}, + createTensorsTypeOpAttr('Tidx', 'int32') + ]; + const axesTensor = tensor1d(origAxes, 'int32'); + const res = backend.executeSingleOutput(All, opAttrs, [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Any.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Any.ts new file mode 100644 index 000000000..ec59359ab --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Any.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Any, AnyAttrs, AnyInputs, KernelConfig, tensor1d, util} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const anyConfig: KernelConfig = { + kernelName: Any, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AnyInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as AnyAttrs; + + const origAxes = util.parseAxisParam(axis, x.shape); + const opAttrs = [ + {name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims}, + createTensorsTypeOpAttr('Tidx', 'int32') + ]; + const axesTensor = tensor1d(origAxes, 'int32'); + const res = backend.executeSingleOutput(Any, opAttrs, [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMax.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMax.ts new file mode 100644 index 000000000..1ab79a295 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMax.ts @@ -0,0 +1,49 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {ArgMax, ArgMaxAttrs, ArgMaxInputs, KernelConfig, scalar, Tensor} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const argMaxConfig: KernelConfig = { + kernelName: ArgMax, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ArgMaxInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis} = args.attrs as {} as ArgMaxAttrs; + + const toDispose: Tensor[] = []; + let xInput = x; + if (x.dtype === 'bool') { + xInput = (x as Tensor).toInt(); + toDispose.push(xInput as Tensor); + } + const axisScalar = scalar(axis, 'int32'); + toDispose.push(axisScalar); + const opAttrs = [ + createTensorsTypeOpAttr('T', xInput.dtype), + createTensorsTypeOpAttr('Tidx', 'int32'), + createTensorsTypeOpAttr('output_type', 'int32') + ]; + + const res = + backend.executeSingleOutput(ArgMax, opAttrs, [xInput, axisScalar]); + toDispose.forEach(t => t.dispose()); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMin.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMin.ts new file mode 100644 index 000000000..9c3aabf64 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ArgMin.ts @@ -0,0 +1,49 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {ArgMin, ArgMinAttrs, ArgMinInputs, KernelConfig, scalar, Tensor} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const argMinConfig: KernelConfig = { + kernelName: ArgMin, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ArgMinInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis} = args.attrs as {} as ArgMinAttrs; + + const toDispose: Tensor[] = []; + let xInput = x; + if (x.dtype === 'bool') { + xInput = (x as Tensor).toInt(); + toDispose.push(xInput as Tensor); + } + const axisScalar = scalar(axis, 'int32'); + toDispose.push(axisScalar); + const opAttrs = [ + createTensorsTypeOpAttr('T', xInput.dtype), + createTensorsTypeOpAttr('Tidx', 'int32'), + createTensorsTypeOpAttr('output_type', 'int32') + ]; + + const res = + backend.executeSingleOutput(ArgMin, opAttrs, [xInput, axisScalar]); + toDispose.forEach(t => t.dispose()); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asin.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asin.ts new file mode 100644 index 000000000..b8005fc2f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asin.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Asin, AsinInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const asinConfig: KernelConfig = { + kernelName: Asin, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AsinInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Asin, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asinh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asinh.ts new file mode 100644 index 000000000..13a27901e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Asinh.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Asinh, AsinhInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const asinhConfig: KernelConfig = { + kernelName: Asinh, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AsinhInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Asinh, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan.ts new file mode 100644 index 000000000..e1463c46d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Atan, AtanInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const atanConfig: KernelConfig = { + kernelName: Atan, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AtanInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Atan, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan2.ts new file mode 100644 index 000000000..d5e19da47 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atan2.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Atan2, Atan2Inputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const atan2Config: KernelConfig = { + kernelName: Atan2, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as Atan2Inputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('T', a.dtype)]; + return backend.executeSingleOutput(Atan2, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atanh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atanh.ts new file mode 100644 index 000000000..d7a6c8188 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Atanh.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Atanh, AtanhInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const atanhConfig: KernelConfig = { + kernelName: Atanh, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AtanhInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Atanh, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool.ts new file mode 100644 index 000000000..3a76b92da --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool.ts @@ -0,0 +1,57 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {AvgPool, AvgPoolAttrs, AvgPoolInputs, backend_util, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const avgPoolConfig: KernelConfig = { + kernelName: AvgPool, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AvgPoolInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dimRoundingMode} = + args.attrs as {} as AvgPoolAttrs; + + const convInfo = backend_util.computePool2DInfo( + x.shape as [number, number, number, number], filterSize, strides, + 1 /* dilations */, pad, dimRoundingMode); + + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; + const $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + ]; + return backend.executeSingleOutput(AvgPool, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3D.ts new file mode 100644 index 000000000..6df0d06e3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3D.ts @@ -0,0 +1,62 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {AvgPool3D, AvgPool3DAttrs, AvgPool3DInputs, backend_util, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const avgPool3DConfig: KernelConfig = { + kernelName: AvgPool3D, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as AvgPool3DInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dimRoundingMode, dataFormat} = + args.attrs as {} as AvgPool3DAttrs; + + const convInfo = backend_util.computePool3DInfo( + x.shape as [number, number, number, number, number], filterSize, + strides, 1 /* dilations */, pad, dimRoundingMode, dataFormat); + + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const ksize = [ + 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 + ]; + const $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + const padding = convInfo.padInfo.type; + const $dataFormat = + convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: $dataFormat + }, + ]; + return backend.executeSingleOutput(AvgPool3D, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3DGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3DGrad.ts new file mode 100644 index 000000000..e60734708 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPool3DGrad.ts @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {AvgPool3DGrad, AvgPool3DGradAttrs, AvgPool3DGradInputs, backend_util, KernelConfig, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const avgPool3DGradConfig: KernelConfig = { + kernelName: AvgPool3DGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, input} = args.inputs as AvgPool3DGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dimRoundingMode} = + args.attrs as {} as AvgPool3DGradAttrs; + + const convInfo = backend_util.computePool3DInfo( + input.shape as [number, number, number, number, number], filterSize, + strides, 1 /* dilations */, pad, dimRoundingMode); + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding type was ${convInfo.padInfo.type}`); + } + const ksize = [ + 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 + ]; + const $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + const padding = convInfo.padInfo.type; + const dataFormat = + convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', input.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + ]; + const origInputShape = tensor1d(input.shape, 'int32'); + const res = backend.executeSingleOutput( + AvgPool3DGrad, opAttrs, [origInputShape, dy]); + origInputShape.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPoolGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPoolGrad.ts new file mode 100644 index 000000000..df7914406 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/AvgPoolGrad.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {AvgPoolGrad, AvgPoolGradAttrs, AvgPoolGradInputs, backend_util, KernelConfig, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const avgPoolGradConfig: KernelConfig = { + kernelName: AvgPoolGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, input} = args.inputs as AvgPoolGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad} = args.attrs as {} as AvgPoolGradAttrs; + + const convInfo = backend_util.computePool2DInfo( + input.shape as [number, number, number, number], filterSize, strides, + 1 /* dilations */, pad); + + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding type was ${convInfo.padInfo.type}`); + } + const ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; + const $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', input.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + ]; + const origInputShape = tensor1d(input.shape, 'int32'); + const ret = + backend.executeSingleOutput(AvgPoolGrad, opAttrs, [origInputShape, dy]); + origInputShape.dispose(); + return ret; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchMatMul.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchMatMul.ts new file mode 100644 index 000000000..96a726ce7 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchMatMul.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {BatchMatMul, BatchMatMulAttrs, BatchMatMulInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const batchMatMulConfig: KernelConfig = { + kernelName: BatchMatMul, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as BatchMatMulInputs; + const backend = args.backend as NodeJSKernelBackend; + const {transposeA, transposeB} = args.attrs as {} as BatchMatMulAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', a.dtype), + {name: 'adj_x', type: backend.binding.TF_ATTR_BOOL, value: transposeA}, + {name: 'adj_y', type: backend.binding.TF_ATTR_BOOL, value: transposeB} + ]; + return backend.executeSingleOutput(BatchMatMul, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchToSpaceND.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchToSpaceND.ts new file mode 100644 index 000000000..fac53d108 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/BatchToSpaceND.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {BatchToSpaceND, BatchToSpaceNDAttrs, BatchToSpaceNDInputs, KernelConfig, tensor1d, tensor2d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const batchToSpaceNDConfig: KernelConfig = { + kernelName: BatchToSpaceND, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as BatchToSpaceNDInputs; + const backend = args.backend as NodeJSKernelBackend; + const {blockShape, crops} = args.attrs as {} as BatchToSpaceNDAttrs; + + const blockShapeTensor = tensor1d(blockShape, 'int32'); + const cropsTensor = + tensor2d(crops, [crops.length, crops[0].length], 'int32'); + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tblock_shape', 'int32'), + createTensorsTypeOpAttr('Tcrops', cropsTensor.dtype) + ]; + const res = backend.executeSingleOutput( + BatchToSpaceND, opAttrs, [x, blockShapeTensor, cropsTensor]); + + cropsTensor.dispose(); + blockShapeTensor.dispose(); + + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Bincount.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Bincount.ts new file mode 100644 index 000000000..6052fe184 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Bincount.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Bincount, BincountAttrs, BincountInputs, KernelConfig, scalar} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const bincountConfig: KernelConfig = { + kernelName: Bincount, + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {x, weights} = inputs as BincountInputs; + const {size} = attrs as {} as BincountAttrs; + const nodeBackend = backend as NodeJSKernelBackend; + + const $size = scalar(size, 'int32'); + + const opAttrs = [createTensorsTypeOpAttr('T', weights.dtype)]; + + const result = + nodeBackend.executeSingleOutput(Bincount, opAttrs, [x, $size, weights]); + + $size.dispose(); + + return result; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cast.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cast.ts new file mode 100644 index 000000000..93663896b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cast.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Cast, CastAttrs, CastInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const castConfig: KernelConfig = { + kernelName: Cast, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as CastInputs; + const backend = args.backend as NodeJSKernelBackend; + const {dtype} = args.attrs as {} as CastAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('SrcT', x.dtype), + createTensorsTypeOpAttr('DstT', dtype), + {name: 'Truncate', type: backend.binding.TF_ATTR_BOOL, value: false} + ]; + return backend.executeSingleOutput(Cast, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Ceil.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Ceil.ts new file mode 100644 index 000000000..9ebbd545f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Ceil.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Ceil, CeilInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const ceilConfig: KernelConfig = { + kernelName: Ceil, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as CeilInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Ceil, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ClipByValue.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ClipByValue.ts new file mode 100644 index 000000000..f76a71294 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ClipByValue.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {ClipByValue, ClipByValueAttrs, ClipByValueInputs, KernelConfig, maximum, minimum, scalar, Tensor, tidy} from '@tensorflow/tfjs'; + +export const clipByValueConfig: KernelConfig = { + kernelName: ClipByValue, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ClipByValueInputs; + const {clipValueMin, clipValueMax} = args.attrs as {} as ClipByValueAttrs; + + return tidy(() => { + const xMin = minimum(x as Tensor, scalar(clipValueMax, x.dtype)); + return maximum(xMin, scalar(clipValueMin, x.dtype)); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Complex.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Complex.ts new file mode 100644 index 000000000..4ef544b20 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Complex.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Complex, ComplexInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const complexConfig: KernelConfig = { + kernelName: Complex, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {real, imag} = args.inputs as ComplexInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', real as Tensor), + { + name: 'Tout', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_COMPLEX64 + }, + ]; + const inputs = [real, imag]; + return backend.executeSingleOutput(Complex, opAttrs, inputs); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ComplexAbs.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ComplexAbs.ts new file mode 100644 index 000000000..41fb32d9a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ComplexAbs.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {ComplexAbs, ComplexAbsInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const complexAbsConfig: KernelConfig = { + kernelName: ComplexAbs, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ComplexAbsInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tout', 'float32') + ]; + return backend.executeSingleOutput(ComplexAbs, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Concat.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Concat.ts new file mode 100644 index 000000000..e59b28dfa --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Concat.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Concat, ConcatAttrs, ConcatInputs, KernelConfig, scalar, Tensor} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const concatConfig: KernelConfig = { + kernelName: Concat, + backendName: 'tensorflow', + kernelFunc: (args) => { + const tensors = args.inputs as {} as ConcatInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis} = args.attrs as {} as ConcatAttrs; + + const opAttrs = [ + {name: 'N', type: backend.binding.TF_ATTR_INT, value: tensors.length}, { + name: 'Tidx', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_INT32 + }, + createTensorsTypeOpAttr('T', tensors as Tensor[]) + ]; + + const inputs = Array.from(tensors); + const axisTensor = scalar(axis, 'int32'); + inputs.push(axisTensor); + const res = backend.executeSingleOutput('ConcatV2', opAttrs, inputs); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2D.ts new file mode 100644 index 000000000..0948cf500 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2D.ts @@ -0,0 +1,79 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Conv2D, Conv2DAttrs, Conv2DInputs, KernelConfig, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const conv2DConfig: KernelConfig = { + kernelName: Conv2D, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, filter} = args.inputs as Conv2DInputs; + const backend = args.backend as NodeJSKernelBackend; + const {strides, pad, dataFormat, dilations, dimRoundingMode} = + args.attrs as {} as Conv2DAttrs; + + const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util.computeConv2DInfo( + x.shape as [number, number, number, number], + filter.shape as [number, number, number, number], strides, dilations, + pad, dimRoundingMode, false /* depthwise */, $dataFormat); + + return conv2dImpl(x, filter, convInfo, backend); + } +}; + +export function conv2dImpl( + x: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, + backend: NodeJSKernelBackend): Tensor4D { + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME' && + convInfo.padInfo.type !== 'EXPLICIT') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'use_cudnn_on_gpu', type: backend.binding.TF_ATTR_BOOL, value: true}, + {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations}, + ]; + if (padding === 'EXPLICIT') { + const padValue = [ + convInfo.padInfo.top, convInfo.padInfo.bottom, convInfo.padInfo.left, + convInfo.padInfo.right + ]; + opAttrs.push({ + name: 'explicit_paddings', + type: backend.binding.TF_ATTR_INT, + value: dataFormat === 'NHWC' ? [0, 0, ...padValue, 0, 0] : + [0, 0, 0, 0, ...padValue] + }); + } + return backend.executeSingleOutput(Conv2D, opAttrs, [x, filter]) as Tensor4D; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropFilter.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropFilter.ts new file mode 100644 index 000000000..dcb984f9f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropFilter.ts @@ -0,0 +1,70 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Conv2DBackpropFilter, Conv2DBackpropFilterAttrs, Conv2DBackpropFilterInputs, KernelConfig, tensor1d, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const conv2DBackpropFilterConfig: KernelConfig = { + kernelName: Conv2DBackpropFilter, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, dy} = args.inputs as Conv2DBackpropFilterInputs; + const backend = args.backend as NodeJSKernelBackend; + const {strides, pad, dataFormat, dimRoundingMode, filterShape} = + args.attrs as {} as Conv2DBackpropFilterAttrs; + + const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util.computeConv2DInfo( + x.shape as [number, number, number, number], filterShape, strides, + 1 /* dilations */, pad, dimRoundingMode, false /* depthwise */, + $dataFormat); + + return conv2DBackpropFilterImpl(dy, x, convInfo, backend); + } +}; + +function conv2DBackpropFilterImpl( + dy: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, + backend: NodeJSKernelBackend): Tensor4D { + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; + const opAttrs = [ + createTensorsTypeOpAttr('T', 'float32'), + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'use_cudnn_on_gpu', type: backend.binding.TF_ATTR_BOOL, value: true}, + {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} + ]; + const filterSizes = tensor1d(convInfo.filterShape, 'int32'); + const res = + backend.executeSingleOutput( + Conv2DBackpropFilter, opAttrs, [filter, filterSizes, dy]) as Tensor4D; + filterSizes.dispose(); + return res; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropInput.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropInput.ts new file mode 100644 index 000000000..7974044c0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv2DBackpropInput.ts @@ -0,0 +1,69 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Conv2DBackpropInput, Conv2DBackpropInputAttrs, Conv2DBackpropInputInputs, KernelConfig, tensor1d, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const conv2DBackpropInputConfig: KernelConfig = { + kernelName: Conv2DBackpropInput, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, filter} = args.inputs as Conv2DBackpropInputInputs; + const backend = args.backend as NodeJSKernelBackend; + const {strides, pad, dataFormat, dimRoundingMode, inputShape} = + args.attrs as {} as Conv2DBackpropInputAttrs; + + const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util.computeConv2DInfo( + inputShape, filter.shape as [number, number, number, number], strides, + 1 /* dilations */, pad, dimRoundingMode, false, $dataFormat); + + return conv2DBackpropInputImpl(dy, filter, convInfo, backend); + } +}; + +function conv2DBackpropInputImpl( + dy: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, + backend: NodeJSKernelBackend): Tensor4D { + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; + const opAttrs = [ + createTensorsTypeOpAttr('T', 'float32'), + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'use_cudnn_on_gpu', type: backend.binding.TF_ATTR_BOOL, value: true}, + {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} + ]; + const inputSizes = tensor1d(convInfo.inShape, 'int32'); + const res = + backend.executeSingleOutput( + Conv2DBackpropInput, opAttrs, [inputSizes, filter, dy]) as Tensor4D; + inputSizes.dispose(); + return res; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3D.ts new file mode 100644 index 000000000..c89eff980 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3D.ts @@ -0,0 +1,62 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Conv3D, Conv3DAttrs, Conv3DInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const conv3DConfig: KernelConfig = { + kernelName: Conv3D, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, filter} = args.inputs as Conv3DInputs; + const backend = args.backend as NodeJSKernelBackend; + const {strides, pad, dilations} = args.attrs as {} as Conv3DAttrs; + + const convInfo = backend_util.computeConv3DInfo( + x.shape as [number, number, number, number, number], + filter.shape as [number, number, number, number, number], strides, + dilations, pad); + + const $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + const padding = convInfo.padInfo.type; + const $dataFormat = + convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + + if (!backend.isGPUPackage && convInfo.dilationDepth > 1) { + throw new Error('CPU Dilation depth must be 1'); + } + const $dilations = [ + 1, convInfo.dilationDepth, convInfo.dilationHeight, + convInfo.dilationWidth, 1 + ]; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: $dataFormat + }, + {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: $dilations} + ]; + return backend.executeSingleOutput(Conv3D, opAttrs, [x, filter]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropFilterV2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropFilterV2.ts new file mode 100644 index 000000000..65fe202f4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropFilterV2.ts @@ -0,0 +1,67 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Conv3DBackpropFilterV2, Conv3DBackpropFilterV2Attrs, Conv3DBackpropFilterV2Inputs, KernelConfig, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const conv3DBackpropFilterV2Config: KernelConfig = { + kernelName: Conv3DBackpropFilterV2, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, dy} = args.inputs as Conv3DBackpropFilterV2Inputs; + const backend = args.backend as NodeJSKernelBackend; + const {strides, pad, filterShape} = + args.attrs as {} as Conv3DBackpropFilterV2Attrs; + + const dilations = 1; + + const convInfo = backend_util.computeConv3DInfo( + x.shape as [number, number, number, number, number], filterShape, + strides, dilations, pad); + + const $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + const padding = convInfo.padInfo.type; + const dataFormat = + convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + + if (!backend.isGPUPackage && convInfo.dilationDepth > 1) { + throw new Error('CPU Dilation depth must be 1'); + } + const $dilations = [ + 1, convInfo.dilationDepth, convInfo.dilationHeight, + convInfo.dilationWidth, 1 + ]; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: $dilations} + ]; + const filterSizes = tensor1d(filterShape, 'int32'); + const res = backend.executeSingleOutput( + Conv3DBackpropFilterV2, opAttrs, [x, filterSizes, dy]); + filterSizes.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropInputV2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropInputV2.ts new file mode 100644 index 000000000..a93e5f6d3 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Conv3DBackpropInputV2.ts @@ -0,0 +1,67 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Conv3DBackpropInputV2, Conv3DBackpropInputV2Attrs, Conv3DBackpropInputV2Inputs, KernelConfig, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const conv3DBackpropInputV2Config: KernelConfig = { + kernelName: Conv3DBackpropInputV2, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, filter} = args.inputs as Conv3DBackpropInputV2Inputs; + const backend = args.backend as NodeJSKernelBackend; + const {strides, pad, inputShape} = + args.attrs as {} as Conv3DBackpropInputV2Attrs; + + const dilations = 1; + + const convInfo = backend_util.computeConv3DInfo( + inputShape, filter.shape as [number, number, number, number, number], + strides, dilations, pad); + + const $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + const padding = convInfo.padInfo.type; + const dataFormat = + convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + if (!backend.isGPUPackage && convInfo.dilationDepth > 1) { + throw new Error('CPU Dilation depth must be 1'); + } + const $dilations = [ + 1, convInfo.dilationDepth, convInfo.dilationHeight, + convInfo.dilationWidth, 1 + ]; + const opAttrs = [ + createTensorsTypeOpAttr('T', dy.dtype), + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: $dilations}, + createTensorsTypeOpAttr('Tshape', 'int32') + ]; + const inputSizes = tensor1d(inputShape, 'int32'); + const res = backend.executeSingleOutput( + Conv3DBackpropInputV2, opAttrs, [inputSizes, filter, dy]); + inputSizes.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cos.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cos.ts new file mode 100644 index 000000000..972830ef5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cos.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Cos, CosInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const cosConfig: KernelConfig = { + kernelName: Cos, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as CosInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Cos, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cosh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cosh.ts new file mode 100644 index 000000000..0bcb0a9f7 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cosh.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Cosh, CoshInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const coshConfig: KernelConfig = { + kernelName: Cosh, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as CoshInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Cosh, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/CropAndResize.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/CropAndResize.ts new file mode 100644 index 000000000..dad226f5a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/CropAndResize.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {CropAndResize, CropAndResizeAttrs, CropAndResizeInputs, KernelConfig, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const cropAndResizeConfig: KernelConfig = { + kernelName: CropAndResize, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {image, boxes, boxInd} = args.inputs as CropAndResizeInputs; + const backend = args.backend as NodeJSKernelBackend; + const {cropSize, method, extrapolationValue} = + args.attrs as {} as CropAndResizeAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', image.dtype), + {name: 'method', type: backend.binding.TF_ATTR_STRING, value: method}, { + name: 'extrapolation_value', + type: backend.binding.TF_ATTR_FLOAT, + value: extrapolationValue + } + ]; + const cropSizeTensor = tensor1d(cropSize, 'int32'); + const res = backend.executeSingleOutput( + CropAndResize, opAttrs, [image, boxes, boxInd, cropSizeTensor]); + cropSizeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cumsum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cumsum.ts new file mode 100644 index 000000000..57a6344d2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Cumsum.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Cumsum, CumsumAttrs, CumsumInputs, KernelConfig, scalar} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const cumsumConfig: KernelConfig = { + kernelName: Cumsum, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as CumsumInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, exclusive, reverse} = args.attrs as {} as CumsumAttrs; + + const axisTensor = scalar(axis, 'int32'); + const opAttrs = [ + {name: 'exclusive', type: backend.binding.TF_ATTR_BOOL, value: exclusive}, + {name: 'reverse', type: backend.binding.TF_ATTR_BOOL, value: reverse}, + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tidx', 'int32') + ]; + const res = backend.executeSingleOutput(Cumsum, opAttrs, [x, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthToSpace.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthToSpace.ts new file mode 100644 index 000000000..cc43eda54 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthToSpace.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {DepthToSpace, DepthToSpaceAttrs, DepthToSpaceInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const depthToSpaceConfig: KernelConfig = { + kernelName: DepthToSpace, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as DepthToSpaceInputs; + const backend = args.backend as NodeJSKernelBackend; + const {blockSize, dataFormat} = args.attrs as {} as DepthToSpaceAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x as Tensor), { + name: 'block_size', + type: backend.binding.TF_ATTR_INT, + value: blockSize < 2 ? 2 : blockSize + }, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + } + ]; + const inputs = [x]; + return backend.executeSingleOutput(DepthToSpace, opAttrs, inputs); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNative.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNative.ts new file mode 100644 index 000000000..85baf6212 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNative.ts @@ -0,0 +1,82 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, DepthwiseConv2dNative, DepthwiseConv2dNativeAttrs, DepthwiseConv2dNativeInputs, KernelConfig, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const depthwiseConv2dNativeConfig: KernelConfig = { + kernelName: DepthwiseConv2dNative, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, filter} = args.inputs as DepthwiseConv2dNativeInputs; + const backend = args.backend as NodeJSKernelBackend; + const {strides, pad, dilations, dimRoundingMode} = + args.attrs as {} as DepthwiseConv2dNativeAttrs; + + let $dilations = dilations; + if ($dilations == null) { + $dilations = [1, 1]; + } + + const convInfo = backend_util.computeConv2DInfo( + x.shape as [number, number, number, number], + filter.shape as [number, number, number, number], strides, $dilations, + pad, dimRoundingMode, true /* depthwise */); + + return depthwiseConv2dNativeImpl(x, filter, convInfo, backend); + } +}; + +export function depthwiseConv2dNativeImpl( + input: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, + backend: NodeJSKernelBackend): Tensor4D { + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME' && + convInfo.padInfo.type !== 'EXPLICIT') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; + const opAttrs = [ + createTensorsTypeOpAttr('T', input.dtype), + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} + ]; + if (padding === 'EXPLICIT') { + const padValue = [ + convInfo.padInfo.top, convInfo.padInfo.bottom, convInfo.padInfo.left, + convInfo.padInfo.right + ]; + opAttrs.push({ + name: 'explicit_paddings', + type: backend.binding.TF_ATTR_INT, + value: dataFormat === 'NHWC' ? [0, 0, ...padValue, 0, 0] : + [0, 0, 0, 0, ...padValue] + }); + } + return backend.executeSingleOutput( + DepthwiseConv2dNative, opAttrs, [input, filter]) as Tensor4D; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts new file mode 100644 index 000000000..7efcd07a4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropFilter.ts @@ -0,0 +1,62 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, DepthwiseConv2dNativeBackpropFilter, DepthwiseConv2dNativeBackpropFilterAttrs, DepthwiseConv2dNativeBackpropFilterInputs, KernelConfig, tensor1d, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const depthwiseConv2dNativeBackpropFilterConfig: KernelConfig = { + kernelName: DepthwiseConv2dNativeBackpropFilter, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, dy} = args.inputs as DepthwiseConv2dNativeBackpropFilterInputs; + const backend = args.backend as NodeJSKernelBackend; + const {strides, dilations, pad, dimRoundingMode, filterShape} = + args.attrs as {} as DepthwiseConv2dNativeBackpropFilterAttrs; + + const convInfo = backend_util.computeConv2DInfo( + x.shape as [number, number, number, number], filterShape, strides, + dilations, pad, dimRoundingMode, true /* depthwise */); + + return depthwiseConv2dNativeBackpropFilterImpl(x, dy, convInfo, backend); + } +}; + +function depthwiseConv2dNativeBackpropFilterImpl( + x: TensorInfo, dy: TensorInfo, convInfo: backend_util.Conv2DInfo, + backend: NodeJSKernelBackend): Tensor4D { + const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; + const opAttrs = [ + createTensorsTypeOpAttr('T', 'float32'), + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} + ]; + const filterSizes = tensor1d(convInfo.filterShape, 'int32'); + const res = backend.executeSingleOutput( + DepthwiseConv2dNativeBackpropFilter, opAttrs, + [x, filterSizes, dy]) as Tensor4D; + filterSizes.dispose(); + return res; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropInput.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropInput.ts new file mode 100644 index 000000000..f1f54202a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/DepthwiseConv2dNativeBackpropInput.ts @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, DepthwiseConv2dNativeBackpropInput, DepthwiseConv2dNativeBackpropInputAttrs, DepthwiseConv2dNativeBackpropInputInputs, KernelConfig, tensor1d, Tensor4D, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const depthwiseConv2dNativeBackpropInputConfig: KernelConfig = { + kernelName: DepthwiseConv2dNativeBackpropInput, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, filter} = + args.inputs as DepthwiseConv2dNativeBackpropInputInputs; + const backend = args.backend as NodeJSKernelBackend; + const {strides, dilations, pad, dimRoundingMode, inputShape} = + args.attrs as {} as DepthwiseConv2dNativeBackpropInputAttrs; + + const convInfo = backend_util.computeConv2DInfo( + inputShape, filter.shape as [number, number, number, number], strides, + dilations, pad, dimRoundingMode, true /* depthwise */); + + return depthwiseConv2dNativeBackpropInputImpl( + dy, filter, convInfo, backend); + } +}; + +function depthwiseConv2dNativeBackpropInputImpl( + dy: TensorInfo, filter: TensorInfo, convInfo: backend_util.Conv2DInfo, + backend: NodeJSKernelBackend): Tensor4D { + const strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const dilations = [1, convInfo.dilationHeight, convInfo.dilationWidth, 1]; + const opAttrs = [ + createTensorsTypeOpAttr('T', 'float32'), + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'dilations', type: backend.binding.TF_ATTR_INT, value: dilations} + ]; + + const inputSizes = tensor1d(convInfo.inShape, 'int32'); + const res = backend.executeSingleOutput( + DepthwiseConv2dNativeBackpropInput, opAttrs, + [inputSizes, filter, dy]) as Tensor4D; + inputSizes.dispose(); + return res; +} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Diag.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Diag.ts new file mode 100644 index 000000000..5462a29e8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Diag.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Diag, DiagInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const diagConfig: KernelConfig = { + kernelName: Diag, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as DiagInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Diag, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2D.ts new file mode 100644 index 000000000..609fb7b9c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2D.ts @@ -0,0 +1,51 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Dilation2D, Dilation2DAttrs, Dilation2DInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const dilation2dConfig: KernelConfig = { + kernelName: Dilation2D, + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {x, filter} = inputs as Dilation2DInputs; + const {strides, pad, dilations} = attrs as {} as Dilation2DAttrs; + const {dilationHeight, dilationWidth, padInfo, strideHeight, strideWidth} = + backend_util.computeDilation2DInfo( + x.shape as [number, number, number, number], + filter.shape as [number, number, number], strides, pad, + 'NHWC' /* dataFormat */, dilations); + const $strides = [1, strideHeight, strideWidth, 1]; + const $dilations = [1, dilationHeight, dilationWidth, 1]; + + const nodeBackend = backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'strides', type: nodeBackend.binding.TF_ATTR_INT, value: $strides}, + {name: 'rates', type: nodeBackend.binding.TF_ATTR_INT, value: $dilations}, + { + name: 'padding', + type: nodeBackend.binding.TF_ATTR_STRING, + value: padInfo.type + } + ]; + + return nodeBackend.executeSingleOutput(Dilation2D, opAttrs, [x, filter]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropFilter.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropFilter.ts new file mode 100644 index 000000000..7896e03cc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropFilter.ts @@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Dilation2DAttrs, Dilation2DBackpropFilter, Dilation2DBackpropFilterInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const dilation2dBackpropFilterConfig: KernelConfig = { + kernelName: Dilation2DBackpropFilter, + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {x, filter, dy} = inputs as Dilation2DBackpropFilterInputs; + const {strides, pad, dilations} = attrs as {} as Dilation2DAttrs; + const {dilationHeight, dilationWidth, padInfo, strideHeight, strideWidth} = + backend_util.computeDilation2DInfo( + x.shape as [number, number, number, number], + filter.shape as [number, number, number], strides, pad, + 'NHWC' /* dataFormat */, dilations); + const $strides = [1, strideHeight, strideWidth, 1]; + const $dilations = [1, dilationHeight, dilationWidth, 1]; + + const nodeBackend = backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'strides', type: nodeBackend.binding.TF_ATTR_INT, value: $strides}, + {name: 'rates', type: nodeBackend.binding.TF_ATTR_INT, value: $dilations}, + { + name: 'padding', + type: nodeBackend.binding.TF_ATTR_STRING, + value: padInfo.type + } + ]; + + return nodeBackend.executeSingleOutput( + Dilation2DBackpropFilter, opAttrs, [x, filter, dy]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropInput.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropInput.ts new file mode 100644 index 000000000..61c931dd6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Dilation2DBackpropInput.ts @@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Dilation2DAttrs, Dilation2DBackpropInput, Dilation2DBackpropInputInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const dilation2dBackpropInputConfig: KernelConfig = { + kernelName: Dilation2DBackpropInput, + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {x, filter, dy} = inputs as Dilation2DBackpropInputInputs; + const {strides, pad, dilations} = attrs as {} as Dilation2DAttrs; + const {dilationHeight, dilationWidth, padInfo, strideHeight, strideWidth} = + backend_util.computeDilation2DInfo( + x.shape as [number, number, number, number], + filter.shape as [number, number, number], strides, pad, + 'NHWC' /* dataFormat */, dilations); + const $strides = [1, strideHeight, strideWidth, 1]; + const $dilations = [1, dilationHeight, dilationWidth, 1]; + + const nodeBackend = backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'strides', type: nodeBackend.binding.TF_ATTR_INT, value: $strides}, + {name: 'rates', type: nodeBackend.binding.TF_ATTR_INT, value: $dilations}, + { + name: 'padding', + type: nodeBackend.binding.TF_ATTR_STRING, + value: padInfo.type + } + ]; + + return nodeBackend.executeSingleOutput( + Dilation2DBackpropInput, opAttrs, [x, filter, dy]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Elu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Elu.ts new file mode 100644 index 000000000..a9b7684e8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Elu.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Elu, EluInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const eluConfig: KernelConfig = { + kernelName: Elu, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as EluInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Elu, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/EluGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/EluGrad.ts new file mode 100644 index 000000000..93640f9c5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/EluGrad.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {EluGrad, EluGradInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const eluGradConfig: KernelConfig = { + kernelName: EluGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, y} = args.inputs as EluGradInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('T', y.dtype)]; + return backend.executeSingleOutput(EluGrad, opAttrs, [dy, y]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Equal.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Equal.ts new file mode 100644 index 000000000..1b2d0b5e6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Equal.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Equal, EqualInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const equalConfig: KernelConfig = { + kernelName: Equal, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as EqualInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Equal, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Erf.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Erf.ts new file mode 100644 index 000000000..681e90ed7 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Erf.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Erf, ErfInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const erfConfig: KernelConfig = { + kernelName: Erf, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ErfInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Erf, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Exp.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Exp.ts new file mode 100644 index 000000000..ecfd1212d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Exp.ts @@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Exp, ExpInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const expConfig: KernelConfig = { + kernelName: Exp, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ExpInputs; + const backend = args.backend as NodeJSKernelBackend; + + const xTensor = x.dtype === 'int32' ? (x as Tensor).toFloat() : x; + return backend.executeSingleInput(Exp, xTensor); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ExpandDims.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ExpandDims.ts new file mode 100644 index 000000000..51ed2122b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ExpandDims.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {ExpandDims, ExpandDimsAttrs, ExpandDimsInputs, KernelConfig, scalar} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const expandDimsConfig: KernelConfig = { + kernelName: ExpandDims, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as ExpandDimsInputs; + const backend = args.backend as NodeJSKernelBackend; + const {dim} = args.attrs as {} as ExpandDimsAttrs; + + const dimTensor = scalar(dim, 'int32'); + + const res = backend.executeSingleOutput(ExpandDims, [], [input, dimTensor]); + dimTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Expm1.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Expm1.ts new file mode 100644 index 000000000..121c4fd68 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Expm1.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Expm1, Expm1Inputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const expm1Config: KernelConfig = { + kernelName: Expm1, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as Expm1Inputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Expm1, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FFT.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FFT.ts new file mode 100644 index 000000000..2c7a77b3f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FFT.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {FFT, FFTInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// tslint:disable-next-line: variable-name +export const FFTConfig: KernelConfig = { + kernelName: FFT, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as FFTInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('Tcomplex', input.dtype)]; + return backend.executeSingleOutput(FFT, opAttrs, [input]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Fill.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Fill.ts new file mode 100644 index 000000000..fd1a78183 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Fill.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Fill, FillAttrs, KernelConfig, scalar, tensor1d} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const fillConfig: KernelConfig = { + kernelName: Fill, + backendName: 'tensorflow', + kernelFunc: (args) => { + const backend = args.backend as NodeJSKernelBackend; + const {shape, value} = args.attrs as {} as FillAttrs; + let {dtype} = args.attrs as {} as FillAttrs; + + // TODO(cais, nkreeger): Investigate whether backend can be made into + // a dtype helper method. The underlying op kernel doesn't accept undefined + // or null dtype. + if (dtype == null) { + if (typeof value === 'number') { + dtype = 'float32'; + } else { + dtype = 'string'; + } + } + const shapeTensor = tensor1d(shape, 'int32'); + const valueTensor = scalar(value, dtype); + const opAttrs = [ + { + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.getDTypeInteger(dtype) + }, + { + name: 'index_type', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_INT32 + } + ]; + const res = + backend.executeSingleOutput(Fill, opAttrs, [shapeTensor, valueTensor]); + shapeTensor.dispose(); + valueTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Floor.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Floor.ts new file mode 100644 index 000000000..39616538e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Floor.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Floor, FloorInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const floorConfig: KernelConfig = { + kernelName: Floor, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as FloorInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Floor, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FloorDiv.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FloorDiv.ts new file mode 100644 index 000000000..3752e2c0f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FloorDiv.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, FloorDiv, FloorDivInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const floorDivConfig: KernelConfig = { + kernelName: FloorDiv, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as FloorDivInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(FloorDiv, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedBatchNorm.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedBatchNorm.ts new file mode 100644 index 000000000..4e0f0b313 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedBatchNorm.ts @@ -0,0 +1,70 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {add, fill, FusedBatchNorm, FusedBatchNormAttrs, FusedBatchNormInputs, KernelConfig, mul, Rank, rsqrt, scalar, sub, Tensor, Tensor4D, tidy} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const fusedBatchNormConfig: KernelConfig = { + kernelName: FusedBatchNorm, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, mean, variance} = args.inputs as FusedBatchNormInputs; + let {scale, offset} = args.inputs as FusedBatchNormInputs; + const backend = args.backend as NodeJSKernelBackend; + const {varianceEpsilon} = args.attrs as {} as FusedBatchNormAttrs; + + return tidy(() => { + if ((mean as Tensor).rank > 1) { + // Fused batch norm doesn't work with high-dim mean/var/scale/offset. + let inv = rsqrt(add(variance as Tensor, scalar(varianceEpsilon))); + if (scale != null) { + inv = mul(inv, scale as Tensor); + } + const xNorm: Tensor4D = mul(sub(x as Tensor, mean as Tensor), inv); + return offset != null ? add(xNorm, offset as Tensor) : xNorm; + } + const dataFormat = 'NHWC'; + const depth = x.shape[3]; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + { + name: 'epsilon', + type: backend.binding.TF_ATTR_FLOAT, + value: varianceEpsilon + }, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + {name: 'is_training', type: backend.binding.TF_ATTR_BOOL, value: false}, + ]; + const numOutputs = 5; + + if (scale == null) { + scale = fill([depth], 1); + } + if (offset == null) { + offset = fill([depth], 0); + } + return backend.executeMultipleOutputs( + FusedBatchNorm, opAttrs, [x, scale, offset, mean, variance], + numOutputs)[0]; + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedConv2D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedConv2D.ts new file mode 100644 index 000000000..27b390e79 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedConv2D.ts @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {add, backend_util, FusedConv2D, FusedConv2DAttrs, FusedConv2DInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +import {conv2dImpl} from './Conv2D'; + +export const fusedConv2DConfig: KernelConfig = { + kernelName: FusedConv2D, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, filter, bias, preluActivationWeights} = + args.inputs as FusedConv2DInputs; + const backend = args.backend as NodeJSKernelBackend; + const { + strides, + pad, + dataFormat, + dilations, + dimRoundingMode, + activation, + leakyreluAlpha + } = args.attrs as {} as FusedConv2DAttrs; + + const $dataFormat = backend_util.convertConv2DDataFormat(dataFormat); + const convInfo = backend_util.computeConv2DInfo( + x.shape as [number, number, number, number], + filter.shape as [number, number, number, number], strides, dilations, + pad, dimRoundingMode, false /* depthwise */, $dataFormat); + + let result = conv2dImpl(x, filter, convInfo, backend); + + const toDispose = []; + if (bias != null) { + toDispose.push(result); + result = add(result, bias as Tensor); + } + + const temp = result; + result = backend.applyActivation( + result, activation, preluActivationWeights as Tensor, leakyreluAlpha); + if (temp !== result) { + toDispose.push(temp); + } + + toDispose.forEach(t => t.dispose()); + return result; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedDepthwiseConv2D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedDepthwiseConv2D.ts new file mode 100644 index 000000000..d626c6c7f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/FusedDepthwiseConv2D.ts @@ -0,0 +1,68 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {add, backend_util, FusedDepthwiseConv2D, FusedDepthwiseConv2DAttrs, FusedDepthwiseConv2DInputs, KernelConfig, Tensor} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +import {depthwiseConv2dNativeImpl} from './DepthwiseConv2dNative'; + +export const fusedDepthwiseConv2DConfig: KernelConfig = { + kernelName: FusedDepthwiseConv2D, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, filter, bias, preluActivationWeights} = + args.inputs as FusedDepthwiseConv2DInputs; + const backend = args.backend as NodeJSKernelBackend; + const { + strides, + pad, + dilations, + dimRoundingMode, + activation, + leakyreluAlpha + } = args.attrs as {} as FusedDepthwiseConv2DAttrs; + + let $dilations = dilations; + if ($dilations == null) { + $dilations = [1, 1]; + } + + const convInfo = backend_util.computeConv2DInfo( + x.shape as [number, number, number, number], + filter.shape as [number, number, number, number], strides, $dilations, + pad, dimRoundingMode, true /* depthwise */); + + let result = depthwiseConv2dNativeImpl(x, filter, convInfo, backend); + + const toDispose = []; + if (bias != null) { + toDispose.push(result); + result = add(result, bias as Tensor); + } + + const temp = result; + result = backend.applyActivation( + result, activation, preluActivationWeights as Tensor, leakyreluAlpha); + if (temp !== result) { + toDispose.push(temp); + } + + toDispose.forEach(t => t.dispose()); + return result; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherNd.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherNd.ts new file mode 100644 index 000000000..326b4eaf2 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherNd.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {GatherNd, GatherNdInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const gatherNdConfig: KernelConfig = { + kernelName: GatherNd, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {params, indices} = args.inputs as GatherNdInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('Tparams', params.dtype), + createTensorsTypeOpAttr('Tindices', 'int32') + ]; + return backend.executeSingleOutput(GatherNd, opAttrs, [params, indices]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherV2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherV2.ts new file mode 100644 index 000000000..7aea08f91 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GatherV2.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, GatherV2, GatherV2Attrs, GatherV2Inputs, KernelConfig, scalar, Tensor} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const gatherV2Config: KernelConfig = { + kernelName: GatherV2, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, indices} = args.inputs as GatherV2Inputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, batchDims} = args.attrs as {} as GatherV2Attrs; + + // validate the inputs + backend_util.segment_util.collectGatherOpShapeInfo( + x as Tensor, indices as Tensor, axis, batchDims); + + const axisTensor = scalar(axis, 'int32'); + const opAttrs = [ + {name: 'batch_dims', type: backend.binding.TF_ATTR_INT, value: batchDims}, + createTensorsTypeOpAttr('Tparams', x.dtype), + createTensorsTypeOpAttr('Tindices', indices.dtype), + createTensorsTypeOpAttr('Taxis', 'int32') + ]; + + const res = backend.executeSingleOutput( + GatherV2, opAttrs, [x, indices, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Greater.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Greater.ts new file mode 100644 index 000000000..7effb2e23 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Greater.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, Greater, GreaterInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const greaterConfig: KernelConfig = { + kernelName: Greater, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as GreaterInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Greater, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GreaterEqual.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GreaterEqual.ts new file mode 100644 index 000000000..7f70d2961 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/GreaterEqual.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, GreaterEqual, GreaterEqualInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const greaterEqualConfig: KernelConfig = { + kernelName: GreaterEqual, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as GreaterEqualInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(GreaterEqual, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IFFT.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IFFT.ts new file mode 100644 index 000000000..6ca476d9f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IFFT.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {IFFT, IFFTInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// tslint:disable-next-line: variable-name +export const IFFTConfig: KernelConfig = { + kernelName: IFFT, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as IFFTInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('Tcomplex', input.dtype)]; + return backend.executeSingleOutput(IFFT, opAttrs, [input]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Identity.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Identity.ts new file mode 100644 index 000000000..0e55493a5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Identity.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Identity, IdentityInputs, KernelConfig} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const identityConfig: KernelConfig = { + kernelName: Identity, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as IdentityInputs; + // Backend needs to track refCount for the dataId for identity op + (args.backend as NodeJSKernelBackend).incRef(x.dataId); + return {dataId: x.dataId, shape: x.shape, dtype: x.dtype}; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Imag.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Imag.ts new file mode 100644 index 000000000..99b2e6b9a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Imag.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {Imag, ImagInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const imagConfig: KernelConfig = { + kernelName: Imag, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as ImagInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [ + { + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_COMPLEX64 + }, + { + name: 'Tout', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_FLOAT + } + ]; + const inputs = [input]; + return backend.executeSingleOutput(Imag, opAttrs, inputs); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsFinite.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsFinite.ts new file mode 100644 index 000000000..522a0ea62 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsFinite.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {IsFinite, IsFiniteInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const isFiniteConfig: KernelConfig = { + kernelName: IsFinite, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as IsFiniteInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(IsFinite, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsInf.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsInf.ts new file mode 100644 index 000000000..4b1eead48 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsInf.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {IsInf, IsInfInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const isInfConfig: KernelConfig = { + kernelName: IsInf, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as IsInfInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(IsInf, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsNan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsNan.ts new file mode 100644 index 000000000..36a9c339f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/IsNan.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {IsNan, IsNanInputs, KernelConfig} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const isNanConfig: KernelConfig = { + kernelName: IsNan, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as IsNanInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(IsNan, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRN.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRN.ts new file mode 100644 index 000000000..b460004db --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRN.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, LRN, LRNAttrs, LRNInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// tslint:disable-next-line: variable-name +export const LRNConfig: KernelConfig = { + kernelName: LRN, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as LRNInputs; + const backend = args.backend as NodeJSKernelBackend; + const {depthRadius, bias, alpha, beta} = args.attrs as {} as LRNAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + { + name: 'depth_radius', + type: backend.binding.TF_ATTR_INT, + value: depthRadius + }, + {name: 'bias', type: backend.binding.TF_ATTR_FLOAT, value: bias}, + {name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha}, + {name: 'beta', type: backend.binding.TF_ATTR_FLOAT, value: beta}, + ]; + return backend.executeSingleOutput(LRN, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRNGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRNGrad.ts new file mode 100644 index 000000000..cb5950b3b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LRNGrad.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, LRNGrad, LRNGradAttrs, LRNGradInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// tslint:disable-next-line: variable-name +export const LRNGradConfig: KernelConfig = { + kernelName: LRNGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x, y, dy} = args.inputs as LRNGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {depthRadius, bias, alpha, beta} = args.attrs as {} as LRNGradAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', dy.dtype), + { + name: 'depth_radius', + type: backend.binding.TF_ATTR_INT, + value: depthRadius + }, + {name: 'bias', type: backend.binding.TF_ATTR_FLOAT, value: bias}, + {name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha}, + {name: 'beta', type: backend.binding.TF_ATTR_FLOAT, value: beta}, + ]; + return backend.executeSingleOutput(LRNGrad, opAttrs, [dy, x, y]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LeakyRelu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LeakyRelu.ts new file mode 100644 index 000000000..7b43b7181 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LeakyRelu.ts @@ -0,0 +1,38 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, LeakyRelu, LeakyReluAttrs, LeakyReluInputs, Tensor} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const leakyReluConfig: KernelConfig = { + kernelName: LeakyRelu, + backendName: 'tensorflow', + kernelFunc: (args) => { + const inputs = args.inputs as LeakyReluInputs; + const attrs = args.attrs as {} as LeakyReluAttrs; + const backend = args.backend as NodeJSKernelBackend; + const x = inputs.x as Tensor; + const alpha = attrs.alpha; + + const opAttrs = [ + {name: 'alpha', type: backend.binding.TF_ATTR_FLOAT, value: alpha}, + createTensorsTypeOpAttr('T', x.dtype) + ]; + + return backend.executeSingleOutput(LeakyRelu, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Less.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Less.ts new file mode 100644 index 000000000..9d45a6a7e --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Less.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, Less, LessInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const lessConfig: KernelConfig = { + kernelName: Less, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as LessInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Less, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LessEqual.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LessEqual.ts new file mode 100644 index 000000000..01d24faac --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LessEqual.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, LessEqual, LessEqualInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const lessEqualConfig: KernelConfig = { + kernelName: LessEqual, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as LessEqualInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(LessEqual, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LinSpace.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LinSpace.ts new file mode 100644 index 000000000..768122cfd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LinSpace.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, LinSpace, LinSpaceAttrs, scalar, tidy} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const linSpaceConfig: KernelConfig = { + kernelName: LinSpace, + backendName: 'tensorflow', + kernelFunc: (args) => { + const backend = args.backend as NodeJSKernelBackend; + const {start, stop, num} = args.attrs as {} as LinSpaceAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', 'float32'), + createTensorsTypeOpAttr('Tidx', 'int32') + ]; + + return tidy(() => { + const inputs = [ + scalar(start, 'float32'), scalar(stop, 'float32'), scalar(num, 'int32') + ]; + return backend.executeSingleOutput(LinSpace, opAttrs, inputs); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log.ts new file mode 100644 index 000000000..9d2db8c59 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Log, LogInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const logConfig: KernelConfig = { + kernelName: Log, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as LogInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Log, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log1p.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log1p.ts new file mode 100644 index 000000000..ae49842dd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Log1p.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Log1p, Log1pInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const log1pConfig: KernelConfig = { + kernelName: Log1p, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as Log1pInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Log1p, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalAnd.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalAnd.ts new file mode 100644 index 000000000..9c9ab427d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalAnd.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, LogicalAnd, LogicalAndInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const logicalAndConfig: KernelConfig = { + kernelName: LogicalAnd, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as LogicalAndInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleOutput(LogicalAnd, [], [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalNot.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalNot.ts new file mode 100644 index 000000000..4d78164a7 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalNot.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, LogicalNot, LogicalNotInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const logicalNotConfig: KernelConfig = { + kernelName: LogicalNot, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as LogicalNotInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleOutput(LogicalNot, [], [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalOr.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalOr.ts new file mode 100644 index 000000000..2da97e04c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/LogicalOr.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, LogicalOr, LogicalOrInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const logicalOrConfig: KernelConfig = { + kernelName: LogicalOr, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as LogicalOrInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleOutput(LogicalOr, [], [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Max.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Max.ts new file mode 100644 index 000000000..c8fe5c017 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Max.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Max, MaxAttrs, MaxInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxConfig: KernelConfig = { + kernelName: Max, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MaxInputs; + const backend = args.backend as NodeJSKernelBackend; + const {reductionIndices, keepDims} = args.attrs as {} as MaxAttrs; + + const axes = util.parseAxisParam(reductionIndices, x.shape); + const axesTensor = tensor1d(axes, 'int32'); + const res = backend.executeSingleOutput( + Max, backend.createReductionOpAttrs(x, keepDims), [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool.ts new file mode 100644 index 000000000..2ff7da19a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool.ts @@ -0,0 +1,56 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, MaxPool, MaxPoolAttrs, MaxPoolInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxPoolConfig: KernelConfig = { + kernelName: MaxPool, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MaxPoolInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dimRoundingMode} = + args.attrs as {} as MaxPoolAttrs; + + const convInfo = backend_util.computePool2DInfo( + x.shape as [number, number, number, number], filterSize, strides, + 1 /* dilations */, pad, dimRoundingMode); + + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; + const $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + } + ]; + return backend.executeSingleOutput(MaxPool, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3D.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3D.ts new file mode 100644 index 000000000..b5d4c46f0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3D.ts @@ -0,0 +1,60 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, MaxPool3D, MaxPool3DAttrs, MaxPool3DInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxPool3DConfig: KernelConfig = { + kernelName: MaxPool3D, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MaxPool3DInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dataFormat, dimRoundingMode} = + args.attrs as {} as MaxPool3DAttrs; + + const convInfo = backend_util.computePool3DInfo( + x.shape as [number, number, number, number, number], filterSize, + strides, 1 /* dilations */, pad, dimRoundingMode, dataFormat); + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding was ${convInfo.padInfo.type}`); + } + const ksize = [ + 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 + ]; + const $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + const padding = convInfo.padInfo.type; + const $dataFormat = + convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: $dataFormat + } + ]; + return backend.executeSingleOutput(MaxPool3D, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3DGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3DGrad.ts new file mode 100644 index 000000000..71d60fcec --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPool3DGrad.ts @@ -0,0 +1,63 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, MaxPool3DGrad, MaxPool3DGradAttrs, MaxPool3DGradInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxPool3DGradConfig: KernelConfig = { + kernelName: MaxPool3DGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, input, output} = args.inputs as MaxPool3DGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dimRoundingMode} = + args.attrs as {} as MaxPool3DGradAttrs; + + const convInfo = backend_util.computePool3DInfo( + input.shape as [number, number, number, number, number], filterSize, + strides, 1 /* dilations */, pad, dimRoundingMode); + + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding type was ${convInfo.padInfo.type}`); + } + const ksize = [ + 1, convInfo.filterDepth, convInfo.filterHeight, convInfo.filterWidth, 1 + ]; + const $strides = [ + 1, convInfo.strideDepth, convInfo.strideHeight, convInfo.strideWidth, 1 + ]; + const padding = convInfo.padInfo.type; + const dataFormat = + convInfo.dataFormat === 'channelsLast' ? 'NDHWC' : 'NCDHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', input.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + ]; + return backend.executeSingleOutput( + MaxPool3DGrad, opAttrs, [input, output, dy]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPoolGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPoolGrad.ts new file mode 100644 index 000000000..2d3193382 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MaxPoolGrad.ts @@ -0,0 +1,58 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, MaxPoolGrad, MaxPoolGradAttrs, MaxPoolGradInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maxPoolGradConfig: KernelConfig = { + kernelName: MaxPoolGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {dy, input, output} = args.inputs as MaxPoolGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {filterSize, strides, pad, dimRoundingMode} = + args.attrs as {} as MaxPoolGradAttrs; + + const convInfo = backend_util.computePool2DInfo( + input.shape as [number, number, number, number], filterSize, strides, + 1 /* dilations */, pad, dimRoundingMode); + + if (convInfo.padInfo.type !== 'VALID' && convInfo.padInfo.type !== 'SAME') { + throw new Error( + `TF Backend supports only 'valid' and 'same' padding ` + + `while padding type was ${convInfo.padInfo.type}`); + } + const ksize = [1, convInfo.filterHeight, convInfo.filterWidth, 1]; + const $strides = [1, convInfo.strideHeight, convInfo.strideWidth, 1]; + const padding = convInfo.padInfo.type; + const dataFormat = convInfo.dataFormat === 'channelsLast' ? 'NHWC' : 'NCHW'; + const opAttrs = [ + createTensorsTypeOpAttr('T', input.dtype), + {name: 'ksize', type: backend.binding.TF_ATTR_INT, value: ksize}, + {name: 'strides', type: backend.binding.TF_ATTR_INT, value: $strides}, + {name: 'padding', type: backend.binding.TF_ATTR_STRING, value: padding}, + { + name: 'data_format', + type: backend.binding.TF_ATTR_STRING, + value: dataFormat + }, + ]; + return backend.executeSingleOutput( + MaxPoolGrad, opAttrs, [input, output, dy]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Maximum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Maximum.ts new file mode 100644 index 000000000..94b06e65c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Maximum.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, Maximum, MaximumInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const maximumConfig: KernelConfig = { + kernelName: Maximum, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as MaximumInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Maximum, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mean.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mean.ts new file mode 100644 index 000000000..63062cd16 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mean.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {cast, KernelConfig, Mean, MeanAttrs, MeanInputs, Tensor, tensor1d, util} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const meanConfig: KernelConfig = { + kernelName: Mean, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MeanInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as MeanAttrs; + const axes = util.parseAxisParam(axis, x.shape); + const axesTensor = tensor1d(axes, 'int32'); + + // Cast to float32 to match existing tfjs implementation/tests. + const asFloat32 = cast(x as Tensor, 'float32'); + const res = backend.executeSingleOutput( + Mean, backend.createReductionOpAttrs(x, keepDims), + [asFloat32, axesTensor]); + + asFloat32.dispose(); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Min.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Min.ts new file mode 100644 index 000000000..cc35bf477 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Min.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Min, MinAttrs, MinInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const minConfig: KernelConfig = { + kernelName: Min, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as MinInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as MinAttrs; + const axes = util.parseAxisParam(axis, x.shape); + const axesTensor = tensor1d(axes, 'int32'); + const res = backend.executeSingleOutput( + Min, backend.createReductionOpAttrs(x, keepDims), [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Minimum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Minimum.ts new file mode 100644 index 000000000..8b6805a54 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Minimum.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, Minimum, MinimumInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const minimumConfig: KernelConfig = { + kernelName: Minimum, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as MinimumInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Minimum, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MirrorPad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MirrorPad.ts new file mode 100644 index 000000000..e72667ac0 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/MirrorPad.ts @@ -0,0 +1,49 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, MirrorPad, MirrorPadAttrs, MirrorPadInputs, tensor2d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const mirrorPadConfig: KernelConfig = { + kernelName: MirrorPad, + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {x} = inputs as MirrorPadInputs; + const {paddings, mode} = attrs as {} as MirrorPadAttrs; + + const nodeBackend = backend as NodeJSKernelBackend; + + const paddingsTensor = tensor2d(paddings, [paddings.length, 2], 'int32'); + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype), { + name: 'mode', + type: nodeBackend.binding.TF_ATTR_STRING, + value: mode.toUpperCase() + } + ]; + + const output = nodeBackend.executeSingleOutput( + 'MirrorPad', opAttrs, [x, paddingsTensor]); + + paddingsTensor.dispose(); + + return output; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mod.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mod.ts new file mode 100644 index 000000000..5999d5bc6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Mod.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Mod, ModInputs} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const modConfig: KernelConfig = { + kernelName: Mod, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as ModInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('T', a.dtype)]; + return backend.executeSingleOutput('FloorMod', opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multinomial.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multinomial.ts new file mode 100644 index 000000000..1f0540054 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multinomial.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Multinomial, MultinomialAttrs, MultinomialInputs, scalar} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const multinomialConfig: KernelConfig = { + kernelName: Multinomial, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {logits} = args.inputs as MultinomialInputs; + const backend = args.backend as NodeJSKernelBackend; + const {numSamples, seed, normalized} = args.attrs as {} as MultinomialAttrs; + + if (normalized) { + throw new Error( + 'TF Node backend does not support normalized logits ' + + 'passed to multinomial'); + } + const opAttrs = [ + createTensorsTypeOpAttr('T', logits.dtype), + createTensorsTypeOpAttr('output_dtype', 'int32'), + {name: 'seed', type: backend.binding.TF_ATTR_INT, value: seed}, + {name: 'seed2', type: backend.binding.TF_ATTR_INT, value: seed * seed}, + ]; + const numSamplesTensor = scalar(numSamples, 'int32'); + const res = backend.executeSingleOutput( + Multinomial, opAttrs, [logits, numSamplesTensor]); + numSamplesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multiply.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multiply.ts new file mode 100644 index 000000000..2252e30a5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Multiply.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, Multiply, MultiplyInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const multiplyConfig: KernelConfig = { + kernelName: Multiply, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as MultiplyInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput('Mul', opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Neg.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Neg.ts new file mode 100644 index 000000000..83736ed6a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Neg.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Neg, NegInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const negConfig: KernelConfig = { + kernelName: Neg, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as NegInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Neg, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV3.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV3.ts new file mode 100644 index 000000000..e97dc1c94 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV3.ts @@ -0,0 +1,45 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, NonMaxSuppressionV3, NonMaxSuppressionV3Attrs, NonMaxSuppressionV3Inputs, scalar} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const nonMaxSuppressionV3Config: KernelConfig = { + kernelName: NonMaxSuppressionV3, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {boxes, scores} = args.inputs as NonMaxSuppressionV3Inputs; + const backend = args.backend as NodeJSKernelBackend; + const {maxOutputSize, iouThreshold, scoreThreshold} = + args.attrs as {} as NonMaxSuppressionV3Attrs; + + const opAttrs = [createTensorsTypeOpAttr('T', boxes.dtype)]; + + const maxOutputSizeTensor = scalar(maxOutputSize, 'int32'); + const iouThresholdTensor = scalar(iouThreshold); + const scoreThresholdTensor = scalar(scoreThreshold); + const res = backend.executeSingleOutput(NonMaxSuppressionV3, opAttrs, [ + boxes, scores, maxOutputSizeTensor, iouThresholdTensor, + scoreThresholdTensor + ]); + maxOutputSizeTensor.dispose(); + iouThresholdTensor.dispose(); + scoreThresholdTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV4.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV4.ts new file mode 100644 index 000000000..e98e15f1c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV4.ts @@ -0,0 +1,59 @@ +/** + * @license + * Copyright 2019 Google LLC. 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 {KernelConfig, NonMaxSuppressionV4, NonMaxSuppressionV4Attrs, NonMaxSuppressionV4Inputs, scalar, Tensor1D, Tensor2D} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +// TODO(nsthorat, dsmilkov): Remove dependency on tensors, use dataId. +export const nonMaxSuppressionV4Config: KernelConfig = { + kernelName: NonMaxSuppressionV4, + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {boxes, scores} = inputs as NonMaxSuppressionV4Inputs; + const {maxOutputSize, iouThreshold, scoreThreshold, padToMaxOutputSize} = + attrs as {} as NonMaxSuppressionV4Attrs; + const maxOutputSizeTensor = scalar(maxOutputSize, 'int32'); + const iouThresholdTensor = scalar(iouThreshold, 'float32'); + const scoreThresholdTensor = scalar(scoreThreshold, 'float32'); + + const nodeBackend = backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', boxes.dtype), + createTensorsTypeOpAttr('T_threshold', 'float32'), { + name: 'pad_to_max_output_size', + type: nodeBackend.binding.TF_ATTR_BOOL, + value: padToMaxOutputSize + } + ]; + + const [selectedIndices, validOutputs] = nodeBackend.executeMultipleOutputs( + 'NonMaxSuppressionV4', opAttrs, + [ + boxes as Tensor2D, scores as Tensor1D, maxOutputSizeTensor, + iouThresholdTensor, scoreThresholdTensor + ], + 2); + + maxOutputSizeTensor.dispose(); + iouThresholdTensor.dispose(); + scoreThresholdTensor.dispose(); + + return [selectedIndices, validOutputs]; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV5.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV5.ts new file mode 100644 index 000000000..51cd0a6df --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NonMaxSuppressionV5.ts @@ -0,0 +1,67 @@ +/** + * @license + * Copyright 2019 Google LLC. 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 {KernelConfig, NamedAttrMap, NamedTensorInfoMap, scalar, Tensor1D, Tensor2D, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +interface NonMaxSuppressionWithScoreInputs extends NamedTensorInfoMap { + boxes: TensorInfo; + scores: TensorInfo; +} + +interface NonMaxSuppressionWithScoreAttrs extends NamedAttrMap { + maxOutputSize: number; + iouThreshold: number; + scoreThreshold: number; + softNmsSigma: number; +} + +// TODO(nsthorat, dsmilkov): Remove dependency on tensors, use dataId. +export const nonMaxSuppressionV5Config: KernelConfig = { + kernelName: 'NonMaxSuppressionV5', + backendName: 'tensorflow', + kernelFunc: ({inputs, backend, attrs}) => { + const {boxes, scores} = inputs as NonMaxSuppressionWithScoreInputs; + const {maxOutputSize, iouThreshold, scoreThreshold, softNmsSigma} = + attrs as NonMaxSuppressionWithScoreAttrs; + const maxOutputSizeTensor = scalar(maxOutputSize, 'int32'); + const iouThresholdTensor = scalar(iouThreshold); + const scoreThresholdTensor = scalar(scoreThreshold); + const softNmsSigmaTensor = scalar(softNmsSigma); + const opAttrs = [createTensorsTypeOpAttr('T', boxes.dtype)]; + + const nodeBackend = backend as NodeJSKernelBackend; + + const [selectedIndices, selectedScores, validOutputs] = + nodeBackend.executeMultipleOutputs( + 'NonMaxSuppressionV5', opAttrs, + [ + boxes as Tensor2D, scores as Tensor1D, maxOutputSizeTensor, + iouThresholdTensor, scoreThresholdTensor, softNmsSigmaTensor + ], + 3); + + maxOutputSizeTensor.dispose(); + iouThresholdTensor.dispose(); + scoreThresholdTensor.dispose(); + softNmsSigmaTensor.dispose(); + validOutputs.dispose(); + + return [selectedIndices, selectedScores]; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NotEqual.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NotEqual.ts new file mode 100644 index 000000000..174a125f8 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/NotEqual.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, NotEqual, NotEqualInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const notEqualConfig: KernelConfig = { + kernelName: NotEqual, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as NotEqualInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(NotEqual, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OneHot.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OneHot.ts new file mode 100644 index 000000000..331f4e64a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OneHot.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, OneHot, OneHotAttrs, OneHotInputs, scalar} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const oneHotConfig: KernelConfig = { + kernelName: OneHot, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {indices} = args.inputs as OneHotInputs; + const backend = args.backend as NodeJSKernelBackend; + const {depth, onValue, offValue} = args.attrs as {} as OneHotAttrs; + + const depthTensor = scalar(depth, 'int32'); + const onValueTensor = scalar(onValue, 'int32'); + const offValueTensor = scalar(offValue, 'int32'); + + const opAttrs = [ + {name: 'axis', type: backend.binding.TF_ATTR_INT, value: -1}, + createTensorsTypeOpAttr('T', indices.dtype), + createTensorsTypeOpAttr('TI', indices.dtype) + ]; + + const res = backend.executeSingleOutput( + OneHot, opAttrs, [indices, depthTensor, onValueTensor, offValueTensor]); + depthTensor.dispose(); + onValueTensor.dispose(); + offValueTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OnesLike.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OnesLike.ts new file mode 100644 index 000000000..3e71f3f67 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/OnesLike.ts @@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, OnesLike, OnesLikeInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const onesLikeConfig: KernelConfig = { + kernelName: OnesLike, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as OnesLikeInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [{ + name: 'T', + type: backend.binding.TF_ATTR_TYPE, + value: backend.getDTypeInteger(x.dtype) + }]; + return backend.executeSingleOutput(OnesLike, opAttrs, [x]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pack.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pack.ts new file mode 100644 index 000000000..0e39cd21b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pack.ts @@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, KernelFunc, Pack, PackAttrs, PackInputs, Tensor, TensorInfo} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export function pack( + args: {inputs: PackInputs, backend: NodeJSKernelBackend, attrs: PackAttrs}): + TensorInfo { + const {inputs, backend, attrs} = args; + const {axis} = attrs; + + const opAttrs = [ + {name: 'N', type: backend.binding.TF_ATTR_INT, value: inputs.length}, + createTensorsTypeOpAttr('T', inputs as Tensor[]), + {name: 'axis', type: backend.binding.TF_ATTR_INT, value: axis} + ]; + + const res = backend.executeSingleOutput(Pack, opAttrs, inputs); + return res; +} + +export const packConfig: KernelConfig = { + kernelName: Pack, + backendName: 'tensorflow', + kernelFunc: pack as {} as KernelFunc +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/PadV2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/PadV2.ts new file mode 100644 index 000000000..b2580065b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/PadV2.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, PadV2, PadV2Attrs, PadV2Inputs, scalar, tensor2d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const padV2Config: KernelConfig = { + kernelName: PadV2, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as PadV2Inputs; + const backend = args.backend as NodeJSKernelBackend; + const {paddings, constantValue} = args.attrs as {} as PadV2Attrs; + + // Bind tensor values + const paddingsTensor = tensor2d(paddings, [paddings.length, 2], 'int32'); + const constantTensor = scalar(constantValue, x.dtype); + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype) + ]; + + const res = backend.executeSingleOutput( + PadV2, opAttrs, [x, paddingsTensor, constantTensor]); + + paddingsTensor.dispose(); + constantTensor.dispose(); + + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pow.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pow.ts new file mode 100644 index 000000000..aca2c005b --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Pow.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, cast, KernelConfig, Pow, PowInputs, Tensor, tidy} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const powConfig: KernelConfig = { + kernelName: Pow, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as PowInputs; + const backend = args.backend as NodeJSKernelBackend; + + const dtype = backend_util.upcastType(a.dtype, b.dtype); + const opAttrs = [createTensorsTypeOpAttr('T', dtype)]; + return tidy(() => { + return backend.executeSingleOutput( + Pow, opAttrs, [cast(a as Tensor, dtype), cast(b as Tensor, dtype)]); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prelu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prelu.ts new file mode 100644 index 000000000..84cd1c03d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prelu.ts @@ -0,0 +1,34 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {abs, KernelConfig, Prelu, PreluInputs, relu, Tensor, tidy} from '@tensorflow/tfjs'; + +export const preluConfig: KernelConfig = { + kernelName: Prelu, + backendName: 'tensorflow', + kernelFunc: (args) => { + const inputs = args.inputs as PreluInputs; + const x = inputs.x as Tensor; + const alpha = inputs.alpha as Tensor; + + return tidy(() => { + const pos = relu(x); + const neg = alpha.mul(x.sub(abs(x))).mul(0.5); + return pos.add(neg); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prod.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prod.ts new file mode 100644 index 000000000..c7851e163 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Prod.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Prod, ProdAttrs, ProdInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const prodConfig: KernelConfig = { + kernelName: Prod, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ProdInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as ProdAttrs; + const axes = util.parseAxisParam(axis, x.shape); + const axesTensor = tensor1d(axes, 'int32'); + const opAttrs = [ + {name: 'keep_dims', type: backend.binding.TF_ATTR_BOOL, value: keepDims}, + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tidx', 'int32') + ]; + const res = backend.executeSingleOutput(Prod, opAttrs, [x, axesTensor]); + axesTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Range.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Range.ts new file mode 100644 index 000000000..39a5a1754 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Range.ts @@ -0,0 +1,61 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Range, RangeAttrs, scalar, zeros} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const rangeConfig: KernelConfig = { + kernelName: Range, + backendName: 'tensorflow', + kernelFunc: (args) => { + const backend = args.backend as NodeJSKernelBackend; + const {start, stop, dtype} = args.attrs as {} as RangeAttrs; + let {step} = args.attrs as {} as RangeAttrs; + + // TensorFlow.js specific allowances + const sameStartStop = start === stop; + const increasingRangeNegativeStep = start < stop && step < 0; + const decreasingRangePositiveStep = stop < start && step > 1; + + if (sameStartStop || increasingRangeNegativeStep || + decreasingRangePositiveStep) { + return zeros([0], dtype); + } + + if (stop < start && step === 1) { + // Auto adjust the step's sign if it hasn't been set + // (or was set to 1) + step = -1; + } + + const opAttrs = [createTensorsTypeOpAttr('Tidx', dtype)]; + const startTensor = scalar(start); + const stopTensor = scalar(stop); + const stepTensor = scalar(step); + const res = backend.executeSingleOutput( + Range, opAttrs, [startTensor, stopTensor, stepTensor]); + const castedRes = res.cast(dtype); + + startTensor.dispose(); + stopTensor.dispose(); + stepTensor.dispose(); + res.dispose(); + + return castedRes; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Real.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Real.ts new file mode 100644 index 000000000..a4064923f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Real.ts @@ -0,0 +1,38 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Real, RealInputs, Tensor} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const realConfig: KernelConfig = { + kernelName: Real, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {input} = args.inputs as RealInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [ + createTensorsTypeOpAttr('T', input as Tensor), { + name: 'Tout', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_FLOAT + } + ]; + const inputs = [input]; + return backend.executeSingleOutput(Real, opAttrs, inputs); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/RealDiv.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/RealDiv.ts new file mode 100644 index 000000000..872747ec9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/RealDiv.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, RealDiv, RealDivInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const realDivConfig: KernelConfig = { + kernelName: RealDiv, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as RealDivInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(RealDiv, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reciprocal.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reciprocal.ts new file mode 100644 index 000000000..76ab5c3d1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reciprocal.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Reciprocal, ReciprocalInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const reciprocalConfig: KernelConfig = { + kernelName: Reciprocal, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ReciprocalInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Reciprocal, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu.ts new file mode 100644 index 000000000..170a56a48 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Relu, ReluInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const reluConfig: KernelConfig = { + kernelName: Relu, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ReluInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Relu, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu6.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu6.ts new file mode 100644 index 000000000..db266545d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Relu6.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Relu6, Relu6Inputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const relu6Config: KernelConfig = { + kernelName: Relu6, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as Relu6Inputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Relu6, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reshape.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reshape.ts new file mode 100644 index 000000000..a19d15879 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reshape.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Reshape, ReshapeAttrs, ReshapeInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const reshapeConfig: KernelConfig = { + kernelName: Reshape, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ReshapeInputs; + const backend = args.backend as NodeJSKernelBackend; + const {shape} = args.attrs as {} as ReshapeAttrs; + + const shapeTensor = tensor1d(shape, 'int32'); + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tshape', shapeTensor.dtype) + ]; + const res = backend.executeSingleOutput(Reshape, opAttrs, [x, shapeTensor]); + shapeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinear.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinear.ts new file mode 100644 index 000000000..9d9a9eda5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinear.ts @@ -0,0 +1,51 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, ResizeBilinear, ResizeBilinearAttrs, ResizeBilinearInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const resizeBilinearConfig: KernelConfig = { + kernelName: ResizeBilinear, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {images} = args.inputs as ResizeBilinearInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alignCorners, halfPixelCenters, size} = + args.attrs as {} as ResizeBilinearAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', images.dtype), + { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + }, + { + name: 'half_pixel_centers', + type: backend.binding.TF_ATTR_BOOL, + value: halfPixelCenters + }, + ]; + const [newHeight, newWidth] = size; + const sizeTensor = tensor1d([newHeight, newWidth], 'int32'); + const ret = backend.executeSingleOutput( + ResizeBilinear, opAttrs, [images, sizeTensor]); + sizeTensor.dispose(); + return ret; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinearGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinearGrad.ts new file mode 100644 index 000000000..10bc8b05a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeBilinearGrad.ts @@ -0,0 +1,40 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, ResizeBilinearGrad, ResizeBilinearGradAttrs, ResizeBilinearGradInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const resizeBilinearGradConfig: KernelConfig = { + kernelName: ResizeBilinearGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {images, dy} = args.inputs as ResizeBilinearGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alignCorners} = args.attrs as {} as ResizeBilinearGradAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', images.dtype), { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + } + ]; + return backend.executeSingleOutput( + ResizeBilinearGrad, opAttrs, [dy, images]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighbor.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighbor.ts new file mode 100644 index 000000000..a7d1786e5 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighbor.ts @@ -0,0 +1,51 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, ResizeNearestNeighbor, ResizeNearestNeighborAttrs, ResizeNearestNeighborInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const resizeNearestNeighborConfig: KernelConfig = { + kernelName: ResizeNearestNeighbor, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {images} = args.inputs as ResizeNearestNeighborInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alignCorners, halfPixelCenters, size} = + args.attrs as {} as ResizeNearestNeighborAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', images.dtype), + { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + }, + { + name: 'half_pixel_centers', + type: backend.binding.TF_ATTR_BOOL, + value: halfPixelCenters + }, + ]; + const [newHeight, newWidth] = size; + const sizeTensor = tensor1d([newHeight, newWidth], 'int32'); + const res = backend.executeSingleOutput( + ResizeNearestNeighbor, opAttrs, [images, sizeTensor]); + sizeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighborGrad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighborGrad.ts new file mode 100644 index 000000000..43bc13c15 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ResizeNearestNeighborGrad.ts @@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, ResizeNearestNeighborGrad, ResizeNearestNeighborGradAttrs, ResizeNearestNeighborGradInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const resizeNearestNeighborGradConfig: KernelConfig = { + kernelName: ResizeNearestNeighborGrad, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {images, dy} = args.inputs as ResizeNearestNeighborGradInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alignCorners} = args.attrs as {} as ResizeNearestNeighborGradAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', images.dtype), { + name: 'align_corners', + type: backend.binding.TF_ATTR_BOOL, + value: alignCorners + } + ]; + const [, origHeight, origWidth, ] = images.shape; + const sizeTensor = tensor1d([origHeight, origWidth], 'int32'); + const res = backend.executeSingleOutput( + ResizeNearestNeighborGrad, opAttrs, [dy, sizeTensor]); + sizeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reverse.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reverse.ts new file mode 100644 index 000000000..2513c3cbc --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Reverse.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Reverse, ReverseAttrs, ReverseInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const reverseConfig: KernelConfig = { + kernelName: Reverse, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as ReverseInputs; + const backend = args.backend as NodeJSKernelBackend; + const {dims} = args.attrs as {} as ReverseAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('Tidx', 'int32'), + createTensorsTypeOpAttr('T', x.dtype) + ]; + + const axes = util.parseAxisParam(dims, x.shape); + const axisTensor = tensor1d(axes, 'int32'); + const res = + backend.executeSingleOutput('ReverseV2', opAttrs, [x, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Round.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Round.ts new file mode 100644 index 000000000..bc8a0634d --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Round.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Round, RoundInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const roundConfig: KernelConfig = { + kernelName: Round, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as RoundInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Round, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Rsqrt.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Rsqrt.ts new file mode 100644 index 000000000..92f16f8d1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Rsqrt.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Rsqrt, RsqrtInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const rsqrtConfig: KernelConfig = { + kernelName: Rsqrt, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as RsqrtInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Rsqrt, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ScatterNd.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ScatterNd.ts new file mode 100644 index 000000000..3eff751f9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/ScatterNd.ts @@ -0,0 +1,42 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, ScatterNd, ScatterNdAttrs, ScatterNdInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const scatterNdConfig: KernelConfig = { + kernelName: ScatterNd, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {indices, updates} = args.inputs as ScatterNdInputs; + const backend = args.backend as NodeJSKernelBackend; + const {shape} = args.attrs as {} as ScatterNdAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', updates.dtype), + createTensorsTypeOpAttr('Tindices', 'int32') + ]; + const shapeTensor = tensor1d(shape, 'int32'); + const ret = backend.executeSingleOutput( + ScatterNd, opAttrs, [indices, updates, shapeTensor]); + + shapeTensor.dispose(); + + return ret; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Select.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Select.ts new file mode 100644 index 000000000..72854e066 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Select.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, Select, SelectInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const selectConfig: KernelConfig = { + kernelName: Select, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {condition, t, e} = args.inputs as SelectInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(t.dtype, e.dtype))]; + return backend.executeSingleOutput(Select, opAttrs, [condition, t, e]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Selu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Selu.ts new file mode 100644 index 000000000..5e04a1f33 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Selu.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Selu, SeluInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const seluConfig: KernelConfig = { + kernelName: Selu, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SeluInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Selu, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sigmoid.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sigmoid.ts new file mode 100644 index 000000000..9d637b340 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sigmoid.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Sigmoid, SigmoidInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sigmoidConfig: KernelConfig = { + kernelName: Sigmoid, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SigmoidInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sigmoid, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sign.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sign.ts new file mode 100644 index 000000000..0e99f3997 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sign.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Sign, SignInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const signConfig: KernelConfig = { + kernelName: Sign, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SignInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sign, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sin.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sin.ts new file mode 100644 index 000000000..9fcf1ec2a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sin.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Sin, SinInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sinConfig: KernelConfig = { + kernelName: Sin, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SinInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sin, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sinh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sinh.ts new file mode 100644 index 000000000..7c1386241 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sinh.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Sinh, SinhInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sinhConfig: KernelConfig = { + kernelName: Sinh, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SinhInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sinh, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Slice.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Slice.ts new file mode 100644 index 000000000..6060a90f1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Slice.ts @@ -0,0 +1,48 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, Slice, SliceAttrs, SliceInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sliceConfig: KernelConfig = { + kernelName: Slice, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SliceInputs; + const backend = args.backend as NodeJSKernelBackend; + const {begin, size} = args.attrs as {} as SliceAttrs; + + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Index', 'int32') + ]; + + // Bind tensor values + const [begin_, size_] = + backend_util.slice_util.parseSliceParams(x, begin, size); + const beginTensor = tensor1d(begin_, 'int32'); + const sizeTensor = tensor1d(size_, 'int32'); + + const res = backend.executeSingleOutput( + Slice, opAttrs, [x, beginTensor, sizeTensor]); + beginTensor.dispose(); + sizeTensor.dispose(); + + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softmax.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softmax.ts new file mode 100644 index 000000000..594da3bfd --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softmax.ts @@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, NamedTensorInfoMap, TensorInfo} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +interface SoftmaxInputs extends NamedTensorInfoMap { + logits: TensorInfo; +} + +export const softmaxConfig: KernelConfig = { + kernelName: 'Softmax', + backendName: 'tensorflow', + kernelFunc: ({inputs, backend}) => { + const {logits} = inputs as SoftmaxInputs; + const opAttrs = [createTensorsTypeOpAttr('T', logits.dtype)]; + + const nodeBackend = backend as NodeJSKernelBackend; + + return nodeBackend.executeSingleOutput('Softmax', opAttrs, [logits]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softplus.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softplus.ts new file mode 100644 index 000000000..75110850f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Softplus.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Softplus, SoftplusInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const softplusConfig: KernelConfig = { + kernelName: Softplus, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SoftplusInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Softplus, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SpaceToBatchND.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SpaceToBatchND.ts new file mode 100644 index 000000000..0e5a8499c --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SpaceToBatchND.ts @@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, SpaceToBatchND, SpaceToBatchNDAttrs, SpaceToBatchNDInputs, tensor1d, tensor2d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const spaceToBatchNDConfig: KernelConfig = { + kernelName: SpaceToBatchND, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SpaceToBatchNDInputs; + const backend = args.backend as NodeJSKernelBackend; + const {blockShape, paddings} = args.attrs as {} as SpaceToBatchNDAttrs; + + const blockShapeTensor = tensor1d(blockShape, 'int32'); + const paddingsTensor = + tensor2d(paddings, [paddings.length, paddings[0].length], 'int32'); + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Tblock_shape', 'int32'), + createTensorsTypeOpAttr('Tpaddings', paddingsTensor.dtype) + ]; + const res = backend.executeSingleOutput( + SpaceToBatchND, opAttrs, [x, blockShapeTensor, paddingsTensor]); + + blockShapeTensor.dispose(); + paddingsTensor.dispose(); + + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SparseToDense.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SparseToDense.ts new file mode 100644 index 000000000..df5a6b89a --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SparseToDense.ts @@ -0,0 +1,47 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, SparseToDense, SparseToDenseAttrs, SparseToDenseInputs, tensor1d} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sparseToDenseConfig: KernelConfig = { + kernelName: SparseToDense, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {sparseIndices, sparseValues, defaultValue} = + args.inputs as SparseToDenseInputs; + const backend = args.backend as NodeJSKernelBackend; + const {outputShape} = args.attrs as {} as SparseToDenseAttrs; + + const opAttrs = [ + { + name: 'validate_indices', + type: backend.binding.TF_ATTR_BOOL, + value: true + }, + createTensorsTypeOpAttr('T', sparseValues.dtype), + createTensorsTypeOpAttr('Tindices', sparseIndices.dtype) + ]; + const outputShapeTensor = tensor1d(outputShape, 'int32'); + const res = backend.executeSingleOutput( + SparseToDense, opAttrs, + [sparseIndices, outputShapeTensor, sparseValues, defaultValue]); + outputShapeTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SplitV.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SplitV.ts new file mode 100644 index 000000000..a330e84d4 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SplitV.ts @@ -0,0 +1,53 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, scalar, SplitV, SplitVAttrs, SplitVInputs, Tensor, tensor1d, tidy, util} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const splitVConfig: KernelConfig = { + kernelName: SplitV, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SplitVInputs; + const backend = args.backend as NodeJSKernelBackend; + const {numOrSizeSplits, axis} = args.attrs as {} as SplitVAttrs; + + const $axis = util.parseAxisParam(axis, x.shape)[0]; + const splitSizes = backend_util.prepareSplitSize(x, numOrSizeSplits, $axis); + + const opAttrs = [ + { + name: 'num_split', + type: backend.binding.TF_ATTR_INT, + value: splitSizes.length + }, + createTensorsTypeOpAttr('T', x as Tensor), { + name: 'Tlen', + type: backend.binding.TF_ATTR_TYPE, + value: backend.binding.TF_INT32 + } + ]; + const inputs = [x]; + return tidy(() => { + inputs.push(tensor1d(splitSizes, 'int32')); + inputs.push(scalar($axis, 'int32')); + return backend.executeMultipleOutputs( + SplitV, opAttrs, inputs, splitSizes.length); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sqrt.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sqrt.ts new file mode 100644 index 000000000..066660511 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sqrt.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Sqrt, SqrtInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sqrtConfig: KernelConfig = { + kernelName: Sqrt, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SqrtInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Sqrt, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Square.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Square.ts new file mode 100644 index 000000000..84524c7b1 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Square.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Square, SquareInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const squareConfig: KernelConfig = { + kernelName: Square, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SquareInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Square, x); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SquaredDifference.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SquaredDifference.ts new file mode 100644 index 000000000..9b5e1ed4f --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/SquaredDifference.ts @@ -0,0 +1,31 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, SquaredDifference, SquaredDifferenceInputs} from '@tensorflow/tfjs'; +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const squaredDifferenceConfig: KernelConfig = { + kernelName: SquaredDifference, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as SquaredDifferenceInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr('T', a.dtype)]; + return backend.executeSingleOutput(SquaredDifference, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Step.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Step.ts new file mode 100644 index 000000000..e898fff81 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Step.ts @@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, fill, greater, isNaN as tfIsNan, KernelConfig, ones, scalar, Step, StepAttrs, StepInputs, Tensor, tidy, where} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const stepConfig: KernelConfig = { + kernelName: Step, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as StepInputs; + const backend = args.backend as NodeJSKernelBackend; + const {alpha} = args.attrs as {} as StepAttrs; + + const dtype = x.dtype; + return tidy(() => { + const nans = tfIsNan(x as Tensor); + const stepNoNans = where( + greater(x as Tensor, scalar(0, dtype)), ones(x.shape), + fill(x.shape, alpha, dtype)); + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(x.dtype, stepNoNans.dtype))]; + return backend.executeSingleOutput( + 'Select', opAttrs, [nans, x, stepNoNans]); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/StridedSlice.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/StridedSlice.ts new file mode 100644 index 000000000..7838e42c6 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/StridedSlice.ts @@ -0,0 +1,125 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, reshape, slice, StridedSlice, StridedSliceAttrs, StridedSliceInputs, Tensor, tensor1d, tidy} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const stridedSliceConfig: KernelConfig = { + kernelName: StridedSlice, + backendName: 'tensorflow', + kernelFunc: (args) => { + let {x} = args.inputs as StridedSliceInputs; + const backend = args.backend as NodeJSKernelBackend; + const {beginMask, endMask, ellipsisMask, newAxisMask, shrinkAxisMask} = + args.attrs as {} as StridedSliceAttrs; + + let {begin, end, strides} = args.attrs as {} as StridedSliceAttrs; + // make a copy because it may be modified in-place further down. + begin = begin.slice(); + end = end.slice(); + if (strides == null) { + strides = new Array(begin.length); + } + + const ellipsisAxes = backend_util.slice_util.maskToAxes(ellipsisMask); + if (ellipsisAxes.length > 1) { + throw new Error('Multiple ellipses in slice is not allowed.'); + } + + if (ellipsisMask !== 0 && newAxisMask !== 0) { + throw new Error( + 'Using both ellipsisMask and newAxisMask is not yet supported.'); + } + + if (ellipsisMask !== 0 && shrinkAxisMask !== 0) { + throw new Error( + 'Using both ellipsisMask and shrinkAxisMask is not yet supported.'); + } + + return tidy(() => { + const numInterpolatedAxes = (x as Tensor).rank - begin.length; + + // Expand the dims of x based on the newAxisMask. + const expandAxes = backend_util.slice_util.maskToAxes(newAxisMask); + const newShape = x.shape.slice(); + expandAxes.forEach(axis => { + begin[axis] = 0; + end[axis] = 1; + newShape.splice(axis, 0, 1); + }); + x = reshape(x as Tensor, newShape); + + const { + begin: normalizedBegin, + end: normalizedEnd, + strides: normalizedStrides + } = + backend_util.slice_util.getNormalizedAxes( + x.shape, ellipsisAxes, numInterpolatedAxes, begin, end, strides, + beginMask, endMask, ellipsisMask); + begin = normalizedBegin; + end = normalizedEnd; + strides = normalizedStrides; + + const shrinkAxes = backend_util.slice_util.maskToAxes(shrinkAxisMask); + // Adjust the ends based on the shrink mask. + shrinkAxes.forEach(axis => { + end[axis] = begin[axis] + 1; + strides[axis] = 1; + }); + + // Figure out the output shape. + const size = backend_util.slice_util.computeOutShape(begin, end, strides); + // Remove the axes based on shrinkMask. + const outShape = + size.filter((_, axis) => shrinkAxes.indexOf(axis) === -1); + + const nonStrided = strides.every(v => v === 1); + if (nonStrided) { + return reshape(slice(x as Tensor, begin, size), outShape); + } + + const beginTensor = tensor1d(begin, 'int32'); + for (let axis = 0; axis < end.length; axis++) { + // Unlike Numpy, when the strides are negative, TF C uses -n-1 instead + // of -1 as the "end" in order to include the first element. + if (strides[axis] < 0 && end[axis] === -1) { + end[axis] -= x.shape[axis]; + } + } + const endTensor = tensor1d(end, 'int32'); + const stridesTensor = tensor1d(strides, 'int32'); + + // Because tfjs allows begin, end and strides to be of different lengths + // It has custom code (see above to handle the masking), so we do not + // pass the mask info to the tensorflow backend. + const opAttrs = [ + createTensorsTypeOpAttr('T', x.dtype), + createTensorsTypeOpAttr('Index', 'int32'), + {name: 'begin_mask', type: backend.binding.TF_ATTR_INT, value: 0}, + {name: 'end_mask', type: backend.binding.TF_ATTR_INT, value: 0}, + {name: 'ellipsis_mask', type: backend.binding.TF_ATTR_INT, value: 0}, + {name: 'new_axis_mask', type: backend.binding.TF_ATTR_INT, value: 0}, + {name: 'shrink_axis_mask', type: backend.binding.TF_ATTR_INT, value: 0} + ]; + const res = backend.executeSingleOutput( + StridedSlice, opAttrs, [x, beginTensor, endTensor, stridesTensor]); + return reshape(res, outShape); + }); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sub.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sub.ts new file mode 100644 index 000000000..976b23f44 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sub.ts @@ -0,0 +1,33 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {backend_util, KernelConfig, Sub, SubInputs} from '@tensorflow/tfjs'; + +import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const subConfig: KernelConfig = { + kernelName: Sub, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {a, b} = args.inputs as SubInputs; + const backend = args.backend as NodeJSKernelBackend; + + const opAttrs = [createTensorsTypeOpAttr( + 'T', backend_util.upcastType(a.dtype, b.dtype))]; + return backend.executeSingleOutput(Sub, opAttrs, [a, b]); + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sum.ts new file mode 100644 index 000000000..0ca67e835 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Sum.ts @@ -0,0 +1,36 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Sum, SumAttrs, SumInputs, tensor1d, util} from '@tensorflow/tfjs'; + +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const sumConfig: KernelConfig = { + kernelName: Sum, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as SumInputs; + const backend = args.backend as NodeJSKernelBackend; + const {axis, keepDims} = args.attrs as {} as SumAttrs; + const axes = util.parseAxisParam(axis, x.shape); + const axisTensor = tensor1d(axes, 'int32'); + const res = backend.executeSingleOutput( + Sum, backend.createReductionOpAttrs(x, keepDims), [x, axisTensor]); + axisTensor.dispose(); + return res; + } +}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tan.ts new file mode 100644 index 000000000..88e7542d9 --- /dev/null +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-node/src/kernels/Tan.ts @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2020 Google LLC. 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 {KernelConfig, Tan, TanInputs} from '@tensorflow/tfjs'; +import {NodeJSKernelBackend} from '../nodejs_kernel_backend'; + +export const tanConfig: KernelConfig = { + kernelName: Tan, + backendName: 'tensorflow', + kernelFunc: (args) => { + const {x} = args.inputs as TanInputs; + const backend = args.backend as NodeJSKernelBackend; + + return backend.executeSingleInput(Tan, x); + } +};